/* ============================================================
   ARNAV GOEL — PORTFOLIO
   Theme: clinical instrument / annotated lab notebook
   ============================================================ */

:root{
  --paper: #F6F2EA;
  --paper-dim: #EFE9DD;
  --ink: #15140F;
  --ink-soft: #55503F;
  --line: #DDD4C1;
  --signal: #E8672C;
  --signal-wash: #F6DCC9;
  --panel: #15140F;
  --panel-2: #201E17;
  --on-dark: #F2EDE2;
  --on-dark-soft: #A49D8A;
  --panel-line: #33301F;

  --serif: "Fraunces", Georgia, serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1080px;
  --radius: 10px;

  --ease-out: cubic-bezier(.22,.61,.36,1);
  --ease-spring: cubic-bezier(.34,1.4,.64,1);
  --dur-fast: .18s;
  --dur-base: .32s;
  --dur-slow: .6s;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; scroll-padding-top: 90px; }

body{
  margin:0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- cinematic background layers ---------- */
.bg-layer{
  position:fixed; inset:0; z-index:0; background: var(--paper);
  transition: background-color 1s var(--ease-out);
}
.ambient{ position:fixed; inset:0; z-index:0; width:100%; height:100%; pointer-events:none; }
.site-nav, main, .site-footer{ position:relative; z-index:2; }
.scroll-progress{
  position:fixed; top:0; left:0; height:2px; width:0; background: var(--signal); z-index:120;
  transition: width .1s linear;
}

.mono{ font-family: var(--mono); }
.wrap{ max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

::selection{ background: var(--signal-wash); color: var(--ink); }

h1,h2,h3{
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 .5em;
  font-variation-settings: "opsz" 40;
}
h2{ font-size: clamp(1.9rem, 3vw, 2.7rem); }
h3{ font-size: clamp(1.25rem, 2vw, 1.45rem); }
h4{ font-family: var(--sans); font-weight:600; font-size:1.02rem; margin:0 0 .3em; line-height:1.35; }

p{ margin:0 0 1em; color: var(--ink-soft); }

a{ color: var(--ink); text-decoration: none; background-image: linear-gradient(var(--signal), var(--signal)); background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size var(--dur-base) var(--ease-out), color var(--dur-fast); }
a:hover{ color: var(--signal); background-size: 100% 1px; }

.skip-link{ position:absolute; left:-999px; top:0; background:var(--ink); color:var(--on-dark); padding:.6em 1em; z-index:200; }
.skip-link:focus{ left:1em; top:1em; }

.grain{
  position:fixed; inset:0; pointer-events:none; z-index:1; opacity:.035; mix-blend-mode:multiply;
  background-image:
    radial-gradient(circle at 20% 20%, #000 .5px, transparent .5px),
    radial-gradient(circle at 60% 70%, #000 .5px, transparent .5px);
  background-size: 3px 3px, 5px 5px;
}

/* ---------- scroll reveal ---------- */
.reveal{ opacity:0; transform: translateY(14px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.reveal.is-in{ opacity:1; transform:none; }
.reveal-d1{ transition-delay:.08s; } .reveal-d2{ transition-delay:.16s; } .reveal-d3{ transition-delay:.24s; }

/* word-stagger heading reveal */
.w-word{ display:inline-block; opacity:0; transform: translateY(.55em) rotate(.4deg); transition: opacity .55s var(--ease-out), transform .55s var(--ease-out); transition-delay: var(--wd, 0s); }
.section-head.is-in .w-word, .wp-title .w-word{ opacity:1; transform:none; }

/* timeline self-draw */
.timeline{ position:relative; }
.timeline-progress{
  position:absolute; left:-2px; top:0; width:2px; background: var(--signal); height:0;
  transition: height .25s linear;
}

/* ============ NAV ============ */
.site-nav{
  position: sticky; top:0; z-index:80;
  background: rgba(246,242,234,.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--dur-base);
}
.site-nav.is-scrolled{ box-shadow: 0 6px 24px -18px rgba(21,20,15,.35); }
.nav-inner{
  max-width: var(--max); margin:0 auto; padding:.85rem 1.5rem;
  display:flex; align-items:center; justify-content:space-between; gap:1.2rem;
}
.nav-mark{ font-weight:600; font-size:1.08rem; background:none; }
.nav-mark:hover{ color: var(--ink); }
.cursor-blink{ color: var(--signal); animation: blink 1.1s steps(1) infinite; }
@keyframes blink{ 50%{ opacity:0; } }

.nav-links{ display:flex; gap:1.35rem; }
.nav-links a{ font-size:.92rem; color: var(--ink-soft); background:none; position:relative; }
.nav-links a::after{
  content:""; position:absolute; left:0; bottom:-4px; height:1.5px; width:100%;
  background: var(--signal); transform: scaleX(0); transform-origin:left;
  transition: transform var(--dur-base) var(--ease-out);
}
.nav-links a:hover{ color: var(--signal); }
.nav-links a:hover::after{ transform: scaleX(1); }

.nav-tools{ display:flex; align-items:center; gap:.7rem; }
.lens-switcher{ display:flex; gap:.25rem; border:1px solid var(--line); border-radius:999px; padding:.2rem; background: var(--paper-dim); }
.lens-btn{
  font-size:.72rem; border:none; background:transparent; color: var(--ink-soft);
  padding:.32rem .7rem; border-radius:999px; cursor:pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.lens-btn:hover{ color: var(--ink); }
.lens-btn.is-active{ background: var(--ink); color: var(--paper); }

.audit-toggle{
  font-size:.72rem; border:1px solid var(--signal); color:var(--signal); background:transparent;
  padding:.38rem .8rem; border-radius:999px; cursor:pointer;
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.audit-toggle:hover{ transform: translateY(-1px); }
.audit-toggle[aria-pressed="true"]{ background: var(--signal); color: var(--paper); }

/* ============ EVIDENCE MARKERS (audit mode) ============ */
.ev{
  display:none; font-family: var(--mono); font-size:.68rem; color: var(--ink-soft);
  border:1px dashed var(--line); border-radius:999px; padding:.08rem .5rem; margin-left:.45rem;
  white-space:nowrap; vertical-align: middle; position:relative; top:-1px;
  animation: evPop .35s var(--ease-spring);
}
.ev[data-ev="verified"]{ color: var(--signal); border-color: var(--signal); }
body.audit-mode .ev{ display:inline-block; }
@keyframes evPop{ from{ opacity:0; transform:scale(.85);} to{ opacity:1; transform:scale(1);} }

/* ============ HERO ============ */
.hero{ padding: 6rem 0 4rem; position:relative; z-index:2; }
.hero .wrap{ max-width: var(--max); }
.eyebrow{
  text-transform:uppercase; letter-spacing:.09em; font-size:.72rem; font-weight:500;
  color: var(--signal); margin-bottom:1rem;
}
.hero-title{
  font-size: clamp(2.4rem, 5.5vw, 3.9rem);
  max-width: 780px;
  margin-bottom: 1.1rem;
  font-variation-settings: "opsz" 60;
}
.hl{ color: var(--signal); font-style: italic; }
.hero-lede{ font-size:1.08rem; max-width: 660px; line-height:1.65; }
.hero-lede strong{ color: var(--ink); }
.hero-actions{ display:flex; gap:.9rem; margin:1.7rem 0 1.5rem; flex-wrap:wrap; }

.btn{
  display:inline-flex; align-items:center; gap:.45rem;
  padding:.8rem 1.45rem; border-radius:999px; font-size:.95rem; font-weight:500;
  border:1px solid transparent; cursor:pointer; font-family: var(--sans);
  background-image:none;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-base) var(--ease-out), color var(--dur-base), border-color var(--dur-base), box-shadow var(--dur-base);
}
.btn:hover{ transform: translateY(-2px); }
.btn:active{ transform: translateY(0) scale(.98); }
.btn-primary{ background-color: var(--ink); color: var(--paper); }
.btn-primary:hover{ background-color: var(--signal); color: var(--paper); box-shadow: 0 10px 24px -14px rgba(232,103,44,.6); }
.btn-ghost{ border-color: var(--ink); color: var(--ink); background-color:transparent; }
.btn-ghost:hover{ border-color: var(--signal); color: var(--signal); }

.now-line{ font-size:.84rem; color: var(--ink-soft); display:flex; align-items:center; gap:.55rem; }
.dot{ width:8px; height:8px; border-radius:50%; background: var(--signal); flex-shrink:0; animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse{ 0%,100%{ opacity:1; transform:scale(1);} 50%{ opacity:.35; transform:scale(.8);} }

/* hero entrance */
.hero .eyebrow, .hero .hero-title, .hero .hero-lede, .hero .hero-actions, .hero .now-line{
  opacity:0; transform: translateY(16px);
  animation: heroIn .7s var(--ease-out) forwards;
}
.hero .hero-title{ animation-delay:.08s; }
.hero .hero-lede{ animation-delay:.18s; }
.hero .hero-actions{ animation-delay:.28s; }
.hero .now-line{ animation-delay:.4s; }
@keyframes heroIn{ to{ opacity:1; transform:none; } }

/* ============ BANDS ============ */
/* bands are transparent — the fixed bg-layer carries the tone shifts */
.band{ background: transparent; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }

/* ============ DARK CHAPTER (agent section) ============ */
.agent-section{ transition: color .8s; }
body.on-ink .agent-section h2{ color: var(--on-dark); }
body.on-ink .agent-section .section-sub{ color: var(--on-dark-soft); }
body.on-ink .agent-section .section-sub a{ color: var(--on-dark); }
body.on-ink .agent-section .tour-launcher-label{ color: var(--on-dark-soft); }
body.on-ink .agent-section .persona-chip{ border-color: var(--on-dark-soft); color: var(--on-dark); }
body.on-ink .agent-section .persona-chip:hover{ border-color: var(--signal); color: var(--signal); }
body.on-ink .agent-section .console{ box-shadow: 0 0 0 1px var(--panel-line), 0 24px 60px -30px rgba(0,0,0,.8); }
body.on-ink .site-nav{ background: rgba(21,20,15,.88); border-bottom-color: var(--panel-line); }
body.on-ink .nav-mark{ color: var(--on-dark); }
body.on-ink .nav-links a{ color: var(--on-dark-soft); }
body.on-ink .nav-links a:hover{ color: var(--signal); }
body.on-ink .nav-readout{ color: var(--on-dark-soft); }
body.on-ink .lens-switcher{ background: var(--panel-2); border-color: var(--panel-line); }
body.on-ink .lens-btn{ color: var(--on-dark-soft); }
body.on-ink .lens-btn.is-active{ background: var(--on-dark); color: var(--ink); }
body.on-ink .grain{ opacity:.06; mix-blend-mode:screen; }
.agent-section h2, .agent-section .section-sub, .agent-section .section-sub a,
.agent-section .tour-launcher-label, .agent-section .persona-chip,
.site-nav, .nav-mark, .nav-links a, .nav-readout, .lens-switcher, .lens-btn{ transition: color .8s var(--ease-out), background-color .8s var(--ease-out), border-color .8s var(--ease-out); }

.nav-readout{ font-size:.68rem; color: var(--ink-soft); letter-spacing:.06em; min-width:9.5em; }
@media (max-width: 1150px){ .nav-readout{ display:none; } }

/* neighbours visible during the ink chapter stay readable */
body.on-ink .proof-label{ color: var(--on-dark-soft); }
body.on-ink .proof-strip.band, body.on-ink .jd-section.band{ border-color: var(--panel-line); }
body.on-ink .jd-section h2{ color: var(--on-dark); }
body.on-ink .jd-section .section-sub{ color: var(--on-dark-soft); }
body.on-ink .jd-label{ color: var(--signal); }
.proof-label, .jd-section h2, .jd-section .section-sub, .band{ transition: color .8s var(--ease-out), border-color .8s var(--ease-out); }

/* timeline nodes fill as the rule draws past them */
.timeline-item.is-passed::before{ background: var(--signal); }
.timeline-item::before{ transition: background .4s var(--ease-out); }

/* ============ PROOF STRIP ============ */
.proof-strip{ padding: 2.4rem 0; }
.proof-inner{ display:grid; grid-template-columns: repeat(3,1fr); gap:2rem; }
.proof-item{ position:relative; padding-left:1.1rem; }
.proof-item::before{ content:""; position:absolute; left:0; top:.4rem; bottom:.4rem; width:2px; background: var(--signal); opacity:.55; }
.proof-num{ font-size:2.2rem; font-weight:600; color: var(--signal); margin:0; line-height:1.1; }
.proof-label{ font-size:.9rem; margin:.3rem 0 0; }

/* ============ SECTIONS ============ */
section{ padding: 4.5rem 0; }
.section-head{ max-width: 680px; margin-bottom:2.4rem; }
.section-sub{ font-size:1.05rem; line-height:1.65; }

/* ============ AGENT CONSOLE ============ */
.console{
  background: var(--panel); border-radius: var(--radius); overflow:hidden;
  box-shadow: 0 24px 60px -30px rgba(21,20,15,.5);
}
.console-bar{ display:flex; align-items:center; gap:.4rem; padding:.7rem 1rem; background: var(--panel-2); border-bottom:1px solid var(--panel-line); }
.console-dot{ width:9px; height:9px; border-radius:50%; background:#4A4636; }
.console-title{ margin-left:.6rem; font-size:.72rem; color: var(--on-dark-soft); }
.console-body{ padding:1.2rem 1.3rem 1.3rem; }
.console-log{ min-height:150px; max-height:400px; overflow-y:auto; margin-bottom:1rem; scrollbar-width:thin; scrollbar-color: var(--panel-line) transparent; }
.console-hint{ color: var(--on-dark-soft); font-size:.85rem; }

.trace{ margin-bottom:1.25rem; animation: traceIn .3s var(--ease-out); }
@keyframes traceIn{ from{ opacity:0; transform:translateY(6px);} to{ opacity:1; transform:none;} }
.trace-q{ color: var(--on-dark); font-size:.95rem; margin-bottom:.6rem; font-family:var(--mono); }
.trace-q::before{ content:"> "; color: var(--signal); }
.trace-step{ display:flex; gap:.6rem; margin-bottom:.35rem; font-size:.8rem; opacity:0; animation: traceIn .25s var(--ease-out) forwards; }
.trace-step:nth-child(2){ animation-delay:.12s; } .trace-step:nth-child(3){ animation-delay:.24s; } .trace-step:nth-child(4){ animation-delay:.36s; }
.trace-step-label{ color: var(--signal); flex-shrink:0; width:78px; font-family:var(--mono); }
.trace-step-body{ color: var(--on-dark-soft); font-family:var(--mono); }
.trace-answer{
  margin-top:.65rem; padding:.95rem 1.05rem; background: var(--panel-2); border-left:2px solid var(--signal);
  border-radius:4px; color: var(--on-dark); font-size:.93rem; line-height:1.6;
  opacity:0; animation: traceIn .3s var(--ease-out) .45s forwards;
}
.trace-answer a{ color: var(--signal); background:none; }
.trace-sources{ margin-top:.6rem; display:flex; flex-wrap:wrap; gap:.4rem; opacity:0; animation: traceIn .3s var(--ease-out) .55s forwards; }
.source-chip{
  font-family:var(--mono); font-size:.7rem; color: var(--signal);
  border:1px solid #3A3626; padding:.18rem .55rem; border-radius:999px; background: rgba(232,103,44,.08);
  cursor:pointer; transition: background var(--dur-fast);
}
.source-chip:hover{ background: rgba(232,103,44,.18); }

.console-chips{ display:flex; flex-wrap:wrap; gap:.5rem; margin-bottom:1rem; }
.chip-btn{
  font-family:var(--mono); font-size:.76rem; color: var(--on-dark);
  border:1px solid #3A3626; background: var(--panel-2); padding:.42rem .8rem; border-radius:999px; cursor:pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.chip-btn:hover{ border-color: var(--signal); color: var(--signal); transform: translateY(-1px); }

.console-input{ display:flex; align-items:center; gap:.6rem; border-top:1px solid var(--panel-line); padding-top:.95rem; }
.prompt-caret{ color: var(--signal); }
.console-input input{ flex:1; background:transparent; border:none; outline:none; color: var(--on-dark); font-size:.92rem; }
.console-input input::placeholder{ color:#5C584A; }
.console-input button{
  background: var(--signal); color: var(--panel); border:none; padding:.5rem .95rem; border-radius:6px;
  font-size:.78rem; cursor:pointer; font-weight:600;
  transition: transform var(--dur-fast), filter var(--dur-fast);
}
.console-input button:hover{ transform: translateY(-1px); filter: brightness(1.08); }

/* tour launcher */
.tour-launcher{ margin-top:1.6rem; }
.tour-launcher-label{ font-size:.8rem; color: var(--ink-soft); margin-bottom:.7rem; }
.persona-chips{ display:flex; flex-wrap:wrap; gap:.55rem; }
.persona-chip{
  font-family:var(--sans); font-size:.88rem; font-weight:500; color: var(--ink);
  border:1px solid var(--ink); background:transparent; padding:.55rem 1.05rem; border-radius:999px; cursor:pointer;
  transition: all var(--dur-base) var(--ease-out);
}
.persona-chip:hover{ border-color: var(--signal); color: var(--signal); transform: translateY(-2px); }

/* ============ JD MATCHER ============ */
.jd-section{ padding: 4.5rem 0; }
.jd-panel{ display:grid; grid-template-columns: 1fr 1fr; gap:1.2rem; align-items:start; }
.jd-input-wrap{ border:1px solid var(--line); border-radius: var(--radius); padding:1.2rem; background: var(--paper); }
.jd-label{ display:block; font-size:.7rem; color: var(--signal); text-transform:uppercase; letter-spacing:.06em; margin-bottom:.6rem; }
#jdInput{
  width:100%; min-height:200px; resize:vertical; font-family:var(--mono); font-size:.82rem; line-height:1.55;
  border:1px solid var(--line); border-radius:6px; padding:.85rem; background: var(--paper-dim); color: var(--ink); outline:none;
  transition: border-color var(--dur-base), box-shadow var(--dur-base);
}
#jdInput:focus{ border-color: var(--signal); box-shadow: 0 0 0 3px rgba(232,103,44,.12); }
.jd-actions{ display:flex; gap:.7rem; margin-top:.95rem; flex-wrap:wrap; }
.jd-actions .btn{ padding:.62rem 1.15rem; font-size:.86rem; }
#jdSample{ font-size:.78rem; }

.jd-results{ border:1px solid var(--line); border-radius: var(--radius); padding:1.25rem; min-height:280px; background: var(--paper); }
.jd-placeholder{ font-size:.8rem; color: var(--ink-soft); }
.jd-score-head{ display:flex; align-items:baseline; gap:.7rem; }
.jd-score{ font-family:var(--mono); font-size:2.5rem; color: var(--signal); font-weight:600; line-height:1; }
.jd-score-label{ font-size:.78rem; color: var(--ink-soft); font-family:var(--mono); }
.jd-verdict{ font-size:.92rem; margin:.5rem 0 1rem; }
.jd-block-title{
  font-family:var(--mono); font-size:.68rem; text-transform:uppercase; letter-spacing:.07em;
  color: var(--ink-soft); margin:1rem 0 .55rem; border-top:1px solid var(--line); padding-top:.85rem;
}
.jd-req{ display:flex; gap:.6rem; align-items:flex-start; margin-bottom:.55rem; font-size:.86rem; opacity:0; transform:translateX(-6px); animation: jdIn .35s var(--ease-out) forwards; }
@keyframes jdIn{ to{ opacity:1; transform:none; } }
.jd-mark{ font-family:var(--mono); flex-shrink:0; width:1.1rem; }
.jd-req.hit .jd-mark{ color: var(--signal); }
.jd-req.miss .jd-mark{ color:#A89E88; }
.jd-req-text strong{ color: var(--ink); font-weight:600; }
.jd-req-ev{ display:block; color: var(--ink-soft); font-size:.76rem; font-family:var(--mono); margin-top:.15rem; }
.jd-req.miss .jd-req-text{ color: var(--ink-soft); }
.jd-reorder{ font-size:.86rem; padding-left:1.2rem; margin:.3rem 0 0; }
.jd-reorder li{ margin-bottom:.35rem; }
.jd-honesty{
  margin-top:1.1rem; padding:.8rem .95rem; border-left:2px solid var(--signal); background: var(--paper-dim);
  font-size:.8rem; border-radius:4px; color: var(--ink-soft);
}

/* ============ CASE STUDIES ============ */
.case-list{ display:flex; flex-direction:column; gap:1rem; }
.case{
  border:1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  overflow:hidden; transition: border-color var(--dur-base), box-shadow var(--dur-base), opacity var(--dur-base), transform var(--dur-base);
}
.case:hover{ border-color:#C9BFA8; box-shadow: 0 14px 34px -26px rgba(21,20,15,.4); }
.case-feature{ border-color: var(--signal); }
.case-feature:hover{ border-color: var(--signal); }
.case[data-hidden="true"]{ display:none; }

.case-head{
  width:100%; display:flex; align-items:flex-start; justify-content:space-between; gap:1.5rem;
  background:none; border:none; text-align:left; padding:1.45rem 1.6rem; cursor:pointer; font-family:inherit;
}
.case-kicker{ font-size:.7rem; color: var(--signal); text-transform:uppercase; letter-spacing:.06em; margin:0 0 .5rem; font-weight:500; }
.case-head h3{ margin-bottom:.4rem; }
.case-dek{ margin:0; font-size:.95rem; max-width:640px; }
.case-toggle{ font-size:.72rem; color: var(--ink-soft); flex-shrink:0; margin-top:.4rem; transition: color var(--dur-fast); }
.case-head:hover .case-toggle{ color: var(--signal); }
.case-toggle::after{ content:" ↓"; display:inline-block; transition: transform var(--dur-base) var(--ease-out); }
.case-head[aria-expanded="true"] .case-toggle::after{ transform: rotate(180deg); }

.case-body{
  display:grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-slow) var(--ease-out);
}
.case-body > .case-body-inner{ overflow:hidden; }
.case-body.is-open{ grid-template-rows: 1fr; }
.case-body-inner{ padding:0 1.6rem; border-top:1px solid transparent; transition: border-color var(--dur-base); }
.case-body.is-open .case-body-inner{ border-top-color: var(--line); padding-top:1.5rem; padding-bottom:1.6rem; }

.case-grid{ display:grid; grid-template-columns: 1.15fr .85fr; gap:2.2rem; align-items:start; }
.case-prose h4{ color: var(--ink); font-family:var(--mono); font-size:.72rem; text-transform:uppercase; letter-spacing:.07em; font-weight:600; margin-bottom:.35rem; }
.case-prose h4:not(:first-child){ margin-top:1.15rem; }
.case-prose p{ font-size:.93rem; margin-bottom:0; line-height:1.62; }
.metric{ color: var(--signal); font-weight:600; }

.case-side{ display:flex; flex-direction:column; gap:1rem; }
.case-diagram{ background: var(--paper-dim); border-radius:8px; padding:.7rem .7rem .4rem; border:1px solid var(--line); }
.diagram{ width:100%; height:auto; }
.d-box{ fill: var(--paper); stroke: var(--line); stroke-width:1; }
.d-accent{ fill: var(--signal-wash); stroke: var(--signal); }
.d-text{ font-size:9.5px; fill: var(--ink); text-anchor:middle; }
.d-arrow, .d-line{ stroke:#8A8271; stroke-width:1.2; fill:none; }
.d-arrow{ stroke-dasharray:3 3; }
.case-body.is-open .d-box, .case-body.is-open .d-text{ animation: diagIn .5s var(--ease-out) both; }
.case-body.is-open .d-arrow, .case-body.is-open .d-line{ stroke-dashoffset:60; animation: diagDraw .7s var(--ease-out) .3s both; }
@keyframes diagIn{ from{ opacity:0; } to{ opacity:1; } }
@keyframes diagDraw{ from{ stroke-dashoffset:60; opacity:0;} to{ stroke-dashoffset:0; opacity:1;} }
.diagram-caption{ font-size:.68rem; color: var(--ink-soft); text-align:center; margin:.35rem 0 .2rem; }

.demo-slot{
  border:1px dashed var(--signal); border-radius:8px; padding:.9rem 1rem; background: rgba(232,103,44,.04);
  cursor:pointer; transition: background var(--dur-base);
}
.demo-slot:hover{ background: rgba(232,103,44,.09); }
.demo-slot-label{ font-size:.78rem; color: var(--signal); font-weight:500; margin:0 0 .3rem; }
.demo-slot-note{ font-size:.78rem; margin:0; line-height:1.5; }

.case-evidence{ margin-top:1.2rem; font-size:.76rem; color: var(--ink-soft); }
.ev-mark{ color: var(--signal); }
.case-links{ margin-top:.8rem; display:flex; gap:1.2rem; }
.case-links a{ font-size:.86rem; }

.work-more{ margin-top:2rem; font-size:.92rem; max-width:720px; }

/* highlight sweep (agent tour) */
.tour-highlight{
  background-image: linear-gradient(var(--signal-wash), var(--signal-wash));
  background-repeat:no-repeat; background-size: 0% 100%; background-position: 0 0;
  animation: sweep .6s var(--ease-out) forwards;
  border-radius:2px;
}
@keyframes sweep{ to{ background-size:100% 100%; } }

/* ============ TIMELINE ============ */
.timeline{ list-style:none; margin:0; padding:0 0 0 1.7rem; border-left:2px solid var(--line); }
.timeline-item{ position:relative; padding-bottom:2.1rem; }
.timeline-item:last-child{ padding-bottom:.5rem; }
.timeline-item::before{
  content:""; position:absolute; left:calc(-1.7rem - 7px); top:5px; width:10px; height:10px; border-radius:50%;
  background: var(--paper); border:2px solid var(--signal);
  transition: background var(--dur-base);
}
.timeline-item.is-active::before{ background: var(--signal); }
.tl-date{ font-size:.74rem; color: var(--signal); margin:0 0 .3rem; font-weight:500; }
.tl-org{ color: var(--ink-soft); font-weight:400; }
.timeline-item p{ font-size:.92rem; max-width:660px; margin-bottom:.2rem; }
.tl-link{ font-size:.84rem; }
.tl-margin{ font-size:.72rem; color: var(--ink-soft); font-style:normal; margin-top:.4rem; }
.tl-margin::before{ content:"※ "; color: var(--signal); }

/* ============ BEYOND ============ */
.beyond-section{ padding:4.5rem 0; }
.beyond-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap:2.2rem; }
.beyond-kicker{ font-size:.7rem; text-transform:uppercase; letter-spacing:.07em; color: var(--signal); font-weight:500; margin-bottom:.7rem; }
.beyond-col h4{ margin-bottom:.15rem; }
.beyond-second{ margin-top:1.2rem; }
.beyond-dates{ font-size:.72rem; color: var(--ink-soft); margin-bottom:.45rem; }
.beyond-col p{ font-size:.88rem; line-height:1.6; }
.beyond-recognition{
  margin-top:2.6rem; padding-top:1.6rem; border-top:1px solid var(--line);
  font-size:1.02rem; color: var(--signal); font-weight:600;
}

/* ============ PLAY ============ */
.play-grid{ display:grid; grid-template-columns: repeat(4,1fr); gap:1rem; }
.play-card{
  border:1px dashed var(--line); border-radius: var(--radius); padding:1.25rem;
  transition: border-color var(--dur-base), transform var(--dur-base) var(--ease-out);
}
.play-card:hover{ border-color: var(--signal); transform: translateY(-3px); }
.play-kicker{ font-size:.68rem; color: var(--ink-soft); text-transform:uppercase; letter-spacing:.06em; margin-bottom:.5rem; }
.play-card h4{ margin-bottom:.35rem; }
.play-card p{ font-size:.85rem; margin:0; line-height:1.55; }

/* ============ CONTACT ============ */
.contact-section{ text-align:center; padding-bottom:5.5rem; }
.contact-inner{ max-width:560px; }
.contact-links{ display:flex; gap:.9rem; justify-content:center; flex-wrap:wrap; margin:1.4rem 0 1.2rem; }
.contact-resume{ font-size:.8rem; color: var(--ink-soft); }

/* ============ TOUR STRIP ============ */
.tour-strip{
  position:fixed; left:50%; bottom:1.2rem; transform:translateX(-50%) translateY(20px);
  width:min(680px, calc(100vw - 2rem));
  background: var(--panel); border-radius:12px; padding:.9rem 1.1rem 1rem;
  box-shadow: 0 30px 70px -25px rgba(21,20,15,.65);
  z-index:90; opacity:0;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.tour-strip.is-on{ opacity:1; transform:translateX(-50%) translateY(0); }
.tour-strip-head{ display:flex; align-items:center; gap:.6rem; margin-bottom:.5rem; }
.tour-dot{ width:7px; height:7px; border-radius:50%; background: var(--signal); animation: pulse 2s ease-in-out infinite; }
.tour-status{ font-size:.7rem; color: var(--signal); letter-spacing:.05em; }
.tour-skip{ margin-left:auto; background:none; border:none; color: var(--on-dark-soft); font-size:.7rem; cursor:pointer; transition: color var(--dur-fast); }
.tour-skip:hover{ color: var(--on-dark); }
.tour-text{ color: var(--on-dark); font-size:.92rem; line-height:1.55; margin:0 0 .7rem; min-height:2.6em; }
.tour-controls{ display:flex; align-items:center; gap:.7rem; border-top:1px solid var(--panel-line); padding-top:.7rem; }
.tour-ask{ display:flex; align-items:center; gap:.5rem; flex:1; }
.tour-ask input{ flex:1; background:transparent; border:none; outline:none; color: var(--on-dark); font-size:.85rem; }
.tour-ask input::placeholder{ color:#5C584A; }
.tour-ask button{
  background:transparent; border:1px solid #3A3626; color: var(--on-dark-soft);
  padding:.32rem .7rem; border-radius:6px; font-size:.72rem; cursor:pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.tour-ask button:hover{ border-color: var(--signal); color: var(--signal); }
.tour-next{
  background: var(--signal); color: var(--panel); border:none; padding:.45rem 1rem; border-radius:6px;
  font-size:.78rem; font-weight:600; cursor:pointer; flex-shrink:0;
  transition: transform var(--dur-fast), filter var(--dur-fast);
}
.tour-next:hover{ transform:translateY(-1px); filter:brightness(1.08); }
.tour-paused{ margin:.6rem 0 0; font-size:.74rem; color: var(--on-dark-soft); }
.tour-paused button{ background:none; border:none; color: var(--signal); cursor:pointer; font-size:.74rem; text-decoration:underline; }

/* agent cursor */
.agent-cursor{
  position:fixed; z-index:95; pointer-events:none; opacity:0;
  transition: top .8s var(--ease-out), left .8s var(--ease-out), opacity var(--dur-base);
  display:flex; align-items:flex-start; gap:2px;
}
.agent-cursor.is-on{ opacity:1; }
.agent-cursor-tag{
  font-size:.62rem; background: var(--signal); color: var(--panel); padding:.1rem .4rem; border-radius:4px;
  font-weight:600; margin-top:14px; margin-left:-4px;
}

/* ============ FOOTER ============ */
.site-footer{ border-top:1px solid var(--line); padding:1.8rem 0 2.2rem; }
.footer-inner{ display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap; font-size:.72rem; color: var(--ink-soft); }
.footer-inner p{ margin:0; color: var(--ink-soft); }
.footer-audit{ background:none; border:none; color: var(--signal); cursor:pointer; font-size:.72rem; padding:0; text-decoration:underline; }

/* ============ HERO SIDE DIAGRAM ============ */
.hero-grid{ display:grid; grid-template-columns: 1fr 280px; gap:3rem; align-items:center; }
.hero-side{ opacity:0; animation: heroIn .8s var(--ease-out) .55s forwards; }
.hero-diagram{ max-width:260px; }
.hero-side-note{ font-size:.68rem; color: var(--ink-soft); text-align:center; margin:.6rem 0 0; line-height:1.6; }
@media (max-width: 1020px){ .hero-grid{ grid-template-columns:1fr; } .hero-side{ display:none; } }

/* ============ FOCUS STATES ============ */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible{
  outline:2px solid var(--signal); outline-offset:3px; border-radius:4px;
}

/* ============ CASE DEEP LINK ============ */
.case-deep-link{ font-weight:500; color: var(--signal); }

/* ============ WORK PAGES (client-side routes) ============ */
.work-page{ padding: 4.5rem 0 5rem; min-height: 70vh; animation: heroIn .5s var(--ease-out); }
.wp-back{ font-size:.85rem; color: var(--ink-soft); background:none; margin-bottom:2rem; display:inline-block; }
.wp-kicker{ font-size:.72rem; color: var(--signal); text-transform:uppercase; letter-spacing:.07em; margin:1.4rem 0 .6rem; font-weight:500; }
.wp-title{ font-size: clamp(2rem, 4vw, 3rem); max-width:760px; }
.wp-meta{ display:flex; flex-wrap:wrap; gap:1.6rem; margin:1.4rem 0 2.4rem; padding:1rem 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.wp-meta-item{ font-size:.78rem; }
.wp-meta-item .wp-meta-label{ display:block; font-family:var(--mono); font-size:.64rem; text-transform:uppercase; letter-spacing:.07em; color: var(--ink-soft); margin-bottom:.2rem; }
.wp-meta-item .wp-meta-value{ font-family:var(--mono); color: var(--ink); font-weight:500; }
.wp-outcome{
  font-size:1.15rem; line-height:1.6; color: var(--ink); max-width:680px; margin-bottom:2.6rem;
  padding-left:1.1rem; border-left:3px solid var(--signal);
}
.wp-q{ max-width:680px; margin-bottom:2rem; }
.wp-q h3{ font-family:var(--mono); font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; color: var(--signal); font-weight:600; margin-bottom:.5rem; }
.wp-q p{ font-size:.97rem; line-height:1.68; }
.wp-diagram{ max-width:520px; margin:2.4rem 0; }
.wp-links{ display:flex; gap:1.4rem; margin:2.2rem 0 0; }
.wp-next{
  margin-top:3.5rem; padding-top:1.6rem; border-top:1px solid var(--line);
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:1rem;
}
.wp-next a{ font-family:var(--serif); font-size:1.15rem; font-weight:600; }
.wp-next .wp-next-label{ font-family:var(--mono); font-size:.68rem; text-transform:uppercase; letter-spacing:.07em; color: var(--ink-soft); display:block; margin-bottom:.25rem; }
body.route-work .site-footer{ }

/* ============ RESPONSIVE ============ */
@media (max-width: 960px){
  .nav-links{ display:none; }
  .beyond-grid{ grid-template-columns: repeat(2,1fr); gap:1.8rem; }
  .play-grid{ grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 700px){
  .beyond-grid{ grid-template-columns:1fr; }
}
@media (max-width: 760px){
  .hero{ padding-top:4rem; }
  .proof-inner{ grid-template-columns:1fr; gap:1.3rem; }
  .case-grid{ grid-template-columns:1fr; gap:1.4rem; }
  .jd-panel{ grid-template-columns:1fr; }
  .play-grid{ grid-template-columns:1fr; }
  .lens-switcher{ display:none; }
  .footer-inner{ flex-direction:column; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation-duration:.01ms !important; animation-delay:0ms !important; transition-duration:.01ms !important; }
  html{ scroll-behavior:auto; }
  .hero .eyebrow, .hero .hero-title, .hero .hero-lede, .hero .hero-actions, .hero .now-line{ opacity:1; transform:none; }
  .reveal{ opacity:1; transform:none; }
}
