/* ============================================================
   ONDOS — shared stylesheet
   Evidence-first intelligence infrastructure
   Tokens · type roles · evidence block · depth rail · top bar
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300..600;1,6..72,300..500&family=Hanken+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* ---- palette ---- */
  --abyss:      #0D2426;
  --abyss-2:    #0A1C1E;  /* deeper, footer */
  --sea-glass:  #E8ECE5;
  --sea-glass-2:#EEF1EB;  /* faintly lighter panel on light bg */
  --contour:    #2F6B66;
  --flare:      #D96D2A;
  --ink:        #14201F;
  --jacaranda:  #6E5FA3;
  --lily:       #7FA08C;

  /* derived tints */
  --contour-30: rgba(47,107,102,0.30);
  --contour-15: rgba(47,107,102,0.15);
  --contour-08: rgba(47,107,102,0.08);
  --flare-12:   rgba(217,109,42,0.12);
  --flare-20:   rgba(217,109,42,0.20);
  --glass-line: rgba(232,236,229,0.16); /* hairline on abyss */
  --glass-line-strong: rgba(232,236,229,0.30);

  /* ---- type ---- */
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body:    'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* ---- spacing / measure ---- */
  --measure: 36rem;        /* ~5-col text measure */
  --radius: 2px;
  --rule: 1px;

  /* ---- depth rail ---- */
  --rail-w: 84px;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--sea-glass);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }

/* ============================================================
   TYPE ROLES
   ============================================================ */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.display-xl { font-size: clamp(2.6rem, 6.2vw, 5.4rem); }
.display-l  { font-size: clamp(2.2rem, 4.6vw, 3.9rem); }
.display-m  { font-size: clamp(1.7rem, 3vw, 2.6rem); }
.display em { font-style: italic; }

.lede {
  font-size: clamp(1.06rem, 1.5vw, 1.32rem);
  line-height: 1.5;
  max-width: var(--measure);
}
.prose p { max-width: var(--measure); }
.prose p + p { margin-top: 1.1em; }

/* eyebrow / section label */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--contour);
}
.eyebrow .tick { color: var(--flare); }

/* mono utility */
.mono { font-family: var(--font-mono); }

/* ============================================================
   LAYOUT
   ============================================================ */
.shell {
  padding-left: var(--rail-w);
}
.section {
  position: relative;
  padding: clamp(4.5rem, 9vh, 8rem) clamp(1.5rem, 5vw, 6rem);
  border-top: var(--rule) solid var(--contour-15);
}
.section--full {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.section--abyss {
  background: var(--abyss);
  color: var(--sea-glass);
  border-top-color: var(--glass-line);
}
.section--abyss .eyebrow { color: var(--lily); }
.section--abyss .display { color: var(--sea-glass); }

.wrap { width: min(100%, 1180px); margin: 0 auto; }

.grid12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1rem, 2.4vw, 2.4rem);
}
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-12 { grid-column: 1 / -1; }

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem clamp(1.5rem, 5vw, 2.4rem);
  padding-left: calc(var(--rail-w) + 0.4rem);
  background: color-mix(in srgb, var(--sea-glass) 78%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: var(--rule) solid var(--contour-15);
}
.topbar.is-dark {
  background: color-mix(in srgb, var(--abyss) 72%, transparent);
  border-bottom-color: var(--glass-line);
  color: var(--sea-glass);
}
.wordmark {
  font-family: var(--font-display);
  font-size: 1.32rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
}
/* nestled wave-tonos over the O — lily (#7FA08C) */
.ondos-mark { display: inline-block; white-space: nowrap; }
.o-mark { position: relative; display: inline-block; }
.o-wave {
  position: absolute; left: 50%; top: -0.12em;
  width: 0.50em; height: 0.26em;
  transform: translateX(-50%);
  fill: none; stroke: #7FA08C; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  overflow: visible;
}
.wordmark .glyph,
.jx-brand .glyph { display: none; }
.navlinks {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 2rem);
  font-size: 0.95rem;
}
.navlinks a {
  position: relative;
  padding: 0.3rem 0;
  color: inherit;
  opacity: 0.82;
  transition: opacity 0.18s ease;
}
.navlinks a:hover { opacity: 1; }
.navlinks a::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1.5px; background: var(--flare);
  transition: width 0.22s ease;
}
.navlinks a:hover::after,
.navlinks a[aria-current="page"]::after { width: 100%; }
.navlinks a[aria-current="page"] { opacity: 1; }

.btn-cta {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  background: var(--flare);
  padding: 0.56rem 1.1rem;
  border-radius: var(--radius);
  border: var(--rule) solid var(--flare);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}
.btn-cta:hover { background: #c45d20; }
.btn-cta:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: var(--flare);
  border-color: var(--flare);
}
.btn-ghost:hover { background: var(--flare-12); }

/* right-side actions: quiet login + CTA */
.topbar-actions { display: flex; align-items: center; gap: clamp(0.7rem, 1.6vw, 1.25rem); }
.login-link {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.82;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  white-space: nowrap;
  transition: opacity 0.18s ease;
}
.login-link:hover { opacity: 1; }
.login-link svg { width: 14px; height: 14px; display: block; }
.topbar.is-dark .login-link { color: var(--sea-glass); }
@media (max-width: 420px) { .login-link span { display: none; } }

/* focus visibility — flare */
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--flare);
  outline-offset: 3px;
}

/* mobile nav: collapse links, keep wordmark + CTA */
.nav-toggle { display: none; }
@media (max-width: 820px) {
  .navlinks { display: none; }
}

/* ============================================================
   DEPTH RAIL
   left-edge sounding line; ticks = sections
   ============================================================ */
.depth-rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail-w);
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 86px 0 28px;
  background: transparent;
  border-right: var(--rule) solid var(--contour-15);
  pointer-events: none;
}
.depth-rail.on-abyss { border-right-color: var(--glass-line); }
/* the vertical sounding line */
.depth-rail::before {
  content: "";
  position: absolute;
  left: 50%; top: 96px; bottom: 36px;
  width: 1px;
  background: var(--contour-30);
  transform: translateX(-0.5px);
}
.depth-rail.on-abyss::before { background: var(--glass-line-strong); }

.rail-ticks {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: auto;
}
.rail-tick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: calc(50% - 0.5px);
  height: 0;
  cursor: pointer;
  text-decoration: none;
}
.rail-tick .mark {
  position: absolute;
  left: 50%;
  width: 9px; height: 1px;
  background: var(--contour);
  transform: translateX(-50%);
  transition: width 0.25s ease, background 0.25s ease;
}
.depth-rail.on-abyss .rail-tick .mark { background: var(--lily); }
.rail-tick .num {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--contour);
  transform: translateX(14px);
  opacity: 0.55;
  transition: opacity 0.25s ease, color 0.25s ease;
  white-space: nowrap;
}
.depth-rail.on-abyss .rail-tick .num { color: var(--lily); }
.rail-tick:hover .num { opacity: 1; }
.rail-tick:hover .mark { width: 15px; }
/* active state — illuminate in flare */
.rail-tick.is-active .mark { width: 19px; height: 1.5px; background: var(--flare); }
.rail-tick.is-active .num { opacity: 1; color: var(--flare); }

/* mobile: rail collapses to a thin top progress line */
.rail-progress { display: none; }
@media (max-width: 820px) {
  .shell { padding-left: 0; }
  .depth-rail { display: none; }
  .topbar { padding-left: clamp(1.2rem, 5vw, 2.4rem); }
  .section { padding-left: clamp(1.4rem, 5vw, 2rem); padding-right: clamp(1.4rem, 5vw, 2rem); }
  .rail-progress {
    display: block;
    position: fixed; top: 0; left: 0;
    height: 2px; width: 0%;
    background: var(--flare);
    z-index: 70;
  }
}

/* ============================================================
   EVIDENCE BLOCK  — the brand's core component
   mono type · thin rule above · provenance tag
   ============================================================ */
.evidence {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.5;
  border-top: var(--rule) solid var(--contour);
  padding-top: 0.55rem;
  color: var(--ink);
}
.section--abyss .evidence { color: var(--sea-glass); border-top-color: var(--contour); }

.evidence__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--contour);
  margin-bottom: 0.4rem;
}
.section--abyss .evidence__tag { color: var(--lily); }
.evidence__tag .dot { color: var(--contour-30); }
/* confirmed records carry the flare accent on the tag */
.evidence__tag.is-confirmed { color: var(--flare); }
.evidence__tag.is-confirmed .dot { color: var(--flare-20); }

.evidence__body { display: block; }
.evidence__k { color: var(--contour); }
.section--abyss .evidence__k { color: var(--lily); }
.evidence__v { color: inherit; }
.evidence__src {
  color: color-mix(in srgb, currentColor 62%, transparent);
  font-style: normal;
}

/* a stack of evidence rows */
.evidence-stack { display: flex; flex-direction: column; gap: 1.5rem; }

/* wire-copy print animation — rows reveal line by line */
.print-line {
  opacity: 0;
  transform: translateY(6px);
}
.print-line.is-printed {
  opacity: 1;
  transform: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
@media (prefers-reduced-motion: reduce) {
  .print-line { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ============================================================
   GENERIC HELPERS
   ============================================================ */
.hr-hair { border: 0; border-top: var(--rule) solid var(--contour-15); margin: 0; }
.section--abyss .hr-hair { border-top-color: var(--glass-line); }
.stack-sm > * + * { margin-top: 0.75rem; }
.stack-md > * + * { margin-top: 1.4rem; }
.stack-lg > * + * { margin-top: 2.2rem; }
.muted { color: color-mix(in srgb, var(--ink) 62%, transparent); }
.section--abyss .muted { color: color-mix(in srgb, var(--sea-glass) 64%, transparent); }
.accent { color: var(--flare); }

/* ============================================================
   FOOTER (shared) — sits outside .shell, so clear the depth rail
   ============================================================ */
.footer {
  background: var(--abyss-2);
  color: var(--sea-glass);
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 5vw, 6rem);
  padding-left: calc(var(--rail-w) + clamp(1.5rem, 5vw, 6rem));
  border-top: 1px solid var(--glass-line);
}
.footer .f-grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; align-items: flex-end; }
.footer .f-links { display: flex; gap: 1.6rem; font-size: 0.9rem; flex-wrap: wrap; }
.footer .f-links a { opacity: 0.75; }
.footer .f-links a:hover { opacity: 1; }
.footer .f-fine { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em; color: color-mix(in srgb, var(--sea-glass) 50%, transparent); margin-top: 1.6rem; }
@media (max-width: 820px) {
  .footer { padding-left: clamp(1.5rem, 5vw, 6rem); }
}
