/* ==========================================================================
   Sections — in page order
   01 Hero · 02 Trace · 03 Beliefs · 04 Work · 05 Open source
   06 Voices · 07 Contact · 08 Footer · 09 Story panels
   ========================================================================== */


/* ---------- 01 Hero ---------- */
.hero .container{padding-top:clamp(40px,6vw,88px);padding-bottom:clamp(56px,7vw,104px)}
.hero-meta{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:8px 24px;font-size:12px;color:var(--muted)}
/* Name in Geist (you), headline in Anton (your ideas) */
.hero-name{font-family:var(--font-sans);font-size:clamp(18px,1.6vw,24px);font-weight:500;line-height:1.2;letter-spacing:-0.01em;text-transform:none;color:var(--fg)}
.hero-h1{margin-top:clamp(28px,4vw,56px);font-size:clamp(60px,13vw,210px);line-height:.92;font-weight:900}
.hero-accent{color:var(--accent-display)}
.hero-tagline{margin-top:18px;max-width:820px;font-size:clamp(18px,1.8vw,24px);line-height:1.35;font-weight:500;color:var(--text-2)}

/* Trace viewer (assets/js/hero-trace.js).
   States on .tv: is-playing (sweep running) → is-live (finished) → is-scrub (pointer over timeline) */
.tv{--tv-cols:minmax(150px,240px) 1fr 52px;--tv-gap:16px;margin-top:clamp(40px,5vw,72px);font-size:12px}
.tv-cap{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 24px;min-height:44px;color:var(--muted)}
.tv-ctrl{display:flex;align-items:center;gap:20px}
.tv-status{display:inline-flex;align-items:center;gap:8px;color:var(--fg)}
.tv-status i{width:7px;height:7px;border-radius:50%;background:var(--blue)}
.tv-status b{font-weight:400}
.tv-status .live,.tv.is-live .tv-status .rec{display:none}
.tv.is-live .tv-status .live{display:inline}
.tv-replay{min-height:44px;padding:0;background:none;border:0;color:var(--muted);font-size:12px;cursor:pointer;opacity:0;pointer-events:none;transition:opacity .4s,color .2s}
.tv.is-live .tv-replay{opacity:1;pointer-events:auto}
.tv-replay:hover{color:var(--fg)}

.tv-row{display:grid;grid-template-columns:var(--tv-cols);gap:var(--tv-gap);align-items:center;padding:11px 0;border-bottom:1px solid var(--hair);transition:background-color .2s}
.tv-head{padding:9px 0;border-top:2px solid var(--fg);color:var(--muted)}
.tv-axis{display:flex;justify-content:space-between}
.tv-body{position:relative;margin-bottom:34px}
a.tv-row:hover,.tv-row.is-hot{background-color:rgba(43,59,255,.05)}

.tv-name{color:var(--muted-2);transition:color .3s}
.tv-row.is-on .tv-name{color:var(--fg)}
.tv-row.is-hot .tv-name{color:var(--blue)}
.tv-name small{display:block;margin-top:2px;color:var(--muted);font-size:11px}
.tv-name.is-child{position:relative;padding-left:18px}
.tv-name.is-child::before{content:"";position:absolute;left:4px;top:-12px;bottom:50%;width:8px;border-left:1px solid var(--hair-strong);border-bottom:1px solid var(--hair-strong)}

/* Bars are placed on the 2004–2026 axis from the row's --from / --to */
.tv-track{position:relative;height:14px;background:var(--track)}
.tv-bar{position:absolute;top:0;bottom:0;left:calc((var(--from) - 2004) / 22 * 100%);width:calc((var(--to) - var(--from)) / 22 * 100%);background:var(--fg);transform-origin:0 50%}
.tv-bar.is-root{top:5px;bottom:5px;background:var(--muted-2)}
.tv-bar.is-home{background:var(--blue)}
.tv-home{position:absolute;right:6px;top:50%;transform:translateY(-50%);font-size:10px;color:var(--white);opacity:0;transition:opacity .5s}
.tv.is-live .tv-home{opacity:1}
.tv-dur{text-align:right;color:var(--muted)}

/* Scan line with a year tag riding underneath */
.tv-overlay{position:absolute;inset:0;display:grid;grid-template-columns:var(--tv-cols);column-gap:var(--tv-gap);pointer-events:none}
.tv-lane{grid-column:2;position:relative}
.tv-scan{position:absolute;top:0;bottom:0;left:0;width:1px;background:var(--blue);box-shadow:0 0 12px rgba(43,59,255,.45)}
.tv-tag{position:absolute;top:100%;left:0;margin-top:8px;padding:2px 7px;background:var(--blue);color:var(--white);font-size:11px;white-space:nowrap;transform:translateX(-50%)}
.tv.is-live:not(.is-scrub) .tv-tag{transform:translateX(-100%)}

/* Before JS runs: bars hidden (no flash). Without JS: finished state, no scan line. */
.js .tv:not(.is-live) .tv-bar{transform:scaleX(0)}
html:not(.js) .tv-name{color:var(--fg)}
html:not(.js) .tv-home{opacity:1}
html:not(.js) .tv-ctrl,html:not(.js) .tv-overlay{display:none}

@media (prefers-reduced-motion: no-preference){
  .tv-status i{animation:blink 1s steps(2) infinite}
  .tv.is-live .tv-status i{animation:breathe 2.4s ease-in-out infinite}
}
@keyframes blink{50%{opacity:0}}
@keyframes breathe{50%{opacity:.3}}

@media (max-width:640px){
  .tv{--tv-cols:104px 1fr 34px;--tv-gap:10px}
}


/* ---------- 02 Trace (story behind each span) ---------- */
.trace .container{padding-block:var(--section-y)}
.trace-title{font-size:clamp(44px,6vw,96px);line-height:.9;font-weight:900}
.trace .lead{max-width:400px}

.trace-item{display:flex;flex-wrap:wrap;gap:14px 40px;padding:32px 0;border-bottom:1px solid var(--hair)}
.trace-label{flex:1 1 280px;min-width:0}
.trace-lane{flex:3 1 480px;min-width:0}
.trace-city{font-size:40px;line-height:.9;font-weight:800}
.trace-when{margin-top:8px;font-size:13px;color:var(--muted)}
.trace-note{font-size:16px;line-height:1.55;color:var(--text-2)}
.trace-callout{font-size:clamp(26px,2.6vw,34px);line-height:1.08;font-weight:700}
.trace-callout + .trace-note{margin-top:10px}


/* ---------- 03 Beliefs ---------- */
.beliefs .container{padding-block:var(--section-y)}
.beliefs .eyebrow{margin-bottom:clamp(40px,5vw,72px);color:var(--inv-muted)}
.belief{display:flex;flex-wrap:wrap;gap:10px 40px;align-items:baseline;padding:28px 0;border-top:2px solid var(--inv-fg);view-timeline-name:--belief}
.belief:last-child{border-bottom:2px solid var(--inv-fg)}
.belief-num{flex:0 0 60px;font-size:12px;color:var(--inv-muted)}
.belief-title{flex:999 1 520px;font-size:clamp(34px,7.4vw,120px);line-height:.96;overflow-wrap:break-word;font-weight:900}
.belief-title .accent{color:var(--inv-accent)}
.belief-body{flex:1 1 260px;font-size:17px;line-height:1.5;color:var(--inv-text)}
.belief-proof{margin-top:8px;font-size:12px;color:var(--inv-fg)}

/* Words light up one after another as each belief scrolls up (words split by beliefs.js) */
@media (prefers-reduced-motion: no-preference){
  @supports (animation-timeline: view()){
    .belief-title .w{animation:lit linear both;animation-timeline:--belief;animation-range:cover calc(6% + var(--i) * 4%) cover calc(16% + var(--i) * 4%)}
  }
}
@keyframes lit{from{opacity:.14}}


/* ---------- 04 Work (the call / the outcome) ---------- */
.work .container{padding-top:var(--section-y);padding-bottom:clamp(64px,8vw,120px)}
.work-title{font-size:clamp(44px,6vw,96px);line-height:1.02;font-weight:900}
.work-title .dim{color:var(--muted-2)}
.work .lead{margin:24px 0 clamp(40px,5vw,64px);max-width:560px}

.work-list{border-top:1px solid var(--hair-strong)}
.work-item{display:flex;flex-wrap:wrap;gap:16px 40px;align-items:flex-start;padding:40px 0;border-bottom:1px solid var(--hair);transition:background-color .3s}
@media (hover:hover){.work-item:hover{background-color:var(--wash)}}

/* Watermark index number: large, faint, cropped by the row and kept behind the content.
   Drifts slightly on scroll; fills with a pale blue tint on hover. */
.work-item{position:relative;overflow:hidden}
.work-body,.work-result{position:relative;z-index:1}
.work-num{position:absolute;z-index:0;right:min(22vw,320px);top:50%;transform:translateY(-50%);font-size:clamp(150px,19vw,300px);line-height:.8;font-weight:900;pointer-events:none;color:transparent;-webkit-text-stroke:1px rgba(43,59,255,.2);background:linear-gradient(rgba(43,59,255,.08) 0 0) 0 0/0% 100% no-repeat;-webkit-background-clip:text;background-clip:text;transition:background-size .8s var(--ease-out),-webkit-text-stroke-color .4s}
@media (hover:hover){.work-item:hover .work-num{background-size:100% 100%;-webkit-text-stroke-color:rgba(43,59,255,.4)}}
@media (prefers-reduced-motion: no-preference){
  @supports (animation-timeline: view()){
    .work-num{animation:drift linear both;animation-timeline:view();animation-range:cover}
  }
}
@keyframes drift{from{transform:translateY(-40%)}to{transform:translateY(-60%)}}

.work-body{flex:999 1 420px;min-width:0}
.work-meta{font-size:13px;color:var(--muted)}
.work-h{margin-top:12px;font-size:clamp(32px,3.6vw,52px);line-height:1.02;font-weight:800}
.work-desc{margin-top:14px;max-width:600px;font-size:17px;line-height:1.55;color:var(--text-2)}

.work-result{flex:1 1 260px;min-width:0}
.work-metric{font-size:clamp(64px,6.5vw,104px);line-height:.9;font-weight:900}
.work-caption{margin-top:10px;font-size:13px;line-height:1.7;color:var(--muted)}
.work-caption .badge{margin-right:6px}

@media (max-width:720px){
  .work-num{right:-.04em;top:24px;font-size:130px;transform:none;animation:none}
}

/* "The story ↗" button that opens a story panel */
.storybtn{display:inline-flex;align-items:center;gap:6px;min-height:44px;margin-top:10px;padding:0;background:none;border:0;color:var(--fg);font-family:var(--font-mono);font-size:12px;cursor:pointer;background-image:linear-gradient(currentColor 0 0);background-position:0 78%;background-size:0 1px;background-repeat:no-repeat;transition:background-size .25s var(--ease-ui)}
.storybtn:hover{background-size:100% 1px}
.storybtn span{transition:transform .3s var(--ease-ui)}
.storybtn:hover span{transform:translate(3px,-3px)}


/* ---------- 05 Open source ---------- */
.oss{padding-top:clamp(32px,4vw,56px);padding-bottom:var(--section-y);border-top:1px solid var(--hair)}
.oss-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:8px 32px;margin-bottom:24px}
.oss .eyebrow,.oss-note{color:var(--muted)}
.oss-note{font-size:13px}

.tiles{display:flex;flex-wrap:wrap;gap:16px}
.tile{flex:1 1 420px;min-width:0;display:flex;flex-direction:column;justify-content:space-between;gap:40px;padding:clamp(24px,3.5vw,48px)}
.tile-stack{font-size:13px}
.tile.theme-blue .tile-stack{opacity:.85}
.tile.theme-inverse .tile-stack{color:var(--inv-muted)}
.tile-title{margin-top:18px;font-size:min(clamp(88px,10vw,160px),19vw);line-height:.8;font-weight:900}
.tile-desc{margin-top:22px;max-width:460px;font-size:18px;line-height:1.5}
.tile-link{margin-top:18px;font-size:13px}

/* Pulse: trust-boundary diagram */
.pulse-diagram{display:flex;flex-direction:column;gap:4px;font-size:12px}
.pulse-llm{display:flex;justify-content:space-between;gap:12px;padding:14px 16px;background:rgba(255,255,255,.12)}
.pulse-trusted{padding:14px 16px;background:var(--white);color:var(--on-white)}
.pulse-trusted>:first-child{opacity:.7}
.pulse-trusted>:last-child{margin-top:6px}

/* TSight: what it reports */
.tsight-facts{font-size:12px;border-top:2px solid var(--inv-fg)}
.tsight-facts>div{display:flex;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--inv-hair)}
.tsight-facts dd{color:var(--inv-muted)}

/* Playbook: full-width outlined tile */
.tile-wide{flex-basis:100%;flex-direction:row;flex-wrap:wrap;align-items:flex-start;border:1px solid var(--hair-strong)}
.tile-wide>div{flex:1 1 420px;min-width:0}
.tile-wide .tile-stack{color:var(--muted)}
.tile-wide .badge{margin-right:8px}
.playbook-facts{flex:1 1 360px;font-size:12px;border-top:2px solid var(--fg)}
.playbook-facts>div{display:flex;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--hair)}
.playbook-facts dd{color:var(--muted);text-align:right}


/* ---------- 06 Voices (recommendation letters) ---------- */
.voices{border-top:1px solid var(--hair)}
.voices .container{padding-block:clamp(96px,12vw,170px)}
.voices-layout{display:flex;flex-wrap:wrap;gap:48px clamp(40px,6vw,96px);align-items:center}
.voices-title{flex:1 1 300px;min-width:0;font-size:clamp(44px,5.5vw,88px);line-height:1;font-weight:900}
.voices-deck{flex:1.4 1 420px;min-width:0;display:flex;flex-direction:column;gap:40px;align-items:center}

/* Stacked letters; data-pos 0 is on top */
.stack{display:grid;width:min(620px,100%);padding:28px 18px 0}
.letter{grid-area:1/1;display:flex;flex-direction:column;justify-content:space-between;gap:36px;padding:clamp(28px,4vw,48px);background:var(--card);color:var(--card-fg);box-shadow:0 30px 60px -24px rgba(11,11,12,.28),0 8px 18px -8px rgba(11,11,12,.16);transform-origin:50% 60%;transition:transform .7s cubic-bezier(.2,.8,.2,1),filter .5s ease;cursor:pointer}
.letter blockquote{font-size:clamp(20px,2vw,26px);line-height:1.4;font-weight:500;letter-spacing:-.01em}
.letter .sig{border-top:1px solid var(--card-hair);padding-top:14px;font-size:12px;color:var(--card-muted);line-height:1.7}
.letter .sig b{color:var(--card-fg);font-weight:500}
.letter .tag{display:flex;justify-content:space-between;font-size:12px;color:var(--card-faint);margin-bottom:-12px}
.letter>*{transition:opacity .35s ease .15s}
.letter[data-pos="0"]{z-index:3;transform:rotate(0deg)}
.letter[data-pos="1"]{z-index:2;transform:translate(16px,-16px) rotate(2.6deg);filter:brightness(.94)}
.letter[data-pos="2"]{z-index:1;transform:translate(-14px,-28px) rotate(-3.4deg);filter:brightness(.86)}
.letter[data-pos="1"]>*,.letter[data-pos="2"]>*{opacity:0}
@media (hover:hover){.letter[data-pos="0"]:hover{transform:rotate(-.4deg) translateY(-2px)}}

/* Name tabs under the stack */
.names{display:flex;gap:4px 8px;width:min(620px,100%)}
.name{flex:1 1 0;min-width:0;min-height:56px;padding:12px 6px 0;background:none;border:0;border-top:2px solid var(--name-line);color:var(--muted);cursor:pointer;font-family:var(--font-mono);font-size:12px;text-align:left}
.name span{display:block;font-family:var(--font-sans);text-transform:none;letter-spacing:0;font-size:16px;font-weight:500}
.name[aria-selected="true"]{color:var(--fg);border-top-color:var(--blue)}

@media (max-width:600px){
  .name span{font-size:14px}
  .name{font-size:10px}
  .stack{padding:24px 14px 0}
  .letter[data-pos="1"]{transform:translate(6px,-10px) rotate(1.6deg)}
  .letter[data-pos="2"]{transform:translate(-6px,-20px) rotate(-2deg)}
}


/* ---------- 07 Contact ---------- */
.contact .container{padding-top:var(--section-y);padding-bottom:clamp(56px,7vw,96px)}
.contact-lede{max-width:560px;font-size:clamp(19px,1.8vw,24px);line-height:1.4;font-weight:500}
.contact-title{margin-top:clamp(40px,5vw,72px);font-size:clamp(64px,12vw,200px);line-height:.95;font-weight:900}
.contact-links{margin-top:32px;font-size:13px}
.talk .arr{display:inline-block;font-size:.45em;vertical-align:.62em;margin-left:.12em;transition:transform .35s var(--ease-ui)}
.talk:hover .arr,.talk:focus-visible .arr{transform:translate(4px,-4px)}


/* ---------- 08 Footer ---------- */
/* Reveal: <main> scrolls over a sticky footer, so the page appears to lift away */
main{position:relative;z-index:1;background:var(--bg);box-shadow:0 28px 56px -16px rgba(11,11,12,.5)}
.site-footer{position:sticky;bottom:0;z-index:0;overflow:hidden;background:var(--inv-bg);color:var(--inv-fg)}
.footer-in{min-height:min(78vh,560px);display:flex;flex-direction:column;justify-content:space-between;gap:48px;padding-top:clamp(40px,6vw,72px)}
.footer-top{display:flex;justify-content:flex-end}
.footer-meta{font-size:12px;color:var(--inv-muted)}
.footer-meta a{color:var(--inv-fg)}

/* Living wordmark: Geist variable weight, set per letter by footer-mark.js */
.footer-mark{width:max-content;margin-bottom:-.13em;font-family:var(--font-sans);font-size:clamp(48px,15vw,260px);font-weight:200;line-height:1;letter-spacing:-.04em;text-transform:uppercase;white-space:nowrap;user-select:none}
.footer-mark span{display:inline-block}


/* ---------- 09 Story panels (full-screen <dialog>) ---------- */
.panel{position:fixed;inset:0;z-index:100;overflow-y:auto;overscroll-behavior:contain;background:var(--bg);color:var(--fg);font-family:var(--font-sans);animation:pin .5s var(--ease-out)}
dialog.panel{width:100%;height:100%;max-width:none;max-height:none;margin:0;border:0;padding:0}
dialog.panel:not([open]){display:none}
dialog.panel::backdrop{background:var(--bg)}
.panel-in{max-width:920px;margin:0 auto;padding:clamp(24px,4vw,48px) var(--gutter) clamp(80px,10vw,140px)}
.panel-top{display:flex;justify-content:space-between;align-items:center;gap:16px;padding-bottom:20px;border-bottom:1px solid var(--hair-panel);color:var(--muted);font-size:12px}
.panel-x{flex:0 0 auto;white-space:nowrap;min-height:44px;padding:0 4px;background:none;border:0;color:var(--fg);font-family:var(--font-mono);font-size:12px;letter-spacing:.06em;text-transform:uppercase;cursor:pointer}
.panel-h{margin-top:clamp(40px,6vw,72px);font-size:clamp(44px,7vw,104px);line-height:1}
.blk{margin-top:clamp(40px,5vw,64px)}
.blk .k{margin-bottom:14px;font-size:12px;color:var(--accent-text)}
.blk .tx,.blk .p0{font-size:clamp(18px,1.6vw,21px);line-height:1.6;color:var(--text-panel);max-width:62ch}
.blk .li{position:relative;margin-top:10px;padding-left:22px;font-size:clamp(17px,1.5vw,19px);line-height:1.55;color:var(--text-2);max-width:62ch}
.blk .li::before{content:"";position:absolute;left:0;top:.75em;width:10px;height:2px;background:var(--accent-text)}
.val{padding-top:clamp(32px,4vw,48px);border-top:1px solid var(--hair-panel)}
.metric{font-size:clamp(72px,9vw,140px);line-height:.95;margin-bottom:18px}
.panel .badge{margin-bottom:16px;font-size:12px}

/* Morph: the work row expands into the panel (assets/js/stories.js adds .vt when supported) */
.vt .panel{animation:none}
::view-transition-group(story-card){animation-duration:.55s;animation-timing-function:var(--ease-out)}
::view-transition-old(story-card),::view-transition-new(story-card){animation-duration:.35s}
::view-transition-old(root),::view-transition-new(root){animation-duration:.35s}


/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  .letter,.letter>*,.talk .arr{transition:none}
  .panel{animation:none}
}
