/* ===========================================================
   NMEA0183 Simulator — bottle-green instrument styling
   =========================================================== */

:root {
  /* Bottle green base */
  --paper:      #0a2419;
  --paper-deep: #071a12;
  --paper-alt:  #0d2c1f;
  --card:       #10362647;
  --card-solid: #103526;
  --footer-bg:  #061710;

  --ink:       #e9f2ea;
  --ink-soft:  #9db8a6;
  --ink-faint: #6d8a78;

  /* Brass, the only warm colour on the page */
  --brass:      #d59b3c;
  --brass-lift: #f0bb63;
  --on-brass:   #10251b;

  /* Phosphor, used only inside the terminal */
  --phos:      #6ff0a2;
  --phos-dim:  #3fae74;
  --phos-glow: rgba(111, 240, 162, 0.28);

  --line:      rgba(233, 242, 234, 0.13);
  --line-soft: rgba(233, 242, 234, 0.07);

  --wrap: 1140px;
  --sans: "IBM Plex Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --cond: "IBM Plex Sans Condensed", "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Faint horizontal machining lines over the whole page — texture without dots */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.014) 0 1px,
    transparent 1px 4px
  );
}

body > * { position: relative; z-index: 1; }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-family: var(--cond);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.005em;
  color: var(--ink);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.02rem; letter-spacing: 0; }

p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: var(--ink); }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.6rem;
}

/* --- Section label: ruled datasheet caption, no comment-slash cliché --- */
.label {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.4rem;
}

.label b {
  color: var(--brass);
  font-weight: 500;
}

.label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.label-sub { margin-top: 4rem; }

/* ============================ Header ============================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 26, 18, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.7rem 1.6rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-family: var(--cond);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-logo {
  display: block;
  height: 30px;
  width: auto;
}

/* Hairline between the company logo and the product name */
.brand-name {
  border-left: 1px solid var(--line);
  padding-left: 0.7rem;
}

.site-nav {
  display: flex;
  gap: 1.8rem;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover { color: var(--ink); border-bottom-color: var(--brass); }

.lang-select-wrap { position: relative; display: inline-flex; align-items: center; }

.lang-select-wrap::after {
  content: "";
  position: absolute;
  right: 0.6rem;
  top: 45%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: rotate(45deg);
  pointer-events: none;
}

#lang-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.34rem 1.7rem 0.34rem 0.6rem;
  cursor: pointer;
}

#lang-select:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }

/* ============================ Hero ============================ */

.hero {
  padding: 4.5rem 0 4rem;
  background:
    radial-gradient(90% 120% at 12% 0%, rgba(213, 155, 60, 0.09), transparent 60%),
    linear-gradient(180deg, var(--paper-deep), var(--paper));
  border-bottom: 1px solid var(--line-soft);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3.5rem;
  align-items: center;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.kicker::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--brass);
}

.hero h1 { margin-bottom: 0.7em; }
.hero h1 em {
  font-style: normal;
  color: var(--brass-lift);
}

.hero-copy .lead {
  font-size: 1.08rem;
  max-width: 52ch;
  text-wrap: pretty;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Spec strip under the hero copy — real numbers from the firmware */
.hero-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem 1.8rem;
  margin-top: 2.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.hero-specs div { color: var(--ink-faint); }
.hero-specs b { display: block; color: var(--ink); font-weight: 500; letter-spacing: 0.02em; }

/* Photo: mounted like a plate, not a floating rounded card */
.hero-media { position: relative; }

.hero-photo-frame {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  padding: 0.55rem;
  background: rgba(0, 0, 0, 0.22);
}

.hero-photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.85) contrast(1.05);
}

/* Corner registration marks */
.hero-media::before,
.hero-media::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--brass);
}

.hero-media::before { top: -9px; left: -9px; border-right: none; border-bottom: none; }
.hero-media::after { bottom: -9px; right: -9px; border-left: none; border-top: none; }

/* ============================ Buttons ============================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.78rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.btn-accent {
  background: var(--brass);
  color: var(--on-brass);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.22);
}

.btn-accent:hover { background: var(--brass-lift); }
.btn-accent:active { box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.3); }

.btn:focus-visible { outline: 2px solid var(--brass-lift); outline-offset: 2px; }

/* ============================ Sections ============================ */

.section { padding: 5rem 0; }
.section-alt { background: var(--paper-alt); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }

.section-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.section-intro p { max-width: 54ch; }
.section-intro p:last-child { margin-bottom: 0; }

/* Feature list: numbered datasheet rows, not a grid of cards */
.feature-rows {
  border-top: 1px solid var(--line-soft);
  margin-top: 1.5rem;
}

.feature-row {
  display: grid;
  grid-template-columns: 3.2rem 15rem 1fr;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}

.feature-row:hover { background: rgba(255, 255, 255, 0.018); }

.feature-row .idx {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--brass);
  letter-spacing: 0.08em;
}

.feature-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.feature-row h4 { margin: 0; }

/* "volitelné" — hardware that is not on every unit */
.tag {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.1rem 0.38rem;
  white-space: nowrap;
}
.feature-row p { margin: 0; font-size: 0.95rem; }

/* ============================ Terminal demo ============================ */

.section-demo {
  background:
    radial-gradient(70% 100% at 80% 0%, rgba(111, 240, 162, 0.05), transparent 65%),
    var(--paper-deep);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.demo-head { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: end; }
.demo-head p { margin-bottom: 0; max-width: 52ch; }

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  margin-top: 2.5rem;
  align-items: stretch;
}

.terminal {
  position: relative;
  border: 1px solid rgba(111, 240, 162, 0.22);
  background: #03130c;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 26px 60px -30px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.7rem;
  background: rgba(111, 240, 162, 0.06);
  border-bottom: 1px solid rgba(111, 240, 162, 0.16);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--phos-dim);
}

.term-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--phos);
  box-shadow: 0 0 7px var(--phos-glow);
  flex: none;
}

.term-led.idle { background: var(--ink-faint); box-shadow: none; }

.term-title { color: var(--phos); }
.term-meta { margin-left: auto; color: var(--phos-dim); white-space: nowrap; }

.term-toggle {
  font: inherit;
  letter-spacing: 0.1em;
  background: transparent;
  color: var(--phos-dim);
  border: 1px solid rgba(111, 240, 162, 0.28);
  border-radius: 2px;
  padding: 0.12rem 0.45rem;
  cursor: pointer;
  flex: none;
}

.term-toggle:hover { color: var(--phos); border-color: var(--phos); }

.term-body {
  position: relative;
  height: 21rem;
  overflow: hidden;
  padding: 0.8rem 0.9rem 1.4rem;
  font-family: var(--mono);
  font-size: 0.735rem;
  line-height: 1.62;
  color: var(--phos);
  text-shadow: 0 0 6px var(--phos-glow);
  white-space: pre;
  overflow-x: auto;
  scrollbar-width: thin;
}

.term-body .t-id { color: var(--brass-lift); }
.term-body .t-cs { color: var(--phos-dim); }
.term-body .t-echo { color: #e9f2ea; }

.term-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  vertical-align: -0.14em;
  background: var(--phos);
  animation: blink 1.05s steps(1, end) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* Scanlines + bottom fade, so it reads as a screen instead of a code block */
.terminal::after {
  content: "";
  position: absolute;
  inset: 2.1rem 0 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px),
    radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.45));
}

/* Control panel */
.demo-panel {
  border: 1px solid var(--line);
  background: var(--card-solid);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}

.panel-title {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.auto-chip {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  padding: 0.14rem 0.4rem;
  border: 1px solid var(--brass);
  color: var(--brass);
  border-radius: 2px;
}

.auto-chip.off { border-color: var(--line); color: var(--ink-faint); }

.readout {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.28rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line-soft);
}

.readout dt { color: var(--ink-faint); letter-spacing: 0.08em; }
.readout dd { margin: 0; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.readout dd.warn { color: var(--brass-lift); }

.knob label {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
}

.knob label span { color: var(--brass-lift); font-variant-numeric: tabular-nums; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.5rem;
  background: transparent;
  cursor: grab;
  margin: 0;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(213, 155, 60, 0.45), rgba(255, 255, 255, 0.12));
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(213, 155, 60, 0.45), rgba(255, 255, 255, 0.12));
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 22px;
  margin-top: -9px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brass-lift), var(--brass));
  border: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 20px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brass-lift), var(--brass));
  border: 1px solid rgba(0, 0, 0, 0.4);
}

input[type="range"]:focus-visible { outline: 2px solid var(--brass-lift); outline-offset: 3px; }

.panel-buttons { display: flex; gap: 0.5rem; }

.panel-buttons button {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.55rem 0.3rem;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
}

.panel-buttons button:hover { border-color: var(--brass); color: var(--brass-lift); }
.panel-buttons button:active { background: rgba(0, 0, 0, 0.5); }
.panel-buttons button:focus-visible { outline: 2px solid var(--brass-lift); outline-offset: 2px; }

.demo-note {
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--ink-faint);
  margin: 0;
}

/* ============================ Variants ============================ */

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.spec-card {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line);
  border-top: 2px solid var(--brass);
  padding: 1.6rem;
}

.spec-card h3 {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.spec-list { margin: 0 0 1rem; }

.spec-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.5rem 0;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.spec-row::after {
  content: "";
  flex: 1;
  border-bottom: 1px dotted var(--line);
  transform: translateY(-3px);
}

.spec-row dt { color: var(--ink); font-weight: 400; }
.spec-row .mark { font-size: 0.7rem; color: var(--brass); flex: none; }

.variant-note {
  font-size: 0.88rem;
  margin: 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-faint);
}

/* ============================ Contact ============================ */

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; }

.contact-direct { margin-top: 1.6rem; font-family: var(--mono); font-size: 0.85rem; }
.contact-direct a { color: var(--brass-lift); text-decoration: none; border-bottom: 1px solid rgba(213, 155, 60, 0.4); }
.contact-direct a:hover { border-bottom-color: var(--brass-lift); }
.contact-direct span { display: block; color: var(--ink-faint); margin-bottom: 0.4rem; letter-spacing: 0.06em; }

.contact-address {
  margin-top: 1.4rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--ink-faint);
}

.contact-form { display: flex; flex-direction: column; gap: 0.3rem; }

.contact-form label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 1rem;
}

.contact-form input,
.contact-form textarea {
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--brass);
  background: rgba(0, 0, 0, 0.35);
}

.contact-form button { margin-top: 1.6rem; align-self: flex-start; }

/* ============================ Footer ============================ */

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 2rem 0;
  background: var(--footer-bg);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.footer-row p { margin: 0; color: var(--ink-faint); }
.footer-row a { color: var(--ink-soft); text-decoration: none; }
.footer-row a:hover { color: var(--brass-lift); }

/* ============================ Responsive ============================ */

@media (max-width: 980px) {
  .demo-grid { grid-template-columns: 1fr; }
  .demo-panel { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .demo-panel > * { flex: 1 1 220px; }
  .demo-panel .panel-title, .demo-panel .demo-note { flex-basis: 100%; }
}

@media (max-width: 860px) {
  .hero { padding-top: 3rem; }
  .hero-grid, .section-intro, .demo-head, .contact-grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .hero-media { order: -1; }
  .feature-row { grid-template-columns: 2.4rem 1fr; }
  .feature-row p { grid-column: 2; }
  .term-body { height: 17rem; font-size: 0.68rem; }
  .section { padding: 3.5rem 0; }
}

@media (max-width: 560px) {
  .header-row { gap: 0.8rem; }
  .brand { font-size: 1rem; gap: 0.55rem; }
  .brand-logo { height: 24px; }
  .brand-name { padding-left: 0.55rem; }
  .site-nav { gap: 1rem; order: 3; width: 100%; }
  .term-meta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .term-cursor { animation: none; }
}

/* Inline command names in body copy */
code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--brass-lift);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 0.05em 0.32em;
  white-space: nowrap;
}

/* Keep the terminal's horizontal scrollbar in the screen's own palette */
.term-body { scrollbar-color: rgba(111, 240, 162, 0.35) transparent; }
.term-body::-webkit-scrollbar { height: 6px; }
.term-body::-webkit-scrollbar-track { background: transparent; }
.term-body::-webkit-scrollbar-thumb { background: rgba(111, 240, 162, 0.3); border-radius: 3px; }
