/* ═══════════════════════════════════════════════════════════
   Lily Stone
   Five palettes, one per Amplifly brain state. The state is set
   on <html data-state>, so everything below inherits from it.
   ═══════════════════════════════════════════════════════════ */

:root,
[data-state="sharp"] {
  --bg:      #07121B;
  --bg-2:    #0B1A26;
  --surface: #0E2130;
  --ink:     #EAF6FB;
  --ink-2:   #93B0C2;
  --line:    #17313F;
  --accent:  #2FD8F0;
  --accent-2:#7CF2C6;
}
[data-state="spicy"] {
  --bg:      #150705;
  --bg-2:    #1F0B07;
  --surface: #26100B;
  --ink:     #FDEDE7;
  --ink-2:   #C79E8E;
  --line:    #3C1B13;
  --accent:  #FF6B35;
  --accent-2:#FFC145;
}
[data-state="flat"] {
  --bg:      #0D1013;
  --bg-2:    #12171B;
  --surface: #161C22;
  --ink:     #E8EDF2;
  --ink-2:   #94A3B0;
  --line:    #232C34;
  --accent:  #86AFD2;
  --accent-2:#B6CBDB;
}
[data-state="foggy"] {
  --bg:      #101017;
  --bg-2:    #16161F;
  --surface: #1B1B26;
  --ink:     #ECEAF4;
  --ink-2:   #A09CB8;
  --line:    #292639;
  --accent:  #B4A6E8;
  --accent-2:#8FD9E0;
}
[data-state="scattered"] {
  --bg:      #150A12;
  --bg-2:    #1E0E19;
  --surface: #26121F;
  --ink:     #FCE9F4;
  --ink-2:   #C295B0;
  --line:    #3B1C2F;
  --accent:  #F45CA0;
  --accent-2:#FFD166;
}

:root {
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --sans:    "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wrap:    1180px;
  --ease:    cubic-bezier(.2,.7,.3,1);
  --tint:    color-mix(in srgb, var(--accent) 12%, transparent);
}

/* ── base ─────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .6s var(--ease), color .6s var(--ease);
}

/* Faint engineering grid, tinted by the current state. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--tint) 1px, transparent 1px),
    linear-gradient(90deg, var(--tint) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .28;
  mask-image: radial-gradient(ellipse 100% 60% at 50% 0%, #000 20%, transparent 75%);
  transition: background-image .6s var(--ease);
}

main, footer, .topbar { position: relative; z-index: 1; }

p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

strong, b { font-weight: 600; color: var(--ink); }

::selection { background: var(--accent); color: var(--bg); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 32px; }

.display {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: .92;
  margin: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--bg); padding: 10px 16px;
}
.skip:focus { left: 0; }

/* ── scroll progress ──────────────────────────────────────── */

.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 300;
  box-shadow: 0 0 12px var(--accent);
  transition: background .6s var(--ease);
}

/* ── topbar ───────────────────────────────────────────────── */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 32px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .6s var(--ease);
}
.topbar.stuck { border-bottom-color: var(--line); }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.logo:hover { text-decoration: none; }
.logo span {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.topbar nav { display: flex; gap: 24px; }
.topbar nav a {
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 500;
  position: relative;
}
.topbar nav a::after {
  content: "";
  position: absolute; left: 0; right: 100%; bottom: -5px;
  height: 1px; background: var(--accent);
  transition: right .3s var(--ease);
}
.topbar nav a:hover { color: var(--ink); text-decoration: none; }
.topbar nav a:hover::after,
.topbar nav a.on::after { right: 0; }
.topbar nav a.on { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 100px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font: 600 14px/1 var(--sans);
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .3s var(--ease);
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 26px -10px var(--accent);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Mobile menu button — hidden until the nav collapses. */
.menu {
  display: none;
  place-items: center;
  align-content: center;   /* otherwise the auto rows stretch and the X won't close */
  gap: 4px;
  width: 40px; height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
}
.menu span {
  width: 16px; height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .28s var(--ease), opacity .18s var(--ease);
}
.menu[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ── hero ─────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 130px 32px 90px;
  overflow: hidden;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: .85;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin-inline: auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: 26px 64px;
  align-items: center;
}
.hero-left { min-width: 0; }

.kicker {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 4px;
}

h1.display {
  font-size: clamp(4.5rem, 13vw, 10.5rem);
  margin: 0 0 22px;
  background: linear-gradient(160deg, var(--ink) 30%, var(--accent) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-text {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 46ch;
}
.hero-text strong { color: var(--ink); }

/* the picker */
.picker {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.picker-q {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  line-height: 1.28;
  margin-bottom: 16px;
}

.states {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 11px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
  transition: border-color .25s var(--ease), background .25s var(--ease),
              transform .25s var(--ease), color .25s var(--ease);
}
.state i {
  font-style: normal;
  font-size: 13px;
  color: var(--ink-2);
  transition: color .25s var(--ease);
}
.state b { font-size: 14px; font-weight: 600; color: var(--ink); }
.state em { font-style: normal; font-size: 11.5px; line-height: 1.3; }
.state:hover { border-color: var(--accent); transform: translateY(-2px); }
.state[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.state[aria-pressed="true"] i { color: var(--accent); }

.rec {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}
.rec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.rec-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 100px;
  padding: 3px 9px;
}
.rec-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
}
.rec h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.rec p { font-size: 14.5px; color: var(--ink-2); margin-bottom: 10px; }
.rec-note {
  font-size: 12px !important;
  color: var(--ink-2);
  opacity: .72;
  border-top: 1px solid var(--line);
  padding-top: 9px;
  margin-bottom: 0 !important;
}
.rec.flash { animation: flash .5s var(--ease); }
@keyframes flash {
  from { opacity: .25; transform: translateY(6px); }
  to   { opacity: 1;   transform: none; }
}

/* ── sections ─────────────────────────────────────────────── */

.section { padding: 108px 0; }
.section.alt {
  background: color-mix(in srgb, var(--bg-2) 70%, transparent);
  border-block: 1px solid var(--line);
}

.sec-head { margin-bottom: 56px; }
.sec-head h2 {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  margin-bottom: 10px;
}
.sec-head p { color: var(--ink-2); font-size: 16px; }

/* ── projects ─────────────────────────────────────────────── */

.proj {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0 40px;
  padding: 46px 0;
  border-top: 1px solid var(--line);
}
.proj:first-of-type { border-top: 0; padding-top: 0; }

.proj-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 100px;
  align-self: start;
}
.idx {
  font-family: var(--display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px var(--accent);
}
.when {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.proj-main { max-width: 66ch; color: var(--ink-2); }
.proj-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 6px;
}
.proj-role {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 20px;
}

ul.stack {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 22px 0 0;
  padding: 0;
}
ul.stack li {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-2);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
ul.stack li:hover { border-color: var(--accent); color: var(--accent); }

.pair {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding-top: 46px;
  border-top: 1px solid var(--line);
}
.proj-sm {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  color: var(--ink-2);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.proj-sm:hover { border-color: var(--accent); transform: translateY(-3px); }
.proj-sm .idx { font-size: 24px; display: block; margin-bottom: 10px; }
.proj-sm .proj-title { font-size: 1.5rem; }

.more {
  margin-top: 40px;
  color: var(--ink-2);
  font-size: 15px;
}

/* ── the loop tabs ────────────────────────────────────────── */

.loop {
  margin: 26px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.loop-tabs { display: grid; grid-template-columns: repeat(4, 1fr); }
.loop-tabs button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font: 500 13px/1.2 var(--sans);
  text-align: left;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.loop-tabs button:last-child { border-right: 0; }
.loop-tabs button span {
  display: grid; place-items: center;
  width: 21px; height: 21px;
  flex: 0 0 21px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  transition: all .25s var(--ease);
}
.loop-tabs button:hover { color: var(--ink); }
.loop-tabs button[aria-selected="true"] {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.loop-tabs button[aria-selected="true"] span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.loop-panel {
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  min-height: 92px;
}
.loop-panel.flash { animation: flash .4s var(--ease); }
.loop-bar { height: 2px; background: var(--line); }
.loop-bar i { display: block; height: 100%; width: 25%; background: var(--accent); transition: width .4s var(--ease), margin-left .4s var(--ease); }

/* ── chart ────────────────────────────────────────────────── */

.chart {
  margin: 26px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.chart-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 18px;
}
.bars { display: grid; gap: 14px; }
.bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 46px;
  align-items: center;
  gap: 14px;
}
.bar-label { font-size: 13.5px; color: var(--ink-2); }
.bar-track {
  height: 12px;
  background: color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 100px;
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 100px;
  transition: width 1.1s var(--ease);
}
.chart.in .bar-fill { width: var(--to); }
.bar-fill.base  { background: color-mix(in srgb, var(--ink-2) 45%, transparent); }
.bar-fill.model { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar-val {
  font-family: var(--mono);
  font-size: 12.5px;
  text-align: right;
  color: var(--ink);
}
.chart.in .bar-row:last-child .bar-val { color: var(--accent); }
.chart-note {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--ink-2);
  opacity: .8;
}

/* ── gameplay clip + hardware photos ──────────────────────── */

.clip { margin: 26px 0 14px; }
.clip video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #05070C;
}
.clip figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-2);
}


.shots { margin: 26px 0; }
.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.shot {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  color: var(--ink-2);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.shot:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-3px); }
.shot img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: #05070C;
}
.shot figcaption {
  padding: 10px 13px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: .02em;
  color: var(--ink-2);
}
.shots-note {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-2);
  opacity: .75;
}

/* ── game ─────────────────────────────────────────────────── */

.game {
  margin: 26px 0 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.game-hud {
  display: flex;
  gap: 22px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--ink-2);
}
.game-hud b { color: var(--accent); font-weight: 700; }
.hud-tag {
  margin-right: auto;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 100px;
  letter-spacing: .04em;
  text-transform: none;
  opacity: .9;
}

.game-stage { position: relative; background: #05070C; }
#galaga {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  outline: none;
  touch-action: none;
}

.game-start, .game-over {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: color-mix(in srgb, #05070C 78%, transparent);
  color: var(--ink);
  font-family: var(--sans);
  cursor: pointer;
  backdrop-filter: blur(2px);
}
.game-start .play {
  display: grid; place-items: center;
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 17px;
  padding-left: 4px;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.game-start:hover .play { transform: scale(1.08); background: var(--accent); color: var(--bg); }
.play-label { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.play-hint  { font-family: var(--mono); font-size: 11px; color: var(--ink-2); text-align: center; }
.play-hint.touch { display: none; }
@media (hover: none) {
  .play-hint.keys  { display: none; }
  .play-hint.touch { display: block; }
}
.game-start[hidden], .game-over[hidden] { display: none; }

.game-over { cursor: default; gap: 12px; }
.game-over p { margin: 0; font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -0.02em; }
.game-over .go-score { font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--accent); }

.game-pad {
  display: none;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}
.game-pad button {
  flex: 1;
  padding: 14px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: 600 13px/1 var(--mono);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.game-pad button:active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.game > figcaption {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}
.game > figcaption b { color: var(--ink); }

/* ── accordion ────────────────────────────────────────────── */

.acc { border-top: 1px solid var(--line); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-head {
  display: grid;
  grid-template-columns: 160px 1fr 24px;
  align-items: center;
  gap: 24px;
  width: 100%;
  padding: 26px 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
  transition: padding-left .3s var(--ease);
}
.acc-head:hover { padding-left: 12px; }
.acc-when {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.acc-what { display: flex; flex-direction: column; gap: 2px; }
.acc-what b {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.acc-what em { font-style: normal; font-size: 13.5px; color: var(--ink-2); }
.acc-mark {
  position: relative;
  width: 16px; height: 16px;
  justify-self: end;
}
.acc-mark::before, .acc-mark::after {
  content: "";
  position: absolute;
  background: var(--accent);
  transition: transform .35s var(--ease), opacity .35s var(--ease);
}
.acc-mark::before { inset: 7px 0 7px 0; height: 2px; }
.acc-mark::after  { inset: 0 7px 0 7px; width: 2px; }
.acc-item[data-open="true"] .acc-mark::after { transform: scaleY(0); opacity: 0; }

/* One child only: a grid row of 0fr collapses the first row, and any extra
   children would land in auto-sized implicit rows and stay visible. */
.acc-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .4s var(--ease);
}
.acc-item[data-open="true"] .acc-body { grid-template-rows: 1fr; }
.acc-inner { overflow: hidden; min-height: 0; }
.acc-body p {
  color: var(--ink-2);
  max-width: 62ch;
  margin-left: 184px;
}
.acc-body p:first-child { padding-top: 2px; }
.acc-body p:last-child { padding-bottom: 30px; margin-bottom: 0; }

/* ── skills ───────────────────────────────────────────────── */

.skills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.skill {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 22px;
  background: color-mix(in srgb, var(--surface) 45%, transparent);
  transition: transform .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.skills:hover .skill { opacity: .55; }
.skills .skill:hover {
  opacity: 1;
  transform: translateY(-6px);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.skill h3 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
}
.skill ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.skill li { font-size: 14.5px; color: var(--ink-2); }

/* ── school ───────────────────────────────────────────────── */

.school { display: grid; gap: 44px; }
.school-lead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.degree {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  letter-spacing: -0.03em;
  line-height: 1.14;
  margin: 0;
}
.degree span { font-size: 15px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }

.facts { display: flex; gap: 36px; margin: 0; }
.facts dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.facts dd {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.school-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 44px; }
.school-cols h3 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.school-cols h3.mt { margin-top: 30px; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
ul.plain li {
  font-size: 15px;
  color: var(--ink-2);
  padding-left: 16px;
  position: relative;
}
ul.plain li::before {
  content: "";
  position: absolute; left: 0; top: 10px;
  width: 6px; height: 1px;
  background: var(--accent);
}
ul.plain li span {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  opacity: .8;
  margin-left: 6px;
}

/* ── contact ──────────────────────────────────────────────── */

.contact { padding-bottom: 90px; }
.display.big {
  font-size: clamp(3.4rem, 11vw, 8rem);
  margin-bottom: 22px;
  background: linear-gradient(150deg, var(--ink) 35%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.contact-lead {
  font-size: 19px;
  color: var(--ink-2);
  max-width: 52ch;
  margin-bottom: 40px;
}

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ccard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 45%, transparent);
  color: var(--ink);
  transition: transform .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.ccard:hover {
  text-decoration: none;
  transform: translateY(-4px);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.cc-k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.cc-v { font-size: 15px; font-weight: 500; word-break: break-word; }

/* ── footer ───────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 46px;
}
.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--ink-2);
}
.foot p { margin: 0; }

/* ── reveal ───────────────────────────────────────────────── */

.r {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.r.in { opacity: 1; transform: none; }

/* ── responsive ───────────────────────────────────────────── */

@media (max-width: 1040px) {
  .hero-inner { grid-template-columns: 1fr; gap: 34px; }
  .hero-text { max-width: none; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .cards  { grid-template-columns: repeat(2, 1fr); }
  .school-cols { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 820px) {
  .topbar { padding: 12px 20px; gap: 14px; }
  .menu { display: grid; }

  /* Nav becomes a panel under the bar. */
  .topbar nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: 6px 20px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .22s var(--ease), transform .22s var(--ease);
  }
  .topbar nav.open { opacity: 1; transform: none; pointer-events: auto; }
  .topbar nav a {
    padding: 13px 0;
    font-size: 16px;
    border-bottom: 1px solid var(--line);
  }
  .topbar nav a::after { display: none; }
  .wrap, .hero { padding-inline: 20px; }

  .proj { grid-template-columns: 1fr; gap: 14px; padding: 36px 0; }
  .proj-side { position: static; flex-direction: row; align-items: baseline; gap: 12px; }
  .idx { font-size: 26px; }
  .pair { grid-template-columns: 1fr; }

  .states { grid-template-columns: repeat(2, 1fr); }
  .loop-tabs { grid-template-columns: repeat(2, 1fr); }
  .loop-tabs button:nth-child(2) { border-right: 0; }
  .loop-tabs button:nth-child(-n+2) { border-bottom: 1px solid var(--line); }

  .acc-head { grid-template-columns: 1fr 24px; gap: 8px 16px; padding: 22px 4px; }
  .acc-when { grid-column: 1 / -1; }
  .acc-body p { margin-left: 0; }

  .bar-row { grid-template-columns: 1fr; gap: 6px; }
  .bar-val { text-align: left; }

  .game-pad { display: flex; }
  .shot-grid { grid-template-columns: 1fr; }
  .shot img { height: 210px; }
  .game-hud { flex-wrap: wrap; gap: 8px 16px; }
  .hud-tag { flex-basis: 100%; margin-right: 0; text-align: center; }
  .section { padding: 74px 0; }
  .sec-head { margin-bottom: 38px; }
  .facts { gap: 24px; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .skills, .cards { grid-template-columns: 1fr; }
  .states { grid-template-columns: 1fr 1fr; }
  h1.display { font-size: clamp(3.4rem, 19vw, 6rem); }
  .picker { padding: 18px; }
}

/* ── reduced motion ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .r { opacity: 1; transform: none; transition: none; }
  .chart .bar-fill { transition: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .08s !important;
  }
}

/* ── print ────────────────────────────────────────────────── */

@media print {
  body { background: #fff; color: #000; }
  body::before, .topbar, .progress, .hero-canvas,
  .game, .picker { display: none !important; }
  .shot-grid { grid-template-columns: repeat(2, 1fr); }
  .shot { break-inside: avoid; }
  .r { opacity: 1; transform: none; }
  .acc-body { grid-template-rows: 1fr !important; }
  a { color: #000; text-decoration: underline; }
}
