/* =========================================================
   Arvindh Kumar Kalainathan — portfolio
   Tokens → base → layout → components → sections
   ========================================================= */

:root,
:root[data-theme="dark"] {
  --bg: #0a0a0b;
  --bg-elev: #111113;
  --surface: #151518;
  --surface-2: #1c1c20;
  --border: #26262b;
  --border-strong: #34343a;
  --text: #ededef;
  --text-muted: #a1a1aa;
  --text-faint: #71717a;
  --accent: #facc15;          /* electric yellow */
  --accent-strong: #fde047;
  --accent-text: #facc15;     /* accent used for text on bg */
  --accent-ink: #0a0a0b;      /* text on accent fill */
  --accent-soft: rgba(250, 204, 21, 0.12);
  --glow: rgba(250, 204, 21, 0.35);
  --grid-line: rgba(255, 255, 255, 0.045);
  --shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 20px 40px -24px rgba(0,0,0,0.8);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fafaf9;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f4f2;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --text: #18181b;
  --text-muted: #52525b;
  --text-faint: #78716c;
  --accent: #facc15;
  --accent-strong: #eab308;
  --accent-text: #a16207;     /* darker for contrast on light bg */
  --accent-ink: #18181b;
  --accent-soft: rgba(234, 179, 8, 0.14);
  --glow: rgba(234, 179, 8, 0.35);
  --grid-line: rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 20px 40px -28px rgba(0,0,0,0.25);
  color-scheme: light;
}

:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  --font-pixel: "Press Start 2P", var(--font-mono);
  --radius: 14px;
  --radius-sm: 9px;
  --container: 1120px;
  --nav-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.accent { color: var(--accent-text); }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px;
  transition: transform .2s var(--ease), background-color .2s, border-color .2s, box-shadow .2s;
}
.btn svg { font-size: 18px; transition: transform .2s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-strong); box-shadow: 0 8px 28px -8px var(--glow); transform: translateY(-1px); }
.btn--ghost { border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--text-faint); background: var(--surface-2); }
.btn--small { height: 36px; padding: 0 14px; font-size: 14px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color .2s, border-color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.icon-btn svg { font-size: 18px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--border);
}
.nav__inner { height: 100%; display: flex; align-items: center; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.brand__mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--text); color: var(--accent);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.brand__mark svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.05); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 24px var(--glow); }
:root[data-theme="dark"] .brand__mark { background: var(--surface-2); border: 1px solid var(--border-strong); }

/* "Charged" ring: a spark orbits the logo while the bolt cursor is ready to summon.
   It discharges when clicked and recharges when the bolt cursor is dismissed. */
@property --charge-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@media (hover: hover) and (pointer: fine) {
  .brand__mark { position: relative; --ring-head: #fff; }
  :root[data-theme="light"] .brand__mark { --ring-head: #ca8a04; }
  .brand__mark::before {
    content: ""; position: absolute; inset: -5px; border-radius: 13px; padding: 1.5px; pointer-events: none;
    background: conic-gradient(from var(--charge-angle),
      transparent 0deg 220deg, rgba(250, 204, 21, .2) 270deg, var(--accent) 335deg, var(--ring-head) 356deg, transparent 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: charge-spin 2.2s linear infinite, charge-in .6s ease-out;
  }
  .brand.is-spent .brand__mark::before { animation: charge-out .45s ease-out forwards; }
  html.bolt-cursor .brand:not(.is-spent) .brand__mark::before { opacity: 0; animation: none; }
}
@keyframes charge-spin { to { --charge-angle: 360deg; } }
@keyframes charge-in { from { opacity: 0; transform: scale(.8); } }
@keyframes charge-out {
  0% { opacity: 1; transform: scale(1); filter: brightness(1.8); }
  30% { opacity: 1; transform: scale(1.18); }
  100% { opacity: 0; transform: scale(1.45); }
}

.nav__links { display: flex; gap: 4px; margin-left: auto; }
.nav__links a {
  position: relative; padding: 8px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  transition: color .2s, background-color .2s;
}
.nav__links a:hover { color: var(--text); background: var(--surface-2); }
.nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px;
  border-radius: 2px; background: var(--accent);
}
.nav__actions { display: flex; align-items: center; gap: 10px; }
.nav__menu { display: none; }

.icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 72px 0 40px; overflow: hidden; }
.hero__grid {
  position: absolute; inset: -64px 0 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 65% 35%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 65% 35%, #000 20%, transparent 75%);
}
.hero__inner {
  position: relative;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-elev);
  font: 500 13px/1.4 var(--font-mono); color: var(--text-muted);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
.hero__title {
  margin-top: 22px;
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 700; letter-spacing: -0.035em; line-height: 1.04;
}
.strike { position: relative; color: var(--accent-text); white-space: nowrap; }
.strike svg {
  width: .5em; height: .5em; margin-left: .04em;
  fill: var(--accent); stroke: none; vertical-align: .45em;
  filter: drop-shadow(0 0 10px var(--glow));
  animation: flicker 5s 1.2s infinite;
}
.hero__lede { margin-top: 22px; max-width: 560px; font-size: 18px; color: var(--text-muted); }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.socials { display: flex; gap: 8px; margin-top: 28px; }
.socials a {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  color: var(--text-muted); border: 1px solid var(--border);
  transition: color .2s, border-color .2s, transform .2s var(--ease);
}
.socials a:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-2px); }
.socials svg { font-size: 18px; }

.hero__visual { position: relative; justify-self: center; width: min(400px, 100%); }
.portrait {
  position: relative; aspect-ratio: 4 / 4.6;
  border-radius: 28px; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 100%, var(--accent-soft), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--bg-elev));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.portrait img {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 92%; height: auto;
}
.portrait__bolt {
  position: absolute; top: 4%; right: -8%; width: 70%; height: auto;
  fill: none; stroke: var(--accent); stroke-width: .35; opacity: .55;
  stroke-dasharray: 80; stroke-dashoffset: 80;
  filter: drop-shadow(0 0 6px var(--glow));
  animation: draw 1.6s .6s var(--ease) forwards;
}
.award-chip {
  position: absolute; left: -28px; bottom: 36px; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px 12px 12px; border-radius: 14px;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  white-space: nowrap;
  transition: width .38s var(--ease), translate .25s var(--ease), border-color .25s;
}
.award-chip:hover { translate: 0 -3px; border-color: var(--accent); }
.award-chip__icon {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); perspective: 200px;
}
.award-chip__icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.award-chip__window { display: block; overflow: hidden; padding: 2px 0; margin: -2px 0; }
.award-chip__text { display: block; }
.award-chip strong { display: block; font-size: 14px; line-height: 1.2; }
.award-chip small { font-size: 12px; color: var(--text-muted); }

/* countdown to the next swap; its animationend drives the rotation */
.award-chip__progress {
  position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--accent); opacity: .75; transform-origin: left; transform: scaleX(0);
  animation: chip-progress 3.4s linear forwards;
}
.award-chip:is(:hover, :focus-visible, .is-paused) .award-chip__progress { animation-play-state: paused; }

.award-chip.is-out .award-chip__text { animation: chip-text-out .22s ease-in forwards; }
.award-chip.is-out .award-chip__icon svg { animation: chip-icon-out .22s ease-in forwards; }
.award-chip.is-in .award-chip__text { animation: chip-text-in .42s var(--ease) both; }
.award-chip.is-in .award-chip__icon svg { animation: chip-icon-in .42s var(--ease) both; }
.award-chip.is-in .award-chip__icon { animation: chip-spark .5s ease-out; }
@keyframes chip-progress { to { transform: scaleX(1); } }
@keyframes chip-text-out { to { transform: translateY(-110%); opacity: 0; filter: blur(2px); } }
@keyframes chip-text-in { from { transform: translateY(110%); opacity: 0; filter: blur(2px); } }
@keyframes chip-icon-out { to { transform: rotateX(90deg) scale(.7); opacity: 0; } }
@keyframes chip-icon-in { from { transform: rotateX(-90deg) scale(.7); opacity: 0; } }
@keyframes chip-spark { from { box-shadow: 0 0 0 0 rgba(250, 204, 21, .65); } to { box-shadow: 0 0 0 10px rgba(250, 204, 21, 0); } }

/* "Hear me play" draws the eye to the piano button */
.listen.is-beckoning { animation: beckon .85s ease-out 3; }
@keyframes beckon { from { box-shadow: 0 0 0 0 rgba(250, 204, 21, .7); } to { box-shadow: 0 0 0 12px rgba(250, 204, 21, 0); } }

.stats {
  margin: 72px 0 0; display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev);
  overflow: hidden;
}
.stats > div { padding: 22px 24px; border-left: 1px solid var(--border); }
.stats > div:first-child { border-left: 0; }
.stats dt { font: 500 12px/1 var(--font-mono); color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; }
.stats dd { margin: 10px 0 4px; font: 700 30px/1 var(--font-display); letter-spacing: -0.02em; }
.stats span { font-size: 13px; color: var(--text-muted); line-height: 1.45; display: block; }

/* ---------- sections ---------- */
.section { padding: 112px 0 0; }
.section__head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 44px; }
.section__head h2 { font-size: clamp(30px, 4vw, 42px); font-weight: 600; }
.section__num {
  font: 500 13px/1 var(--font-mono); color: var(--accent-text);
  padding: 5px 8px; border-radius: 6px; background: var(--accent-soft);
}
.section__link {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; color: var(--text-muted); transition: color .2s;
}
.section__link:hover { color: var(--accent-text); }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; align-items: start; }
.about__photo { margin: 0; position: sticky; top: calc(var(--nav-h) + 24px); }
.about__photo img {
  width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 40% 20%;
  border-radius: var(--radius); border: 1px solid var(--border);
  filter: grayscale(.25) contrast(1.02);
  transition: filter .5s var(--ease);
}
.about__photo:hover img { filter: none; }
.prose p { font-size: 17px; color: var(--text-muted); }
.prose p + p { margin-top: 18px; }
.prose strong { color: var(--text); font-weight: 600; }

.skills { margin-top: 40px; display: grid; gap: 24px; }
.skills__group h3 {
  font: 500 12px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-faint); margin-bottom: 12px;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 6px 12px; border-radius: 8px; font-size: 14px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}

/* ---------- projects ---------- */
.projects { display: grid; gap: 20px; }
.projects__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.card {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); overflow: hidden; text-align: left;
  padding: 0; cursor: pointer;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.card::before {
  /* electric charge that sweeps across the top edge on hover */
  content: ""; position: absolute; z-index: 2; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateX(-100%); opacity: 0;
}
.card:hover, .card:focus-visible { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.card:hover::before, .card:focus-visible::before { opacity: 1; animation: charge 1s var(--ease) forwards; }
.card:focus-visible { outline-offset: 2px; }

.card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .6s var(--ease); }
.card:hover .card__media img { transform: scale(1.04); }
.card__media--contain img { object-fit: contain; padding: 18px; background: #0f1220; }

.card__body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 22px; flex: 1; }
.card__meta { font: 500 12px/1 var(--font-mono); color: var(--text-faint); letter-spacing: .02em; }
.card__title { font-size: 21px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card__title svg { font-size: 16px; color: var(--text-faint); transition: transform .3s var(--ease), color .3s; }
.card:hover .card__title svg { color: var(--accent-text); transform: translate(2px, -2px); }
.card__desc { font-size: 15px; color: var(--text-muted); }
.card__stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.card__stack li {
  font: 500 12px/1 var(--font-mono); color: var(--text-muted);
  padding: 6px 8px; border-radius: 6px; background: var(--surface-2);
}

.badge {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  padding: 5px 10px 5px 8px; border-radius: 999px;
  font: 600 12px/1 var(--font-sans);
  background: var(--accent); color: var(--accent-ink);
}
.badge svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }

.card--featured { grid-column: 1 / -1; flex-direction: row; }
.card--featured .card__media { flex: 1.25; aspect-ratio: auto; min-height: 340px; border-bottom: 0; border-right: 1px solid var(--border); }
.card--featured .card__body { flex: 1; padding: 36px; gap: 14px; justify-content: center; }
.card--featured .card__title { font-size: 32px; }
.card--featured .card__desc { font-size: 16px; }
.card--featured .card__stack { margin-top: 8px; }

/* Orb glowing behind the card text; JS moves it to trail the cursor */
.card { isolation: isolate; }
.card__media, .card__body { position: relative; z-index: 1; }
.card__orb {
  --orb-core: rgba(253, 224, 71, .32); --orb-mid: rgba(250, 204, 21, .13); --orb-edge: rgba(250, 204, 21, .045);
  position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none;
  width: 300px; height: 300px; margin: -150px 0 0 -150px; border-radius: 50%;
  background: radial-gradient(circle, var(--orb-core) 0%, var(--orb-mid) 32%, var(--orb-edge) 52%, transparent 70%);
  opacity: 0; transition: opacity .45s var(--ease);
  will-change: transform;
}
:root[data-theme="light"] .card__orb { --orb-core: rgba(234, 179, 8, .3); --orb-mid: rgba(234, 179, 8, .13); --orb-edge: rgba(234, 179, 8, .05); }
.card__orb.is-lit { opacity: 1; }

/* ---------- compact project index ("More projects") ---------- */
.archive { margin-top: 56px; }
.archive[hidden] { display: none; }
.archive__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.archive__head h3 { font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.archive__count {
  font: 500 12px/1 var(--font-mono); color: var(--text-muted);
  padding: 4px 7px; border-radius: 6px; border: 1px solid var(--border);
}
.archive__head p { font-size: 14px; color: var(--text-faint); }
.archive__list { border-top: 1px solid var(--border); }
.archive__list li { border-bottom: 1px solid var(--border); }

.index-row {
  position: relative; width: 100%;
  display: grid; grid-template-columns: 40px 160px 1fr auto 28px; align-items: center; gap: 20px;
  padding: 16px 12px; border: 0; background: none; text-align: left;
  transition: background-color .25s, padding .3s var(--ease);
}
.index-row::before {
  /* a bolt of charge runs along the bottom edge on hover */
  content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
.index-row:hover, .index-row:focus-visible { background: var(--surface); padding-left: 18px; }
.index-row:hover::before, .index-row:focus-visible::before { transform: scaleX(1); }
.index-row__num { font: 500 12px/1 var(--font-mono); color: var(--text-faint); transition: color .2s; }
.index-row:hover .index-row__num { color: var(--accent-text); }
.index-row__thumb { display: none; }
.index-row__title { font: 600 18px/1.3 var(--font-display); letter-spacing: -0.01em; }
.index-row__tagline { font-size: 15px; color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.index-row__meta { font: 500 12px/1 var(--font-mono); color: var(--text-faint); white-space: nowrap; }
.index-row__go {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  color: var(--text-faint); transition: color .2s, background-color .2s, transform .3s var(--ease);
}
.index-row:hover .index-row__go { color: var(--accent-ink); background: var(--accent); transform: rotate(45deg); }

.peek {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  width: 280px; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.6), 0 0 0 4px var(--accent-soft);
  opacity: 0; scale: .92; rotate: -2deg;
  transition: opacity .2s, scale .25s var(--ease), rotate .25s var(--ease);
}
.peek.is-on { opacity: 1; scale: 1; rotate: 0deg; }
.peek img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* ---------- games: console + cartridge label ---------- */
.new-tag {
  align-self: center; padding: 6px 9px 5px; border-radius: 999px;
  font: 9px/1 var(--font-pixel); letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-text); border: 1px solid var(--accent); background: var(--accent-soft);
}
.games__intro { margin: -24px 0 36px; max-width: 620px; color: var(--text-muted); font-size: 17px; }

.arcade { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.arcade__main {
  flex: 0 0 calc(57.45% - 23px); min-width: 0; max-width: 100%;
  position: sticky; top: calc(var(--nav-h) + 24px);
  transition: flex-basis .62s cubic-bezier(.65, 0, .35, 1);
}
.cart-label { flex: 1 1 0; min-width: 0; }
.cart-label[hidden], .shelf[hidden] { display: none !important; }

/* ----- play mode: console takes the full row, info becomes a compact strip ----- */
.arcade.is-playing { gap: 20px; }
.arcade.is-playing .arcade__main { flex-basis: 100%; position: static; }
.console.is-playing .screen { max-height: max(360px, calc(100svh - var(--nav-h) - 130px)); }
.console.is-playing .hud, .console.is-playing .press-start { opacity: 0; transition: opacity .2s; }
.press-start.is-pressed { animation: none; background: #fff; translate: -50% calc(-50% + 3px); box-shadow: 0 1px 0 #a16207; }

.console .screen:fullscreen { border-radius: 0; aspect-ratio: auto; max-height: none; }
.game-frame {
  position: absolute; left: 50%; top: 50%; overflow: hidden; background: #231f20;
  transform: translate(-50%, -50%) scale(var(--s, 1));
}
.game-frame iframe { display: block; border: 0; }

.arcade.is-playing .cart-label {
  flex-basis: 100%;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px;
  padding: 20px 24px 18px;
}
.arcade.is-playing .cart-label__body,
.arcade.is-playing .cart-label__note,
.arcade.is-playing [data-start] { display: none; }
.arcade.is-playing .cart-label__title { margin-top: 8px; font-size: 22px; white-space: nowrap; }
.arcade.is-playing .cart-label__stats {
  margin: 0; padding: 0 0 0 28px; border: 0; border-left: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
}
.arcade.is-playing .cart-label__controls { grid-column: auto; gap: 12px; }
.arcade.is-playing [data-stat="platform"] { display: none; }
.arcade.is-playing .keys { grid-template-columns: repeat(3, 26px); grid-auto-rows: 24px; gap: 3px; }
.arcade.is-playing .keys kbd { font-size: 10px; border-radius: 5px; }
.arcade.is-playing .cart-label__ctas { margin: 0; }

.is-leaving { animation: squash .28s cubic-bezier(.5, 0, .75, 0) forwards; transform-origin: 50% 100%; }
.is-entering { animation: unsquash .45s var(--ease) both; transform-origin: 50% 0; }
@keyframes squash { to { opacity: 0; transform: translateY(36px) scale(.96, .3); filter: blur(2px); } }
@keyframes unsquash { from { opacity: 0; transform: translateY(-18px) scaleY(.5); } }

/* The console is always "hardware dark", in both themes */
.console {
  padding: 14px 14px 0; border-radius: 22px;
  background: linear-gradient(180deg, #19191e, #0e0e11);
  border: 1px solid #2a2a31;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 40px 80px -36px rgba(0,0,0,.75), 0 0 0 1px rgba(0,0,0,.4);
  transition: transform .25s ease-out, opacity .7s var(--ease);
  will-change: transform;
}
.js .console.reveal.is-in { transform: none; }

.screen {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; isolation: isolate;
  border-radius: 12px; background: #000;
  box-shadow: 0 0 0 1px #000, 0 0 30px rgba(0,0,0,.8) inset;
}

.screen__cover {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.02); transition: transform .8s var(--ease);
}
.console:hover .screen__cover { transform: scale(1.06); }
.screen__fx {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.6) 100%),
    linear-gradient(rgba(0,0,0,.15), transparent 30%, transparent 60%, rgba(0,0,0,.45));
}

.hud {
  position: absolute; z-index: 2;
  padding: 8px 10px; border-radius: 6px;
  font: 10px/1 var(--font-pixel); letter-spacing: .04em; color: #fff;
  background: rgba(10,10,11,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.08);
}
.hud--tl { top: 14px; left: 14px; }
.hud--tr {
  top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 8px;
  color: #facc15; font-variant-numeric: tabular-nums;
}
.hud--bl { bottom: 14px; left: 14px; font: 600 13px/1 var(--font-display); letter-spacing: 0; }
.coin {
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff4b8, #facc15 45%, #b45309);
  box-shadow: 0 0 8px rgba(250,204,21,.6);
  animation: coin 1.4s ease-in-out infinite;
}

.press-start {
  position: absolute; z-index: 3; left: 50%; top: 50%; translate: -50% -50%;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 22px 14px; border-radius: 8px;
  font: 12px/1 var(--font-pixel); letter-spacing: .06em; text-transform: uppercase;
  color: #0a0a0b; background: #facc15;
  box-shadow: 0 4px 0 #a16207, 0 14px 30px -6px rgba(0,0,0,.7), 0 0 0 6px rgba(250,204,21,.18);
  transition: translate .12s, box-shadow .12s, background-color .2s;
  animation: glowpulse 2.4s ease-in-out infinite;
}
.press-start:hover { background: #fde047; translate: -50% calc(-50% - 2px); box-shadow: 0 6px 0 #a16207, 0 18px 36px -6px rgba(0,0,0,.7), 0 0 0 8px rgba(250,204,21,.22); }
.press-start:active { translate: -50% calc(-50% + 3px); box-shadow: 0 1px 0 #a16207, 0 6px 16px -6px rgba(0,0,0,.7); }
.press-start__tri {
  width: 0; height: 0;
  border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  animation: blink 1s steps(1) infinite;
}

.console__bar {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 6px;
  font: 500 12px/1 var(--font-mono); color: #8b8b94;
}
.console__led {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,.8);
}
.console.is-playing .console__led { background: #22c55e; box-shadow: 0 0 10px rgba(34,197,94,.9); }
.console__player { color: #e4e4e7; }
.console__hint { margin-left: auto; }
.console__actions { display: flex; gap: 6px; }
.console__btn {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid #2a2a31; background: #1c1c21; color: #d4d4d8;
  transition: color .2s, border-color .2s;
}
.console__btn:hover { color: #facc15; border-color: #facc15; }
.console__btn[hidden] { display: none; }
.console__btn svg { font-size: 15px; }
.console.is-booting .screen { animation: boot .65s var(--ease); }

.cart-label {
  position: relative; overflow: hidden;
  padding: 30px 28px 26px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border);
}
.cart-label::before {
  /* striped label edge, like a cartridge sticker */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 28px, transparent 28px 34px);
}
.cart-label__level { font: 10px/1 var(--font-pixel); letter-spacing: .06em; color: var(--accent-text); text-transform: uppercase; }
.cart-label__title { margin-top: 14px; font-size: 30px; font-weight: 700; }
.cart-label__tagline { margin-top: 8px; font-weight: 500; }
.cart-label__desc { margin-top: 12px; font-size: 15px; color: var(--text-muted); }
.cart-label__stats {
  margin: 22px 0 0; padding: 18px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.cart-label__stats dt { font: 500 11px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }
.cart-label__stats dd { margin: 6px 0 0; font-size: 14.5px; }
.cart-label__controls { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cart-label__controls dd { margin: 0; }
.cart-label__note { margin-top: 14px; font-size: 13px; color: var(--text-faint); }
.cart-label__ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.keys { display: grid; grid-template-columns: repeat(3, 34px); grid-auto-rows: 32px; gap: 5px; }
.keys kbd {
  display: grid; place-items: center;
  font: 600 12px/1 var(--font-mono); color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-bottom-width: 3px; border-radius: 7px;
  transition: transform .08s, background-color .08s, border-color .08s, color .08s;
}
.keys kbd:nth-child(1) { grid-column: 2; grid-row: 1; }
.keys kbd:nth-child(2) { grid-column: 1; grid-row: 2; }
.keys kbd:nth-child(3) { grid-column: 2; grid-row: 2; }
.keys kbd:nth-child(4) { grid-column: 3; grid-row: 2; }
.keys kbd.is-down { transform: translateY(2px); border-bottom-width: 1px; background: var(--accent); border-color: var(--accent-strong); color: var(--accent-ink); }

.shelf { margin-top: 28px; }
.shelf__label { font: 500 11px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }
.shelf__list {
  display: flex; gap: 12px; margin-top: 12px; padding: 8px 2px 0; overflow-x: auto;
  border-bottom: 3px solid var(--border-strong); /* the shelf the cartridges stand on */
}
.shelf__list li { padding-bottom: 0; }
.cart {
  position: relative; flex: none; width: 112px; min-height: 124px;
  display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 10px;
  border-radius: 10px 10px 4px 4px; border: 1px solid var(--border);
  background: var(--surface-2); text-align: left;
  transition: transform .25s var(--ease), border-color .2s, box-shadow .25s;
}
.cart::before {
  content: ""; height: 6px; margin: 0 8px 2px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 3px, transparent 3px 6px);
}
.cart img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.cart > span { font: 600 12px/1.25 var(--font-display); }
.cart:not(.cart--empty):hover { transform: translateY(-3px); border-color: var(--border-strong); }
.cart.is-inserted { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 10px 22px -12px var(--glow); }
.cart--empty {
  align-items: center; justify-content: center; text-align: center; gap: 8px;
  border-style: dashed; border-color: var(--border-strong); background: transparent; color: var(--text-faint);
}
.cart--empty::before { display: none; }
.cart--empty span { font: 9px/1 var(--font-pixel); }
.cart--empty small { font: 500 11px/1 var(--font-mono); }
.cart--empty i { font-style: normal; animation: dot 1.2s infinite; }
.cart--empty i:nth-child(2) { animation-delay: .2s; }
.cart--empty i:nth-child(3) { animation-delay: .4s; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes dot { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes coin { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.2); } }
@keyframes glowpulse { 50% { box-shadow: 0 4px 0 #a16207, 0 14px 30px -6px rgba(0,0,0,.7), 0 0 0 12px rgba(250,204,21,.08); } }
@keyframes boot {
  0% { clip-path: inset(50% 0 50% 0); filter: brightness(5); }
  35% { clip-path: inset(49.4% 0 49.4% 0); filter: brightness(5); }
  100% { clip-path: inset(0 0 0 0); filter: none; }
}

/* ---------- timeline ---------- */
.timeline { position: relative; max-width: 820px; }
.timeline::before {
  content: ""; position: absolute; left: 76px; top: 8px; bottom: 8px; width: 1px;
  background: linear-gradient(var(--accent), var(--border) 30%, var(--border));
}
.timeline li { position: relative; display: grid; grid-template-columns: 76px 1fr; gap: 36px; padding-bottom: 40px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 71px; top: 8px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border-strong);
}
.timeline li:first-child::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 16px var(--glow); }
.timeline__year { font: 500 14px/1.6 var(--font-mono); color: var(--text-faint); }
.timeline li:first-child .timeline__year { color: var(--accent-text); }
.timeline h3 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.timeline p { color: var(--text-muted); font-size: 15.5px; }
.timeline strong { color: var(--text); font-weight: 600; }

/* Folded older years: an arrow on the line unfolds them */
.timeline-more { position: relative; max-width: 820px; }
.timeline-toggle {
  position: relative; width: 100%; margin-top: 34px; padding: 6px 0; border: 0; background: none; text-align: left;
  display: grid; grid-template-columns: 76px 1fr; column-gap: 36px; align-items: center;
}
.timeline-toggle::before {
  /* dashed trail from the last visible year down to the arrow */
  content: ""; position: absolute; left: 76px; top: -34px; height: calc(34px + 50% - 15px); border-left: 1px dashed var(--border-strong);
}
.timeline-toggle__range { font: 500 13px/1 var(--font-mono); color: var(--text-faint); }
.timeline-toggle__arrow {
  position: absolute; left: 76.5px; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg); border: 1px solid var(--border-strong); color: var(--text-muted);
  transition: border-color .2s, color .2s, box-shadow .2s;
}
.timeline-toggle__arrow svg { width: 15px; height: 15px; transition: transform .45s var(--ease); animation: bob 1.8s ease-in-out infinite; }
.timeline-toggle__text { padding-left: 0; }
.timeline-toggle__text strong { display: block; font: 600 17px/1.3 var(--font-display); color: var(--text); }
.timeline-toggle__text small { display: block; margin-top: 2px; font-size: 13.5px; color: var(--text-faint); }
.timeline-toggle:hover .timeline-toggle__arrow,
.timeline-toggle:focus-visible .timeline-toggle__arrow { border-color: var(--accent); color: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline-toggle:focus-visible { outline: none; }
.timeline-more.is-open .timeline-toggle__arrow svg { transform: rotate(180deg); animation: none; }
@keyframes bob { 50% { translate: 0 2.5px; } }

.timeline-older-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .65s cubic-bezier(.65, 0, .35, 1); }
.timeline-more.is-open .timeline-older-wrap { grid-template-rows: 1fr; }
.timeline--older { min-height: 0; overflow: hidden; } /* overflow also stops the margin below escaping */
.timeline--older li:first-child { margin-top: 36px; }
.timeline--older::before { top: 0; background: linear-gradient(transparent, var(--border) 36px); }
.timeline--older li:first-child::before { border-color: var(--border-strong); background: var(--bg); box-shadow: none; }
.timeline--older li:first-child .timeline__year { color: var(--text-faint); }

.beyond {
  margin-top: 72px; padding: 28px; border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  display: grid; grid-template-columns: auto 1fr; gap: 12px 40px; align-items: start;
}
.beyond h3 { font: 500 12px/1.9 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }
.beyond ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px 40px; }
.beyond li { font-size: 15px; color: var(--text-muted); }
.beyond__k { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.beyond__k .listen { margin-left: 8px; vertical-align: 1px; }

/* Weightlifting: bench press figure (posed by JS) */
.lift { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-radius: 12px; outline-offset: 6px; }
.lift__pr { color: var(--text); font-weight: 600; padding: 1px 6px; border-radius: 5px; background: var(--accent-soft); }
.lift__hint {
  display: block; margin-top: 8px;
  font: 500 11px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint);
  transition: color .2s;
}
.lift.is-locked .lift__hint { color: var(--accent-text); }
.lift__art { flex: none; width: 132px; height: auto; overflow: visible; stroke: none; } /* don't inherit the base icon outline */
.lift__art * { vector-effect: non-scaling-stroke; }
.lift__floor { stroke: var(--border-strong); stroke-width: 1.5; }
.lift__leg-bench { stroke: var(--text-faint); stroke-width: 3; stroke-linecap: round; }
.lift__pad { fill: var(--text-faint); }
.lift__body { fill: none; stroke: var(--text); stroke-linecap: round; stroke-linejoin: round; }
.lift__legs { stroke-width: 4.5; }
.lift__torso { stroke-width: 7.5; }
.lift__arm { stroke-width: 3.6; }
.lift__head { fill: var(--text); }
.lift__plate { fill: var(--accent); stroke: #0a0a0b; stroke-width: 1.6; }
.lift__plate-ring { fill: none; stroke: #0a0a0b; stroke-width: 1; opacity: .45; }
.lift__sleeve { fill: #0a0a0b; }
.lift__strain { fill: none; stroke: var(--accent-text); stroke-width: 1.6; stroke-linecap: round; opacity: 0; transition: opacity .15s; }
.lift.is-pushing .lift__strain { opacity: 1; }
.lift.is-locked .lift__plate { filter: drop-shadow(0 0 4px var(--glow)); }

/* Piano "Listen" pill: play/pause, equalizer while playing, progress fill */
.listen {
  --p: 0%;
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px 0 8px; border-radius: 999px; overflow: hidden;
  border: 1px solid var(--border-strong); color: var(--text);
  font: 500 12px/1 var(--font-mono);
  background: linear-gradient(90deg, var(--accent-soft) var(--p), var(--surface-2) var(--p));
  transition: border-color .2s, box-shadow .2s;
}
.listen:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.listen svg { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.listen__pause, .listen__bars { display: none; }
.listen__label { min-width: 4.6ch; font-variant-numeric: tabular-nums; }
.listen.is-playing { border-color: var(--accent); color: var(--accent-text); }
.listen.is-playing .listen__play { display: none; }
.listen.is-playing .listen__pause { display: block; }
.listen.is-playing .listen__bars { display: inline-flex; }
.listen__bars { align-items: flex-end; gap: 2px; height: 11px; }
.listen__bars i { width: 2px; height: 100%; border-radius: 1px; background: currentColor; animation: eq .9s ease-in-out infinite; transform-origin: bottom; }
.listen__bars i:nth-child(2) { animation-delay: -.3s; }
.listen__bars i:nth-child(3) { animation-delay: -.6s; }
.listen__bars i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

.beyond a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- contact ---------- */
.section--contact { padding-bottom: 112px; }
.contact {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px;
  padding: 56px; border-radius: 24px;
  background: var(--bg-elev); border: 1px solid var(--border);
}
.contact::before {
  content: ""; position: absolute; width: 520px; height: 520px; right: -200px; top: -260px;
  background: radial-gradient(circle, var(--accent-soft), transparent 65%); pointer-events: none;
}
.contact__intro h2 { margin-top: 18px; font-size: clamp(32px, 4vw, 44px); font-weight: 700; }
.contact__intro > p { margin-top: 14px; color: var(--text-muted); max-width: 420px; }
.contact__list { margin-top: 32px; display: grid; gap: 4px; }
.contact__list li {
  display: grid; grid-template-columns: 88px 1fr auto; align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--border); font-size: 15px;
}
.contact__list span { font: 500 12px/1 var(--font-mono); color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; }
.contact__list a { overflow-wrap: anywhere; transition: color .2s; }
.contact__list a:hover { color: var(--accent-text); }
.copy-btn {
  font: 500 12px/1 var(--font-mono); padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
}
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); }
.copy-btn.is-done { color: var(--accent-text); border-color: var(--accent); }

.form { position: relative; display: grid; gap: 16px; align-content: start; }
.form label { display: grid; gap: 8px; }
.form label span { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.form input, .form textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.form .btn { justify-self: start; margin-top: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: 14px; color: var(--text-faint); }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__meta { display: inline-flex; align-items: center; gap: 8px; }
.footer__meta svg { fill: var(--accent); stroke: none; }
.footer a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { color: var(--accent-text); }

/* ---------- modal ---------- */
.modal {
  width: min(820px, calc(100% - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 1px solid var(--border-strong); border-radius: 20px;
  background: var(--bg-elev); color: var(--text); box-shadow: 0 40px 120px -20px rgba(0,0,0,.6);
}
body:has(.modal[open]) { overflow: hidden; }
.modal::backdrop { background: rgba(5, 5, 7, 0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal[open] { animation: pop .3s var(--ease); }
.modal__inner { position: relative; padding: 36px; }
.modal__close { position: absolute; top: 16px; right: 16px; z-index: 2; background: var(--bg-elev); }
.modal h2 { font-size: 34px; font-weight: 700; margin-top: 10px; padding-right: 48px; }
.modal__tagline { margin-top: 6px; font-size: 17px; color: var(--text-muted); }
.modal__media {
  position: relative; margin-top: 24px; aspect-ratio: 16 / 9; border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2); border: 1px solid var(--border);
}
.modal__media img, .modal__media iframe { width: 100%; height: 100%; object-fit: cover; object-position: top; border: 0; }
.video-btn { position: absolute; inset: 0; display: grid; place-items: center; border: 0; padding: 0; background: none; }
.video-btn img { position: absolute; inset: 0; }
.video-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,.55)); }
.video-btn__play {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px 12px 16px; border-radius: 999px;
  background: var(--accent); color: #0a0a0b; font-weight: 600; font-size: 15px;
  box-shadow: 0 10px 30px -6px rgba(0,0,0,.5); transition: transform .2s var(--ease);
}
.video-btn:hover .video-btn__play { transform: scale(1.05); }
.video-btn__play svg { fill: currentColor; stroke: none; }
.modal__grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 36px; margin-top: 28px; }
.modal h3 { font: 500 12px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: 12px; }
.modal__section + .modal__section { margin-top: 24px; }
.modal p { color: var(--text-muted); }
.modal ul.bullets { display: grid; gap: 8px; }
.modal ul.bullets li { position: relative; padding-left: 20px; color: var(--text-muted); font-size: 15px; }
.modal ul.bullets li::before {
  content: ""; position: absolute; left: 2px; top: 8px; width: 9px; height: 9px;
  background: var(--accent);
  clip-path: polygon(56% 0, 18% 56%, 44% 56%, 38% 100%, 82% 42%, 56% 42%);
}
.modal aside dl { display: grid; gap: 14px; margin: 0; }
.modal aside dt { font: 500 12px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }
.modal aside dd { margin: 6px 0 0; font-size: 15px; }
.modal aside .tags { margin-top: 8px; }
.modal aside .tags li { font-size: 13px; padding: 5px 10px; }
.modal__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ---------- reveal & motion ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
/* Hero animates on load instead of waiting for the scroll observer */
.js .hero .reveal { opacity: 1; transform: none; transition: none; animation: rise .8s var(--ease) both; }
.js .hero .reveal:nth-child(2) { animation-delay: .06s; }
.js .hero .reveal:nth-child(3) { animation-delay: .12s; }
.js .hero .reveal:nth-child(4) { animation-delay: .18s; }
.js .hero .reveal:nth-child(5) { animation-delay: .24s; }
.js .hero__visual.reveal { animation-delay: .15s; }
.js .stats.reveal { animation-delay: .3s; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes charge { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: .2; } 94% { opacity: 1; } 95.5% { opacity: .35; } 96.5% { opacity: 1; }
}

/* Lightning flash easter egg (click the logo) */
.flash { position: fixed; inset: 0; z-index: 200; pointer-events: none; background: #fffbe6; animation: flash .7s ease-out forwards; }
@keyframes flash { 0% { opacity: 0; } 8% { opacity: .55; } 16% { opacity: .05; } 24% { opacity: .35; } 100% { opacity: 0; } }

/* ---------- bolt cursor (toggled from the logo) ---------- */
:root {
  --cursor-bolt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M14.7 30 3 14.3 11.4 14.5 10 3 21.7 18.7 13.3 18.5Z' fill='%23facc15' stroke='%230a0a0b' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 10 3, auto;
  --cursor-bolt-hot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M6.4 5.6 3.8 4M13.8 5.2 16.4 3.4' stroke='%230a0a0b' stroke-width='3.4' stroke-linecap='round'/%3E%3Cpath d='M6.4 5.6 3.8 4M13.8 5.2 16.4 3.4' stroke='%23fde047' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M14.7 30 3 14.3 11.4 14.5 10 3 21.7 18.7 13.3 18.5Z' fill='%23fff3b0' stroke='%230a0a0b' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 10 3, pointer;
}
html.bolt-cursor, html.bolt-cursor * { cursor: var(--cursor-bolt); }
html.bolt-cursor :is(a, button, label, summary, [role="button"], .card, .index-row, .cart:not(.cart--empty)),
html.bolt-cursor :is(a, button, label, summary, [role="button"], .card, .index-row) * { cursor: var(--cursor-bolt-hot); }
html.bolt-cursor :is(input, textarea) { cursor: text; }

/* ---------- the strike ---------- */
.zap { position: fixed; inset: 0; z-index: 300; pointer-events: none; background: rgba(6, 6, 12, 0); transition: background-color .35s; }
.zap.is-charging { background: rgba(6, 6, 12, .34); }
:root[data-theme="light"] .zap.is-charging { background: rgba(14, 14, 28, .4); }
.zap.is-done { background: rgba(6, 6, 12, 0); transition: background-color .45s; }
.zap::after { content: ""; position: absolute; inset: 0; background: #fffbe6; opacity: 0; }
.zap.is-striking::after { animation: zapflash .5s ease-out; }

.zap__orb {
  position: absolute; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 6%, #fef08a 14%, rgba(250, 204, 21, .55) 32%, rgba(250, 204, 21, .12) 55%, transparent 70%);
  mix-blend-mode: screen; opacity: 0; transform: scale(0);
}
.zap__orb::after {
  content: ""; position: absolute; inset: 22%; border-radius: 50%;
  border: 2px solid rgba(253, 224, 71, .85); box-shadow: 0 0 12px rgba(250, 204, 21, .7);
  animation: zapring .42s ease-out infinite;
}
.zap.is-charging .zap__orb { animation: zapcharge .52s cubic-bezier(.3, .7, .2, 1) forwards; }
.zap.is-striking .zap__orb { animation: zaporb .5s ease-out forwards; }
.zap.is-striking .zap__orb::after { display: none; }

.zap__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.zap__svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.zap__glow { stroke: #facc15; stroke-width: 10; opacity: .5; filter: blur(5px); }
:root[data-theme="light"] .zap__glow { stroke: #f59e0b; opacity: .65; }
.zap__core { stroke: #fff; stroke-width: 2.6; filter: drop-shadow(0 0 3px #fde047) drop-shadow(0 0 10px rgba(250, 204, 21, .85)); }
.zap__fork { stroke: #fef9c3; stroke-width: 1.3; opacity: .85; filter: drop-shadow(0 0 4px #facc15); }
.zap__crackle { stroke: #fef08a; stroke-width: 1.4; filter: drop-shadow(0 0 4px #facc15); }
.zap.is-striking :is(.zap__glow, .zap__core, .zap__fork) { stroke-dasharray: 1; stroke-dashoffset: 1; animation: zapdraw .09s linear forwards; }
.zap.is-striking .zap__svg { animation: zapflicker .32s steps(1) .09s; }
.zap.is-done :is(.zap__svg, .zap__orb) { opacity: 0; transition: opacity .3s; }

.zap__burst { position: absolute; width: 0; height: 0; }
.zap__burst::before {
  content: ""; position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  border: 2px solid #fde047; box-shadow: 0 0 14px #facc15, inset 0 0 8px #facc15;
  animation: zapburst .55s ease-out forwards;
}
.zap__burst::after {
  content: ""; position: absolute; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 12%, rgba(254, 240, 138, .8) 30%, transparent 70%);
  animation: zapfade .4s ease-out forwards;
}
.zap__spark {
  position: absolute; left: 0; top: 0; width: 11px; height: 2px; margin: -1px 0 0 -5.5px; border-radius: 2px;
  background: linear-gradient(90deg, #fff, #facc15); box-shadow: 0 0 6px #facc15;
  animation: zapspark .55s cubic-bezier(.2, .7, .3, 1) forwards;
}

@keyframes zapcharge {
  0% { opacity: 0; transform: scale(.1); }
  35% { opacity: .9; }
  50% { opacity: .55; transform: scale(.75); }
  62% { opacity: 1; }
  100% { opacity: 1; transform: scale(1.1); }
}
@keyframes zapring { from { opacity: 0; transform: scale(1.7); } to { opacity: 1; transform: scale(.35); } }
@keyframes zaporb { 0% { opacity: 1; transform: scale(1.1); } 20% { transform: scale(1.5); } 100% { opacity: 0; transform: scale(.5); } }
@keyframes zapdraw { to { stroke-dashoffset: 0; } }
@keyframes zapflicker { 0% { opacity: 1; } 22% { opacity: .2; } 38% { opacity: 1; } 60% { opacity: .45; } 74% { opacity: 1; } }
@keyframes zapflash { 0% { opacity: 0; } 12% { opacity: .32; } 24% { opacity: .03; } 36% { opacity: .2; } 100% { opacity: 0; } }
@keyframes zapburst { from { opacity: 1; transform: scale(.2); } to { opacity: 0; transform: scale(5); } }
@keyframes zapfade { from { opacity: 1; } to { opacity: 0; transform: scale(1.6); } }
@keyframes zapspark {
  from { opacity: 1; transform: translate(0, 0) rotate(var(--rot)) scaleX(1); }
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scaleX(.3); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .portrait__bolt { stroke-dashoffset: 0; }
  .award-chip__progress { display: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; gap: 48px; }
  .hero__visual { width: min(340px, 82%); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .about { grid-template-columns: 1fr; gap: 36px; }
  .about__photo { position: static; max-width: 420px; }
  .index-row { grid-template-columns: 40px 140px 1fr 28px; }
  .index-row__meta { display: none; }
  .card--featured { flex-direction: column; }
  .card--featured .card__media { min-height: 0; aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--border); }
  .card--featured .card__body { padding: 24px; }
  .contact { grid-template-columns: 1fr; padding: 36px; gap: 40px; }
  .beyond { grid-template-columns: 1fr; }
  .arcade { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 24px; }
  .arcade__main { flex-basis: auto; position: static; }
  .cart-label { flex: none; }
  .arcade.is-playing .cart-label { grid-template-columns: 1fr; gap: 16px; }
  .arcade.is-playing .cart-label__stats { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--border); }
}

@media (max-width: 720px) {
  .nav__links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s var(--ease), visibility .2s;
  }
  .nav__links.is-open { opacity: 1; transform: none; visibility: visible; }
  .nav__links a { padding: 14px 8px; font-size: 16px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav__links a.is-active::after { display: none; }
  .nav__menu { display: inline-grid; }
  .nav__cta { display: none; }
  .nav__actions { margin-left: auto; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .hero { padding-top: 40px; }
  .hero__lede { font-size: 16.5px; }
  .award-chip { left: -8px; bottom: 20px; }
  .stats { margin-top: 48px; }
  .stats > div { padding: 18px; }
  .stats dd { font-size: 24px; }
  .section { padding-top: 80px; }
  .section__head { flex-wrap: wrap; margin-bottom: 32px; }
  .section__link { margin-left: 0; width: 100%; }
  .projects__grid { grid-template-columns: 1fr; }
  /* On phones the index shows a small thumbnail instead of the hover preview */
  .index-row { grid-template-columns: 64px 1fr 28px; grid-template-rows: auto auto; gap: 2px 14px; padding: 14px 4px; }
  .index-row:hover, .index-row:focus-visible { padding-left: 4px; }
  .index-row__num { display: none; }
  .index-row__thumb { display: block; grid-row: 1 / 3; width: 64px; height: 44px; object-fit: cover; object-position: top center; border-radius: 6px; border: 1px solid var(--border); }
  .index-row__title { font-size: 16px; }
  .index-row__tagline { grid-column: 2; font-size: 13.5px; white-space: normal; }
  .index-row__go { grid-column: 3; grid-row: 1 / 3; }
  .peek { display: none; }
  .card--featured .card__title { font-size: 26px; }
  .timeline::before { left: 5px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; padding-left: 28px; }
  .timeline li::before { left: 0; }
  .timeline-toggle { grid-template-columns: 1fr; padding-left: 28px; }
  .timeline-toggle::before { left: 5px; }
  .timeline-toggle__arrow { left: 5.5px; }
  .timeline-toggle__range { display: none; }
  .beyond ul { grid-template-columns: 1fr; gap: 16px; }
  .contact { padding: 24px; border-radius: 18px; }
  .contact__list li { grid-template-columns: 1fr auto; }
  .contact__list li span { grid-column: 1 / -1; }
  .modal__inner { padding: 24px 20px; }
  .modal h2 { font-size: 26px; }
  .modal__grid { grid-template-columns: 1fr; gap: 28px; }
  .footer__inner { flex-direction: column; }
  .games__intro { margin-top: -16px; font-size: 16px; }
  .console { padding: 8px 8px 0; border-radius: 16px; }
  .screen { border-radius: 9px; }
  .hud { font-size: 8px; padding: 6px 7px; }
  .hud--tl, .hud--tr { top: 8px; } .hud--tl { left: 8px; } .hud--tr { right: 8px; }
  .hud--bl { display: none; }
  .press-start { font-size: 9px; padding: 12px 14px 11px; gap: 9px; white-space: nowrap; }
  .console__hint { display: none; }
  .cart-label { padding: 26px 20px 22px; }
  .cart-label__title { font-size: 26px; }
}
