:root {
  --cream: #FFF8EC;
  --navy: #16213A;
  --ink: #16213A;
  --muted: #4A5468;
  --orange: #D9480F;
  --peach: #FFE1D6;
  --teal: #0F6E78;
  --teal-bg: #D6EEF0;
  --gold: #8A5A00;
  --gold-bg: #FFF0B8;
  --purple: #5B3FB5;
  --purple-bg: #E4DDF7;
  --green: #2F6B2F;
  --green-bg: #D9EFD9;
  --card: #FFFFFF;
  --line: #E8DCC4;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.5;
}

a { color: var(--navy); }
a:hover { color: var(--orange); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Draft banner: remove once Marlon has reviewed */
.draft {
  background: var(--navy);
  color: var(--cream);
  text-align: center;
  font-size: 14px;
  padding: 8px 16px;
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.01em;
}
.brand .braces { color: var(--orange); }
.nav { display: flex; gap: 8px; flex-wrap: nowrap; }
.nav a {
  text-decoration: none;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 999px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover { background: var(--card); color: var(--ink); }
.nav a.cta { background: var(--navy); color: var(--cream); }
.nav a.cta:hover { background: var(--orange); color: #fff; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  align-items: center;
  padding-block: 32px 56px;
}
.pill {
  display: inline-block;
  background: var(--navy);
  color: var(--cream);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
}
.pill.soon { background: var(--orange); color: #fff; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.02; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(44px, 7vw, 76px); margin: 16px 0 18px; }
h1 .hl { color: var(--orange); }
h2 { font-size: clamp(32px, 4.5vw, 48px); margin-bottom: 24px; }
h3 { font-size: 24px; margin-bottom: 6px; letter-spacing: -0.01em; }
.lead { font-size: 22px; line-height: 1.4; margin: 0 0 24px; max-width: 34em; }

.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; padding: 0; list-style: none; }
.facts li {
  background: var(--card);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 700;
  box-shadow: 0 2px 0 var(--line);
  display: flex;
  gap: 8px;
  align-items: center;
}
.facts svg { flex: none; }

.buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  border: 2px solid var(--navy);
}
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: #B83A08; border-color: #B83A08; color: #fff; }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.ghost:hover { background: var(--navy); color: var(--cream); }

/* Hero showcase: Scratch / Python / HTML */
.show {
  background: var(--card);
  border-radius: 28px;
  padding: 20px;
  box-shadow: 0 4px 0 var(--line);
  transform: rotate(1.2deg);
  min-width: 0;
}
.tabs { display: flex; gap: 6px; background: var(--cream); padding: 5px; border-radius: 999px; margin-bottom: 16px; }
.tabs button {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
  cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--navy); color: var(--cream); }
.tabs button:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.panel { min-height: 400px; display: flex; flex-direction: column; }
.panel[hidden] { display: none; }
.panel .caption { font-size: 15px; color: var(--muted); margin: auto 0 0; padding-top: 12px; }

/* lines and blocks appear one by one */
.ln, .blk { opacity: 0; transform: translateY(6px); transition: opacity 0.3s ease, transform 0.3s ease; }
.ln.on, .blk.on { opacity: 1; transform: none; }
.ln { display: inline-block; }

.scratch { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: stretch; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.blk {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  color: #fff;
  padding: 6px 10px;
  border-radius: 7px;
  width: fit-content;
  max-width: 100%;
}
.blk.event { background: var(--gold); border-radius: 16px 16px 7px 7px; }
.blk.var { background: #C2410C; }
.blk.loop { background: var(--orange); }
.blk.move { background: var(--purple); }
.blk.sense { background: var(--teal); }
.blk.look { background: #8E44AD; }
.blk.in { margin-left: 16px; }
.blk.in2 { margin-left: 32px; }
.blk.gap { margin-top: 10px; }
/* the block that just ran glows */
.blk.hit { animation: glow 0.6s ease; }
@keyframes glow { 0%, 60% { box-shadow: 0 0 0 3px #FFD866; } 100% { box-shadow: 0 0 0 0 transparent; } }

.stagecol { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stage {
  position: relative;
  display: block;
  width: 100%;
  flex: 1;
  min-height: 210px;
  padding: 0;
  background: linear-gradient(#D6EEF0, #EAF6F7);
  border-radius: 16px;
  border: 2px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.stage:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.stage .score {
  position: absolute; top: 8px; left: 8px;
  background: #fff; border-radius: 8px; padding: 2px 8px;
  font-size: 14px; font-weight: 700;
}
.stage .score b { color: var(--orange); }
.stage .star { position: absolute; left: 70%; bottom: 90px; animation: twinkle 1.6s ease-in-out infinite; }
.stage .sprite { position: absolute; left: 10px; bottom: 12px; line-height: 0; }
@keyframes twinkle { 50% { transform: scale(1.25) rotate(20deg); } }
.flag {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px;
  border: 0; border-radius: 999px;
  background: var(--green); color: #fff;
  font: 700 16px var(--body);
  cursor: pointer;
}
.flag:hover { background: #245524; }
.flag:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.code, .console {
  margin: 0;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  border-radius: 14px;
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre;
}
.code { background: var(--navy); color: #E8EDF7; font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; }
.code .k { color: #FFB38A; }
.code .f { color: #8FD3DB; }
.code .s { color: #B6E3A8; }
.code .n { color: #FFD866; }
.code .t { color: #C9B8FF; }
.code .ln.hit { animation: line 0.9s ease; border-radius: 4px; }
@keyframes line { 0%, 60% { background: rgba(255, 216, 102, 0.28); } 100% { background: transparent; } }
.console { background: #0B1222; color: #E8EDF7; margin-top: 10px; white-space: normal; }
.console .log { min-height: 66px; }
.console .out { white-space: pre-wrap; }
.console .echo { color: #9AA6BF; }
.console .ok { color: #B6E3A8; font-weight: 700; }
.console .note { color: #8FD3DB; font-style: italic; }
.console .ask { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.console .ask label { color: #E8EDF7; }
.console .ask input {
  width: 56px; min-height: 40px;
  font: 700 16px ui-monospace, Consolas, monospace;
  color: #FFD866; background: #16213A;
  border: 2px solid #3A4A6B; border-radius: 8px; padding: 4px 8px;
}
.console .ask input:focus { outline: none; border-color: #FFD866; }
.console .ask button {
  min-height: 40px; padding: 4px 14px;
  font: 700 15px var(--body);
  background: var(--orange); color: #fff; border: 0; border-radius: 999px; cursor: pointer;
}
.console .ask button:hover { background: #B83A08; }

.preview { margin-top: 10px; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.preview .bar { display: flex; gap: 5px; padding: 7px 10px; background: var(--cream); }
.preview .bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.preview .page { padding: 12px 16px 16px; }
.preview h4 { font-family: var(--display); font-size: 24px; margin: 0 0 4px; color: var(--orange); }
.preview h4.pop { animation: goal 0.5s ease; }
.preview .pitch { display: block; width: 100%; max-width: 300px; height: auto; margin: 6px 0 10px; }
.preview .ball { transform-box: fill-box; transform-origin: center; }
.preview .ball.shoot { animation: shoot 1s ease; }
@keyframes shoot {
  45% { transform: translate(var(--dx, 0px), -46px) scale(0.75); }
  75% { transform: translate(var(--dx, 0px), -40px) scale(0.75); }
  100% { transform: none; }
}
.preview p { margin: 0 0 10px; font-size: 16px; }
.preview button {
  font: 700 16px var(--body);
  background: var(--green); color: #fff; border: 0; border-radius: 999px;
  padding: 10px 18px; min-height: 44px; cursor: pointer;
}
.preview button:hover { background: #245524; }
@keyframes goal { 40% { transform: scale(1.15) rotate(-3deg); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ln, .blk { transition: none; }
  .stage .star, .preview h4.pop, .preview .ball.shoot, .blk.hit, .code .ln.hit { animation: none; }
}

/* Sections */
section { padding: 48px 0; }
section.alt { background: var(--card); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 2px 0 var(--line);
}
section.alt .card { background: var(--cream); box-shadow: none; }
.card p { margin: 0; }
.icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.i-orange { background: var(--peach); color: #C2410C; }
.i-teal { background: var(--teal-bg); color: var(--teal); }
.i-gold { background: var(--gold-bg); color: var(--gold); }
.i-purple { background: var(--purple-bg); color: var(--purple); }
.i-green { background: var(--green-bg); color: var(--green); }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: 82px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 22px;
  top: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

details {
  background: var(--card);
  border-radius: 16px;
  padding: 0 20px;
  box-shadow: 0 2px 0 var(--line);
  margin-bottom: 10px;
}
summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 19px;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; margin-left: auto; font-family: var(--display); font-size: 26px; color: var(--orange); }
details[open] summary::after { content: '\2212'; }
details p { margin: 0; padding-bottom: 20px; }

.band {
  background: var(--navy);
  color: var(--cream);
  border-radius: 28px;
  padding: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.band h2 { margin: 0 0 8px; }
.band h2 .hl { color: #FFC9B5; }
.band p { margin: 0; max-width: 34em; }
.band .btn.primary:hover { background: #fff; border-color: #fff; color: var(--navy); }

.notice {
  background: var(--gold-bg);
  border-radius: 16px;
  padding: 16px 20px;
  margin-top: 20px;
}

/* Volunteer page */
.role { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
.role ul { padding-left: 22px; margin: 0 0 8px; }
.role li { margin-bottom: 8px; }
.aside { position: sticky; top: 20px; }
.aside dl { margin: 0; }
.aside dt { font-weight: 700; margin-top: 14px; }
.aside dt:first-child { margin-top: 0; }
.aside dd { margin: 2px 0 0; }

footer { padding: 40px 0 56px; color: var(--muted); font-size: 16px; }
footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .hero, .role { grid-template-columns: 1fr; }
  .hero { padding-top: 8px; gap: 28px; }
  .show { transform: none; }
  .aside { position: static; }
  .band { padding: 28px 22px; }
}

@media (max-width: 560px) {
  .top { gap: 10px; padding-block: 14px; }
  .brand { font-size: 22px; }
  .nav { gap: 2px; margin-left: -10px; }
  .nav a { font-size: 15px; padding: 8px 10px; }
  .nav a.cta { padding: 6px 14px; margin-left: 4px; min-height: 40px; align-self: center; background: transparent; color: var(--navy); border: 2px solid var(--navy); }
  .nav a.cta:hover { background: var(--navy); color: var(--cream); }
  .scratch { grid-template-columns: 1fr; }
  .stack { flex-direction: row; flex-wrap: wrap; gap: 4px 6px; }
  .blk.in, .blk.in2 { margin-left: 0; }
  .blk.gap { margin-top: 0; }
  .stage { min-height: 170px; }
}
