:root {
  --ink: #071426;
  --ink-soft: #0d1f38;
  --panel: #111e34;
  --panel-light: #172944;
  --line: rgba(174, 213, 255, .15);
  --text: #f7fbff;
  --muted: #aebbd0;
  --aqua: #70e3d0;
  --coral: #ff6d73;
  --gold: #ffd372;
  --pink: #ff9ab8;
  --purple: #aa96ff;
  --green: #a2efb1;
  --shadow: 0 22px 60px rgba(0, 0, 0, .2);
  --radius-lg: 28px;
  --radius-md: 18px;
  --shell: min(1180px, calc(100% - 48px));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--ink);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 74% 6%, rgba(42, 135, 172, .15), transparent 33%), radial-gradient(circle at 5% 70%, rgba(126, 70, 142, .12), transparent 32%);
  z-index: -2;
}
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.shell { width: var(--shell); margin-inline: auto; }

.site-header {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 2;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 2px solid var(--aqua);
  border-radius: 12px 12px 12px 3px;
  color: var(--aqua);
  font-size: 1.35rem;
  font-weight: 900;
  transform: rotate(-7deg);
}
.brand-kicker, .eyebrow {
  display: block;
  color: var(--aqua);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.brand-name {
  display: block;
  margin-top: -2px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.header-note, .header-back { color: var(--muted); font-size: .88rem; text-decoration: none; }
.header-back:hover { color: var(--text); }
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 0 5px rgba(112, 227, 208, .1);
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.03; letter-spacing: -.045em; }
h1 { font-size: clamp(3.2rem, 7vw, 6.3rem); margin-bottom: 24px; }
h2 { font-size: clamp(2rem, 4vw, 3.45rem); margin-bottom: 18px; }
h3 { font-size: 1.25rem; margin: 30px 0 14px; }
h1 em, h2 em { color: var(--aqua); font-style: normal; }
.hero-lead {
  max-width: 590px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.24rem);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button-ghost { border-color: rgba(112, 227, 208, .4); color: var(--aqua); }
.button-ghost:hover { border-color: var(--aqua); background: rgba(112, 227, 208, .08); }
.button-primary { background: var(--aqua); color: var(--ink); }

.ambient {
  position: absolute;
  width: 28vw;
  height: 28vw;
  min-width: 240px;
  min-height: 240px;
  border-radius: 50%;
  filter: blur(10px);
  opacity: .35;
  pointer-events: none;
}
.ambient-one { top: 3%; right: -9%; background: #104e70; }
.ambient-two { top: 46%; left: -12%; background: #40285e; }

.hub-hero {
  min-height: 500px;
  display: grid;
  grid-template-columns: 1fr .85fr;
  align-items: center;
  gap: 50px;
  padding: 70px 0 74px;
}
.hero-illustration, .tutorial-hero-art { position: relative; filter: drop-shadow(0 28px 48px rgba(0, 0, 0, .2)); }
.hero-illustration svg, .tutorial-hero-art svg { display: block; width: 100%; height: auto; }
.hub-content { padding: 24px 0 90px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 26px;
}
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { max-width: 250px; margin-bottom: 6px; color: var(--muted); text-align: right; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.project-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(17, 30, 52, .88);
  box-shadow: var(--shadow);
  transition: transform .25s ease, border-color .25s ease;
}
.project-card-link { display: block; color: inherit; text-decoration: none; }
.project-card-link:focus-visible { outline-offset: 7px; }
.project-card:hover:not(.is-coming) { transform: translateY(-6px); border-color: rgba(112, 227, 208, .55); }
.card-art { margin: 14px 14px 0; overflow: hidden; border-radius: 19px; background: #102f58; }
.card-art svg, .card-art-image { display: block; width: 100%; height: auto; }
.card-body { padding: 24px 24px 26px; }
.card-topline, .progress-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-number { color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .12em; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.tag-live { background: rgba(162, 239, 177, .13); color: var(--green); }
.tag-link { background: rgba(112, 227, 208, .12); color: var(--aqua); }
.tag-soon { background: rgba(174, 187, 208, .11); color: var(--muted); }
.project-card h3 { margin: 20px 0 8px; font-size: 1.46rem; }
.project-card p { min-height: 52px; margin-bottom: 20px; color: var(--muted); font-size: .92rem; }
.card-link { display: inline-flex; align-items: center; gap: 8px; color: var(--aqua); font-size: .86rem; font-weight: 800; text-decoration: none; }
.card-coral .card-link { color: var(--coral); }
.card-gold .card-link { color: var(--gold); }
.card-pink .card-link { color: var(--pink); }
.card-purple .card-link { color: var(--purple); }
.card-link:hover { text-decoration: underline; }
.card-link-disabled { color: var(--muted); cursor: default; }
.is-coming { opacity: .86; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0 35px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}
.site-footer a { color: var(--aqua); text-decoration: none; }

.tutorial-page { background: linear-gradient(180deg, #071426 0%, #0a1b32 100%); }
.tutorial-header { border-bottom: 1px solid var(--line); }
.tutorial-main { padding-bottom: 76px; }
.tutorial-hero {
  display: grid;
  grid-template-columns: 1fr .74fr;
  align-items: center;
  gap: 60px;
  padding: 72px 0 80px;
}
.tutorial-hero h1 { margin-bottom: 20px; }
.tutorial-meta { display: flex; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: .78rem; }
.tutorial-meta span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; }
.tutorial-hero-art svg { border-radius: 28px; }
.tutorial-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 58px; align-items: start; }
.tutorial-sidebar { position: sticky; top: 22px; }
.progress-card { padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(23, 41, 68, .7); }
.progress-label { color: var(--muted); font-size: .75rem; font-weight: 700; }
.progress-label strong { color: var(--aqua); font-size: .85rem; }
.progress-track { height: 7px; margin: 13px 0 11px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .1); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--aqua), var(--gold)); transition: width .3s ease; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .72rem; cursor: pointer; }
.text-button:hover { color: var(--text); }
.step-nav { display: grid; gap: 4px; margin-top: 22px; }
.step-nav a {
  display: grid;
  grid-template-columns: 27px 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: .79rem;
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.step-nav a span { color: #72809a; font-size: .69rem; font-weight: 800; }
.step-nav a:hover, .step-nav a.is-active { border-color: var(--aqua); background: rgba(112, 227, 208, .06); color: var(--text); }
.step-nav a.is-complete { color: var(--aqua); }
.step-nav a.is-complete span { color: var(--aqua); }
.tutorial-content { min-width: 0; }
.lesson-section {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 24px;
  padding: 0 0 84px;
  margin-bottom: 75px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 25px;
}
.lesson-section:last-child { margin-bottom: 0; border-bottom: 0; }
.section-index { display: grid; place-items: start center; color: var(--aqua); font-size: .8rem; font-weight: 900; letter-spacing: .1em; }
.lesson-copy > p { max-width: 700px; color: var(--muted); font-size: 1.05rem; }
.lesson-copy h2 { max-width: 670px; }
.notice {
  display: flex;
  gap: 18px;
  align-items: baseline;
  margin: 26px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--aqua);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: rgba(112, 227, 208, .05);
}
.notice strong { flex: 0 0 auto; color: var(--aqua); font-size: .86rem; }
.notice span { color: var(--muted); font-size: .9rem; }
.notice-coral { border-left-color: var(--coral); background: rgba(255, 109, 115, .05); }
.notice-coral strong { color: var(--coral); }
.notice-orange { border-left-color: #ff9a22; background: rgba(255, 154, 34, .06); }
.notice-orange strong { color: #ffae3f; }
.object-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 6px; }
.object-chip { padding: 8px 11px; border-radius: 10px; background: rgba(255, 255, 255, .06); font-size: .78rem; font-weight: 800; }
.chip-crab { color: var(--coral); }
.chip-shark { color: #74b6ff; }
.chip-star { color: var(--gold); }
.chip-snake { color: #62adff; }
.chip-apple { color: #ff7b75; }
.chip-skeleton { color: #f4dfb6; }
.chip-wizard { color: #b9a9ff; }
.chip-tenis { color: #cfff83; }
.chip-red { color: #ff7b75; }
.chip-blue { color: #72b4ff; }
.two-column, .code-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.mini-card { padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(23, 41, 68, .56); }
.mini-card.wide { margin: 20px 0; }
.forest-card { border-color: rgba(185, 169, 255, .34); background: rgba(76, 50, 110, .18); }
.court-card { border-color: rgba(112, 227, 208, .34); background: rgba(32, 96, 63, .22); }
.wall-card { background: rgba(23, 41, 68, .72); }
.wall-red { border-color: rgba(255, 109, 115, .5); }
.wall-blue { border-color: rgba(114, 180, 255, .5); }
.mini-label { display: block; margin-bottom: 10px; color: var(--aqua); font-size: .7rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.mini-card p { margin: 3px 0; color: var(--muted); font-size: .86rem; }
.mini-card b { color: var(--text); }
.variable-card { border-color: rgba(255, 154, 34, .34); }
.local-variable-card { border-color: rgba(255, 154, 34, .58); }
.hidden-variable-card { border-color: rgba(255, 154, 34, .58); background: rgba(255, 154, 34, .07); }
.variable-label { display: flex; align-items: center; gap: 8px; color: #ffae3f; }
.category-dot { display: inline-block; width: 15px; height: 15px; border-radius: 50%; }
.category-dot-variable { background: #ff9a22; box-shadow: 0 0 0 4px rgba(255, 154, 34, .12); }
.variable-token { display: inline-block; padding: 2px 7px; border-radius: 999px; background: #ff9a22; color: #3a2200; font-weight: 850; }
.scope-note { display: inline-flex; margin-top: 8px; padding: 4px 8px; border-radius: 999px; background: rgba(255, 154, 34, .12); color: #ffbd64; font-size: .72rem; font-weight: 800; }
.asset-download { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 300px); gap: 20px; align-items: center; margin: 24px 0; padding: 18px; border: 1px solid rgba(255, 211, 114, .24); border-radius: var(--radius-md); background: rgba(255, 211, 114, .05); }
.asset-download p { margin-bottom: 15px; color: var(--muted); font-size: .88rem; }
.asset-preview { display: block; width: 100%; border: 1px solid rgba(255, 232, 161, .35); border-radius: 12px; }
.reference-figure { max-width: 760px; margin: 24px 0; }
.reference-figure a { display: block; overflow: hidden; border: 1px solid rgba(112, 227, 208, .26); border-radius: var(--radius-md); background: #0a1529; box-shadow: 0 14px 34px rgba(0, 0, 0, .18); }
.reference-figure img { display: block; width: 100%; height: auto; }
.reference-figure-stage { max-width: 620px; }
.reference-figure-stage a { border-color: rgba(255, 211, 114, .38); }
.reference-figure figcaption { margin-top: 9px; color: var(--muted); font-size: .82rem; }
.enlarge-hint { color: var(--aqua); font-weight: 750; }
.scratch-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: min(100%, 600px);
  padding: 16px 16px 17px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 16px;
  background: #0a1529;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.scratch-block {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  min-height: 31px;
  margin: 2px 0;
  padding: 5px 10px;
  border-radius: 7px;
  color: #fff;
  font-size: .76rem;
  line-height: 1.25;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .15);
}
.scratch-block b { font-weight: 850; }
.scratch-block.event { background: #ffbf35; color: #3c2600; }
.scratch-block.motion { background: #4c9af3; }
.scratch-block.looks { background: #9965e9; }
.scratch-block.sound { background: #d14ed0; }
.scratch-block.control { background: #ff9e2b; color: #3a2200; }
.scratch-block.variables { background: #ff9a22; color: #3a2200; }
.scratch-block.custom { background: #ff6580; }
.scratch-block.condition { display: block; background: #ff9e2b; color: #3a2200; }
.scratch-block.control-stack { display: block; min-width: min(100%, 380px); padding: 7px 9px 10px; background: #ff9e2b; color: #3a2200; }
.scratch-block.control-stack > span { display: block; margin-bottom: 5px; font-weight: 850; }
.scratch-block.control-stack .scratch-block { margin-left: 13px; }
.scratch-block.control-stack .scratch-block.condition { margin-left: 4px; }
.scratch-block.condition .scratch-block { margin-top: 6px; }
.scratch-block.if-block { display: block; min-width: min(100%, 390px); padding: 7px 9px 9px; background: #ff9e2b; color: #3a2200; }
.if-head { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-weight: 850; }
.operator-slot { display: inline-flex; align-items: center; }
.operator-token { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 3px 5px; border-radius: 8px; background: #55bd63; color: #12351c; }
.random-token { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 8px; background: #55bd63; color: #12351c; font-weight: 750; }
.motion-report { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: #4c9af3; color: #fff; font-weight: 750; }
.operator-symbol { font-size: 1rem; font-weight: 950; }
.number-token { display: inline-flex; min-width: 34px; justify-content: center; padding: 4px 7px; border-radius: 999px; background: #fff; color: #243249; font-weight: 850; }
.sensor-token { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #5db7d4; color: #082d42; font-weight: 850; }
.variable-inline { display: inline-flex; padding: 3px 7px; border-radius: 999px; background: #ff9a22; color: #3a2200; font-weight: 850; }
.variable-report { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: #ff9a22; color: #3a2200; font-weight: 850; }
.if-body { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 8px 0 0 5px; padding: 5px 0 2px 13px; border-left: 3px solid rgba(255, 255, 255, .35); }
.if-body .scratch-block { margin: 2px 0; }

.check-line { display: flex; gap: 10px; align-items: baseline; max-width: 650px; margin: 20px 0; color: var(--green); font-size: .88rem; }
.check-line span { font-size: 1.1rem; }
code { padding: 3px 6px; border-radius: 5px; background: rgba(112, 227, 208, .1); color: var(--aqua); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; }
.complete-step { margin-top: 7px; padding: 10px 14px; border: 1px solid rgba(112, 227, 208, .42); border-radius: 10px; background: transparent; color: var(--aqua); font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer; }
.complete-step:hover, .complete-step.is-complete { border-color: var(--aqua); background: rgba(112, 227, 208, .12); }
.complete-step.is-complete::before { content: "✓ "; }
.final-checklist { display: grid; gap: 10px; max-width: 600px; margin: 22px 0; }
.final-checklist label { display: flex; gap: 11px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(23, 41, 68, .5); color: var(--muted); font-size: .9rem; }
.final-checklist input { accent-color: var(--aqua); }

.not-found-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.not-found { max-width: 600px; text-align: center; }
.not-found p { margin-bottom: 28px; color: var(--muted); }

@media (max-width: 900px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-hero, .tutorial-hero { grid-template-columns: 1fr .8fr; gap: 30px; }
  .tutorial-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 30px; }
}
@media (max-width: 700px) {
  :root { --shell: min(100% - 32px, 590px); }
  .site-header { min-height: 76px; }
  .header-note { display: none; }
  .hub-hero, .tutorial-hero { display: block; padding: 56px 0 54px; }
  .hero-illustration, .tutorial-hero-art { max-width: 520px; margin: 35px auto 0; }
  h1 { font-size: clamp(3rem, 16vw, 5rem); }
  .section-heading { display: block; }
  .section-heading > p { max-width: none; margin-top: 12px; text-align: left; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card p { min-height: 0; }
  .tutorial-layout { display: block; }
  .tutorial-sidebar { position: static; margin-bottom: 38px; }
  .step-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-nav a { font-size: .74rem; }
  .lesson-section { grid-template-columns: 35px minmax(0, 1fr); gap: 14px; padding-bottom: 62px; margin-bottom: 55px; }
  .two-column, .code-pair { grid-template-columns: 1fr; }
  .asset-download { grid-template-columns: 1fr; }
  .notice { display: block; }
  .notice strong, .notice span { display: block; }
  .notice span { margin-top: 5px; }
  .scratch-stack { padding: 11px; }
  .scratch-block { font-size: .7rem; }
  .site-footer { display: block; }
  .site-footer span { display: block; margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
