/* =========================================================================
   FlySys Swiss PFD — Swiss / International Typographic Style
   White space, a strict grid, one red accent, precise type. No shadows.
   Type: B612 / B612 Mono — Airbus' cockpit typeface (SIL OFL), as used
   in the app itself.
   ========================================================================= */

@font-face {
  font-family: "B612"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/B612-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "B612"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/B612-Italic.ttf") format("truetype");
}
@font-face {
  font-family: "B612"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/B612-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "B612"; font-style: italic; font-weight: 700; font-display: swap;
  src: url("../fonts/B612-BoldItalic.ttf") format("truetype");
}
@font-face {
  font-family: "B612 Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/B612Mono-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "B612 Mono"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/B612Mono-Bold.ttf") format("truetype");
}

:root {
  --ink:        #0a0a0a;   /* near-black text            */
  --ink-soft:   #5a5a5a;   /* secondary text             */
  --line:       #e3e3e3;   /* hairline rules             */
  --paper:      #ffffff;   /* background                 */
  --paper-2:    #f5f5f3;   /* alt section background     */
  --red:        #cc0000;   /* brand red (from Logo1.svg) — used sparingly */
  --max:        1200px;    /* content max width          */
  --measure:    64rem;     /* body copy fills the content column */
  --gutter:     clamp(20px, 5vw, 64px);
  --t-fast:     .18s ease;
}

/* ---- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: "B612", "Helvetica Neue", Arial, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  font-size: 17px;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }

/* ---- Layout helpers ---------------------------------------------------- */
.wrap   { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section{ padding-block: clamp(64px, 11vw, 140px); }
.section--alt { background: var(--paper-2); }

/* A reusable 12-column grid */
.grid { display: grid; gap: clamp(24px, 4vw, 56px); }
@media (min-width: 760px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 760px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

/* ---- Type scale -------------------------------------------------------- */
.display {
  font-size: clamp(1.9rem, 4.2vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
}
h1, .h1 { font-size: clamp(1.9rem, 5vw, 3.2rem); line-height: 1.05; letter-spacing: -0.015em; font-weight: 700; }
h2, .h2 { font-size: clamp(1.45rem, 3.2vw, 2.2rem); line-height: 1.1; letter-spacing: -0.01em; font-weight: 700; }
h3, .h3 { font-size: 1.15rem; line-height: 1.25; font-weight: 700; }
.lead   { font-size: clamp(1.05rem, 1.8vw, 1.35rem); color: var(--ink-soft); max-width: 46rem; }
p       { max-width: var(--measure); }

.eyebrow {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--red); }
/* a leading reference tag, e.g. "§2.1" or "REV C" */
.eyebrow .ref { color: var(--red); }

.muted  { color: var(--ink-soft); }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-size: 0.92rem; font-weight: 700;
  padding: 0.85em 1.5em;
  border: 2px solid var(--ink);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--red); border-color: var(--red); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* =========================================================================
   "Under construction" banner
   ========================================================================= */
.construction {
  display: flex; align-items: center; justify-content: center; gap: 0.8em; flex-wrap: wrap;
  background: var(--ink); color: #f0f0f0;
  font-size: 0.78rem; letter-spacing: 0.03em;
  padding: 8px 16px; text-align: center;
  border-bottom: 2px solid var(--red);
}
.construction__tag {
  background: var(--red); color: #fff; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; padding: 2px 8px; font-size: 0.68rem;
}
@media (max-width: 520px) { .construction span:not(.construction__tag) { display: none; } }

/* =========================================================================
   Header / Nav
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 0.6em; font-weight: 700; letter-spacing: -0.01em; line-height: 1; }
.brand .logo { height: 30px; width: auto; display: block; }
.brand .name { display: flex; align-items: baseline; gap: 0.4em; }
.brand small { font-weight: 400; color: var(--ink-soft); letter-spacing: 0.04em; }

.nav-links { display: flex; gap: clamp(14px, 2vw, 30px); list-style: none; align-items: center; }
.nav-links a {
  font-size: 0.9rem; font-weight: 500; position: relative; padding-block: 4px;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform var(--t-fast);
}
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--ink); }

.nav-toggle { display: none; background: none; border: 0; font-size: 1.4rem; cursor: pointer; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; inset: 68px 0 auto 0; flex-direction: column; align-items: flex-start;
    gap: 0; background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; border-top: 1px solid var(--line); }
  .nav-links a { display: block; width: 100%; padding: 14px 0; font-size: 1.05rem; }
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero { padding-block: clamp(72px, 12vw, 160px) clamp(48px, 8vw, 96px); }
.hero .display { max-width: 22ch; }
.hero .lead { margin-top: 1.4rem; }
.hero .btn-row { margin-top: 2.4rem; }

/* =========================================================================
   Stat band
   ========================================================================= */
.stats { display: grid; gap: 1px; background: var(--line); grid-template-columns: repeat(2, 1fr); border-block: 1px solid var(--line); }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--paper); padding: 32px clamp(16px, 3vw, 32px); }
.stat .num { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; }
.stat .lbl { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-soft); margin-top: 6px; }

/* =========================================================================
   Feature cards
   ========================================================================= */
.feature { padding-top: 26px; border-top: 2px solid var(--ink); }
.feature .idx { font-size: 0.8rem; color: var(--red); font-weight: 700; letter-spacing: 0.1em; }
.feature h3 { margin: 14px 0 8px; }
.feature p  { color: var(--ink-soft); font-size: 0.97rem; }

/* Spec / definition lists */
.specs { display: grid; gap: 0; }
.spec-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  padding: 18px 0; border-top: 1px solid var(--line); align-items: baseline;
}
.spec-row:last-child { border-bottom: 1px solid var(--line); }
.spec-row dt { font-weight: 700; }
.spec-row dd { color: var(--ink-soft); }

/* =========================================================================
   Split section (text + media)
   ========================================================================= */
.split { display: grid; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } }
/* opt-in vertical centring for short text beside tall media */
.split--center { align-items: center; }
.split--rev > :first-child { order: 2; }
@media (max-width: 859px) { .split--rev > :first-child { order: 0; } }
.media-frame {
  background:
    repeating-linear-gradient(45deg, var(--paper-2) 0 11px, #eeeeea 11px 22px);
  border: 1px dashed #cfcfcf;
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
}
.media-frame::after {
  content: attr(data-label);
  font-family: "B612 Mono", monospace; font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-soft);
  background: var(--paper); padding: 6px 12px; border: 1px solid var(--line);
}

/* =========================================================================
   Forms
   ========================================================================= */
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field label { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.field input, .field textarea {
  font: inherit; padding: 14px 16px; border: 1.5px solid var(--line); background: var(--paper);
  transition: border-color var(--t-fast);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer { border-top: 1px solid var(--line); padding-block: 56px; font-size: 0.9rem; }
.site-footer .grid { align-items: start; }
.site-footer h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 14px; color: var(--ink-soft); }
.site-footer ul { list-style: none; display: grid; gap: 8px; }
.site-footer a:hover { color: var(--red); }
.foot-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--ink-soft); }

/* =========================================================================
   Technical / datasheet components
   ========================================================================= */

/* Mono helper for data, codes, coordinates */
.mono { font-family: "B612 Mono", monospace; }

/* A measured figure frame: header strip + tick ruler + body + caption.
   Reads like a plate in an avionics manual. */
.figure { border: 1px solid var(--ink); background: var(--paper); }
.figure__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 14px; border-bottom: 1px solid var(--ink);
  font-family: "B612 Mono", monospace; font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase;
}
.figure__head .ref { color: var(--red); }
.figure__ruler {
  height: 8px; border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 24px);
}
.figure__body { padding: clamp(14px, 3vw, 28px); }
.figure__body--shot { padding: 0; background: #000; line-height: 0; position: relative; }
.shot { width: 100%; height: auto; display: block; }

/* Small numbered callouts keyed to a legend — kept in empty areas / edges so
   they never cover a reading. */
.marker {
  position: absolute; transform: translate(-50%, -50%);
  width: clamp(14px, 1.5vw, 18px); aspect-ratio: 1; border-radius: 50%;
  background: rgba(204,0,0,0.92); color: #fff; font-weight: 700;
  font-family: "B612 Mono", monospace; font-size: clamp(0.5rem, 0.95vw, 0.62rem);
  display: flex; align-items: center; justify-content: center; line-height: 1;
  border: 1px solid #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* On phones/older tablets, block diagrams would shrink their labels to a few
   pixels. Instead keep a legible minimum width and scroll horizontally. */
@media (max-width: 760px) {
  .figure__body:not(.figure__body--shot) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .diag, .arch { min-width: 600px; }
}
.figure__cap {
  padding: 10px 14px; border-top: 1px solid var(--line);
  font-size: 0.82rem; color: var(--ink-soft); line-height: 1.5;
}
.figure__cap b { color: var(--ink); font-weight: 700; }

/* Annotation list — numbered callouts that pair with a figure */
.annotations { display: grid; gap: 0; margin-top: 1.25rem; }
.annotations .row {
  display: grid; grid-template-columns: 2.2em 1fr auto; gap: 12px; align-items: baseline;
  padding: 11px 0; border-top: 1px solid var(--line);
  font-family: "B612 Mono", monospace; font-size: 0.82rem;
}
.annotations .row:last-child { border-bottom: 1px solid var(--line); }
.annotations .n { color: var(--red); font-weight: 700; }
.annotations .v { color: var(--ink-soft); white-space: nowrap; }

/* Datasheet table — dotted leaders, mono values, right-aligned units */
.datasheet { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.datasheet caption {
  text-align: left; font-family: "B612 Mono", monospace; font-size: 0.7rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
  padding-bottom: 10px; border-bottom: 2px solid var(--ink); margin-bottom: 0;
}
.datasheet th, .datasheet td { padding: 13px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.datasheet th { text-align: left; font-weight: 700; width: 42%; }
.datasheet td { font-family: "B612 Mono", monospace; color: var(--ink-soft); }
.datasheet td .u { color: var(--ink); }

/* Small status / revision chip */
.chip {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: "B612 Mono", monospace; font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 4px 9px; border: 1px solid var(--line); color: var(--ink-soft);
}
.chip::before { content: ""; width: 6px; height: 6px; background: var(--red); border-radius: 50%; }

/* Feature index tags in mono for a technical feel. Stat numbers stay in the
   proportional face — mono spaces out decimals like "8.1" into "8 . 1". */
.feature .idx { font-family: "B612 Mono", monospace; }

/* ---- Code -------------------------------------------------------------- */
code {
  font-family: "B612 Mono", "SF Mono", Consolas, monospace;
  font-size: 0.86em; background: var(--paper-2); padding: 0.1em 0.4em; border-radius: 3px;
}

/* ---- Math (KaTeX) ------------------------------------------------------ */
/* Display equations: block, with horizontal scroll on narrow screens
   instead of breaking the layout — important on phones / older tablets. */
/* Formulas in pure black, a touch larger than body copy */
.math { color: #000; }
.math.block {
  display: block; margin: 1.3rem 0; padding: 4px 2px;
  overflow-x: auto; overflow-y: hidden;
  font-size: 1.18rem;
}
.eq {
  border-left: 2px solid var(--line); padding: 4px 0 4px 18px; margin: 1.3rem 0;
}
.eq .katex { color: #000; }
.eq .lbl {
  font-family: "B612 Mono", monospace; font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; display: block;
}

/* ---- Utilities --------------------------------------------------------- */
.mt-0{margin-top:0}.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.6rem}.mt-4{margin-top:2.4rem}
