/* Last Recess: a schoolyard at dusk, written in chalk. */
@font-face { font-family: "Stencil"; src: url("/stencil.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/atkinson.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/atkinson-bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --night: #17192f;
  --dusk: #34284d;
  --ember: #d9825a;
  --asphalt: #141519;
  --panel: #1c1d23;
  --chalk: #efe9dc;
  --chalk-dim: #aaa496;
  --caution: #f2c14e;
  --line: rgba(239, 233, 220, 0.12);
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --header: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header); }
body { margin: 0; background: var(--asphalt); color: var(--chalk); font: 17px/1.6 "Atkinson", system-ui, sans-serif; overflow-x: hidden; }
img, video { max-width: 100%; }
a { color: var(--caution); text-underline-offset: 3px; }
a:hover { color: #ffd77a; }
h1, h2, h3 { margin: 0; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 780px; }

/* Header */
header.top { position: sticky; top: 0; z-index: 10; height: var(--header); background: rgba(23, 25, 47, 0.82); backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid var(--line); }
header.top .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--chalk); text-decoration: none; font: 800 22px/1 "Stencil", sans-serif; letter-spacing: 0.04em; white-space: nowrap; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); }
nav a { color: var(--chalk-dim); text-decoration: none; font-size: 15px; }
nav a:hover, nav a[aria-current="page"] { color: var(--chalk); }
.pill { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; }
.pill.solid { background: var(--caution); color: #1b1608; }
.pill.solid:hover { background: #ffd77a; color: #1b1608; }
.pill.ghost { border: 1px solid rgba(239, 233, 220, 0.35); color: var(--chalk); }
.pill.ghost:hover { border-color: var(--chalk); color: var(--chalk); }
.pill.lg { padding: 13px 24px; font-size: 16px; }

/* Hero: fits the first screen */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--night) 0%, var(--dusk) 58%, #6b3f4a 85%, var(--ember) 120%); }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: center; gap: clamp(24px, 5vw, 64px); min-height: calc(100svh - var(--header)); padding-top: clamp(28px, 5vh, 56px); padding-bottom: clamp(28px, 5vh, 56px); }
.eyebrow { display: inline-block; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--caution); margin-bottom: 14px; }
.hero h1 { font: 900 clamp(64px, 11vw, 148px)/0.86 "Stencil", sans-serif; letter-spacing: 0.01em; }
.hero h1 span { display: block; color: var(--caution); animation: glow 4s ease-in-out infinite alternate; }
@keyframes glow { from { text-shadow: 0 0 0 rgba(242, 193, 78, 0); } to { text-shadow: 0 0 28px rgba(242, 193, 78, 0.35); } }
.lede { font-size: clamp(18px, 1.6vw, 21px); max-width: 32em; margin: 22px 0 0; color: #e6e0d2; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 26px 0 0; padding: 0; list-style: none; color: var(--chalk-dim); font-size: 15px; }
.facts li::before { content: "✓"; color: var(--caution); margin-right: 8px; font-weight: 700; }
.hero-media { display: flex; justify-content: center; }
.sky { position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 14%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 8%, #fff9 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 46% 20%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 10%, #fffa 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 81% 22%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 6%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 34%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 37% 30%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 36%, #fff5 50%, transparent 51%);
  animation: twinkle 5s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: 0.4; } to { opacity: 1; } }
.bell { display: inline-block; transform-origin: 50% 0; animation: ring 4s ease-in-out infinite; }
@keyframes ring { 0%, 70%, 100% { transform: rotate(0); } 74% { transform: rotate(16deg); } 78% { transform: rotate(-14deg); } 82% { transform: rotate(10deg); } 86% { transform: rotate(-6deg); } 90% { transform: rotate(3deg); } }

/* Phone frame */
.phone { position: relative; aspect-ratio: 402 / 874; width: 100%; border-radius: 13% / 6%; padding: 3.2%;
  background: linear-gradient(145deg, #40414b, #101115); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.phone img, .phone video { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 10.5% / 5%; background: #000; }
.phone.hero-phone { width: auto; height: min(680px, calc(100svh - var(--header) - 96px)); max-width: 100%; animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-1.2deg); } 50% { transform: translateY(-10px) rotate(0.8deg); } }

/* Sections */
.section { padding: clamp(56px, 9vw, 104px) 0; border-top: 1px solid var(--line); }
.section.alt { background: var(--panel); }
.head { max-width: 640px; margin: 0 auto clamp(28px, 4vw, 48px); text-align: center; }
.head h2, .split h2 { font: 800 clamp(32px, 4.4vw, 50px)/1.05 "Stencil", sans-serif; letter-spacing: 0.02em; }
.head p { color: var(--chalk-dim); margin: 14px 0 0; font-size: 18px; }
.kicker { display: block; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--caution); margin-bottom: 10px; }

/* Stats strip */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.stats div { background: var(--asphalt); padding: 22px 16px; text-align: center; }
.stats b { display: block; font: 800 clamp(24px, 3vw, 32px)/1 "Stencil", sans-serif; color: var(--caution); letter-spacing: 0.03em; }
.stats span { color: var(--chalk-dim); font-size: 15px; }

/* Video clips */
.clips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 36px); max-width: 920px; margin: 0 auto; }
.clips figure { margin: 0; text-align: center; }
.clips .phone { max-width: 260px; margin: 0 auto; }
.clips figcaption { margin-top: 14px; color: var(--chalk-dim); font-size: 15.5px; }
.clips figcaption b { display: block; color: var(--chalk); font-size: 17px; }

/* Puzzle grid */
.puzzles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(14px, 2vw, 22px); }
.card { margin: 0; display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, 0.025); transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease; }
.card:hover { transform: translateY(-4px); border-color: rgba(242, 193, 78, 0.45); background: rgba(242, 193, 78, 0.05); }
.card .phone { padding: 4px; border-radius: 14px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4); }
.card .phone img { border-radius: 10px; }
.card h3 { font: 800 22px/1.1 "Stencil", sans-serif; letter-spacing: 0.03em; color: var(--caution); }
.card p { margin: 6px 0 0; font-size: 15.5px; color: var(--chalk-dim); line-height: 1.5; }

/* Feature splits */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: clamp(32px, 6vw, 88px); align-items: center; max-width: 980px; margin: 0 auto; }
.split.flip { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
.split.flip .text { order: 2; }
.split p { color: #ddd7c9; font-size: 18px; }
.split .phone { max-width: 280px; margin: 0 auto; }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; }
.ticks li { padding-left: 28px; position: relative; margin: 8px 0; color: var(--chalk-dim); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 14px; height: 4px; border-radius: 2px; background: var(--caution); }

/* Closing call */
.cta { text-align: center; background: linear-gradient(180deg, var(--asphalt), var(--dusk)); }
.cta h2 { font: 900 clamp(38px, 6vw, 72px)/1 "Stencil", sans-serif; }
.cta p { color: var(--chalk-dim); font-size: 18px; margin: 14px 0 26px; }

/* Text pages */
.doc { padding: clamp(36px, 6vw, 64px) var(--gutter) 72px; }
.doc h1 { font: 900 clamp(44px, 8vw, 64px)/1 "Stencil", sans-serif; margin: 0 0 6px; }
.doc .meta { color: var(--chalk-dim); margin: 0 0 28px; }
.doc h2 { font: 800 28px/1.1 "Stencil", sans-serif; letter-spacing: 0.03em; margin: 38px 0 12px; }
.doc h3 { font-size: 19px; margin: 26px 0 6px; }
.doc li { margin: 6px 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 16px; }
.doc th, .doc td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); padding: 10px 8px 10px 0; }
.doc th { color: var(--chalk-dim); font-weight: 700; }

footer { border-top: 1px solid var(--line); color: var(--chalk-dim); font-size: 15px; padding: 28px 0 40px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
footer a { color: var(--chalk-dim); margin-right: 18px; }
footer p { margin: 0; }

/* Scroll reveal (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* Tablet */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; text-align: center; }
  .hero-grid .actions, .hero-grid .facts { justify-content: center; }
  .lede { margin-left: auto; margin-right: auto; }
  .phone.hero-phone { height: min(520px, 62svh); }
  .split, .split.flip { grid-template-columns: 1fr; text-align: center; }
  .split.flip .text { order: 0; }
  .split .phone { max-width: 230px; }
  .ticks { display: inline-block; text-align: left; }
}

/* Phone */
@media (max-width: 600px) {
  body { font-size: 16px; }
  nav .hide-sm { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .clips { gap: 10px; }
  .clips figcaption { font-size: 13px; }
  .clips figcaption b { font-size: 14px; }
  .card { grid-template-columns: 80px 1fr; padding: 12px; }
  .doc table, .doc thead, .doc tbody, .doc tr, .doc th, .doc td { display: block; }
  .doc thead { display: none; }
  .doc td { border: 0; padding: 2px 0; }
  .doc tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
}
@media (max-width: 380px) {
  .brand span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
