:root {
  color-scheme: light;
  --primary: #fd6d8d;
  --secondary: #E63946;
  --tertiary: #3D5AFE;
  --quaternary: #FFD23F;
  --success: #20C997;
  --neutral: #FDF8EE;
  --surface: #FBF4E4;
  --surface-deep: #F4E8CE;
  --ink: #1A1A1F;
  --border: #1A1A1F;
  --muted: #6E6762;
  --shadow: 0 8px 24px rgba(26, 26, 31, .12);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --max: 1160px;
  --spring: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 6%, rgba(255, 210, 63, .38), transparent 18rem),
    radial-gradient(circle at 90% 9%, rgba(253, 109, 141, .22), transparent 20rem),
    var(--neutral);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image: radial-gradient(var(--ink) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black, transparent 55%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 55%);
}
img, video { max-width: 100%; display: block; }
a { color: var(--ink); }
p a, .faq a, .footer a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
p a:hover, .faq a:hover, .footer a:hover { background: var(--success); border-radius: 3px; text-decoration: none; }
:focus-visible { outline: 3px solid var(--tertiary); outline-offset: 3px; border-radius: 6px; }
code { font-family: "Geist Mono", ui-monospace, monospace; font-size: .88em; padding: 1px 6px; background: var(--surface-deep); border: 1px solid rgba(26,26,31,.25); border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--ink); color: var(--neutral); padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 16px; }

/* ── Type ─────────────────────────────────────── */
h1, h2 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 500;
  font-style: italic;
  font-variation-settings: 'SOFT' 100, 'opsz' 144;
  letter-spacing: -.02em;
  margin: 0;
}
h1 { font-size: clamp(44px, 6.6vw, 92px); line-height: .94; }
h2 { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.04; }
h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.2; letter-spacing: -.01em; font-weight: 800; }
p { color: var(--muted); line-height: 1.6; margin: 0 0 14px; }
.lede { color: var(--ink); font-size: clamp(18px, 1.9vw, 22px); line-height: 1.5; margin: 24px 0 0; max-width: 34em; }
.sectionLede { font-size: 18px; max-width: 42em; margin: 14px 0 24px; }
.hint { font-size: 14px; margin-top: 14px; }

.underlined { position: relative; display: inline-block; white-space: nowrap; }
.underlined::after {
  content: "";
  position: absolute;
  left: -2%; right: -4%; bottom: -.02em;
  height: .2em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20' preserveAspectRatio='none'%3E%3Cpath d='M3 13 C 60 4, 120 17, 180 9 S 270 6, 297 11' fill='none' stroke='%23fd6d8d' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  z-index: -1;
}

/* ── Stickers ─────────────────────────────────── */
.stickers { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; }
.sticker {
  display: inline-block;
  width: fit-content;
  padding: 6px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--neutral);
  transform: rotate(-1.5deg);
}
.sticker:nth-child(2n) { transform: rotate(1.25deg); }
.sticker.yellow { background: var(--quaternary); }
.sticker.pink { background: var(--primary); }
.sticker.blue { background: var(--tertiary); color: var(--neutral); }
.sticker.red { background: var(--secondary); color: var(--neutral); }

/* ── Buttons ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 14px 24px;
  border: 2px solid var(--border);
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms var(--spring), box-shadow 180ms var(--spring), background 180ms;
}
.btn-primary { background: var(--ink); color: var(--neutral); }
.btn-primary:hover { background: var(--success); color: var(--ink); transform: translateY(-2px) rotate(-1deg); box-shadow: var(--shadow); }
.btn-secondary { background: var(--neutral); color: var(--ink); }
.btn-secondary:hover { background: var(--quaternary); transform: translateY(-2px) rotate(1deg); box-shadow: var(--shadow); }
.btn-small { min-height: 40px; padding: 8px 16px; font-size: 14px; }

/* ── Nav ──────────────────────────────────────── */
.nav {
  position: sticky;
  top: 16px;
  z-index: 20;
  width: min(var(--max), calc(100% - 32px));
  margin: 16px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 10px 8px 14px;
  background: rgba(253, 248, 238, .9);
  border: 2px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.wordmark { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.wordmark em { font-family: Fraunces, Georgia, serif; font-style: italic; font-weight: 500; font-variation-settings: 'SOFT' 100, 'opsz' 144; font-size: 21px; }
.navMouth { width: 44px; height: 44px; margin: -6px 0; }
.nav nav { display: flex; align-items: center; gap: 6px; }
.nav nav a:not(.btn) { padding: 8px 12px; border-radius: 999px; text-decoration: none; font-size: 15px; font-weight: 600; }
.nav nav a:not(.btn):hover { background: var(--surface-deep); }

/* ── Layout ───────────────────────────────────── */
main { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; padding: 48px 0 24px; }
.section { padding: 72px 0 0; }
.section > h2 { max-width: 18em; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 5vw, 64px);
  background: linear-gradient(135deg, var(--surface), var(--neutral));
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  position: relative;
}
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* polaroid frame */
.polaroid {
  margin: 0;
  padding: 12px 12px 14px;
  background: #fffdf7;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  transform: rotate(1.5deg);
  transition: transform 260ms var(--spring), box-shadow 260ms var(--spring);
  position: relative;
}
.polaroid.tilt { transform: rotate(-1.5deg); }
.polaroid:hover { transform: rotate(0) translateY(-4px); box-shadow: var(--shadow); }
.polaroid video, .polaroid img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 2px solid var(--border); background: var(--surface-deep); }
.polaroid figcaption { font-size: 14px; color: var(--muted); line-height: 1.45; padding: 12px 4px 0; }
.polaroid figcaption .sticker { margin-right: 6px; font-size: 11px; padding: 3px 7px; vertical-align: 1px; }
.heroVideo { transform: rotate(2deg); }
.soundBtn {
  position: absolute;
  top: 24px;
  right: 24px;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--quaternary);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transform: rotate(-2deg);
  transition: transform 180ms var(--spring), background 180ms;
}
.soundBtn:hover { transform: rotate(0) scale(1.04); }
.soundBtn[aria-pressed="true"] { background: var(--neutral); }

.filmstrip {
  height: 22px;
  margin: 56px auto 0;
  width: min(var(--max), calc(100% - 48px));
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  background: repeating-linear-gradient(90deg, var(--ink) 0 14px, transparent 14px 28px) center / 100% 8px no-repeat;
  opacity: .9;
}

/* cards */
.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: transform 220ms var(--spring), box-shadow 220ms var(--spring);
}
.card:hover { transform: translateY(-3px) rotate(-.5deg); box-shadow: var(--shadow); }
.card p:last-child { margin-bottom: 0; }

.steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.stepNum {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  margin-bottom: 16px;
  border: 2px solid var(--border);
  border-radius: 50%;
  font-family: "Geist Mono", monospace;
  font-weight: 500;
  background: var(--primary);
  transform: rotate(-4deg);
}
.steps li:nth-child(2) .stepNum { background: var(--quaternary); }
.steps li:nth-child(3) .stepNum { background: var(--tertiary); color: var(--neutral); }

.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 32px; max-width: 860px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.split h2 { margin-bottom: 18px; }
.libSection .libText { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 48px; align-items: start; }
.libSection .libText h2 { grid-column: 1 / -1; margin-bottom: 10px; }
.libSection .libraryCard { margin: 28px 0 0; }
.libraryCard { padding: 14px; background: #fffdf7; transform: rotate(-1deg); }
.libraryCard img { width: 100%; height: auto; border-radius: 8px; }

/* code */
.codeBlock {
  position: relative;
  background: var(--ink);
  color: #F4EFE3;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  margin: 0 0 16px;
}
.codeBlock pre { margin: 0; padding: 22px 24px; padding-right: 96px; overflow-x: auto; font-family: "Geist Mono", ui-monospace, monospace; font-size: 14px; line-height: 1.7; }
.codeBlock code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; white-space: pre; }
.codeBlock.wrap code { white-space: pre-wrap; }
.copyBtn {
  position: absolute;
  top: 12px; right: 12px;
  padding: 6px 14px;
  border: 2px solid var(--neutral);
  border-radius: 999px;
  background: transparent;
  color: var(--neutral);
  font: 500 13px "Geist Mono", monospace;
  cursor: pointer;
  transition: background 160ms, color 160ms;
}
.copyBtn:hover { background: var(--neutral); color: var(--ink); }
.copyBtn.done { background: var(--success); border-color: var(--success); color: var(--ink); }

.threeUp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 8px 0 24px; }
.threeUp .sticker { margin-bottom: 14px; }

.visionCard { padding: clamp(28px, 5vw, 56px); background: var(--quaternary); transform: rotate(-.4deg); }
.visionCard:hover { transform: rotate(0) translateY(-3px); }
.visionCard h2 { margin: 14px 0 18px; max-width: 15em; }
.visionCard p { color: var(--ink); font-size: 18px; max-width: 40em; }
.visionCard .sticker { background: var(--secondary); }
.contributors { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.contributor { padding: 8px 14px; border: 2px solid var(--border); border-radius: 999px; background: var(--neutral); font-size: 14px; font-weight: 700; }
.contributor.empty { background: transparent; border-style: dashed; color: rgba(26,26,31,.6); }

/* FAQ */
.faq { display: grid; gap: 12px; margin-top: 28px; max-width: 860px; }
.faq details { border: 2px solid var(--border); border-radius: var(--radius-md); background: var(--neutral); transition: background 180ms; }
.faq details[open] { background: var(--surface); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 56px 18px 20px;
  font-weight: 800;
  font-size: 17px;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 18px; top: 50%;
  width: 28px; height: 28px;
  margin-top: -14px;
  display: grid;
  place-items: center;
  border: 2px solid var(--border);
  border-radius: 50%;
  font: 500 18px/1 "Geist Mono", monospace;
  transition: transform 220ms var(--spring), background 180ms;
}
.faq details[open] summary::after { transform: rotate(45deg); background: var(--primary); }
.faq details p { padding: 0 20px 18px; margin: 0; max-width: 46em; }

/* coffee */
.coffeeCard { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--primary); }
.coffeeCard h2 { margin-bottom: 8px; }
.coffeeCard p { color: var(--ink); margin: 0; max-width: 36em; }
.coffeeBtn { flex-shrink: 0; }

/* signature (from Gumreel) */
.signatureLine {
  width: fit-content;
  margin: 64px auto 0;
  padding: 8px 16px;
  background: var(--ink);
  border-radius: 999px;
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  color: #fff;
}
.signatureLine a { color: #00ff41; text-decoration: none; }
.signatureLine a:hover { color: #00ff41; background: transparent; text-decoration: underline; }

.footer { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; padding: 24px 0 48px; text-align: center; }
.footer p { font-size: 14px; margin: 6px 0; }

/* reveal on scroll (only when JS is on and motion is allowed) */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 500ms var(--spring), transform 500ms var(--spring); }
.js .reveal.in { opacity: 1; transform: none; }
.js .polaroid.reveal.in { transform: rotate(1.5deg); }
.js .polaroid.tilt.reveal.in { transform: rotate(-1.5deg); }
.js .libraryCard.reveal.in { transform: rotate(-1deg); }
.js .visionCard.reveal.in { transform: rotate(-.4deg); }
.js .polaroid.reveal.in:hover, .js .visionCard.reveal.in:hover { transform: rotate(0) translateY(-4px); }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .heroVideo { max-width: 520px; }
  .steps, .threeUp { grid-template-columns: minmax(0, 1fr); }
  .split, .libSection .libText { grid-template-columns: minmax(0, 1fr); }
  .nav nav a:not(.btn) { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  h1 { font-size: 46px; }
  .wordmark { font-size: 16px; }
  .nav { padding-left: 8px; }
  main { width: calc(100% - 32px); padding-top: 28px; }
  .hero { padding: 24px 20px; border-radius: var(--radius-lg); }
  .gallery { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .section { padding-top: 56px; }
  .coffeeCard { flex-direction: column; align-items: flex-start; }
  .codeBlock pre { font-size: 12.5px; padding: 54px 18px 18px; }
  .ctas .btn { flex: 1 1 100%; }
  .filmstrip { width: calc(100% - 32px); }
}

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