:root {
  --paper: #ece7ff;
  --card: #fff;
  --ink: #21134d;
  --muted: #55487e;
  --tang: #ff7a1a;
  --sun: #ffd84d;
  --line: #c9bef2;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.55 Figtree, system-ui, sans-serif; }
a { color: inherit; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 700; letter-spacing: -.015em; margin: 0; }
h1 { font-size: clamp(38px, 5.6vw, 76px); line-height: 1; text-wrap: balance; }
h2 { font-size: clamp(30px, 3.8vw, 48px); line-height: 1.05; }
h3 { font-size: 23px; line-height: 1.15; }
p { margin: 0; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.label { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.todo { background: var(--sun); padding: 0 .2em; }
.contact .todo { background: #fff; }

.skip { position: absolute; z-index: 20; left: 12px; top: -80px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 12px; }

.btn { display: inline-flex; align-items: center; min-height: 46px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: 700 15px/1 Figtree, sans-serif; text-decoration: none; cursor: pointer; }
.btn.alt { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.go { background: var(--sun); color: var(--ink); }
.btn:active { transform: scale(.98); }

.nav { position: fixed; z-index: 10; top: 0; left: 0; right: 0; transition: background-color .2s, box-shadow .2s; }
.nav.stuck { background: var(--paper); box-shadow: 0 1px 0 var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { font-family: Fraunces, serif; font-weight: 700; font-size: 20px; text-decoration: none; margin-right: auto; }
.nav nav { display: flex; gap: 22px; }
.nav nav a { text-decoration: none; font-weight: 600; font-size: 15px; }
.nav nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* First screen */
.hero { position: relative; height: max(720px, 100svh); overflow: hidden; touch-action: pan-y; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.hero.netted { cursor: none; }
.hero.netted a, .hero.netted button { cursor: pointer; }
.hero.done { cursor: default; }
.net { position: absolute; z-index: 4; left: 0; top: 0; width: 110px; height: 110px; pointer-events: none; }
.net svg { display: block; width: 100%; height: 100%; transform-origin: 95% 95%; }
.net.swing svg { animation: swoop .28s ease-out; }
.net-bug { opacity: 0; }
.net.got .net-bug { opacity: 1; }
@keyframes swoop { 0% { transform: rotate(-24deg); } 55% { transform: rotate(10deg); } 100% { transform: rotate(0); } }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-copy { position: relative; z-index: 2; padding-top: 104px; pointer-events: none; }
.hero-copy > * { max-width: 760px; }
.hero-copy p { margin-top: 14px; max-width: 560px; color: var(--muted); }
.mark { display: inline-block; padding: 0 .1em; margin: 0 -.1em; transition: background-color .25s; }
.hero.done .mark { background: var(--sun); }

.tray { position: absolute; z-index: 3; left: 0; right: 0; bottom: 22px; pointer-events: none; }
.tray .wrap { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.slots { display: contents; }
.slot { display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 8px 14px 8px 8px; border-radius: 12px; background: rgba(255, 255, 255, .86); text-decoration: none; font-size: 14px; line-height: 1.2; color: var(--muted); }
.slot svg { width: 44px; height: 44px; opacity: .25; flex: none; }
.slot i { font-family: Fraunces, serif; font-size: 15px; }
.slot.on { background: var(--card); color: var(--ink); pointer-events: auto; box-shadow: inset 0 0 0 2px var(--tang); }
.slot.on svg { opacity: 1; }
.hint { align-self: center; margin-left: 6px; font-weight: 600; font-size: 14px; background: rgba(255, 255, 255, .86); padding: 6px 12px; border-radius: 999px; }
.tray-side { margin-left: auto; display: flex; align-items: center; gap: 10px; pointer-events: auto; }

/* Keyboard and reduced-motion route through the game. Hidden until focused. */
.assist { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.assist:focus, .still .assist { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }

/* Without 3D there is no game: the first screen is just the introduction. */
.no-game { height: auto; cursor: auto; padding-bottom: 56px; }
.no-game canvas, .no-game .slots, .no-game .hint, .no-game .assist { display: none; }
.no-game .tray { position: relative; bottom: auto; margin-top: 28px; }
.no-game .tray-side { margin-left: 0; }

/* Sections */
section { padding: clamp(64px, 8vw, 104px) 0; }
.flush { padding-top: 0; }
.head { display: grid; gap: 8px; margin-bottom: 34px; max-width: 760px; }
.head p { color: var(--muted); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.tag { background: var(--card); border-radius: 14px; padding: 22px; }
.metric b { display: block; font: 700 clamp(38px, 4.6vw, 58px)/1 Fraunces, serif; margin-bottom: 8px; }
.metric span { color: var(--muted); font-size: 16px; line-height: 1.35; display: block; }
.drawer h3 { margin-bottom: 12px; }
.drawer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.drawer li { background: var(--paper); border-radius: 999px; padding: 3px 11px; font-size: 14.5px; }

/* AI workflows: belts that stop for a human */
.band { background: #fff; }
.flow { background: var(--paper); border-radius: 14px; padding: clamp(18px, 2.4vw, 28px); }
.flow + .flow { margin-top: 14px; }
.flow-top { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
.flow-status { color: var(--muted); font-size: 14px; font-weight: 600; }
.track { position: relative; display: grid; gap: 10px; padding-top: 40px; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 8px; border-radius: 4px; background: var(--ink); }
.token { position: absolute; top: 2px; left: 0; width: 32px; height: 32px; border-radius: 8px; background: var(--tang); box-shadow: inset 0 0 0 3px var(--ink); transition: left .7s cubic-bezier(.65, 0, .35, 1), top .7s cubic-bezier(.65, 0, .35, 1), background-color .2s; }
.token.ok { background: var(--sun); }
.st { padding: 12px; border-radius: 10px; background: #fff; font-size: 15.5px; line-height: 1.34; }
.st small { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.st.human { background: #fff3c2; box-shadow: inset 0 0 0 2px var(--ink); }
.st.human small { color: var(--ink); }
.st.on { outline: 3px solid var(--tang); outline-offset: 1px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; min-height: 46px; }

/* Case studies */
.plate { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; background: var(--card); border-radius: 14px; padding: 24px; scroll-margin-top: 24px; }
.plate + .plate { margin-top: 14px; }
.plate.caught { box-shadow: inset 0 0 0 2px var(--tang); }
.specimen { background: var(--paper); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.specimen svg { width: 120px; height: 120px; }
.specimen i { font: italic 500 18px/1.2 Fraunces, serif; }
.specimen .state { font-size: 13px; font-weight: 700; color: var(--muted); }
.plate h3 { font-size: clamp(23px, 2.4vw, 30px); margin: 4px 0 8px; }
.plate .sum { color: var(--muted); margin-bottom: 16px; }
.report { display: grid; gap: 16px; font-size: 15.5px; line-height: 1.45; }
.report b { display: block; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; font-size: 14px; }
.stack span { background: var(--paper); padding: 2px 10px; border-radius: 999px; }

/* Writing */
.project { display: flex; flex-direction: column; gap: 10px; }
.project p { color: var(--muted); }
.project .stack { margin-top: 0; }
.project .row { margin-top: auto; padding-top: 8px; }
.post { display: grid; gap: 8px; text-decoration: none; transition: box-shadow .15s; }
.post:hover { box-shadow: inset 0 0 0 2px var(--tang); }
.post p { color: var(--muted); }

/* Experience */
.log { display: grid; gap: 14px; }
.entry { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; border-top: 2px solid var(--line); padding-top: 18px; }
.entry .when { color: var(--muted); font-weight: 600; font-size: 15.5px; }
.entry ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }

/* Contact */
.contact { background: var(--sun); }
.contact .wrap { display: grid; gap: 16px; }
.contact h2 { font-size: clamp(38px, 6vw, 80px); }
.facts { display: grid; gap: 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 8px 0; }
.facts div { grid-column: span 2; background: var(--card); border-radius: 14px; padding: 16px 18px; }
.facts div:nth-child(n + 4) { grid-column: span 3; }
.facts dt { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.facts dd { margin: 0; font-weight: 600; font-size: 18px; line-height: 1.3; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.copy { min-width: 132px; justify-content: center; }
.footer { background: var(--ink); color: #fff; padding: 20px 0; font-size: 14px; }

@media (max-width: 860px) {
  html { scroll-padding-top: 112px; }
  .nav .wrap { flex-wrap: wrap; gap: 4px 12px; min-height: 0; padding-top: 8px; padding-bottom: 6px; }
  .nav .btn { min-height: 38px; padding: 0 14px; font-size: 14px; }
  .nav nav { order: 3; flex: 1 1 100%; justify-content: space-between; gap: 12px; overflow-x: auto; scrollbar-width: none; }
  .nav nav a { flex: none; padding: 6px 0; font-size: 14px; }
  .hero-copy { padding-top: 120px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts div, .facts div:nth-child(n + 4) { grid-column: auto; }
  .plate, .entry { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .report { grid-template-columns: minmax(0, 1fr) !important; }
  .slot { flex: 1 1 0; justify-content: center; padding: 6px; min-height: 52px; }
  .slot svg { width: 38px; height: 38px; }
  .slot span { display: none; }
  .hint { flex: 1 1 100%; margin-left: 0; text-align: center; }
  .tray-side { flex: 1 1 100%; margin-left: 0; justify-content: center; }
}
@media (max-width: 360px) {
  .brand { font-size: 17px; }
  .nav .btn { padding: 0 12px; }
}
@media (max-width: 760px) {
  .track { grid-template-columns: minmax(0, 1fr) !important; padding-top: 0; padding-left: 44px; }
  .track::before { left: 12px; right: auto; top: 0; bottom: 0; width: 8px; height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .token, .mark { transition: none; }
  .net.swing svg { animation: none; }
}
