/* =========================================================
   SKATER STARTER PACK — grunge / Y2K zine theme
   Palette: duotone indigo + acid yellow, halftone, old-OS windows
   ========================================================= */

:root {
  --ink: #14173d;        /* deepest navy — shadows, text on paper */
  --indigo: #3a3f86;     /* main duotone mid */
  --peri: #8e92d1;       /* graffiti tag fill */
  --acid: #e4e78a;       /* pale acid yellow highlight */
  --paper: #f5f3e8;      /* photocopy paper */
  --white: #ffffff;
  --black: #0b0b10;

  /* old-OS window chrome */
  --chrome: #d4d0c8;
  --chrome-light: #ffffff;
  --chrome-dark: #808080;
  --chrome-darker: #404040;
  --titlebar: linear-gradient(90deg, #0a246a, #3a6ea5);

  --tag: "Sedgwick Ave Display", "Permanent Marker", cursive;
  --display: "Barlow Condensed", "Gill Sans", "Arial Narrow", sans-serif;
  --body: "Barlow", "Gill Sans", system-ui, sans-serif;
  --ui: Tahoma, Verdana, "Segoe UI", sans-serif;
  --pixel: "VT323", ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --nav-h: 56px;
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--paper);
  background: var(--ink) url("../img/art/grip.jpg") repeat;
  background-size: 512px;
  overflow-x: hidden;
}
img, svg, iframe, canvas { max-width: 100%; display: block; }
a { color: var(--acid); }
a:hover { color: var(--white); }
:focus-visible { outline: 3px dashed var(--acid); outline-offset: 3px; }

/* film grain + dust over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: .18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 2000;
  background: var(--acid); color: var(--ink); padding: 8px 14px; font-weight: 700;
}
.skip-link:focus { top: 8px; }

/* ---------- halftone helpers ---------- */
.halftone {
  background-image: radial-gradient(circle, var(--black) 1.6px, transparent 2.1px);
  background-size: 9px 9px;
}
.halftone-fade {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, var(--black) 1.7px, transparent 2.2px);
  background-size: 9px 9px;
  -webkit-mask-image: linear-gradient(200deg, #000 0%, #000 25%, transparent 70%);
          mask-image: linear-gradient(200deg, #000 0%, #000 25%, transparent 70%);
  opacity: .9;
}

/* pixel mosaic blocks (filled by JS) */
.mosaic {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  pointer-events: none;
  opacity: .85;
  z-index: 2;
}
.mosaic span { aspect-ratio: 1; }

/* ---------- NAV: taskbar ---------- */
.taskbar {
  position: sticky; top: 0; z-index: 500;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px;
  background: var(--chrome);
  border-top: 2px solid var(--chrome-light);
  box-shadow: 0 2px 0 var(--chrome-darker);
  font-family: var(--ui);
  font-size: .85rem;
  color: var(--black);
}
.start-btn {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; text-decoration: none; color: var(--black);
  white-space: nowrap;
}
.start-btn img { width: 28px; height: auto; }
.taskbar nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.taskbar nav::-webkit-scrollbar { display: none; }

.btn98, .taskbar nav a {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 4px 14px;
  font: 700 .85rem/1 var(--ui);
  color: var(--black); text-decoration: none; white-space: nowrap;
  background: var(--chrome);
  border: 0;
  box-shadow:
    inset -1px -1px var(--chrome-darker),
    inset 1px 1px var(--chrome-light),
    inset -2px -2px var(--chrome-dark),
    inset 2px 2px #dfdfdf;
  cursor: pointer;
}
.btn98:active, .taskbar nav a:active, .taskbar nav a.active {
  box-shadow:
    inset 1px 1px var(--chrome-darker),
    inset -1px -1px var(--chrome-light),
    inset 2px 2px var(--chrome-dark),
    inset -2px -2px #dfdfdf;
  background: repeating-conic-gradient(var(--chrome) 0 25%, #e8e6e0 0 50%) 0 0 / 2px 2px;
}
.btn98.primary { background: var(--acid); }
.btn98.big { min-height: 48px; padding: 8px 22px; font-size: 1rem; }

.clock {
  font-family: var(--ui); padding: 6px 10px; white-space: nowrap;
  box-shadow: inset 1px 1px var(--chrome-dark), inset -1px -1px var(--chrome-light);
}

/* scroll-progress rail with rolling deck */
.rail { position: sticky; top: var(--nav-h); z-index: 499; height: 6px; background: var(--ink); }
.rail-fill { height: 100%; width: 0; background: var(--acid); }
.rail-deck {
  position: absolute; top: -10px; left: 0; width: 56px;
  transform: translateX(-50%);
  transition: transform .1s linear;
  pointer-events: none;
}

/* ---------- WINDOWS ---------- */
.win {
  background: var(--chrome);
  color: var(--black);
  font-family: var(--ui);
  padding: 3px;
  box-shadow:
    inset -1px -1px var(--black),
    inset 1px 1px #dfdfdf,
    inset -2px -2px var(--chrome-dark),
    inset 2px 2px var(--chrome-light),
    10px 10px 0 rgba(0,0,0,.45);
}
.win-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--titlebar);
  color: var(--white);
  padding: 4px 4px 4px 8px;
  font: 700 .82rem/1.2 var(--ui);
}
.win-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-ctrls { display: flex; gap: 2px; flex-shrink: 0; }
.win-ctrls i {
  width: 18px; height: 16px; display: grid; place-items: center;
  font: 700 10px/1 var(--ui); font-style: normal; color: var(--black);
  background: var(--chrome);
  box-shadow: inset -1px -1px var(--black), inset 1px 1px var(--chrome-light), inset -2px -2px var(--chrome-dark);
}
.win-menu { display: flex; gap: 14px; padding: 3px 8px; font-size: .8rem; }
.win-menu u { text-decoration: underline; }
.win-body { padding: 14px 16px; }
.win-body.inset {
  margin: 4px; padding: 0;
  background: var(--white);
  box-shadow: inset 1px 1px var(--chrome-dark), inset -1px -1px var(--chrome-light), inset 2px 2px var(--chrome-darker);
}
.win-body.inset img { width: 100%; height: auto; }
.win-status {
  display: flex; gap: 4px; padding: 2px; font-size: .75rem;
}
.win-status span {
  flex: 1; padding: 2px 6px;
  box-shadow: inset 1px 1px var(--chrome-dark), inset -1px -1px var(--chrome-light);
}

/* text "paper" window body (for readable lessons) */
.win-body.paper {
  margin: 4px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.1rem;
  padding: clamp(16px, 3vw, 28px);
  box-shadow: inset 1px 1px var(--chrome-dark), inset -1px -1px var(--chrome-light);
}

/* ---------- STICKERS ---------- */
.sticker {
  filter: drop-shadow(0 0 0 var(--white)) drop-shadow(4px 6px 0 rgba(0,0,0,.45));
  transition: transform .2s ease;
}
a.sticker-link { display: block; text-decoration: none; }
a.sticker-link:hover .sticker, a.sticker-link:focus-visible .sticker { transform: rotate(-4deg) scale(1.06); }

/* ---------- TYPE ---------- */
.tag {
  font-family: var(--tag);
  font-weight: 400;
  color: var(--peri);
  line-height: .85;
  letter-spacing: .01em;
  -webkit-text-stroke: 2px var(--black);
  paint-order: stroke fill;
  text-shadow:
    4px 4px 0 var(--black),
    6px 6px 0 var(--acid);
  margin: 0;
}
.kicker {
  display: inline-block;
  font: 400 1.35rem/1 var(--pixel);
  letter-spacing: .06em;
  color: var(--ink);
  background: var(--acid);
  padding: 4px 10px;
  text-transform: uppercase;
}
.textbox {
  background: var(--white);
  color: var(--black);
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.15;
  padding: 14px 18px;
  max-width: 20ch;
}
h2.section-title {
  font-family: var(--tag);
  font-weight: 400;
  font-size: clamp(3rem, 10vw, 6.5rem);
  line-height: .9;
  color: var(--acid);
  -webkit-text-stroke: 2px var(--black);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--black);
  margin: 0 0 .25em;
  transform: rotate(-3deg);
  transform-origin: left;
}
h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; }
.lesson h3, .prose h3 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 .5rem; color: var(--ink); }
.lesson h4, .prose h4 { font-family: var(--display); font-size: 1.35rem; text-transform: uppercase; margin: 1.4rem 0 .4rem; color: var(--indigo); }

/* ---------- LAYOUT ---------- */
.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }
section { position: relative; padding-block: clamp(64px, 10vw, 120px); }
.section-head { position: relative; margin-bottom: clamp(28px, 5vw, 56px); }
.section-head p { max-width: 60ch; font-size: 1.2rem; }
.section-head .sticker { position: absolute; right: 0; top: -10px; width: clamp(120px, 18vw, 220px); transform: rotate(8deg); }

/* paper sections (light) alternate with indigo */
.paper-section {
  background: var(--paper);
  color: var(--ink);
}
.paper-section .section-head p { color: var(--ink); }
.paper-section::before { /* torn top edge */
  content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 20px;
  background: var(--paper);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'><path d='M0 10 L0 6 L4 8 L7 3 L11 7 L15 2 L19 6 L23 4 L27 8 L31 3 L35 6 L40 2 L44 7 L48 4 L52 8 L56 3 L60 6 L64 2 L68 7 L72 4 L76 8 L80 3 L84 6 L88 2 L92 7 L96 4 L100 6 L100 10 Z'/></svg>") 0 0 / 100% 100%;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'><path d='M0 10 L0 6 L4 8 L7 3 L11 7 L15 2 L19 6 L23 4 L27 8 L31 3 L35 6 L40 2 L44 7 L48 4 L52 8 L56 3 L60 6 L64 2 L68 7 L72 4 L76 8 L80 3 L84 6 L88 2 L92 7 L96 4 L100 6 L100 10 Z'/></svg>") 0 0 / 100% 100%;
}
.paper-section a { color: var(--indigo); font-weight: 700; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: min(calc(100svh - var(--nav-h)), 920px);
  padding-block: clamp(40px, 7vw, 90px);
  display: flex; align-items: center;
  background: var(--ink) url("../img/art/hero.jpg") center / cover no-repeat;
  overflow: hidden;
  isolation: isolate;
}
.hero::before { /* darken left for legibility */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(20,23,61,.85) 0%, rgba(20,23,61,.35) 60%, rgba(20,23,61,.1) 100%);
}
.hero .halftone-fade { z-index: 0; }
/* white photocopy patch with halftone dots, like a torn zine cut-out */
.halftone-patch {
  position: absolute; z-index: 1; pointer-events: none;
  background-color: var(--white);
  background-image: radial-gradient(circle, var(--black) 2px, transparent 2.6px);
  background-size: 10px 10px;
  clip-path: polygon(8% 4%, 38% 0, 62% 6%, 100% 2%, 97% 40%, 100% 72%, 84% 100%, 52% 94%, 20% 100%, 0 78%, 5% 46%, 0 18%);
}
.halftone-patch::after { /* fade the dots out toward the middle so it reads as halftone gradient */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 40% 55%, var(--white) 0 28%, transparent 70%);
}
.hero .halftone-patch { right: 4%; top: 6%; width: min(46vw, 640px); aspect-ratio: 1 / .9; transform: rotate(-4deg); }
.hero .textbox { box-shadow: 6px 6px 0 var(--black); }
.hero-grid {
  position: relative; z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.hero .tag { font-size: clamp(3.6rem, 11vw, 9.5rem); transform: rotate(-4deg); }
.hero .tag .line2 { display: block; padding-left: .6em; }
.hero .tag .line3 { display: block; color: var(--acid); }
.hero-copy { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px; margin-top: 34px; }
.hero-copy .textbox { font-size: clamp(1.4rem, 3vw, 2rem); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-photo { position: relative; transform: rotate(3deg); }
.hero-photo .win { max-width: 420px; margin-left: auto; }
.cursor {
  position: absolute; width: 38px; z-index: 6; pointer-events: none;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,.5));
}
.hero-photo .cursor { left: -18px; bottom: 26%; }
.hero .spray { position: absolute; right: 2%; bottom: -30px; width: clamp(110px, 14vw, 190px); z-index: 4; transform: rotate(-12deg); }

/* ---------- PICK PATH ---------- */
.paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 32px); }
.path-card { text-decoration: none; display: block; color: inherit; }
.path-card .win { height: 100%; transition: transform .15s ease; }
.path-card:nth-child(1) .win { transform: rotate(-2deg); }
.path-card:nth-child(2) .win { transform: rotate(1.5deg) translateY(18px); }
.path-card:nth-child(3) .win { transform: rotate(-1deg); }
.path-card:hover .win, .path-card:focus-visible .win { transform: rotate(0) translateY(-6px); }
.path-card .win-body { display: grid; gap: 10px; justify-items: center; text-align: center; }
.path-card .win-body img { width: 75%; height: auto; }
.path-card strong { font: 700 1.7rem/1 var(--display); text-transform: uppercase; }
.path-card small { font-size: .85rem; color: #333; }
.path-card .icon-art { background: var(--white); width: 100%; padding: 12px; box-shadow: inset 1px 1px var(--chrome-dark), inset -1px -1px var(--chrome-light); }

/* ---------- GAME ---------- */
.game-win { max-width: 960px; margin-inline: auto; }
.game-win canvas {
  width: 100%; height: auto; aspect-ratio: 45 / 16;
  background: var(--paper);
  touch-action: manipulation; cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.game-controls { display: none; gap: 8px; padding: 8px 4px 4px; }
.game-controls .btn98 { flex: 1; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
@media (hover: none), (max-width: 640px) {
  .game-controls { display: flex; }
  .hide-sm { display: none; }
}

/* ---------- LESSONS ---------- */
.lessons { display: grid; gap: clamp(40px, 7vw, 80px); }
.lesson {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 44px);
  align-items: start;
}
.lesson:nth-child(even) .lesson-media { order: -1; }
.lesson .num {
  font: 400 1.4rem/1 var(--pixel); color: var(--indigo);
}
.lesson ol, .lesson ul, .prose ol, .prose ul { padding-left: 1.3em; margin: .4rem 0 1rem; }
.lesson li, .prose li { margin-bottom: .45rem; }
.lesson li::marker, .prose li::marker { color: var(--indigo); font-weight: 700; }
.tip {
  margin: 1rem 0 0;
  padding: 10px 14px;
  background: var(--acid);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  border: 2px solid var(--ink);
  transform: rotate(-.6deg);
}
.tip b { font-family: var(--pixel); font-weight: 400; font-size: 1.3rem; text-transform: uppercase; margin-right: 6px; }
.lesson-media { display: grid; gap: 22px; }
.lesson-media .win:nth-child(odd) { transform: rotate(1deg); }
.lesson-media .win:nth-child(even) { transform: rotate(-1deg); }

.video { position: relative; aspect-ratio: 16 / 9; background: var(--black); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.caption { font-size: .8rem; padding: 4px 6px 2px; }

/* ---------- EQUIPMENT ---------- */
.board-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 40px; }
.board-card {
  background: var(--white); color: var(--ink);
  border: 3px solid var(--ink);
  padding: 18px 16px;
  box-shadow: 6px 6px 0 var(--indigo);
}
.board-card:nth-child(odd) { transform: rotate(-1.2deg); }
.board-card:nth-child(even) { transform: rotate(1deg); }
.board-card h3 { margin: 0 0 6px; font-size: 1.6rem; }
.board-card p { margin: 0; font-size: 1rem; }

.quiz-cta {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 24px;
  margin: 48px 0;
}
.quiz-cta .win { max-width: 560px; }
.quiz-cta .dialog { display: flex; gap: 14px; align-items: flex-start; }
.quiz-cta .dialog img { width: 90px; flex-shrink: 0; }
.quiz-cta .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: start; }
.stack { display: grid; gap: clamp(20px, 4vw, 36px); }

/* ---------- FOOTER ---------- */
footer {
  position: relative;
  background: var(--black);
  color: var(--paper);
  padding-block: 56px 90px;
  overflow: hidden;
}
footer .tag { font-size: clamp(2.6rem, 7vw, 4.5rem); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; }
footer ul { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; }
footer .reveille { width: min(240px, 60%); margin-left: auto; transform: rotate(6deg); }

/* ---------- QUIZ PAGE ---------- */
.quiz-page { min-height: 100svh; padding-block: 40px 80px; position: relative; }
.quiz-page .tag { font-size: clamp(3rem, 9vw, 6rem); margin-bottom: 28px; transform: rotate(-3deg); }
.quiz-win { max-width: 780px; margin-inline: auto; position: relative; z-index: 3; }
fieldset { border: 0; margin: 0 0 18px; padding: 0; }
fieldset.group98 {
  padding: 12px 14px 8px;
  border: 1px solid var(--chrome-dark);
  box-shadow: 1px 1px 0 var(--chrome-light), inset 1px 1px 0 var(--chrome-light);
}
legend { font-weight: 700; padding: 0 6px; font-size: .95rem; }
.opt {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 6px; font-size: .95rem; cursor: pointer;
}
.opt:hover { background: rgba(10,36,106,.08); }
.opt input { margin-top: 3px; accent-color: var(--indigo); width: 16px; height: 16px; flex-shrink: 0; }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.quiz-error { color: #a00; font-weight: 700; margin: 0 0 10px; min-height: 1.2em; }
.result-win { margin-top: 28px; }
.result-win[hidden] { display: none; }
.result-body { display: grid; grid-template-columns: 140px 1fr; gap: 18px; align-items: center; }
.result-body h2 { font: 700 2.2rem/1 var(--display); text-transform: uppercase; margin: 0 0 8px; color: var(--ink); }
.result-body p { margin: 0; font-family: var(--body); font-size: 1.05rem; }

/* ---------- MOTION ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
  .js .reveal.in { opacity: 1; transform: none; }
  .hero .tag { animation: slap .5s cubic-bezier(.2,1.6,.4,1) both; }
  @keyframes slap { from { transform: rotate(-4deg) scale(1.3); opacity: 0; } }
  .blink { animation: blink 1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .hero-grid, .lesson, .two-col, .footer-grid, .quiz-cta { grid-template-columns: minmax(0, 1fr); }
  .lesson:nth-child(even) .lesson-media { order: 0; }
  .board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-photo { max-width: 380px; margin: 0 auto; }
  .hero .spray { display: none; }
  .hero .halftone-patch { right: -10%; top: auto; bottom: 4%; width: 90vw; opacity: .9; }
  .clock { display: none; }
  .quiz-cta > .sticker { display: none; }
}
@media (max-width: 640px) {
  .paths { grid-template-columns: minmax(0, 1fr); }
  .path-card:nth-child(2) .win { transform: rotate(1.5deg); }
  .section-head .sticker { position: static; margin: 12px 0 0 auto; width: 120px; }
  .board-grid { grid-template-columns: minmax(0, 1fr); }
  .start-btn span { display: none; }
  .taskbar nav a { padding: 4px 10px; }
  .result-body { grid-template-columns: minmax(0, 1fr); }
  .result-body img { width: 120px; }
  .win { box-shadow: inset -1px -1px var(--black), inset 1px 1px #dfdfdf, inset -2px -2px var(--chrome-dark), inset 2px 2px var(--chrome-light), 6px 6px 0 rgba(0,0,0,.45); }
}

/* titles on light paper sections use the periwinkle tag colour for contrast */
.paper-section h2.section-title { color: var(--peri); }
