:root {
  color-scheme: light;
  --paper: #f4f6fb;
  --page-blue: #e9effb;
  --page-mint: #edf6f7;
  --ink: #172239;
  --muted: #536179;
  --line: #dce3ef;
  --night: #0d192d;
  --aqua: #abf4ec;
  --panel: #fff;
  --header: #fbfcff;
  --nav-fill: #eff2f8;
  --nav-line: #e4e9f4;
  --nav-ink: #344763;
  --accent: #2156a0;
  --focus: #3166bc;
  --hero-edge: #344c6b;
  --control-line: #ccd7e7;
  --control-ink: #243d5e;
  --control-hover: #eef5ff;
  --control-hover-line: #80a2ca;
  --submit-fill: #1e394f;
  --submit-hover: #2a5272;
  --submit-ink: #fff;
  --journal-accent: #4c6783;
  --takeaway-marker: #217879;
  --surface-rim: #fff;
  --surface-shadow: #193c676c;
  --step-blue: #e1efff;
  --step-blue-edge: #89a8c9;
  --step-blue-ink: #264a73;
  --step-violet: #eee6ff;
  --step-violet-edge: #a899d5;
  --step-violet-ink: #543e7a;
  --step-mint: #daf5e9;
  --step-mint-edge: #74b6a5;
  --step-mint-ink: #235b51;
  --lessons-edge: #cbdce7;
  --lessons-mint: #d5f5ef;
  --lessons-blue: #edf4ff;
  --math-edge: #bfdcd7;
  --math-ink: #345d66;
  --math-chip: #c7eae0;
  --math-glow: #d3f1e9;
  --math-fill: #f8fffd;
  --footer: #edf1f8;
  --field-line: #a2b4cd;
  --alert: #8d2921;
  --sun: #a66318;
  --moon: #596889;
  --mono: "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .72, .25, 1);
  font-family: "Segoe UI", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0a1120;
  --page-blue: #1b2442;
  --page-mint: #10282e;
  --ink: #edf3ff;
  --muted: #b8c6db;
  --line: #32435d;
  --panel: #131e31;
  --header: #10192a;
  --nav-fill: #192438;
  --nav-line: #30415b;
  --nav-ink: #d0def2;
  --accent: #a9d7ff;
  --focus: #95cfff;
  --hero-edge: #46658a;
  --control-line: #4c6481;
  --control-ink: #d7e9ff;
  --control-hover: #203551;
  --control-hover-line: #83a7d6;
  --submit-fill: #b8edea;
  --submit-hover: #ddfffa;
  --submit-ink: #142c3b;
  --journal-accent: #adc9e6;
  --takeaway-marker: #84d9cd;
  --surface-rim: #a9ceff20;
  --surface-shadow: #0009;
  --step-blue: #243a59;
  --step-blue-edge: #557ca6;
  --step-blue-ink: #c5e2ff;
  --step-violet: #322948;
  --step-violet-edge: #8268b0;
  --step-violet-ink: #e5d7ff;
  --step-mint: #1c3b3c;
  --step-mint-edge: #427c77;
  --step-mint-ink: #b0f1df;
  --lessons-edge: #3a586b;
  --lessons-mint: #1d3a42;
  --lessons-blue: #1a2b46;
  --math-edge: #41676c;
  --math-ink: #b6dedf;
  --math-chip: #244747;
  --math-glow: #24494d;
  --math-fill: #132a31;
  --footer: #101b2d;
  --field-line: #58708d;
  --alert: #ffbeb5;
  --sun: #ffd18b;
  --moon: #b6caff;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 1.25rem; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse 60rem 48rem at 93% 26rem, var(--page-blue), transparent 78%),
    radial-gradient(ellipse 56rem 62rem at 0% 84rem, var(--page-mint), transparent 74%),
    var(--paper);
  color: var(--ink);
  line-height: 1.55;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: .24em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
.wrap { width: min(100% - 5rem, 75rem); margin-inline: auto; }
.skip { position: absolute; z-index: 3; top: .75rem; left: .75rem; padding: .6rem 1rem; background: var(--panel); transform: translateY(-250%); }
.skip:focus { transform: none; }

.site-header { background: var(--header); border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  min-height: 4.5rem;
  padding-block: .65rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .62rem;
  font-size: 1.09rem;
  font-weight: 750;
  letter-spacing: -.027em;
  text-decoration: none;
}
.header-tools { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.theme-toggle {
  flex: none;
  width: 2.75rem;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--nav-line);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--panel), var(--nav-fill));
  box-shadow: inset 0 1px var(--surface-rim);
  transition: border-color .2s;
}
.theme-toggle:hover { border-color: var(--control-hover-line); }
.theme-icon {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  width: 1.4rem;
  height: 1.4rem;
  margin: auto;
}
.theme-sun {
  color: var(--sun);
  background:
    radial-gradient(circle at 100% 50%, currentColor 0 4.5px, transparent 5px),
    conic-gradient(from 0deg at 100% 50%, transparent 0 194deg, currentColor 194deg 207deg, transparent 207deg 235deg, currentColor 235deg 248deg, transparent 248deg 280deg, currentColor 280deg 293deg, transparent 293deg 326deg, currentColor 326deg 339deg, transparent 339deg);
  mask-image: radial-gradient(circle at 100% 50%, #000 0 5px, transparent 5px 7px, #000 7.5px 10px, transparent 10.5px);
}
.theme-moon {
  background: radial-gradient(circle at 4% 50%, var(--moon) 0 8px, transparent 8.5px);
  mask-image: radial-gradient(circle at 9% 29%, transparent 0 5.6px, #000 6.2px);
}
.brand span {
  display: grid;
  place-items: center;
  min-width: 2.4rem;
  height: 2.15rem;
  padding-inline: .32rem;
  border: 1px solid #395473;
  border-radius: .65rem;
  background: linear-gradient(145deg, #314f72, #15243c 75%);
  box-shadow: inset 0 1px #f0fcff36, 0 2px 0 #0d192d, 0 5px 9px #17284828;
  color: #bef8ee;
  font: bold .92rem/1 var(--mono);
}
nav {
  display: flex;
  flex-wrap: wrap;
  gap: .12rem;
  padding: .23rem;
  border: 1px solid var(--nav-line);
  border-radius: 1.5rem;
  background: var(--nav-fill);
  font-size: .91rem;
  font-weight: 640;
}
nav a {
  display: block;
  padding: .42rem .8rem;
  border-radius: 1rem;
  color: var(--nav-ink);
  text-decoration: none;
  transition: background-color .18s, color .18s;
}
nav a:hover { background: var(--panel); color: var(--accent); }

.hero { padding-top: 1.5rem; }
.hero-inner {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr .94fr;
  align-items: center;
  min-height: 29rem;
  overflow: hidden;
  overflow: clip;
  border: 1px solid var(--hero-edge);
  border-radius: 1.9rem;
  background:
    radial-gradient(ellipse at 82% 33%, #284f7f9c, transparent 53%),
    radial-gradient(ellipse at 72% 105%, #12696a8c, transparent 50%),
    linear-gradient(119deg, #0b1426 4%, #102039 64%, #172942);
  box-shadow: inset 0 1px #b9d4ff33, 0 28px 50px -32px #143156a8, 0 4px 12px #1d35461c;
  color: #f6faff;
}
.hero-copy {
  position: relative;
  z-index: 1;
  padding: clamp(2.45rem, 4vw, 4rem) 0 clamp(2.5rem, 4vw, 4rem) clamp(2rem, 4.5vw, 4.25rem);
}
.eyebrow, .entry-meta, .game-time { font: 600 .875rem/1.45 var(--mono); }
.eyebrow { margin-bottom: 1rem; color: #a9e9e8; letter-spacing: .018em; }
h1 {
  width: fit-content;
  max-width: 100%;
  font-size: clamp(2.65rem, 5.8vw, 5.3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.071em;
}
h1 em { color: #aef6ee; font-style: normal; }
@supports (background-clip: text) {
  h1 em {
    background: linear-gradient(115deg, #b7fff0, #82cfff 28%, #f3faff 46%, #c2a6ff 59%, #90f3dd 78%, #b7fff0);
    background-size: 280% 100%;
    background-clip: text;
    color: transparent;
  }
}
.ai-word { position: relative; display: inline-block; }
.ai-word::after {
  position: absolute;
  inset: auto 2% -.11em;
  height: 2px;
  border-radius: 100px;
  background: linear-gradient(90deg, #82cfff00, #9eeedf, #b3a1ff, #82cfff00);
  box-shadow: 0 0 10px #9cf4efad;
  opacity: 0;
  transform: scaleX(.36);
  transition: opacity .3s, transform .45s var(--ease);
  content: "";
}
h1:hover .ai-word { filter: drop-shadow(0 0 .38em #85dced78); }
h1:hover .ai-word::after { opacity: .95; transform: scaleX(1); }
.intro {
  max-width: 44ch;
  margin-block: 1.3rem 1.6rem;
  color: #d4e1f3;
  font-size: 1.06rem;
  line-height: 1.62;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero :focus-visible { outline-color: #a3e9ff; }
.hero-ambient {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}
.ambient-glow {
  position: absolute;
  inset: -8% -9% -27% 30%;
  background:
    radial-gradient(ellipse at 65% 75%, #24cecf36, transparent 53%),
    radial-gradient(ellipse at 86% 18%, #7178f048, transparent 48%);
  opacity: .65;
}
.ambient-particle {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--size, 4px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #b5fbf8;
  box-shadow: 0 0 8px 1px #8fefff91;
  opacity: .51;
}
.ambient-particle:nth-child(3n) { background: #c9b8ff; box-shadow: 0 0 9px 1px #a990ff8f; }
.ambient-toggle {
  position: absolute;
  z-index: 2;
  top: .8rem;
  right: .8rem;
  width: 2.75rem;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #b2cfff55;
  border-radius: 50%;
  background: #122840bd;
  color: #dcf7ff;
}
.ambient-toggle:hover { background: #2b4d6d; }
.ambient-toggle::before {
  display: block;
  width: .72rem;
  height: .75rem;
  margin: auto;
  background: linear-gradient(90deg, currentColor 33%, transparent 33% 67%, currentColor 67%);
  content: "";
}
.hero[data-ambient-paused] .ambient-toggle::before {
  background: currentColor;
  clip-path: polygon(15% 0, 100% 50%, 15% 100%);
}

.hero-art {
  position: relative;
  align-self: stretch;
  min-width: 0;
  perspective: 1000px;
  perspective-origin: 49% 44%;
}
.hero-art::before, .hero-art::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}
.hero-art::before {
  background:
    radial-gradient(circle at 73% 22%, #ffc79556, transparent 34%),
    radial-gradient(ellipse at 30% 67%, #6df2ed58, transparent 52%);
  mask-image: linear-gradient(90deg, transparent, #000 22%);
}
.hero-art::after {
  z-index: -1;
  inset: 45% -25% -45% -40%;
  background:
    linear-gradient(#c0e6ff30 1px, transparent 1px),
    linear-gradient(90deg, #c0e6ff30 1px, transparent 1px);
  background-size: 27px 27px;
  mask-image: radial-gradient(ellipse, #000b, transparent 69%);
  transform: rotateX(56deg) rotateZ(-18deg);
}
.art-stage {
  position: absolute;
  inset: 12% 13% 14% 7%;
  transform-style: preserve-3d;
  transform: rotateX(calc(11deg + var(--tilt-x, 0deg))) rotateY(calc(-15deg + var(--tilt-y, 0deg))) rotateZ(3deg);
  transition: transform .48s var(--ease);
}
.art-window, .art-plate {
  position: absolute;
  inset: 1% 0 auto;
  width: 100%;
  border-radius: clamp(.8rem, 2vw, 1.35rem);
}
.art-plate {
  aspect-ratio: 1.48;
  border: 1px solid #9ab9dd80;
  background:
    linear-gradient(115deg, #9eeff047, transparent 45%, #ffc09745),
    linear-gradient(156deg, #37597c, #13253d 77%);
  box-shadow: inset 0 2px #c8ebff38, 0 7px 0 #152942, 0 19px 36px #081424a1;
}
.art-plate-back { transform: translate3d(18px, 48px, -36px); }
.art-plate-middle { transform: translate3d(-4px, 24px, 0); }
.art-window {
  overflow: hidden;
  border: 1px solid #accee1bd;
  background: #122b35;
  box-shadow: inset 0 1px #e1fbffb3, 0 5px 0 #1c3856, 0 19px 34px #060d2099;
  transform: translateZ(36px);
}
.art-window::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 22px #a5f2ff21;
  background: linear-gradient(120deg, #e6f7ff20, transparent 45%, #97d7fe12 71%, #ffdcb72a);
  pointer-events: none;
  content: "";
}
.art-bar {
  display: flex;
  align-items: center;
  gap: .4rem;
  min-height: 1.95rem;
  padding-inline: .9rem;
  border-bottom: 1px solid #8facc77a;
  background: linear-gradient(115deg, #274767, #1a2d45 72%, #655857);
}
.art-bar i { width: .45rem; aspect-ratio: 1; border-radius: 50%; background: #99b4cb; }
.art-bar i:first-child { background: #a1faed; box-shadow: 0 0 10px #a1faed; }
.art-bar i:last-child { background: #eac19c; }
#scene { display: block; width: 100%; height: auto; filter: hue-rotate(48deg) saturate(.91); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .48rem;
  min-height: 2.85rem;
  padding: .55rem 1.08rem;
  border: 1px solid transparent;
  border-radius: 100px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .22s var(--ease), background-color .18s, border-color .18s;
}
.button-bright {
  border-color: #d5fffa;
  background: linear-gradient(150deg, #eefffb, #b6eeef);
  box-shadow: inset 0 1px #fff, 0 2px 0 #72b6c1, 0 10px 24px #02091566;
  color: #153646;
}
.button-bright:hover { background: #e7fffa; }
.button-hero-outline { border-color: #91b3da75; background: #a9ccf916; color: #eef6ff; }
.button-hero-outline:hover { border-color: #b8dbffd0; background: #a9ccf933; }
.button-outline { border-color: var(--control-line); background: var(--panel); color: var(--control-ink); }
.button-outline:hover { border-color: var(--control-hover-line); background: var(--control-hover); }
.button-dark { background: var(--submit-fill); color: var(--submit-ink); }
.button-dark:hover { background: var(--submit-hover); }
.button span { font-size: 1.25rem; line-height: 1; }
.text-button, .close { background: transparent; color: inherit; border: 0; }
.text-button { padding: .25rem 0; text-decoration: underline; text-underline-offset: .25em; font-weight: 650; }
.text-button:hover { color: var(--accent); }

.section { padding-block: clamp(2.5rem, 5.2vw, 4.25rem); border-bottom: 1px solid var(--line); }
.section:last-child { border: 0; }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.4rem; }
.section h2 { font-size: clamp(2.05rem, 4.1vw, 3.15rem); letter-spacing: -.054em; line-height: 1.06; }
.section-header p { color: var(--muted); margin-top: .56rem; }
.project-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.75rem, 2vw, 1.2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.project-steps > li { display: grid; }
.project-step {
  display: block;
  padding: clamp(1.1rem, 2.5vw, 1.65rem);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: radial-gradient(ellipse at 96% 1%, var(--step-light), transparent 70%), var(--panel);
  box-shadow: inset 0 1px var(--surface-rim), 0 16px 28px -23px var(--surface-shadow);
  text-decoration: none;
  transition: transform .3s var(--ease), border-color .2s;
}
.project-step:is(:hover, :focus-visible) { border-color: var(--step-edge); }
.step-journal { --step-light: var(--step-blue); --step-edge: var(--step-blue-edge); --step-ink: var(--step-blue-ink); }
.step-game { --step-light: var(--step-violet); --step-edge: var(--step-violet-edge); --step-ink: var(--step-violet-ink); }
.step-math { --step-light: var(--step-mint); --step-edge: var(--step-mint-edge); --step-ink: var(--step-mint-ink); }
.step-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  aspect-ratio: 1;
  margin-bottom: .95rem;
  border: 1px solid var(--step-edge);
  border-radius: .7rem;
  background: linear-gradient(145deg, var(--panel), var(--step-light));
  box-shadow: 0 2px 0 var(--step-edge);
  color: var(--step-ink);
  font: 750 1rem/1 var(--mono);
}
.project-step h3 { margin-bottom: .36rem; font-size: 1.23rem; line-height: 1.2; letter-spacing: -.025em; }
.project-step p { color: var(--muted); line-height: 1.52; }
.entries { display: grid; gap: .8rem; }
.entry {
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: var(--panel);
  box-shadow: 0 15px 24px -18px #18355949, 0 2px 5px #1835590a;
}
.entry summary { position: relative; list-style: none; cursor: pointer; padding: 1.25rem 3.65rem 1.25rem 1.35rem; border-radius: 1.1rem; transition: background-color .2s; }
.entry summary::-webkit-details-marker { display: none; }
.entry summary::after { position: absolute; right: 1.35rem; top: 50%; transform: translateY(-50%); content: "+"; font: 500 1.6rem/1 var(--mono); color: var(--journal-accent); }
.entry details[open] summary::after { content: "−"; }
.entry summary:hover { background: var(--control-hover); }
.entry-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; color: var(--journal-accent); }
.entry-title { display: block; margin-top: .35rem; font-size: 1.26rem; font-weight: 750; }
.entry-content { margin: 0 1.35rem; padding: 1rem 0 0; border-top: 1px solid var(--line); }
.entry-content dt { font-weight: 700; }
.entry-content dd { margin: .1rem 0 .75rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry-content .empty { color: var(--muted); font-style: italic; }
.entry-actions { padding: 0 1.35rem 1rem; }
.journal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: .75rem; color: var(--muted); font-size: .94rem; }
.lessons {
  margin-top: clamp(2rem, 5vw, 3.75rem);
  padding: clamp(1.35rem, 3.7vw, 2.65rem);
  border: 1px solid var(--lessons-edge);
  border-radius: 1.35rem;
  background: radial-gradient(ellipse at 95% 0%, var(--lessons-mint), transparent 61%), linear-gradient(130deg, var(--panel), var(--lessons-blue));
  box-shadow: inset 0 1px var(--surface-rim), 0 16px 30px -25px var(--surface-shadow);
}
.lessons .section-header { margin-bottom: 1.1rem; }
.takeaways { margin: 0; padding-left: 1.4rem; }
.takeaways li { margin: .5rem 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.takeaways li::marker { color: var(--takeaway-marker); }
.empty-takeaways { color: var(--muted); margin: 0; }
.takeaways:has(.empty-takeaways) { padding-left: 0; list-style: none; }

.games { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: clamp(.85rem, 2vw, 1.3rem); }
.game {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: .55rem;
  border: 1px solid var(--game-edge);
  border-radius: 1.45rem;
  box-shadow: inset 0 1px #ffffff3b, 0 23px 35px -24px #18355963, 0 3px 7px #18355913;
  transition: transform .38s var(--ease), border-color .2s;
}
.game-playable {
  --game-edge: #38466b;
  --game-muted: #d2dbf3;
  --game-chip: #b7b8ff26;
  --art-fallback: #243453;
  background: radial-gradient(ellipse at 100% 30%, #334574, transparent 65%), #151d35;
  color: #f6f7ff;
  text-decoration: none;
}
.game-playable:hover { border-color: #8d9ce1; }
.game-playable:focus-visible { outline-offset: 5px; }
.game-playable:is(:hover, :focus-visible) .game-action { background: #f1edff; color: #273255; }
.game-math {
  --game-edge: var(--math-edge);
  --game-muted: var(--math-ink);
  --game-chip: var(--math-chip);
  --art-fallback: #b3dcd5;
  background: radial-gradient(ellipse at 100% 30%, var(--math-glow), transparent 74%), var(--math-fill);
}
.game-art {
  position: relative;
  overflow: hidden;
  height: clamp(11rem, 24vw, 19rem);
  border: 1px solid #ffffff38;
  border-radius: 1rem;
  background: var(--art-fallback);
}
.game-art::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(141deg, #e2f7ff23, transparent 36%);
  box-shadow: inset 0 1px #ffffff65, inset 0 -7px 26px #17213917;
  pointer-events: none;
  content: "";
}
.game-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 51%;
  transform: perspective(700px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) scale(var(--art-scale, 1.018));
  transition: transform .54s var(--ease);
}
.game-math .game-image { object-position: center 48%; }
.game-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(1.05rem, 2.4vw, 1.8rem);
}
.game-time {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: .15rem .56rem;
  border-radius: 100px;
  background: var(--game-chip);
  color: var(--game-muted);
}
.game h3 { margin-block: .62rem .42rem; font-size: clamp(1.55rem, 3vw, 2.32rem); line-height: 1.1; letter-spacing: -.05em; }
.game p:last-of-type { max-width: 47ch; margin-bottom: .8rem; color: var(--game-muted); }
.game-action {
  display: inline-flex;
  align-items: center;
  min-height: 2.65rem;
  margin-top: auto;
  padding: .38rem .9rem;
  border: 1px solid #b7b8f573;
  border-radius: 100px;
  background: #b8bdf52c;
  color: #f3f2ff;
  font-weight: 700;
  transition: background-color .2s, color .2s;
}

.site-footer { border-top: 1px solid var(--line); background: var(--footer); color: var(--nav-ink); font-size: .94rem; }

dialog {
  width: min(42rem, calc(100% - 1.5rem));
  max-height: 92dvh;
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1px solid var(--control-line);
  border-radius: 1.3rem;
  background: var(--panel);
  box-shadow: 0 24px 80px #0b183959;
  color: var(--ink);
}
dialog::backdrop { background: #14223bbf; }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.editor-heading h2 { font-size: 1.6rem; }
.close {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: 50%;
  background: var(--nav-fill);
  font-size: 1.7rem;
  line-height: 1;
}
.close:hover { background: var(--control-hover); }
#entry-form > p { margin-block: .65rem 1rem; color: var(--muted); }
.editor-meta { display: grid; grid-template-columns: 1fr auto; gap: .9rem; }
#entry-form label { display: grid; gap: .3rem; padding-bottom: .85rem; font-weight: 650; }
#entry-form input, #entry-form textarea {
  width: 100%;
  padding: .5rem .65rem;
  border: 1px solid var(--field-line);
  border-radius: .6rem;
  background: var(--header);
  color: var(--ink);
  font-weight: 400;
}
#entry-form textarea { resize: vertical; }
#entry-form .form-feedback:empty { display: none; }
#entry-form .form-feedback { color: var(--alert); }
.editor-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: .65rem; }

@media (max-width: 62rem) {
  .wrap { width: calc(100% - 3rem); }
  .hero-inner { min-height: 27rem; }
  .art-stage { inset: 18% 10% 11% 6%; }
}

@media (max-width: 47rem) {
  .wrap { width: min(100% - 2rem, 38rem); }
  .header-inner { position: relative; align-items: start; flex-direction: column; gap: .65rem; padding-block: .85rem; }
  .header-inner .brand { min-height: 2.75rem; }
  .header-tools { display: contents; }
  .theme-toggle { position: absolute; top: .85rem; right: 0; }
  nav a { padding-inline: .56rem; }
  .hero { padding-top: 1rem; }
  .hero-inner { grid-template-columns: 1fr; border-radius: 1.45rem; }
  .hero-copy { padding: 2.25rem clamp(1.25rem, 4.5vw, 2.65rem) 0; }
  h1 { font-size: clamp(2.3rem, 8.7vw, 4.25rem); }
  .hero-art { width: min(100%, 29rem); min-height: clamp(14rem, 65vw, 20.5rem); justify-self: center; }
  .art-stage { inset: 13% 14% 11% 10%; }
  .section-header { flex-wrap: wrap; align-items: start; }
  .project-steps { grid-template-columns: 1fr; }
  .games { grid-template-columns: 1fr; }
  .game-art { height: auto; aspect-ratio: 1.77; }
}

@media (max-width: 27rem) {
  .editor-meta { grid-template-columns: 1fr; gap: 0; }
  .art-plate-back { transform: translate3d(13px, 35px, -30px); }
}

@media screen and (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .hero-copy { animation: intro-in .65s var(--ease) both; }
  .hero-art { animation: scene-in .85s var(--ease) both; }
  .ambient-glow { animation: ambient-drift 15s ease-in-out infinite alternate paused; }
  .ambient-particle { animation: float-particle 11s ease-in-out var(--phase) infinite alternate paused; }
  .hero[data-ambient-active]:not([data-ambient-paused]) .hero-ambient > * { animation-play-state: running; }
  [data-reveal-state="waiting"]:not(:focus-within) { opacity: 0; translate: 0 16px; }
  [data-reveal-state="shown"] { animation: reveal-section .56s var(--ease) both; }
  .project-steps > li:nth-child(2)[data-reveal-state="shown"] { animation-delay: .07s; }
  .project-steps > li:nth-child(3)[data-reveal-state="shown"] { animation-delay: .14s; }
  .game-math[data-reveal-state="shown"] { animation-delay: .09s; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .button-bright:hover { transform: translateY(-3px); }
  h1:hover .ai-word { animation: ai-gradient 2.6s ease-in-out infinite alternate; }
  .project-step:hover { transform: translateY(-4px); }
  .game-playable:hover { transform: translateY(-4px); }
  .game-art:hover .game-image { --art-scale: 1.075; }
}
@keyframes intro-in {
  from { opacity: .65; transform: translateY(13px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scene-in {
  from { opacity: .2; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ai-gradient {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}
@keyframes ambient-drift {
  from { transform: translate3d(-7%, 3%, 0) scale(.94); opacity: .58; }
  to { transform: translate3d(6%, -6%, 0) scale(1.1); opacity: .93; }
}
@keyframes float-particle {
  from { transform: translate3d(-8px, 16px, 0) scale(.72); opacity: .27; }
  to { transform: translate3d(14px, -14px, 0) scale(1.24); opacity: .86; }
}
@keyframes reveal-section {
  from { opacity: 0; translate: 0 16px; }
  to { opacity: 1; translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
@media (forced-colors: active) {
  h1 em { color: CanvasText; }
}

.motion-heading { position: relative; isolation: isolate; width: fit-content; }
.heading-effect {
  position: absolute;
  display: grid;
  place-content: center;
  inset: 50% auto auto .55em;
  width: .95em;
  height: .95em;
  color: var(--accent);
  opacity: 0;
  transform: translateY(-56%) scale(.8) rotate(-15deg);
  pointer-events: none;
  z-index: -1;
  transition: opacity .25s, transform .48s var(--ease);
}
.motion-heading:hover .heading-effect {
  opacity: .26;
  transform: translateY(-58%) scale(1.15) rotate(10deg);
}
.heading-question {
  font: 800 2em/.8 var(--mono);
  text-shadow: 0 0 .25em currentColor;
}
.heading-notes {
  gap: .08em;
  border: .055em solid;
  border-radius: .12em;
  box-shadow: -.12em .12em 0 -.025em currentColor;
}
.heading-notes i {
  width: .49em;
  height: .044em;
  background: currentColor;
  transform-origin: left;
}
.heading-notes i:last-child { width: .32em; }
.heading-pad {
  grid-auto-flow: column;
  align-items: center;
  gap: .22em;
  width: 1.55em;
  height: .87em;
  border: .075em solid;
  border-radius: .36em .36em .5em .5em;
}
.heading-pad i:first-child { font: 800 .7em/1 var(--mono); }
.heading-pad i:last-child {
  width: .13em;
  height: .13em;
  border-radius: 50%;
  background: currentColor;
  box-shadow: .16em -.13em currentColor;
}
.void-energy, .math-calculation {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.void-energy {
  opacity: 0;
  background: radial-gradient(ellipse at 62% 61%, #bf7dff3d, transparent 57%);
  box-shadow: inset 0 0 26px #9e83ff96;
  transition: opacity .35s;
}
.game-playable:is(:hover, :focus-visible) .void-energy { opacity: 1; }
.void-energy i {
  position: absolute;
  top: var(--height);
  left: 12%;
  width: clamp(2.8rem, 12vw, 9rem);
  height: 2px;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, #ac80ff 65%, #faf7ff);
  box-shadow: 0 0 10px #9e73ff;
  opacity: 0;
}
.void-energy i:nth-child(1) { --height: 24%; --delay: 0ms; }
.void-energy i:nth-child(2) { --height: 42%; --delay: 80ms; }
.void-energy i:nth-child(3) { --height: 64%; --delay: 150ms; }
.void-energy i:nth-child(4) { --height: 79%; --delay: 215ms; }
.math-calculation i {
  position: absolute;
  padding: .42em .68em;
  border: 1px solid #a3f0d7a6;
  border-radius: .6em;
  background: #102d29ef;
  color: #ddfff2;
  box-shadow: 0 4px 16px #0a2b2970;
  font: 700 clamp(.8rem, 2vw, 1.05rem)/1 var(--mono);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px) scale(.9);
  transition: opacity .2s, transform .36s var(--ease);
}
.math-calculation i:nth-child(1) { top: 13%; left: 8%; --delay: 0ms; }
.math-calculation i:nth-child(2) { top: 30%; right: 9%; --delay: 135ms; }
.math-calculation i:nth-child(3) { bottom: 15%; right: 18%; --delay: 270ms; background: #c3fbe7; color: #103f34; }
.game-math:hover .math-calculation i {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: no-preference) {
  .motion-heading:hover .heading-notes i { animation: note-line .4s var(--ease) both; }
  .heading-notes i:nth-child(2) { animation-delay: .08s !important; }
  .heading-notes i:nth-child(3) { animation-delay: .16s !important; }
  .game-playable:is(:hover, :focus-visible) .void-energy i {
    animation: void-streak .78s var(--ease) var(--delay) both;
  }
  .game-math:hover .math-calculation i { transition-delay: var(--delay); }
}
@keyframes note-line {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes void-streak {
  0% { opacity: 0; transform: translate(-30%, 55px) rotate(-19deg) scaleX(.2); }
  34% { opacity: 1; }
  100% { opacity: 0; transform: translate(250%, -55px) rotate(-19deg) scaleX(1.6); }
}
