/* ==========================================================================
   CLAUDE — Activated
   Design tokens, layout, components. Hand-written, no preprocessor.
   ========================================================================== */

:root {
  --bg: #07070a;
  --bg-2: #0d0d12;
  --bg-3: #14141b;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --ink: #f3eee8;
  --ink-2: #c9c2ba;
  --muted: #8c867f;
  --claude: #e2775a;
  --claude-2: #ff9f7a;
  --amber: #f5b971;
  --violet: #8b7cff;
  --cyan: #5ee0ff;
  --mint: #6ff2b4;
  --danger: #ff5c7a;

  --radius: 22px;
  --radius-s: 12px;
  --pad: clamp(18px, 4vw, 56px);
  --maxw: 1320px;

  --f-sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-booting { overflow: hidden; }
::selection { background: var(--claude); color: #140806; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
canvas { display: block; }
code { font-family: var(--f-mono); font-size: 0.88em; background: rgba(255,255,255,.06); padding: .1em .4em; border-radius: 6px; color: var(--amber); }
em { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--f-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kbd { font-family: var(--f-mono); font-size: .78em; padding: .1em .45em; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; color: var(--ink); background: rgba(255,255,255,.04); }

@media (hover: hover) and (pointer: fine) {
  body.has-cursor, body.has-cursor a, body.has-cursor button, body.has-cursor canvas, body.has-cursor [data-cursor] { cursor: none; }
  body.has-cursor textarea, body.has-cursor input[type="range"] { cursor: auto; }
}

/* ---------- grain overlay ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-1%, 3%); } 80% { transform: translate(3%, 1%); } 100% { transform: translate(0, 0); }
}

/* ==========================================================================
   BOOT
   ========================================================================== */
#boot {
  position: fixed; inset: 0; z-index: 200; background: radial-gradient(ellipse at center, #120c0b 0%, #050506 70%);
  display: grid; place-items: center; overflow: hidden;
  transition: opacity 1.1s var(--ease-out), visibility 1.1s;
}
#boot.gone { opacity: 0; visibility: hidden; pointer-events: none; }
#boot-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.boot-inner { position: relative; margin-top: 46vh; display: flex; flex-direction: column; align-items: center; gap: 34px; transition: opacity .5s, transform .8s var(--ease-out); }
#boot.activating .boot-inner { opacity: 0; transform: scale(.9); pointer-events: none; }
.boot-status { font-size: 12px; letter-spacing: .3em; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.blink-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--claude); box-shadow: 0 0 12px var(--claude); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.boot-hint { font-size: 11.5px; color: var(--muted); letter-spacing: .08em; }

.activate {
  position: relative; padding: 26px 54px; border-radius: 999px; font-weight: 800; letter-spacing: .32em; font-size: clamp(14px, 1.6vw, 18px);
  background: linear-gradient(180deg, rgba(226,119,90,.18), rgba(226,119,90,.04));
  border: 1px solid rgba(226,119,90,.55);
  color: #fff; overflow: hidden; isolation: isolate;
  box-shadow: 0 0 0 1px rgba(255,255,255,.03) inset, 0 0 60px -10px rgba(226,119,90,.7), 0 0 140px -30px rgba(226,119,90,.6);
  transition: box-shadow .4s, background .4s, letter-spacing .5s var(--ease-out);
}
.activate:hover, .activate:focus-visible { letter-spacing: .4em; background: linear-gradient(180deg, rgba(226,119,90,.32), rgba(226,119,90,.08)); box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 0 80px -6px rgba(226,119,90,.95), 0 0 200px -20px rgba(226,119,90,.8); outline: none; }
.activate-label { position: relative; z-index: 2; text-shadow: 0 0 18px rgba(255,180,150,.8); }
.activate-ring { position: absolute; inset: -2px; border-radius: inherit; z-index: 0; background: conic-gradient(from var(--a, 0deg), transparent 0 70%, rgba(255,190,160,.9) 85%, transparent 100%); animation: spin 3s linear infinite; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; padding: 1.5px; }
@property --a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --a: 360deg; } }
.activate-shine { position: absolute; inset: 0; z-index: 1; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.22) 50%, transparent 65%); transform: translateX(-120%); animation: shine 3.2s var(--ease-out) infinite 1s; }
@keyframes shine { 60%, 100% { transform: translateX(120%); } }

#boot-log { position: absolute; left: var(--pad); bottom: 60px; margin: 0; font-size: 12.5px; line-height: 1.75; color: var(--ink-2); max-width: 90vw; white-space: pre-wrap; text-shadow: 0 0 10px rgba(226,119,90,.25); pointer-events: none; }
#boot-log .ok { color: var(--mint); }
#boot-log .hl { color: var(--claude-2); }
.boot-corner { position: absolute; font-size: 11px; letter-spacing: .14em; color: rgba(255,255,255,.32); text-transform: uppercase; }
.boot-corner.tl { top: 22px; left: 26px; } .boot-corner.tr { top: 22px; right: 26px; }
.boot-corner.bl { bottom: 22px; left: 26px; } .boot-corner.br { bottom: 22px; right: 26px; }

/* ==========================================================================
   CURSOR / PROGRESS / TOPBAR
   ========================================================================== */
#cursor { position: fixed; inset: 0; pointer-events: none; z-index: 300; display: none; }
body.has-cursor #cursor { display: block; }
.cursor-dot, .cursor-ring { position: absolute; top: 0; left: 0; border-radius: 50%; will-change: transform; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; mix-blend-mode: difference; }
.cursor-ring { width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1px solid rgba(255,255,255,.5); display: grid; place-items: center; transition: width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out), background .3s, border-color .3s; }
.cursor-label { font: 600 10px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: #160b07; opacity: 0; transition: opacity .2s; white-space: nowrap; }
#cursor.is-label .cursor-ring { width: 60px; height: 60px; margin: -30px 0 0 -30px; background: var(--claude); border-color: transparent; }
#cursor.is-label .cursor-label { opacity: 1; }
#cursor.is-down .cursor-ring { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
#cursor.is-hidden { opacity: 0; }

#progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 120; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--violet), var(--claude), var(--amber)); }

#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 110; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px var(--pad); transition: transform .6s var(--ease-out), background .4s, backdrop-filter .4s;
}
#topbar.scrolled { background: rgba(7,7,10,.6); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid var(--line); }
body.is-booting #topbar { transform: translateY(-110%); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; font-size: 19px; }
.brand-spark { width: 22px; height: 22px; fill: var(--claude); transition: transform .8s var(--ease-spring); }
.brand:hover .brand-spark { transform: rotate(180deg) scale(1.15); }
#nav { display: flex; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.025); }
#nav a { position: relative; font-size: 13px; padding: 7px 13px; border-radius: 999px; color: var(--ink-2); transition: color .25s, background .25s; }
#nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
#nav a.active { color: #160b07; background: var(--claude); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; transition: background .3s, border-color .3s; }
.icon-btn:hover { background: rgba(255,255,255,.06); }
.eq { display: flex; gap: 2.5px; align-items: flex-end; height: 14px; }
.eq i { width: 2.5px; background: var(--ink); border-radius: 2px; height: 3px; transition: height .3s; }
body.sound-on .eq i { animation: eq 1s ease-in-out infinite; background: var(--claude); }
body.sound-on .eq i:nth-child(2) { animation-delay: -.3s; } body.sound-on .eq i:nth-child(3) { animation-delay: -.6s; } body.sound-on .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 14px; } }
.fps { font-size: 11px; color: var(--muted); min-width: 52px; text-align: right; }
@media (max-width: 1080px) { #nav { display: none; } }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 620px; overflow: hidden; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-overlay { position: absolute; inset: 0; pointer-events: none; padding: 96px var(--pad) 36px; display: flex; flex-direction: column; justify-content: flex-start; }
.hero-bottom { margin-top: auto; }
.hero-overlay a, .hero-overlay button { pointer-events: auto; }
.hero-kicker { font-size: 12px; color: var(--muted); letter-spacing: .06em; display: flex; gap: 12px; align-items: center; }
.pill { white-space: nowrap; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(111,242,180,.35); color: var(--mint); background: rgba(111,242,180,.06); }
.hero-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.hero-sub { margin: 0; font-size: clamp(24px, 3.4vw, 46px); font-weight: 300; letter-spacing: -.03em; line-height: 1.1; }
.rotator { display: inline-block; position: relative; color: var(--claude); font-family: var(--f-serif); font-style: italic; font-size: 1.12em; min-width: 4ch; }
.rotator span { display: inline-block; }
.rotator .char { display: inline-block; transition: transform .5s var(--ease-out), opacity .5s; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: clamp(20px, 5vw, 70px); margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.hero-stats div { display: flex; flex-direction: column; gap: 2px; }
.hero-stats b { font-family: var(--f-sans); font-size: clamp(22px, 2.4vw, 32px); font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.hero-stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.scroll-hint { position: absolute; right: var(--pad); bottom: 40px; font-size: 11px; letter-spacing: .3em; color: var(--muted); writing-mode: vertical-rl; display: flex; align-items: center; gap: 12px; }
.scroll-hint span { width: 1px; height: 60px; background: linear-gradient(var(--claude), transparent); animation: drip 2s var(--ease-out) infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
@media (max-width: 720px) { .hero-stats { grid-template-columns: repeat(2, auto); } .scroll-hint { display: none; } }

/* ---------- buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 15px 26px; border-radius: 999px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); transition: background .3s, border-color .3s, color .3s, box-shadow .3s; will-change: transform; }
.btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.3); }
.btn-primary { background: var(--claude); border-color: var(--claude); color: #170a06; box-shadow: 0 10px 40px -12px rgba(226,119,90,.8); }
.btn-primary:hover { background: var(--claude-2); border-color: var(--claude-2); box-shadow: 0 14px 50px -10px rgba(255,159,122,.9); }
.btn-ghost { backdrop-filter: blur(8px); }
.btn-small { padding: 9px 16px; font-size: 13px; }
.btn .arrow { display: inline-block; transition: transform .4s var(--ease-spring); }
.btn:hover .arrow { transform: translateY(3px); }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ---------- marquee ---------- */
.marquee { position: relative; overflow: hidden; border-block: 1px solid var(--line); padding: 22px 0; background: linear-gradient(90deg, var(--bg), var(--bg-2), var(--bg)); }
.marquee-track { display: flex; width: max-content; gap: 34px; align-items: center; font-weight: 800; font-size: clamp(28px, 4vw, 54px); letter-spacing: -.03em; will-change: transform; }
.marquee-track span { white-space: nowrap; }
.marquee-track span:nth-child(4n+1) { -webkit-text-stroke: 1px var(--ink-2); color: transparent; }
.marquee-track i { color: var(--claude); font-style: normal; font-size: .6em; }

/* ==========================================================================
   CHAPTERS
   ========================================================================== */
.chapter { position: relative; max-width: var(--maxw); margin: 0 auto; padding: clamp(100px, 14vw, 180px) var(--pad) 40px; }
.chapter-head { display: grid; grid-template-columns: 1fr; gap: 18px; margin-bottom: clamp(36px, 5vw, 64px); max-width: 1000px; }
.chapter-num { font-size: 12px; letter-spacing: .25em; text-transform: uppercase; color: var(--claude); display: flex; align-items: center; gap: 14px; }
.chapter-num::after { content: ""; height: 1px; width: 80px; background: linear-gradient(90deg, var(--claude), transparent); }
.chapter-title { margin: 0; font-size: clamp(44px, 7.4vw, 108px); line-height: .95; letter-spacing: -.055em; font-weight: 800; }
.chapter-title em { color: var(--claude); font-size: 1.06em; letter-spacing: -.03em; padding-right: .05em; }
.chapter-lede { margin: 0; max-width: 680px; color: var(--ink-2); font-size: clamp(16px, 1.4vw, 19px); }
.chapter-lede b { color: var(--ink); }

/* split text reveal */
.split .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split .word > span { display: inline-block; transform: translateY(105%) rotate(4deg); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i) * 55ms); }
.split.in .word > span { transform: none; }
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- stages & cards ---------- */
.stage { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #000; box-shadow: 0 40px 120px -40px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.02) inset; }
.stage canvas { width: 100%; height: 100%; touch-action: none; }
.stage-3d { height: min(78vh, 760px); }
.stage-2d { height: min(76vh, 720px); }
.stage-game { height: min(78vh, 720px); }
.stage-ui { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; pointer-events: none; flex-wrap: wrap; }
.stage-ui > * { pointer-events: auto; }
.stage-meta { font-size: 11px; color: rgba(255,255,255,.6); padding: 8px 12px; border-radius: 999px; background: rgba(0,0,0,.45); backdrop-filter: blur(10px); border: 1px solid var(--line); }
.stage-caption { position: absolute; left: 18px; bottom: 16px; font-size: 11px; color: rgba(255,255,255,.55); letter-spacing: .06em; pointer-events: none; text-shadow: 0 1px 8px #000; }

.seg { display: inline-flex; gap: 3px; padding: 4px; border-radius: 999px; background: rgba(10,10,14,.6); border: 1px solid var(--line-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); flex-wrap: wrap; }
.seg button { padding: 8px 15px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ink-2); transition: background .3s, color .3s; white-space: nowrap; }
.seg button:hover { color: #fff; background: rgba(255,255,255,.07); }
.seg button.on { background: var(--ink); color: #0b0b0e; }
.seg.small button { padding: 5px 11px; font-size: 12px; }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
@media (max-width: 900px) { .duo { grid-template-columns: 1fr; } }
.card { position: relative; padding: 26px; border-radius: var(--radius); background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); border: 1px solid var(--line); overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(500px circle at var(--mx, -100%) var(--my, -100%), rgba(226,119,90,.10), transparent 45%); }
.card-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; position: relative; }
.card h3 { margin: 0; font-size: 24px; letter-spacing: -.03em; font-weight: 700; }
.card p { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; }
.tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.card-canvas { width: 100%; height: 320px; border-radius: var(--radius-s); background: #050507; border: 1px solid var(--line); touch-action: none; }
.card-canvas.tall { height: 380px; }
.card-ctrls { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 10px; }
.card-ctrls.wrap { flex-wrap: wrap; justify-content: flex-start; }
.toggle { font-size: 12px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
.toggle input { accent-color: var(--claude); }

/* ---------- code ---------- */
.code { margin: 0; font: 12.5px/1.7 var(--f-mono); color: #d8d2cb; overflow: auto; max-height: 440px; padding: 18px; border-radius: var(--radius-s); background: #08080b; border: 1px solid var(--line); tab-size: 4; }
.code-card { display: flex; flex-direction: column; }
.code-card .code { flex: 1; }
.tk-kw { color: #ff8f70; } .tk-ty { color: #8b7cff; } .tk-fn { color: #f5d38a; } .tk-num { color: #6ff2b4; } .tk-str { color: #a8e57a; }
.tk-com { color: #6b655f; font-style: italic; } .tk-op { color: #9fd8ff; } .tk-pp { color: #e88ad5; } .tk-id { color: #e8e2db; } .tk-err { text-decoration: wavy underline var(--danger); }

/* ==========================================================================
   MOTION
   ========================================================================== */
.kinetic { margin: 0 calc(var(--pad) * -1) 60px; overflow: hidden; display: flex; flex-direction: column; gap: 0; }
.kinetic-line { white-space: nowrap; font-weight: 900; font-size: clamp(54px, 11vw, 170px); line-height: .92; letter-spacing: -.06em; will-change: transform; }
.kinetic-line.outline { color: transparent; -webkit-text-stroke: 1.5px var(--claude); }
.kinetic-line em { color: var(--amber); font-weight: 400; }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.bento-spring { grid-column: span 4; grid-row: span 2; }
.bento-ease { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; }
.bento-blob, .bento-tilt, .bento-stagger { grid-column: span 2; }
.bento-text { grid-column: span 6; }
@media (max-width: 1000px) { .bento > * { grid-column: span 6 !important; grid-row: auto !important; } }

.sliders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.sliders label { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.sliders input { grid-column: 1 / -1; width: 100%; }
.sliders output { color: var(--claude); }
@media (max-width: 600px) { .sliders { grid-template-columns: 1fr; } }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--claude); box-shadow: 0 0 0 4px rgba(226,119,90,.2); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--claude); cursor: pointer; }

.ease-list { display: flex; flex-direction: column; gap: 10px; flex: 1; margin: 6px 0 16px; }
.ease-row { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; }
.ease-row svg { width: 44px; height: 44px; border-radius: 8px; background: rgba(255,255,255,.03); border: 1px solid var(--line); overflow: visible; }
.ease-track { position: relative; height: 44px; border-radius: 10px; background: rgba(255,255,255,.025); border: 1px dashed var(--line); }
.ease-track .name { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 10.5px var(--f-mono); color: var(--muted); }
.ease-ball { position: absolute; top: 50%; left: 6px; width: 30px; height: 30px; margin-top: -15px; border-radius: 9px; background: linear-gradient(135deg, var(--claude-2), var(--claude)); box-shadow: 0 6px 20px -6px var(--claude); }

#blob { width: 100%; height: 240px; overflow: visible; }
.tilt-wrap { perspective: 900px; display: grid; place-items: center; height: 240px; }
.tilt { position: relative; width: 82%; max-width: 280px; aspect-ratio: 1.58; border-radius: 18px; transform-style: preserve-3d; background: linear-gradient(135deg, #2a1712 0%, #170d1f 50%, #0b1520 100%); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 30px 60px -20px rgba(0,0,0,.9); transition: transform .6s var(--ease-out); overflow: hidden; }
.tilt-glare { position: absolute; inset: 0; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.35), transparent 50%); mix-blend-mode: overlay; pointer-events: none; }
.tilt-layer { position: absolute; transform-style: preserve-3d; pointer-events: none; }
.tilt .l1 { right: 18px; top: 10px; font-size: 52px; color: var(--claude); transform: translateZ(50px); text-shadow: 0 0 30px var(--claude); }
.tilt .l2 { left: 20px; bottom: 34px; font-weight: 900; font-size: 34px; letter-spacing: -.04em; transform: translateZ(35px); }
.tilt .l3 { left: 21px; bottom: 16px; font-size: 9.5px; letter-spacing: .2em; color: var(--muted); transform: translateZ(20px); }

.dots { display: grid; grid-template-columns: repeat(12, 1fr); gap: 7px; height: 240px; align-content: center; padding: 6px; }
.dots i { aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.14); will-change: transform; }

.scramble { font-size: clamp(22px, 4vw, 54px); padding: 26px 0 10px; color: var(--ink); letter-spacing: -.02em; min-height: 1.5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scramble .sc { color: var(--claude); }

.pin { position: relative; height: 320vh; margin-top: 80px; }
.pin-sticky { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 30px; }
.pin-svg { width: 100%; max-height: 50vh; overflow: visible; filter: drop-shadow(0 0 24px rgba(226,119,90,.35)); }
.pin-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.pin-step { padding: 18px; border-radius: 16px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 16px; transition: color .5s, border-color .5s, background .5s, transform .6s var(--ease-spring); }
.pin-step span { display: block; font-size: 11px; color: var(--claude); margin-bottom: 6px; }
.pin-step.on { color: var(--ink); border-color: rgba(226,119,90,.5); background: rgba(226,119,90,.07); transform: translateY(-6px); }
.pin-caption { font-size: 11px; color: var(--muted); }
@media (max-width: 800px) { .pin-steps { grid-template-columns: 1fr 1fr; } }

/* ==========================================================================
   2D / SIM
   ========================================================================== */
.sim-canvas { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .5s; }
.sim-canvas.on { opacity: 1; pointer-events: auto; }

/* ==========================================================================
   C++
   ========================================================================== */
.cpp-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; }
.stage-cpp { min-height: 520px; }
.stage-cpp canvas { image-rendering: auto; }
.cpp-code .card-head { flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.cpp-code .code { max-height: 470px; }
@media (max-width: 1000px) { .cpp-grid { grid-template-columns: 1fr; } }

.race { margin-top: 20px; }
.race-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.race-head p { margin: 6px 0 0; }
.race-lanes { display: flex; flex-direction: column; gap: 14px; }
.lane { display: grid; grid-template-columns: 150px 1fr 110px; gap: 16px; align-items: center; font-size: 13px; }
.lane b { text-align: right; font-size: 14px; }
.bar { height: 14px; border-radius: 999px; background: rgba(255,255,255,.05); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, var(--claude), var(--amber)); transition: width .25s linear; box-shadow: 0 0 20px rgba(226,119,90,.6); }
.bar.js i { background: linear-gradient(90deg, var(--violet), var(--cyan)); box-shadow: 0 0 20px rgba(139,124,255,.6); }
.card .race-note { margin: 20px 0 0; font-size: 12px; color: var(--muted); }
@media (max-width: 600px) { .lane { grid-template-columns: 1fr; gap: 6px; } .lane b { text-align: left; } }

/* ==========================================================================
   IDE
   ========================================================================== */
.ide, .term { border-radius: var(--radius); border: 1px solid var(--line-2); background: #0a0a0e; overflow: hidden; box-shadow: 0 50px 120px -40px rgba(0,0,0,.9), 0 0 120px -60px rgba(226,119,90,.4); }
.ide-bar { display: flex; align-items: center; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #0e0e13; flex-wrap: wrap; }
.lights { display: flex; gap: 7px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; } .lights i:nth-child(3) { background: #28c840; }
.ide-actions { margin-left: auto; }
.ide-body { display: grid; grid-template-columns: 1.05fr 1fr; height: 600px; }
@media (max-width: 900px) { .ide-body { grid-template-columns: 1fr; height: auto; } .editor { height: 420px; } .ide-out { height: 640px; } }
.editor { position: relative; display: grid; grid-template-columns: 46px 1fr; overflow: hidden; border-right: 1px solid var(--line); }
.gutter { padding: 16px 10px 16px 0; text-align: right; color: #48443f; font-size: 13px; line-height: 1.65; user-select: none; overflow: hidden; background: #09090c; }
.editor-scroll { position: relative; overflow: hidden; }
.editor-hl, #editor-ta { position: absolute; inset: 0; margin: 0; padding: 16px; font-size: 13px; line-height: 1.65; white-space: pre; overflow: auto; tab-size: 2; border: 0; letter-spacing: 0; font-family: var(--f-mono); font-variant-ligatures: none; }
.editor-hl { color: #ddd; pointer-events: none; }
#editor-ta { background: transparent; color: transparent; caret-color: var(--claude); resize: none; outline: none; z-index: 1; }
#editor-ta::selection { background: rgba(226,119,90,.3); color: transparent; }
.ide-out { position: relative; display: grid; grid-template-rows: 1fr auto 170px; background: #050507; min-width: 0; }
#spark-canvas { width: 100%; height: 100%; min-height: 0; }
.ide-tabs { margin: 0 12px; justify-self: start; transform: translateY(50%); z-index: 2; }
.ide-pane { margin: 0; padding: 22px 16px 12px; font-size: 12px; line-height: 1.6; overflow: auto; border-top: 1px solid var(--line); color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.ide-pane .err { color: var(--danger); }
.ide-pane .dim { color: var(--muted); }
.ide-status { padding: 7px 14px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); background: #0e0e13; display: flex; gap: 16px; }
.ide-status .ok { color: var(--mint); } .ide-status .bad { color: var(--danger); }

/* ==========================================================================
   SYNTH
   ========================================================================== */
.synth { border-radius: var(--radius); border: 1px solid var(--line-2); background: linear-gradient(180deg, #121218, #0a0a0e); padding: 22px; box-shadow: 0 50px 120px -40px rgba(0,0,0,.9); }
.synth-top { display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: stretch; }
@media (max-width: 1000px) { .synth-top { grid-template-columns: 1fr; } }
#scope { width: 100%; height: 170px; border-radius: 14px; background: #050507; border: 1px solid var(--line); }
.synth-knobs { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.knob-group { display: flex; flex-direction: column; gap: 8px; }
.label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.knob { display: flex; flex-direction: column; align-items: center; gap: 8px; user-select: none; touch-action: none; cursor: ns-resize; }
.knob span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.knob-dial { position: relative; width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #34343e, #121217 70%); border: 1px solid var(--line-2); box-shadow: 0 8px 20px -6px #000, inset 0 1px 0 rgba(255,255,255,.08); }
.knob-dial::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; background: conic-gradient(from 225deg, var(--claude) 0 calc(var(--v, .5) * 270deg), rgba(255,255,255,.06) 0 270deg, transparent 0); mask: radial-gradient(circle, transparent 29px, #000 30px); -webkit-mask: radial-gradient(circle, transparent 29px, #000 30px); }
.knob-dial i { position: absolute; left: 50%; top: 6px; width: 3px; height: 13px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); transform-origin: 50% 21px; transform: rotate(calc(-135deg + var(--v, .5) * 270deg)); }
.seq-wrap { margin-top: 22px; }
.seq-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.seq-scale { margin-left: auto; font-size: 11px; color: var(--muted); }
.seq { display: grid; grid-template-columns: repeat(16, 1fr); gap: 5px; }
.seq button { aspect-ratio: 2.1; border-radius: 6px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.04); transition: background .15s, transform .15s, box-shadow .2s; }
.seq button:nth-child(16n+1), .seq button:nth-child(16n+5), .seq button:nth-child(16n+9), .seq button:nth-child(16n+13) { background: rgba(255,255,255,.075); }
.seq button.on { background: var(--claude); box-shadow: 0 0 16px -2px rgba(226,119,90,.8); }
.seq button.play { transform: scale(1.12); }
.seq button.col { border-color: rgba(255,255,255,.3); }
.keys { position: relative; display: flex; height: 150px; margin-top: 22px; user-select: none; touch-action: none; }
.key { flex: 1; position: relative; border-radius: 0 0 10px 10px; background: linear-gradient(180deg, #e9e4de, #fffaf4); border: 1px solid #000; margin-right: 2px; transition: background .08s, transform .08s; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; font: 10px var(--f-mono); color: #8a837c; }
.key.black { position: absolute; width: 5.2%; height: 60%; z-index: 2; background: linear-gradient(180deg, #1b1b20, #2a2a31); border-radius: 0 0 7px 7px; color: #666; margin: 0; }
.key.down { background: linear-gradient(180deg, var(--claude), #ffb592) !important; transform: translateY(2px); color: #2a0f06; }

/* ==========================================================================
   ALGO / GAME / TERM
   ========================================================================== */
.algo-stats { margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.term-title { font-size: 12px; color: var(--muted); }
.term-body { height: 460px; overflow: auto; padding: 18px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.term-body .ln { min-height: 1.6em; }
.term-body .prompt { color: var(--mint); }
.term-body .path { color: var(--violet); }
.term-body .cmd { color: var(--ink); }
.term-body .err { color: var(--danger); }
.term-body .acc { color: var(--claude); }
.term-body .dim { color: var(--muted); }
.term-input-line { display: flex; gap: 0; }
.term-input { flex: 1; background: transparent; border: 0; outline: none; color: var(--ink); font: inherit; caret-color: var(--claude); padding: 0; margin-left: .6ch; min-width: 0; }

/* ==========================================================================
   FINALE / FOOTER / TOAST
   ========================================================================== */
.finale { position: relative; min-height: 100vh; display: grid; place-items: center; overflow: hidden; margin-top: 120px; border-top: 1px solid var(--line); }
#finale-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.finale-inner { position: relative; text-align: center; padding: 120px var(--pad) 140px; display: flex; flex-direction: column; align-items: center; gap: 26px; pointer-events: none; }
.finale-inner a, .finale-inner button { pointer-events: auto; }
.finale-inner .chapter-num::after { display: none; }
.finale-title { margin: 0; font-size: clamp(56px, 10vw, 160px); line-height: .9; letter-spacing: -.06em; font-weight: 900; }
.finale-title em { color: var(--claude); }
.finale-lede { margin: 0; max-width: 620px; color: var(--ink-2); font-size: clamp(17px, 1.6vw, 21px); }
.finale-stats { display: flex; gap: clamp(18px, 4vw, 48px); flex-wrap: wrap; justify-content: center; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.finale-stats b { display: block; font-family: var(--f-sans); font-size: clamp(26px, 3vw, 42px); color: var(--ink); letter-spacing: -.03em; text-transform: none; }
.footer { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 22px var(--pad); font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); background: rgba(7,7,10,.5); backdrop-filter: blur(8px); }

#toast { position: fixed; left: 50%; bottom: 28px; z-index: 250; opacity: 0; transform: translate(-50%, 220%); transition: transform .6s var(--ease-spring), opacity .3s; padding: 12px 20px; border-radius: 999px; background: rgba(20,20,26,.9); border: 1px solid var(--line-2); backdrop-filter: blur(12px); font-size: 12.5px; pointer-events: none; max-width: 90vw; text-align: center; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }

/* party mode (konami) */
body.party { animation: hue 4s linear infinite; }
@keyframes hue { to { filter: hue-rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .grain, .scroll-hint span, .activate-shine, .activate-ring { animation: none; }
  .reveal, .split .word > span { transition-duration: .01s; }
  html { scroll-behavior: auto; }
}
