/* ============================================================
   owda.io
   Palette : ultramarine field, cool paper, navy ink, ochre marks
   Type    : Archivo Expanded (display) / Archivo (text) /
             Spline Sans Mono (numbers and data only)
   ============================================================ */

:root {
  --paper:      #EDEDE8;
  --paper-2:    #E4E4DE;
  --ink:        #141726;
  --ink-soft:   #565B70;
  --rule:       #D2D2CA;
  --blue:       #2A35E0;
  --blue-deep:  #1D25B4;
  --gold:       #B9820F;
  --panel-bg:   #2A35E0;
  --panel-fg:   #FBFBF9;
  --panel-fg-2: rgba(251, 251, 249, .74);
  --panel-rule: rgba(251, 251, 249, .22);
  --panel-gold: #F2C14E;

  --step--1: .8125rem;
  --step-0:  1.0625rem;
  --step-1:  clamp(1.25rem, 1.1rem + .6vw, 1.5rem);
  --step-2:  clamp(1.75rem, 1.3rem + 2.1vw, 2.75rem);
  --step-3:  clamp(2.3rem, 1.05rem + 4.4vw, 4.15rem);

  --gutter:  clamp(1.25rem, 4vw, 3.5rem);
  --measure: 66ch;
  --ease:    cubic-bezier(.22, .68, .3, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #0C0E17;
    --paper-2:    #131623;
    --ink:        #E8E8E2;
    --ink-soft:   #9BA0B5;
    --rule:       #262B40;
    --blue:       #6B74FF;
    --blue-deep:  #4C56F5;
    --gold:       #EDB747;
    --panel-bg:   #1B22A0;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper:      #0C0E17;
  --paper-2:    #131623;
  --ink:        #E8E8E2;
  --ink-soft:   #9BA0B5;
  --rule:       #262B40;
  --blue:       #6B74FF;
  --blue-deep:  #4C56F5;
  --gold:       #EDB747;
  --panel-bg:   #1B22A0;
  color-scheme: dark;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", ui-sans-serif, system-ui, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.08; letter-spacing: -.012em; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
img, canvas { display: block; max-width: 100%; }

a { color: inherit; }

.num {
  font-family: "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-feature-settings: "tnum" 1;
  letter-spacing: -.01em;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--ink); color: var(--paper);
  padding: .7rem 1rem; text-decoration: none;
}
.skip:focus { left: 0; }

.ulink {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 2px;
  transition: background-size .35s var(--ease);
}
.ulink:hover { background-size: 0% 1px; background-position: 100% 100%; }

/* ---------- top bar ---------- */

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.topbar.is-stuck {
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-bottom-color: var(--rule);
  backdrop-filter: saturate(140%) blur(12px);
}

.topbar-in {
  max-width: 1240px; margin: 0 auto;
  padding: .85rem var(--gutter);
  display: flex; align-items: center; gap: 1.5rem;
}

.mark {
  font-family: "Archivo Expanded", "Archivo", sans-serif;
  font-weight: 700; font-size: .95rem; letter-spacing: -.02em;
  text-decoration: none; margin-right: auto;
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--panel-fg);
  transition: color .3s var(--ease);
}
.mark-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--panel-gold);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--panel-gold) 60%, transparent);
  animation: pulse 3.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 70%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--panel-gold) 55%, transparent); }
  35%           { box-shadow: 0 0 0 7px transparent; }
}

.topnav { display: flex; gap: 1.4rem; }
.topnav a {
  font-size: var(--step--1); text-decoration: none;
  color: var(--panel-fg-2);
  transition: color .25s var(--ease);
}
.topnav a:hover { color: var(--panel-fg); }

.topbar.is-stuck .mark { color: var(--ink); }
.topbar.is-stuck .topnav a { color: var(--ink-soft); }
.topbar.is-stuck .topnav a:hover { color: var(--ink); }

.theme {
  border: 0; background: none; padding: 4px; cursor: pointer;
  display: inline-flex; align-items: center;
}
.theme-track {
  width: 38px; height: 20px; border-radius: 20px;
  border: 1px solid var(--panel-rule);
  display: block; position: relative;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.theme-knob {
  position: absolute; top: 3px; left: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--panel-fg);
  transition: transform .34s var(--ease), background-color .3s var(--ease);
}
.topbar.is-stuck .theme-track { border-color: var(--rule); }
.topbar.is-stuck .theme-knob { background: var(--ink); }
.theme[aria-pressed="true"] .theme-knob { transform: translateX(18px); }

@media (max-width: 640px) {
  .topnav { display: none; }
}

/* ---------- hero ---------- */

.hero {
  background: var(--panel-bg);
  color: var(--panel-fg);
  padding: clamp(6rem, 11vh, 8rem) 0 clamp(1.75rem, 3vw, 2.5rem);
  position: relative;
  overflow: hidden;
}
.hero-in {
  position: relative; z-index: 1;
  max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(1.75rem, 3vw, 2.5rem) clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.display {
  grid-column: 1 / -1;
  font-family: "Archivo Expanded", "Archivo", sans-serif;
  font-size: var(--step-3);
  line-height: .96;
  letter-spacing: -.035em;
  font-weight: 700;
}
.h-line { display: block; overflow: hidden; }
.h-line > span { display: block; will-change: transform; }
.h-line--soft { font-weight: 500; color: var(--panel-fg-2); }

.lede {
  max-width: 46ch;
  color: var(--panel-fg-2);
  font-size: clamp(1rem, .96rem + .25vw, 1.15rem);
  line-height: 1.62;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.btn {
  display: inline-flex; align-items: center;
  padding: .82rem 1.4rem;
  font-size: var(--step--1); font-weight: 600; letter-spacing: .005em;
  text-decoration: none; border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .2s var(--ease), background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-solid { background: var(--panel-fg); color: #1A1E33; }
.btn-solid:hover { background: var(--panel-gold); }
.btn-ghost { border-color: var(--panel-rule); color: var(--panel-fg); }
.btn-ghost:hover { border-color: var(--panel-fg); }

/* retrieval canvas */
.viz { margin: 0; }
#retrieval {
  width: 100%; height: clamp(200px, 21vw, 268px);
  border: 1px solid var(--panel-rule);
  border-radius: 3px;
}
.viz-cap { display: block; margin-top: .9rem; }
.viz-title {
  display: block; font-size: var(--step--1); font-weight: 600; margin-bottom: .2rem;
}
.viz-sub {
  display: block; font-size: var(--step--1); line-height: 1.5;
  color: var(--panel-fg-2); max-width: 42ch;
}

/* fact strip */
.facts {
  grid-column: 1 / -1;
  margin-top: clamp(1.25rem, 3vw, 2.25rem);
  border-top: 1px solid var(--panel-rule);
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.fact { padding: 1.25rem 1.5rem 0 0; }
.fact + .fact { border-left: 1px solid var(--panel-rule); padding-left: 1.5rem; }
.fact dt { font-size: var(--step--1); color: var(--panel-fg-2); margin-bottom: .3rem; }
.fact dd { font-size: .95rem; line-height: 1.45; max-width: 30ch; }

/* narrow screens: let the sentence wrap naturally instead of on fixed lines */
@media (max-width: 620px) {
  .display { font-size: clamp(2rem, 8.6vw, 2.7rem); line-height: 1.06; letter-spacing: -.028em; }
  .h-line, .h-line > span { display: inline; overflow: visible; transform: none !important; }
}

@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; align-items: start; }
  .viz { order: 3; margin-top: 1.5rem; }
  .facts { order: 4; grid-template-columns: 1fr; }
  .fact { padding-right: 0; }
  .fact + .fact { border-left: 0; border-top: 1px solid var(--panel-rule); padding-left: 0; }
}

/* ---------- section scaffolding ---------- */

.band {
  scroll-margin-top: 4.5rem;
  max-width: 1240px; margin: 0 auto;
  padding: clamp(4.5rem, 10vw, 8rem) var(--gutter) 0;
}
.band--tight { padding-top: clamp(3.5rem, 7vw, 6rem); }

.band-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.band-title {
  font-family: "Archivo Expanded", "Archivo", sans-serif;
  font-size: var(--step-2); font-weight: 600; letter-spacing: -.03em;
}
.band-note { margin-top: .6rem; color: var(--ink-soft); font-size: var(--step--1); }

/* ---------- flagship ---------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--rule);
}
.feature-body p + p { margin-top: 1.1rem; }
.feature-body p { max-width: var(--measure); color: var(--ink-soft); }
.feature-body p.feature-lede {
  font-size: clamp(1.15rem, 1rem + .7vw, 1.5rem);
  line-height: 1.45; letter-spacing: -.015em;
  color: var(--ink);
}
.feature-links { margin-top: 1.6rem; font-weight: 600; }
.feature-links a { color: var(--blue); }

.metrics { display: grid; gap: 1.5rem; align-content: start; }
.metric { border-top: 1px solid var(--rule); padding-top: .9rem; }
.metric--chart { grid-column: 1 / -1; }
.metric-label { font-size: var(--step--1); color: var(--ink-soft); line-height: 1.4; }
.metric-num {
  font-family: "Spline Sans Mono", monospace;
  font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1; margin-bottom: .35rem;
  letter-spacing: -.04em;
}

.bars { margin-top: 1rem; display: grid; gap: .6rem; }
.bar-row { display: grid; grid-template-columns: 5.5rem 1fr 3.4rem; align-items: center; gap: .75rem; }
.bar-key { font-size: var(--step--1); color: var(--ink-soft); }
.bar { height: 10px; background: var(--paper-2); display: block; position: relative; }
.bar-fill {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: color-mix(in srgb, var(--ink) 25%, transparent);
  transition: width 1.1s var(--ease);
}
.bar-row--hi .bar-fill { background: var(--blue); }
.is-charted .bar-fill { width: var(--w); }
.is-charted .bar-row--hi .bar-fill { transition-delay: .18s; }
.bar-val { font-size: .9rem; text-align: right; }

@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
}

/* ---------- pipeline (a real sequence, so it is numbered) ---------- */

.pipe {
  counter-reset: step;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.pipe-step {
  counter-increment: step;
  background: var(--paper);
  padding: 1.5rem 1.25rem 1.75rem;
  position: relative;
  opacity: 0;
  transform: translateY(10px);
}
.pipe-step::before {
  content: counter(step);
  font-family: "Spline Sans Mono", monospace;
  font-size: var(--step--1);
  color: var(--blue);
  display: block; margin-bottom: 1.6rem;
}
.pipe-step h3 { font-size: var(--step-1); letter-spacing: -.02em; margin-bottom: .5rem; }
.pipe-step p { font-size: .9375rem; line-height: 1.5; color: var(--ink-soft); }
.pipe-step code { font-size: .875em; color: var(--ink); }
.is-revealed .pipe-step {
  animation: rise .6s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 90ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }

@media (max-width: 1000px) { .pipe { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  {
  .pipe { grid-template-columns: 1fr; }
  .pipe-step { padding: 1.15rem 1.25rem 1.35rem; }
  .pipe-step::before { margin-bottom: .55rem; }
}

/* ---------- rows ---------- */

.rows { border-top: 1px solid var(--rule); }
.row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) 7rem;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.row-role { font-size: var(--step--1); color: var(--ink-soft); padding-top: .25rem; }
.row-main h3 { font-size: var(--step-1); margin-bottom: .45rem; }
.row-main p { color: var(--ink-soft); max-width: var(--measure); font-size: .9375rem; line-height: 1.55; }
.row-year { font-size: var(--step--1); color: var(--ink-soft); text-align: right; padding-top: .25rem; }

@media (max-width: 760px) {
  .row { grid-template-columns: 1fr auto; gap: .5rem 1rem; }
  .row-main { grid-column: 1 / -1; }
  .row-year { text-align: right; padding-top: 0; }
  .row-role { padding-top: 0; }
}

/* ---------- stack ---------- */

.stack {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* six groups, two full rows, no orphan cells */
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.stack-col { background: var(--paper); padding: 1.5rem 1.5rem 1.75rem; }
@media (max-width: 860px) { .stack { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stack { grid-template-columns: 1fr; } }

.stack-col h3 { font-size: .9375rem; margin-bottom: .8rem; }
.stack-col li {
  font-size: .9375rem; color: var(--ink-soft); padding: .2rem 0;
}

/* ---------- timeline ---------- */

.time { border-top: 1px solid var(--rule); }
.time-row {
  display: grid; grid-template-columns: 7rem minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 1.5rem 0; border-bottom: 1px solid var(--rule);
}
.time-year { font-size: var(--step--1); color: var(--blue); padding-top: .25rem; }
.time-body h3 { font-size: var(--step-1); margin-bottom: .35rem; }
.time-body p { color: var(--ink-soft); font-size: .9375rem; }

.certs { margin-top: clamp(2rem, 4vw, 3rem); }
.certs-head { font-size: .9375rem; margin-bottom: 1rem; }
.certs ul {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: .45rem 2rem;
}
.certs li {
  font-size: .9375rem; color: var(--ink-soft);
  padding-left: 1.1rem; position: relative;
}
.certs li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: 5px; height: 1px; background: var(--gold);
}

@media (max-width: 560px) {
  .time-row { grid-template-columns: 1fr; gap: .35rem; }
}

/* ---------- closer ---------- */

.closer {
  scroll-margin-top: 4.5rem;
  margin-top: clamp(5rem, 11vw, 9rem);
  background: var(--panel-bg);
  color: var(--panel-fg);
  padding: clamp(4rem, 9vw, 7rem) 0;
}
.closer-in { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.closer-title {
  font-family: "Archivo Expanded", "Archivo", sans-serif;
  font-size: clamp(1.9rem, 1.2rem + 3.2vw, 3.7rem);
  font-weight: 600; letter-spacing: -.035em; line-height: 1.02;
  max-width: 20ch;
}
.closer-note { margin-top: 1.1rem; color: var(--panel-fg-2); max-width: 42ch; }

.closer-actions {
  margin-top: clamp(2rem, 5vw, 3.25rem);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 1rem 1.75rem;
}
.mail {
  font-family: "Spline Sans Mono", monospace;
  font-size: clamp(1.05rem, .9rem + 1.3vw, 2rem);
  letter-spacing: -.03em; text-decoration: none;
  border-bottom: 1px solid var(--panel-rule);
  padding-bottom: .15rem;
  transition: border-color .25s var(--ease), color .25s var(--ease);
  word-break: break-all;
}
.mail:hover { border-color: var(--panel-gold); color: var(--panel-gold); }

.copy {
  font: inherit; font-size: var(--step--1);
  background: none; color: var(--panel-fg-2);
  border: 1px solid var(--panel-rule); border-radius: 999px;
  padding: .5rem 1rem; cursor: pointer;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.copy:hover { color: var(--panel-fg); border-color: var(--panel-fg); }

.elsewhere {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--panel-rule);
  display: flex; flex-wrap: wrap; gap: 1.75rem;
}
.elsewhere a {
  font-size: var(--step--1); text-decoration: none; color: var(--panel-fg-2);
  transition: color .25s var(--ease);
}
.elsewhere a:hover { color: var(--panel-fg); }

/* ---------- footer ---------- */

.foot { background: var(--paper); }
.foot-in {
  max-width: 1240px; margin: 0 auto; padding: 1.5rem var(--gutter);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
  font-size: var(--step--1); color: var(--ink-soft);
}

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 60;
  transform: translate(-50%, 130%);
  background: var(--ink); color: var(--paper);
  font-size: var(--step--1); padding: .6rem 1.1rem; border-radius: 999px;
  transition: transform .4s var(--ease), opacity .3s var(--ease), visibility .3s;
  pointer-events: none;
  opacity: 0; visibility: hidden;
}
.toast.is-up { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .pipe-step { opacity: 1; transform: none; }
  .bar-fill { width: var(--w); }
}
