/* ==========================================================================
   YONASOL — Section-specific styles for Signal & Telemetry direction
   Ported from handoff/reference.html lines 16-379, minus .ref-banner and .ds
   appendix (both are reference-only). Mobile nav + focus-visible added here
   to satisfy BRIEF §7 acceptance (hamburger drawer, 3px focus rings).
   ========================================================================== */

/* ---------- Base reset (reference.html L17-23) ---------- */
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ff-body);
}

/* ---------- Direction-signal type override (reference.html L26-30) ----------
   tokens.css ships GT America as the default for [data-dir="signal"]; we
   substitute Space Grotesk because that's what the reference loads from
   Google Fonts and what the production site uses.
*/
[data-dir="signal"] {
  --ff-display: 'Space Grotesk', 'GT America', system-ui, sans-serif;
  --ff-body: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --ff-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;
}

/* ---------- Logo ---------- */
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
}
.logo svg { color: var(--ink); display: block; }
.logo .wordmark {
  font-family: var(--ff-mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 64px;
  position: relative;
  border-bottom: 1px solid var(--rule);
}
.hero-coords {
  display: flex; gap: 24px; align-items: center;
  font-family: var(--ff-mono); font-size: 11px; color: var(--ink-faint);
  letter-spacing: 0.06em;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.hero-coords .dot { display: inline-flex; align-items: center; gap: 8px; }
.hero-coords .dot::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--status-live);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--status-live) 25%, transparent);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}
.hero-eyebrow { margin-bottom: 16px; }
.hero h1 {
  font-family: var(--ff-display);
  font-size: clamp(38px, 5.4vw, 68px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  color: var(--ink);
}
.hero h1 em { font-style: normal; color: var(--warm); }
.hero p.lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 52ch;
  margin: 0 0 36px;
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Telemetry panel ---------- */
.telemetry {
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--bg-2);
  padding: 20px;
  font-family: var(--ff-mono);
  font-size: 12px;
  position: relative;
}
.telemetry::before, .telemetry::after,
.telemetry > .c1, .telemetry > .c2 {
  content: ''; position: absolute; width: 8px; height: 8px;
  border: 1px solid var(--warm); border-style: none;
}
.telemetry::before { top: -1px; left: -1px; border-top-style: solid; border-left-style: solid; }
.telemetry::after  { top: -1px; right: -1px; border-top-style: solid; border-right-style: solid; }
.telemetry > .c1   { bottom: -1px; left: -1px; border-bottom-style: solid; border-left-style: solid; }
.telemetry > .c2   { bottom: -1px; right: -1px; border-bottom-style: solid; border-right-style: solid; }
.telemetry-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 12px; border-bottom: 1px solid var(--rule);
  color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase; font-size: 10px;
}
.telemetry-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0; border-bottom: 1px dashed var(--rule);
}
.telemetry-row:last-child { border-bottom: 0; }
.telemetry-key { color: var(--ink-muted); }
.telemetry-val { color: var(--ink); }
.telemetry-val.warm { color: var(--warm); }

/* ---------- Section frame ---------- */
section { padding: 96px 0; border-bottom: 1px solid var(--rule); }
.sec-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 20px; margin-bottom: 48px; border-bottom: 1px solid var(--rule);
  gap: 24px; flex-wrap: wrap;
}
.sec-head .sec-num {
  font-family: var(--ff-mono); font-size: 11px; color: var(--warm);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.sec-head h2 {
  font-family: var(--ff-display); font-size: 32px; font-weight: 500;
  letter-spacing: -0.02em; margin: 8px 0 0; color: var(--ink);
}
.sec-head .sec-meta {
  font-family: var(--ff-mono); font-size: 11px; color: var(--ink-faint);
  letter-spacing: 0.06em;
}

/* ---------- Bands (3 cards) ---------- */
.bands {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
@media (max-width: 920px) { .bands { grid-template-columns: 1fr; } }
.band {
  border: 1px solid var(--rule); padding: 28px; position: relative;
  transition: border-color 220ms var(--ease);
}
.band:hover { border-color: var(--rule-strong); }
.band-num {
  font-family: var(--ff-mono); font-size: 11px; color: var(--warm);
  letter-spacing: 0.1em; margin-bottom: 24px;
}
.band h3 {
  font-family: var(--ff-display); font-size: 19px; font-weight: 500;
  letter-spacing: -0.01em; margin: 0 0 10px; color: var(--ink);
}
.band p { color: var(--ink-muted); font-size: 14px; line-height: 1.55; margin: 0; }

/* ---------- Registry table ---------- */
.registry {
  border: 1px solid var(--rule); border-radius: 4px; overflow: hidden;
}
.reg-head, .reg-row {
  display: grid;
  grid-template-columns: 84px 1.2fr 2fr 110px 80px 28px;
  gap: 16px; align-items: center;
  padding: 14px 20px; font-size: 13px;
}
.reg-head {
  background: var(--bg-2); border-bottom: 1px solid var(--rule);
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint);
}
.reg-row {
  border-bottom: 1px solid var(--rule);
  transition: background 220ms var(--ease);
  text-decoration: none;
  color: inherit;
}
.reg-row:last-child { border-bottom: 0; }
.reg-row:hover { background: var(--bg-2); }
.reg-row .id { font-family: var(--ff-mono); font-size: 11px; color: var(--ink-faint); letter-spacing: 0.06em; }
.reg-row .name { font-weight: 500; color: var(--ink); }
.reg-row .name small { display: block; color: var(--ink-faint); font-weight: 400; font-size: 11px; font-family: var(--ff-mono); letter-spacing: 0.06em; margin-top: 2px; text-transform: uppercase; }
.reg-row .desc { color: var(--ink-muted); font-size: 13px; line-height: 1.5; }
.reg-row .ver { font-family: var(--ff-mono); font-size: 11px; color: var(--ink-faint); }
.reg-row .arrow { font-family: var(--ff-mono); color: var(--ink-faint); justify-self: end; }
.reg-row[href]:hover .arrow { color: var(--warm); }
.reg-row.is-stealth .arrow { opacity: 0.5; }
@media (max-width: 920px) {
  .reg-head { display: none; }
  .reg-row { grid-template-columns: 1fr; gap: 6px; padding: 18px 16px; }
  .reg-row .arrow { display: none; }
}

/* ---------- OS — 5 steps ---------- */
.os {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
  align-items: stretch; position: relative;
}
.os::before {
  content: ''; position: absolute; top: 28px; left: 5%; right: 5%; height: 1px;
  background: var(--rule-strong);
}
.os-step {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 0 12px; position: relative;
}
.os-circle {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--accent-line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono); font-size: 13px; color: var(--accent);
  letter-spacing: 0.06em; margin-bottom: 16px;
  position: relative; z-index: 1;
}
.os-step h4 {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink); margin: 0 0 6px;
}
.os-step p {
  font-size: 12px; color: var(--ink-faint); line-height: 1.5; margin: 0;
  max-width: 140px;
}
.os-callout {
  margin-top: 64px;
  border-left: 2px solid var(--warm);
  padding: 12px 0 12px 20px;
  font-family: var(--ff-display); font-size: 18px; color: var(--ink);
  max-width: 60ch;
}
@media (max-width: 920px) {
  .os { grid-template-columns: 1fr 1fr; gap: 24px; }
  .os::before { display: none; }
}

/* ---------- Founder ---------- */
.founder { display: grid; grid-template-columns: 200px 1fr; gap: 40px; align-items: start; }
.portrait {
  width: 200px; height: 240px; background: var(--bg-2);
  border: 1px solid var(--rule-strong); position: relative;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono); font-size: 10px; color: var(--ink-faint);
  letter-spacing: 0.1em; text-transform: uppercase;
  text-align: center; line-height: 1.6;
}
.portrait::before, .portrait::after, .portrait .c1, .portrait .c2 {
  content: ''; position: absolute; width: 10px; height: 10px;
  border: 1px solid var(--warm); border-style: none;
}
.portrait::before { top: -1px; left: -1px; border-top-style: solid; border-left-style: solid; }
.portrait::after  { top: -1px; right: -1px; border-top-style: solid; border-right-style: solid; }
.portrait .c1     { bottom: -1px; left: -1px; border-bottom-style: solid; border-left-style: solid; }
.portrait .c2     { bottom: -1px; right: -1px; border-bottom-style: solid; border-right-style: solid; }
.founder h3 {
  font-family: var(--ff-display); font-size: 28px; font-weight: 500;
  letter-spacing: -0.02em; margin: 0 0 16px; line-height: 1.15;
}
.founder p {
  font-size: 16px; line-height: 1.7; color: var(--ink-muted);
  max-width: 60ch; margin: 0 0 14px;
}
.founder .sig {
  font-family: var(--ff-mono); font-size: 11px; color: var(--ink-faint);
  letter-spacing: 0.08em; text-transform: uppercase; margin-top: 16px;
}
@media (max-width: 920px) { .founder { grid-template-columns: 1fr; } }

/* ---------- Notes list ---------- */
.notes-list { display: flex; flex-direction: column; }
.note-row {
  display: grid; grid-template-columns: 90px 110px 1fr 24px;
  gap: 24px; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: padding 220ms var(--ease);
}
.note-row:hover { padding-left: 8px; }
.note-row .note-id, .note-row .note-date {
  font-family: var(--ff-mono); font-size: 11px; color: var(--ink-faint);
  letter-spacing: 0.06em;
}
.note-row .note-title {
  font-size: 16px; color: var(--ink);
}
.note-row .note-arrow {
  font-family: var(--ff-mono); color: var(--ink-faint); text-align: right;
}
.note-row:hover .note-arrow { color: var(--warm); }
@media (max-width: 720px) {
  .note-row { grid-template-columns: 1fr; gap: 4px; }
  .note-row .note-arrow { display: none; }
}

/* ---------- Final CTA ---------- */
.final {
  text-align: center;
  padding: 120px 0;
}
.final h2 {
  font-family: var(--ff-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 16px;
}
.final h2 em { font-style: normal; color: var(--warm); }
.final p {
  color: var(--ink-muted); font-size: 16px; max-width: 50ch;
  margin: 0 auto 32px;
}
.final-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Site footer (renamed from .ref-footer in reference.html) ---------- */
.site-footer {
  padding: 48px 0 32px;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.site-footer .grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
  margin-bottom: 40px;
}
.site-footer h5 {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink); margin: 0 0 12px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.site-footer a { color: var(--ink-muted); text-decoration: none; }
.site-footer a:hover { color: var(--warm); }
.site-footer .meta { display: flex; justify-content: space-between; padding-top: 20px; border-top: 1px solid var(--rule); flex-wrap: wrap; gap: 12px; }
.site-footer .footer-tagline {
  margin-top: 12px;
  color: var(--ink-faint);
  max-width: 32ch;
  line-height: 1.6;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--ff-body);
  font-size: 13px;
}
@media (max-width: 720px) {
  .site-footer .grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Contact form (BRIEF preserves contact form, restyled) ---------- */
.contact-form {
  display: flex; flex-direction: column; gap: 16px;
  max-width: 540px; margin: 0 auto;
}
.contact-form .field { width: 100%; }
.contact-form button { align-self: flex-start; }

/* ==========================================================================
   MOBILE NAV — hamburger drawer (BRIEF §7 acceptance: ≥44×44 hit targets)
   Reference.html doesn't define mobile nav. Pattern reuses the slide-in
   drawer UX from the previous site, reskinned with Signal tokens.
   ========================================================================== */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 10px;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
}
.hamburger-line {
  width: 22px; height: 1.5px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform var(--t-base) var(--ease), opacity var(--t-base) var(--ease);
}
.nav-toggle.open .hamburger-line:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-toggle.open .hamburger-line:nth-child(2) { opacity: 0; }
.nav-toggle.open .hamburger-line:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }

  /* Hide the brass Contact CTA on mobile — surfaces inside the drawer instead */
  .nav > .btn-warm { display: none; }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    max-width: 80vw;
    height: 100vh;
    background: var(--bg);
    border-left: 1px solid var(--rule-strong);
    flex-direction: column;
    padding: 96px 24px 24px;
    gap: 4px;
    transition: right var(--t-slow) var(--ease);
    z-index: 40;
  }
  .nav-links.open { right: 0; }
  .nav-link {
    font-size: var(--fs-md);
    padding: 14px 12px;
  }

  /* Drawer-only Contact link */
  .nav-links .nav-contact {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--rule);
    color: var(--warm);
  }
}

/* ==========================================================================
   FOCUS-VISIBLE — BRIEF §7 acceptance: 3px focus rings
   ========================================================================== */
.btn:focus-visible,
.nav-link:focus-visible,
.note-row:focus-visible,
.reg-row:focus-visible,
.lnk-arrow:focus-visible,
.field-input:focus-visible,
.field-textarea:focus-visible,
.logo:focus-visible,
.nav-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 4px var(--accent);
  border-radius: var(--r-sm);
}

/* ==========================================================================
   PREFERS-REDUCED-MOTION — BRIEF §7 acceptance: honor it
   Disable all hover-translate, the heartbeat ticker, and reveal-on-scroll
   transitions.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .note-row:hover { padding-left: 0; }
  .btn-primary:hover, .btn-warm:hover { transform: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .telemetry-val.warm { animation: none !important; }
}

/* ==========================================================================
   REVEAL-ON-SCROLL — IntersectionObserver target class set by app.js
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger reveal for grouped items */
.bands .reveal:nth-child(2) { transition-delay: 80ms; }
.bands .reveal:nth-child(3) { transition-delay: 160ms; }
.os-step.reveal:nth-child(2) { transition-delay: 60ms; }
.os-step.reveal:nth-child(3) { transition-delay: 120ms; }
.os-step.reveal:nth-child(4) { transition-delay: 180ms; }
.os-step.reveal:nth-child(5) { transition-delay: 240ms; }

/* ==========================================================================
   HEARTBEAT TICKER — soft pulse on the online indicator
   ========================================================================== */
@keyframes heartbeat-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.telemetry-val.warm {
  animation: heartbeat-pulse 2.4s ease-in-out infinite;
}

/* ==========================================================================
   REGISTRY — type badge ([INTERNAL] / [OSS]) + GitHub link
   The name cell now has a flex .name-row containing the product name plus
   optional badge and gh link inline, with the existing .small tag below.
   ========================================================================== */
.reg-row .name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.reg-row .name-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 500;
  color: var(--ink);
}
.reg-row .name small {
  display: block;
  margin-top: 0;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warm);
  border: 1px solid color-mix(in oklab, var(--warm) 40%, transparent);
  border-radius: var(--r-xs);
  background: var(--warm-soft);
  white-space: nowrap;
}
.type-badge.type-oss {
  /* OSS reads as a public/community signal — slate-teal differentiates it
     from internal (brass) without competing with the live status pill. */
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.gh-link {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-decoration: none;
  padding: 1px 4px;
  border-radius: var(--r-xs);
  transition: color var(--t-quick) var(--ease), background var(--t-quick) var(--ease);
}
.gh-link:hover {
  color: var(--warm);
  background: var(--warm-soft);
}

/* ==========================================================================
   NOTE PAGE — individual lab note layout (notes/<slug>.html)
   Used by every static note generated by tooling/build-notes.js.
   ========================================================================== */
.note-topnav,
.note-bottomnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  gap: 16px;
  border-bottom: 1px solid var(--rule);
}
.note-bottomnav {
  border-bottom: 0;
  border-top: 1px solid var(--rule);
  margin-top: 64px;
}
.note-page {
  padding: 48px 0 32px;
}
.note-container {
  max-width: 720px;  /* ~64ch — readable measure */
  margin: 0 auto;
}
.note-eyebrow {
  margin-bottom: 16px;
  color: var(--warm);
  opacity: 0.85;
}
.note-title {
  font-family: var(--ff-display);
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--ink);
}
.note-description {
  font-family: var(--ff-body);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 24px;
  font-style: italic;
}
.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 40px;
}

/* Article body typography */
.note-body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}
.note-body > * + * {
  margin-top: 1.4em;
}
.note-body h1,
.note-body h2,
.note-body h3 {
  font-family: var(--ff-display);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
}
.note-body h1 { font-size: 28px; margin-top: 2em; }
.note-body h2 { font-size: 24px; margin-top: 2em; letter-spacing: -0.01em; }
.note-body h3 { font-size: 19px; margin-top: 1.6em; letter-spacing: -0.005em; }
.note-body p {
  color: var(--ink);
}
.note-body strong {
  font-weight: 600;
  color: var(--ink);
}
.note-body em {
  font-style: italic;
  color: var(--ink);
}
.note-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--t-quick) var(--ease);
}
.note-body a:hover {
  color: var(--warm);
}
.note-body ul,
.note-body ol {
  padding-left: 24px;
}
.note-body li {
  margin-bottom: 6px;
}
.note-body li > ul,
.note-body li > ol {
  margin-top: 6px;
}
.note-body blockquote {
  border-left: 2px solid var(--warm);
  padding: 4px 0 4px 20px;
  margin-left: 0;
  color: var(--ink-muted);
}
.note-body blockquote p {
  margin: 0;
  font-style: italic;
}
.note-body code {
  font-family: var(--ff-mono);
  font-size: 0.9em;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--bg-2);
  color: var(--warm);
}
.note-body pre {
  background: var(--bg-inset);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
}
.note-body pre code {
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}
.note-body hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 2.5em 0;
}

@media (max-width: 720px) {
  .note-topnav,
  .note-bottomnav {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .note-body { font-size: 16px; }
}

/* Draft note row gets a small visual signal in the index list */
.note-row.is-draft .note-date {
  color: var(--warm);
}
