/* GenoAccel marketing site — layout and components.
 * Design direction: docs/GENOACCEL-UI-DESIGN.md, mockup option B
 * (docs/mockups/home-option-b-coordinate-first.html).
 *
 * Responsive strategy for the coordinate rail, which is the layout's spine:
 *   ≥1080px  rail is a sticky vertical position indicator beside the content
 *    →820px  rail becomes a horizontal scrollspy pinned under the header
 *    <680px  rail is removed entirely (it costs vertical space it cannot earn)
 * The rail is progressive enhancement: it is decorative navigation, so it is
 * aria-hidden and never the only route to a section.
 */

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 28px; min-height: 56px;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--display); font-stretch: 125%; font-weight: 700;
  font-size: var(--t16); color: var(--ink); white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }

.nav-primary { display: flex; gap: 22px; font-size: var(--t14); }
.nav-primary a { color: var(--slate); }
.nav-primary a:hover, .nav-primary a[aria-current="page"] { color: var(--ink); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: var(--t14); }

.btn {
  display: inline-block; padding: 8px 16px;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: var(--t14); font-weight: 500; font-family: var(--body);
  cursor: pointer; text-align: center;
  transition: background var(--hover) var(--ease), border-color var(--hover) var(--ease), color var(--hover) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--depth); color: #fff; }
.btn-primary:hover { background: #163F76; }
.btn-secondary { border-color: var(--rule); background: var(--surface); color: var(--ink); }
.btn-secondary:hover { border-color: var(--slate); }

/* Mobile menu toggle — hidden until the nav collapses. */
.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 7px 10px; cursor: pointer; color: var(--ink);
}
.nav-toggle svg { width: 18px; height: 14px; }

/* ── Shell: rail + content ────────────────────────────────────────────── */
.shell {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: var(--rail) 1fr;
}
.rail { position: relative; border-right: 1px solid var(--rule); }
.rail-sticky {
  position: sticky; top: 56px;
  height: calc(100vh - 56px);
  padding: 26px 20px 32px 0;
  display: flex; flex-direction: column;
}
.rail-label {
  font-family: var(--data); font-size: var(--t11); letter-spacing: .12em;
  text-transform: uppercase; color: var(--slate); margin-bottom: 16px;
}
.ruler { position: relative; flex: 1; border-left: 1px solid var(--rule); margin-left: 6px; }
.ruler-tick {
  position: absolute; left: 0; transform: translateY(-50%);
  display: flex; align-items: center; gap: 8px;
  color: var(--slate); font-family: var(--data); font-size: var(--t11);
  letter-spacing: .04em; white-space: nowrap;
  transition: color var(--hover) var(--ease);
}
.ruler-tick i { display: block; width: 10px; height: 1px; background: var(--rule); transition: width var(--hover) var(--ease), background var(--hover) var(--ease); }
.ruler-tick:hover { color: var(--ink); text-decoration: none; }
.ruler-tick.is-active { color: var(--depth); }
.ruler-tick.is-active i { width: 16px; background: var(--depth); }
.rail-foot { font-family: var(--data); font-size: var(--t11); color: var(--slate); line-height: 1.8; margin-top: 14px; }

.main { padding-left: 40px; min-width: 0; }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero { padding: 48px 0 40px; }

/* The coverage rule, bounded as a track panel rather than a background wash —
   it reads as an instrument readout with a real coordinate footer. */
.track-panel {
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; margin-bottom: 32px;
}
.track-head, .track-foot {
  display: flex; align-items: center; gap: 14px; padding: 8px 12px;
  font-family: var(--data); font-size: var(--t11); letter-spacing: .06em;
  text-transform: uppercase; color: var(--slate);
}
.track-head { border-bottom: 1px solid var(--rule); }
.track-foot { border-top: 1px solid var(--rule); justify-content: space-between; text-transform: none; letter-spacing: 0; }
.track-head .spacer { margin-left: auto; }
.track-body { height: 132px; }
.track-body svg { width: 100%; height: 100%; }
.track-body rect { fill: var(--depth); opacity: .82; }

/* The one animated moment in the whole site: the track draws itself left to
   right, like a genome-browser track streaming in. */
@keyframes draw-track { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.track-body svg { animation: draw-track var(--draw) var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  .track-body svg { animation: none; clip-path: none; }
}

.hero h1 { margin: 0; font-size: var(--t49); max-width: 22ch; }
.hero h1 .line-2 { display: block; color: var(--depth); }
.hero-sub { margin: 18px 0 0; font-size: var(--t20); color: var(--slate); max-width: 58ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

/* ── Sections ─────────────────────────────────────────────────────────── */
.section { padding: 52px 0; border-top: 1px solid var(--rule); }
.section-label {
  font-family: var(--data); font-size: var(--t12); letter-spacing: .12em;
  text-transform: uppercase; color: var(--slate); margin-bottom: 14px;
}
.section h2 {
  font-family: var(--display); font-stretch: 125%; font-weight: 700;
  font-size: var(--t31); margin: 0 0 12px; letter-spacing: -.01em; line-height: 1.12;
}
.section h3 { font-size: var(--t20); margin: 0 0 8px; font-weight: 600; }
.lead { font-size: var(--t20); color: var(--slate); max-width: 66ch; margin: 0 0 24px; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.data-table-wrap { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--t14); }
table.data caption { text-align: left; padding: 12px 14px 0; font-size: var(--t12); color: var(--slate); }
table.data th, table.data td { text-align: left; padding: 10px 13px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data th {
  font-family: var(--data); font-size: var(--t11); letter-spacing: .09em;
  text-transform: uppercase; color: var(--slate); font-weight: 500;
  background: var(--depth-05); white-space: nowrap;
}
table.data tr:last-child td { border-bottom: 0; }
table.data td.m { font-family: var(--data); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.metric { font-family: var(--display); font-stretch: 125%; font-weight: 700; font-size: var(--t25); }
table.data td.is-pending { color: var(--slate); }

.tag {
  display: inline-block; font-family: var(--data); font-size: 10px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--slate);
  border: 1px solid var(--rule); border-radius: var(--radius); padding: 2px 6px;
  white-space: nowrap;
}
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.status-dot.ok { background: var(--verified); }
.status-dot.pending { background: var(--slate); }

.note {
  background: var(--surface); border: 1px solid var(--rule);
  border-left: 2px solid var(--depth); border-radius: var(--radius);
  padding: 14px 16px; font-size: var(--t14); color: var(--slate); margin-top: 20px;
}
.note strong { color: var(--ink); }

/* ── Pipeline strip ───────────────────────────────────────────────────── */
.pipeline { display: flex; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.pipeline-step { flex: 1; padding: 16px 14px; border-right: 1px solid var(--rule); min-width: 0; }
.pipeline-step:last-child { border-right: 0; }
.pipeline-step.is-accelerated { background: var(--depth-05); }
.pipeline-step .step-no { font-family: var(--data); font-size: var(--t11); color: var(--depth); letter-spacing: .1em; }
.pipeline-step h3 { font-size: var(--t14); margin: 7px 0 5px; font-weight: 600; }
.pipeline-step p { margin: 0; font-size: var(--t12); color: var(--slate); }
.pipeline-step .badge {
  margin-top: 9px; display: inline-block; font-family: var(--data); font-size: 10px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--depth);
}

/* ── FAQ (AEO surface) ────────────────────────────────────────────────── */
.faq { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  padding: 15px 16px; cursor: pointer; font-weight: 600; font-size: var(--t16);
  list-style: none; display: flex; align-items: flex-start; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+"; font-family: var(--data); color: var(--depth);
  font-weight: 400; flex: none; line-height: 1.5;
}
.faq details[open] summary::before { content: "−"; }
.faq .answer { padding: 0 16px 16px 38px; font-size: var(--t14); color: var(--slate); }
.faq .answer p { margin: 0 0 10px; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ── Definition block (quotable by answer engines) ────────────────────── */
.definition {
  border: 1px solid var(--rule); border-left: 2px solid var(--verified);
  border-radius: var(--radius); background: var(--surface);
  padding: 18px 20px; margin: 0 0 26px;
}
.definition dt {
  font-family: var(--data); font-size: var(--t11); letter-spacing: .1em;
  text-transform: uppercase; color: var(--slate); margin-bottom: 8px;
}
.definition dd { margin: 0; font-size: var(--t16); }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--rule); padding: 36px 0 56px; font-size: var(--t14); color: var(--slate); }
.footer-cols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; margin-bottom: 28px; }
.footer-cols h2 {
  font-family: var(--data); font-size: var(--t11); letter-spacing: .1em;
  text-transform: uppercase; margin: 0 0 10px; font-weight: 500; color: var(--slate);
}
.footer-cols a { display: block; color: var(--ink); padding: 3px 0; font-size: var(--t14); }
.footer-bottom { border-top: 1px solid var(--rule); padding-top: 18px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.footer-bottom .locale-form { margin-left: auto; }
select.locale {
  font-family: var(--data); font-size: var(--t12); color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 5px 8px;
}

/* ══ TABLET — rail becomes a horizontal scrollspy ═══════════════════════ */
@media (max-width: 1079px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    border-right: 0; border-bottom: 1px solid var(--rule);
    position: sticky; top: 56px; z-index: 20; background: var(--paper);
  }
  .rail-sticky {
    position: static; height: auto; padding: 0;
    flex-direction: row; align-items: center; gap: 14px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .rail-sticky::-webkit-scrollbar { display: none; }
  .rail-label, .rail-foot { display: none; }
  .ruler { flex: none; border-left: 0; margin: 0; display: flex; gap: 6px; height: auto; }
  .ruler-tick {
    position: static !important; transform: none;
    top: auto !important; padding: 12px 10px; gap: 6px;
    border-bottom: 2px solid transparent;
  }
  .ruler-tick i { display: none; }
  .ruler-tick.is-active { border-bottom-color: var(--depth); }
  .main { padding-left: 0; }
  .hero { padding-top: 32px; }
  .hero h1 { font-size: var(--t39); }
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
}

/* Nav collapses to a disclosure menu before the links would wrap. */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .header-actions { display: none; }
  .nav-primary {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--rule);
    padding: 8px var(--gutter) 16px;
  }
  .site-header.is-open .nav-primary { display: flex; }
  .site-header.is-open .header-actions {
    display: flex; position: absolute; top: 100%; left: 0; right: 0;
    transform: translateY(100%);
    background: var(--surface); border-bottom: 1px solid var(--rule);
    padding: 0 var(--gutter) 16px; gap: 10px;
  }
  .nav-primary a { padding: 11px 0; border-bottom: 1px solid var(--rule-soft); }
  .nav-primary a:last-child { border-bottom: 0; }
  .header-inner { position: relative; }
}

/* ══ MOBILE ════════════════════════════════════════════════════════════ */
@media (max-width: 679px) {
  :root { --gutter: 18px; }
  .rail { display: none; }             /* costs vertical space it can't earn */
  .hero { padding: 26px 0 32px; }
  .hero h1 { font-size: var(--t31); max-width: none; }
  .hero-sub { font-size: var(--t16); }
  .hero-cta .btn { flex: 1 1 100%; }   /* full-width, thumb-reachable targets */
  .track-body { height: 92px; }
  .track-head, .track-foot { font-size: 10px; padding: 7px 10px; gap: 8px; }
  .section { padding: 36px 0; }
  .section h2 { font-size: var(--t25); }
  .lead { font-size: var(--t16); }

  /* Tables become card stacks. A horizontally-scrolling data table on a phone
     is technically responsive and practically unusable — each row becomes a
     labelled block using the header text injected via data-label. */
  table.data, table.data thead, table.data tbody, table.data tr, table.data th, table.data td { display: block; }
  table.data thead { display: none; }
  /* The caption must be reset explicitly: turning every table element into a
     block leaves it as a shrink-to-fit box squeezed into a narrow column. */
  table.data caption { display: block; width: 100%; padding: 0 0 12px; }
  .data-table-wrap { border: 0; background: none; }
  table.data tr {
    border: 1px solid var(--rule); border-radius: var(--radius);
    background: var(--surface); margin-bottom: 10px; padding: 4px 0;
  }
  table.data td { border-bottom: 1px solid var(--rule-soft); padding: 9px 13px; display: flex; gap: 12px; white-space: normal; }
  table.data tr td:last-child { border-bottom: 0; }
  table.data td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    font-family: var(--data); font-size: var(--t11); letter-spacing: .08em;
    text-transform: uppercase; color: var(--slate);
  }
  table.data td.metric { font-size: var(--t20); }

  .pipeline { flex-direction: column; }
  .pipeline-step { border-right: 0; border-bottom: 1px solid var(--rule); }
  .pipeline-step:last-child { border-bottom: 0; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 18px; }
  .footer-bottom .locale-form { margin-left: 0; flex: 1 1 100%; }
}

/* Larger tap targets on touch devices — 44px is the accessible minimum. */
@media (hover: none) and (pointer: coarse) {
  .btn { padding: 12px 18px; }
  .nav-primary a { padding-top: 13px; padding-bottom: 13px; }
  .faq summary { padding: 17px 16px; }
}

@media print {
  .site-header, .rail, .hero-cta, .nav-toggle { display: none; }
  body { background: #fff; color: #000; }
  .main { padding: 0; }
}
