/* =========================================================
   Neue Academy — live event homepage (12.01)
   Dark: MagicPath "Announcement" over the hat jellyfish.
   Light: Figma "main" — blue grid, torn paper, blobs.
   Flow: register → saving run (~1.5 s) → the pass (folder letter).
   ========================================================= */
@font-face {
  font-family: "Dazzed";
  src: url("./assets/fonts/Dazzed-Medium.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}
@font-face {
  font-family: "Dazzed";
  src: url("./assets/fonts/Dazzed-SemiBold.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
}

:root {
  --font: "Dazzed", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);

  /* dark */
  --bg: #000;
  --ink: #f4f4f5;
  --ink-strong: #fafafa;
  --muted: #a1a1aa;
  --soft: #71717a;
  --faint: #52525b;
  --line: #27272a;
  --field: rgba(9, 9, 11, 0.8);
  --field-focus: #18181b;
  --accent: #8b9dff;
  --cta: #4f5bff;
  --cta-hover: #6b78ff;
  --cta-ink: #fff;
  --glow: rgba(79, 99, 255, 0.32);
  --sheen-a: #dbe2ff;
  --sheen-b: #7f95ff;
  --chip: rgba(255, 255, 255, 0.08);
  --done-bg: rgba(139, 157, 255, 0.06);
  --done-line: rgba(139, 157, 255, 0.3);

  /* the pass (same in both themes: it's paper) */
  --paper: #fdfbf5;
  --pocket: #f4efe3;
  --folder: #e3dac5;
  --tab: #eee7d6;
  --cert-ink: #2a2622;
  --cert-grey: #7d776c;
  --stamp: #7b3fe4;
}
[data-theme="light"] {
  --bg: #619df9;
  --ink: #1d1b17;
  --ink-strong: #14130f;
  --muted: #5f5a50;
  --soft: #7d776c;
  --faint: #9a9488;
  --line: rgba(29, 27, 23, 0.12);
  --field: #fffdf8;
  --field-focus: #fff;
  --accent: #3b5bf0;
  --cta: #1d1b17;
  --cta-hover: #3a372f;
  --cta-ink: #fffdf8;
  --sheen-a: #3d4f9a;
  --sheen-b: #6f8cff;
  --chip: rgba(29, 27, 23, 0.07);
  --done-bg: rgba(255, 253, 248, 0.75);
  --done-line: rgba(29, 27, 23, 0.1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.5s var(--ease-out);
}
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- dark background: hat jellyfish ---------- */
.hats {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, var(--grid-alpha, 0.025)) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, var(--grid-alpha, 0.025)) 1px, transparent 1px);
  background-size: 12px 12px;
}
.hats canvas {
  position: absolute;
  inset: -40px;
  width: calc(100% + 80px);
  height: calc(100% + 80px);
  will-change: transform;
  /* hats dim behind the headline and form so the copy stays readable */
  -webkit-mask-image: radial-gradient(ellipse 34% 38% at 50% 52%, rgba(0, 0, 0, var(--center-fade, 0.35)) 0%, rgba(0, 0, 0, var(--center-fade, 0.35)) 45%, #000 100%);
  mask-image: radial-gradient(ellipse 34% 38% at 50% 52%, rgba(0, 0, 0, var(--center-fade, 0.35)) 0%, rgba(0, 0, 0, var(--center-fade, 0.35)) 45%, #000 100%);
}
.glow {
  position: fixed;
  left: 50%;
  top: 44%;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, var(--glow) 0%, rgba(79, 99, 255, 0.07) 40%, transparent 70%);
  filter: blur(40px);
  transform: translate(-50%, -50%);
  opacity: 0.7;
}
[data-theme="light"] .hats, [data-theme="light"] .glow { display: none; }

/* ---------- light background: the collage ---------- */
.collage { display: none; }
[data-theme="light"] .collage {
  --cell: max(48px, 5vw);
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: #619df9;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  animation: fade-in 0.6s var(--ease-out) both;
}
.paper {
  position: absolute;
  top: 0;
  left: 50%;
  width: max(70.6vw, 720px);
  height: 100%;
  transform: translateX(calc(-50% + 2.5vw));
}
.blob {
  position: absolute;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(20, 30, 70, 0.12));
}
.blob-grid {
  left: 8.3vw;
  top: 5.9vh;
  width: 26.8vw;
  animation: drift-a 11s ease-in-out infinite;
}
.blob-lines {
  left: 71.9vw;
  top: 52vh;
  width: 37.9vw;
  transform: rotate(8.24deg);
  animation: drift-b 13s ease-in-out infinite;
}
/* intro (live.js adds .is-intro): the sheet tears open, then the two blobs
   slide in from the edges. `translate` composes with the drift transforms. */
.collage.is-intro .blob { opacity: 0; }
.collage.is-intro.is-open .blob { opacity: 1; translate: 0 0; transition: translate 1.1s var(--ease-spring), opacity 0.5s var(--ease-out); }
.collage.is-intro.is-open .blob-lines { transition-delay: 0.12s; }
.collage.is-intro:not(.is-open) .blob-grid { translate: -24vw -18vh; }
.collage.is-intro:not(.is-open) .blob-lines { translate: 26vw 22vh; }
[data-theme="light"] .hero .rise { animation-delay: calc(var(--d, 0s) + var(--intro, 0s)); }
[data-theme="light"] { --intro: 0.55s; }
.collage.is-intro ~ .page .bar,
.collage.is-intro ~ .page .foot,
.collage.is-intro ~ .page .legal { animation: fade-in 0.6s 0.6s var(--ease-out) both; }

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(0.6vw, 1vh) rotate(-1.2deg); }
}
@keyframes drift-b {
  0%, 100% { transform: rotate(8.24deg) translate(0, 0); }
  50% { transform: rotate(7deg) translate(-0.6vw, -1vh); }
}

/* ---------- page ---------- */
.page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  pointer-events: none; /* clicks fall through to the hats; real controls opt back in */
}
.page a, .page input, .page button, .page .cert, .page .done { pointer-events: auto; }

.bar, .foot {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
[data-theme="light"] .bar, [data-theme="light"] .foot, [data-theme="light"] .legal { max-width: min(760px, 56vw); }
.bar { padding-top: 28px; padding-bottom: 28px; }
.brand {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.bar-right { display: flex; align-items: center; gap: 18px; }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--soft);
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* theme switch: moon | sun with a sliding knob */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 60px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  color: var(--soft);
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s;
}
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tt-icon { position: relative; z-index: 1; width: 14px; height: 14px; transition: color 0.3s; }
.tt-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.35s var(--ease-spring), background-color 0.3s;
}
.tt-moon { color: var(--bg); }
[data-theme="light"] .tt-knob { transform: translateX(30px); }
[data-theme="light"] .tt-moon { color: var(--soft); }
[data-theme="light"] .tt-sun { color: var(--field); }

.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}
.hero {
  width: 100%;
  max-width: 768px;
  text-align: center;
  padding: 24px 0;
}
.hero.is-leaving { animation: leave 0.45s var(--ease-out) forwards; }
.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--soft);
}
.date {
  display: inline-block;
  margin-top: 14px;
  font-weight: 600;
  font-size: clamp(104px, 19vw, 176px);
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.date { color: var(--ink-strong); }
.headline {
  margin: 22px 0 0;
  font-weight: 600;
  font-size: clamp(32px, 5.4vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--ink-strong);
  text-wrap: balance;
}
.accent { color: var(--accent); }
.lede {
  margin: 16px auto 0;
  max-width: 30em;
  font-size: clamp(17px, 2.1vw, 20px);
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--muted);
  text-wrap: pretty;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 32px;
}
.unit { width: 64px; display: flex; flex-direction: column; align-items: center; }
.num {
  font-weight: 600;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.lbl {
  margin-top: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--faint);
}

/* ---------- form ---------- */
.signup { margin-top: 40px; }
.form { max-width: 576px; margin: 0 auto; }
.field-row {
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--field);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s;
}
[data-theme="light"] .field-row { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 10px 30px -18px rgba(29, 27, 23, 0.35); }
.field-row:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.form.is-error .field-row { border-color: rgba(239, 68, 68, 0.55); }
.in {
  min-width: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 12px 16px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: background 0.2s;
}
.in::placeholder { color: var(--faint); }
.in:focus { background: var(--field-focus); }
[data-theme="light"] .in:focus { background: rgba(29, 27, 23, 0.04); }
.in-name { width: 144px; flex: none; }
.in-email { flex: 1; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cta {
  flex: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 24px;
  background: var(--cta);
  color: var(--cta-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s;
}
.cta:hover { background: var(--cta-hover); }
.cta:active { transform: scale(0.97); }
.cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cta[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--faint);
}
[data-theme="light"] .note { color: var(--soft); }
.form.is-error .note { color: #dc2626; }
[data-theme="dark"] .form.is-error .note { color: #f87171; }

/* ---------- 2 · the run: what's happening while we save ---------- */
/* the steps run on the paper itself; the sheet's paper area sits inside the
   image at roughly 5%–94% across and 9%–93% down */
.run {
  --ink: var(--cert-ink);
  --soft: var(--cert-grey);
  --chip: rgba(42, 38, 34, 0.07);
  position: relative;
  width: min(880px, 94vw);
  aspect-ratio: 960 / 640;
  container-type: inline-size;
  margin: 24px 0;
}
.run.is-leaving { animation: leave 0.4s var(--ease-out) forwards; }
.run-paper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.24));
  animation: paper-in 0.6s var(--ease-spring) both;
}
.run-body {
  position: absolute;
  left: 5%;
  right: 6%;
  top: 12%;
  bottom: 7%;
  display: grid;
  place-items: center;
  animation: fade-in 0.4s 0.25s var(--ease-out) both;
}
.run-body > * { grid-area: 1 / 1; }
.run-list.is-out { opacity: 0; transform: translateY(-10px); transition: opacity 0.3s, transform 0.3s var(--ease-out); }
.run-final {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--cert-ink);
  animation: final-in 0.55s var(--ease-spring) both;
}
.run-final-ico { width: clamp(30px, 5.4cqw, 46px); height: auto; color: #22a35a; }
.run-final-title {
  margin: 1.6cqw 0 0;
  font-size: clamp(30px, 6.6cqw, 58px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}
.run-final-sub {
  margin: 1.2cqw 0 0;
  font-size: clamp(15px, 2.1cqw, 19px);
  color: var(--cert-grey);
}
@keyframes final-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}
.run-list {
  --row: clamp(38px, 6cqw, 52px);
  position: relative;
  height: calc(var(--row) * 3);
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}
.run-row {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--row) * 1);
  height: var(--row);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: clamp(16px, 2.3cqw, 20px);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  opacity: 0.28;
  transform: translateY(calc(var(--off, 0) * var(--row)));
  transition: transform 0.38s var(--ease-out), opacity 0.38s var(--ease-out);
}
.run-row.is-now { opacity: 1; }
.run-ico { width: 18px; height: 18px; flex: none; color: var(--soft); }
.run-row.is-now .run-ico { color: var(--ink); }
.run-chip {
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--chip);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.run-row.is-now .run-chip { background: color-mix(in srgb, var(--chip) 100%, var(--ink) 6%); }
.run-row.is-done .run-ico { color: #22a35a; }

/* ---------- 3 · the pass: a folder with the letter pulled out ---------- */
.pass {
  width: 100%;
  max-width: 880px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 16px 0 24px;
}
.cert {
  --pocket: #f4efe3;
  position: relative;
  width: 100%;
  aspect-ratio: 852 / 540;
  container-type: inline-size;
  color: var(--cert-ink);
  transform: rotate(-0.8deg);
  filter: drop-shadow(0 28px 40px rgba(10, 12, 30, 0.28));
  user-select: none;
}
.cert-back {
  position: absolute;
  left: 0.6%;
  right: 0.6%;
  top: 14%;
  bottom: 0;
  border-radius: 1.4cqw 1.4cqw 0.8cqw 0.8cqw;
  background: var(--folder);
  animation: rise-in 0.55s var(--ease-out) both;
}
.cert-sheet {
  position: absolute;
  left: 4.4%;
  right: 5.3%;
  top: 0;
  height: 62%;
  animation: pull-out 0.9s 0.25s var(--ease-spring) both;
}
.cert-tabs {
  position: absolute;
  inset: 0 0 auto 0;
  height: 6.2cqw;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 4cqw;
  padding: 0 2cqw;
}
.cert-tab {
  align-self: start;
  justify-self: stretch;
  height: 5cqw;
  margin: 0 2cqw;
  border-radius: 0.9cqw 0.9cqw 0 0;
  background: var(--tab);
}
.cert-paper {
  position: absolute;
  inset: 3.6cqw 0 0 0;
  padding: 5.4cqw 6.2cqw 0;
  border-radius: 0.9cqw 0.9cqw 0 0;
  background: var(--paper);
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.04), 0 1cqw 2cqw rgba(60, 50, 30, 0.08);
}
.cert-tag {
  display: inline-block;
  padding: 0.25cqw 0.9cqw 0.3cqw 1.2cqw;
  border-left: 0.5cqw solid var(--cert-ink);
  background: #f2a7a2;
  font-size: 1.85cqw;
  font-weight: 600;
  line-height: 1.25;
  color: var(--cert-ink);
}
.cert-name {
  margin: 1.2cqw 0 0;
  font-size: var(--name-size, 9.4cqw);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--cert-ink);
}
.cert-title {
  margin: 2.6cqw 0 0;
  font-size: 3.1cqw;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--cert-ink);
}
.cert-name, .cert-title, .cert-tag { animation: ink-in 0.7s var(--ease-out) both; }
.cert-tag { animation-delay: 0.7s; }
.cert-name { animation-delay: 0.8s; }
.cert-title { animation-delay: 0.92s; }

.cert-pocket {
  position: absolute;
  left: 0;
  right: 0;
  top: 53.6%;
  bottom: 0;
  border-radius: 0.6cqw 0.6cqw 1.2cqw 1.2cqw;
  background-color: var(--pocket);
  background-image: radial-gradient(rgba(42, 38, 34, 0.12) 0.09cqw, transparent 0.12cqw);
  background-size: 1.3cqw 1.3cqw;
  box-shadow: 0 -0.5cqw 1.6cqw rgba(60, 50, 30, 0.14);
  animation: rise-in 0.6s 0.1s var(--ease-out) both;
}
.cert-pocket-tab {
  position: absolute;
  right: 16%;
  bottom: 100%;
  padding: 0.85cqw 2.2cqw 0.6cqw;
  border-radius: 0.9cqw 0.9cqw 0 0;
  background: var(--pocket);
  font-size: 1.5cqw;
  font-weight: 600;
  white-space: nowrap;
  color: var(--cert-ink);
}
.cert-meta {
  position: absolute;
  left: 10.6%;
  top: 19%;
  margin: 0;
  font-size: 1.3cqw;
  color: var(--cert-ink);
}
.cert-meta span, .cert-meta i { color: var(--cert-grey); font-style: normal; font-weight: 500; }
.cert-meta i { margin: 0 0.6cqw; }
.cert-meta b { font-weight: 600; }
.cert-logo {
  position: absolute;
  left: 10.8%;
  bottom: 18%;
  display: flex;
  align-items: center;
  gap: 1cqw;
  font-size: 2.45cqw;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.cert-logo svg { width: 2.6cqw; height: 2.6cqw; }
.cert-logo sup { font-size: 0.4em; vertical-align: 1.2em; margin-left: 0.15em; }
.cert-sign {
  position: absolute;
  left: 41%;
  bottom: 12%;
  width: 19%;
  display: flex;
  flex-direction: column;
  font-size: 1.2cqw;
}
.cert-sign-mark { width: 4.4cqw; height: 4.4cqw; color: var(--cert-ink); transform: rotate(-6deg); }
.cert-sign-line { display: block; height: 1px; margin-top: 1.1cqw; background: var(--cert-ink); opacity: 0.55; }
.cert-signer { margin-top: 0.8cqw; font-weight: 600; }
.cert-role { color: var(--cert-grey); }
.cert-stamp {
  position: absolute;
  left: 71.2%;
  top: 22%;
  width: 18.8%;
  height: auto;
  color: var(--stamp);
  opacity: 0.92;
  mix-blend-mode: multiply;
  transform: rotate(-12deg);
  font-family: var(--font);
  font-weight: 600;
  animation: stamp 0.55s 1.2s cubic-bezier(0.3, 1.6, 0.6, 1) both;
}

.done {
  width: 100%;
  max-width: 600px;
  padding: 28px 36px 32px;
  border: 1px solid var(--done-line);
  border-radius: 20px;
  background: var(--done-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  text-align: center;
  animation: rise-in 0.7s 1.45s var(--ease-out) both;
}
.done-title {
  margin: 0;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.03em;
  color: var(--ink-strong);
  outline: none;
}
.done-sub { margin: 10px auto 0; max-width: 30em; color: var(--muted); line-height: 1.55; text-wrap: pretty; }
.done .watch-link {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px auto 0;
  max-width: 420px;
  padding: 14px 16px 14px 18px;
  border-radius: 14px;
  background: var(--cta);
  color: var(--cta-ink);
  text-decoration: none;
  text-align: left;
  transition: background-color 0.15s, transform 0.15s;
}
.watch-link:hover { background: var(--cta-hover); }
.watch-link:active { transform: scale(0.98); }
.watch-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.watch-link-label { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.watch-link-url { flex: 1; font-size: 14px; opacity: 0.7; }
.watch-link svg { width: 16px; height: 16px; flex: none; }
.cal { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cal-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}
.cal-btn:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.cal-btn:active { transform: scale(0.97); }
.cal-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-primary { background: var(--cta); border-color: var(--cta); color: var(--cta-ink); }
.cal-primary:hover { background: var(--cta-hover); border-color: var(--cta-hover); }
.cal-logo { width: 20px; height: 20px; flex: none; }
.cal-primary .cal-logo { border-radius: 4px; background: #fff; padding: 1px; }
.cal-apple { width: 18px; height: 18px; }

/* ---------- footer ---------- */
.foot {
  padding-top: 16px;
  padding-bottom: 40px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--faint);
  gap: 16px;
}
[data-theme="light"] .foot { color: var(--soft); }
.legal {
  margin: 0 auto;
  padding: 0 24px 28px;
  max-width: 1024px;
  width: 100%;
  font-size: 11px;
  color: #3f3f46;
  text-align: center;
}
.legal a { color: #52525b; text-decoration: none; }
.legal a:hover { color: var(--muted); }
[data-theme="light"] .legal, [data-theme="light"] .legal a { color: var(--soft); }

/* ---------- motion ---------- */
.rise { opacity: 0; animation: rise 1.1s var(--ease-out) forwards; animation-delay: var(--d, 0s); }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes leave {
  to { opacity: 0; transform: translateY(-16px) scale(0.98); filter: blur(6px); }
}
@keyframes paper-in {
  from { opacity: 0; transform: translateY(18px) rotate(-3deg) scale(0.94); }
  to { opacity: 1; transform: none; }
}
@keyframes pull-out {
  from { opacity: 0; transform: translateY(46%); }
  to { opacity: 1; transform: none; }
}
@keyframes ink-in {
  from { opacity: 0; filter: blur(4px); transform: translateY(0.6cqw); }
  to { opacity: 1; filter: none; transform: none; }
}
@keyframes stamp {
  0% { opacity: 0; transform: rotate(-24deg) scale(1.7); }
  70% { opacity: 0.92; }
  100% { opacity: 0.92; transform: rotate(-12deg) scale(1); }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes pulse { 50% { opacity: 0.5; } }

@media (max-width: 760px) {
  .paper { width: 128vw; transform: translateX(-50%); }
  .blob-grid { left: -14vw; top: -3vh; width: 52vw; }
  .blob-lines { left: 62vw; top: 78vh; width: 64vw; }
  [data-theme="light"] .bar, [data-theme="light"] .foot, [data-theme="light"] .legal { max-width: 1024px; }
}
@media (max-width: 640px) {
  .bar { padding-top: 20px; padding-bottom: 20px; }
  .bar-right { gap: 12px; }
  .field-row { flex-direction: column; }
  .in-name { width: auto; }
  .cta { padding: 14px 24px; }
  .countdown { gap: 12px; }
  .num { font-size: 30px; }
  .foot { flex-direction: column; gap: 8px; text-align: center; padding-bottom: 24px; }
  .glow { width: 420px; height: 420px; }
  .run-row { font-size: 15px; gap: 10px; }
  .run-chip { font-size: 13px; }
  .pass { gap: 20px; }
  /* the pass on a phone: taller card, small print scaled up so it stays readable */
  .cert { transform: none; aspect-ratio: 852 / 760; }
  .cert-back { top: 11%; }
  .cert-sheet { height: 60%; }
  .cert-tabs { height: 9cqw; gap: 0 1.5cqw; padding: 0 1cqw; }
  .cert-tab { height: 8cqw; margin: 0 1cqw; }
  .cert-paper { inset: 5.4cqw 0 0 0; padding: 6.5cqw 6cqw 0; }
  .cert-tag { font-size: 3.4cqw; }
  .cert-name { font-size: calc(var(--name-size, 9.4cqw) * 1.2); }
  .cert-title { font-size: 5cqw; margin-top: 3cqw; }
  .cert-pocket { top: 52%; }
  .cert-pocket-tab { right: 6%; font-size: 2.7cqw; padding: 1.4cqw 2.6cqw 1cqw; }
  .cert-meta { left: 8%; right: 8%; top: 10%; font-size: 2.6cqw; line-height: 1.6; }
  .cert-logo { left: 8%; bottom: 13%; font-size: 4cqw; }
  .cert-logo svg { width: 4.2cqw; height: 4.2cqw; }
  .cert-sign { left: 8%; bottom: 31%; width: 30%; font-size: 2.5cqw; }
  .cert-sign-mark { width: 7cqw; height: 7cqw; }
  .cert-stamp { left: 66%; top: 34%; width: 27%; }
  .done { padding: 24px 20px 26px; }
  .cal-btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .rise, .done, .cert *, .cert-back, .run-paper, .collage, .blob { animation: none !important; opacity: 1; }
  .live-dot { animation: none; }
  .collage.is-intro .blob { translate: none; }
  .run-row { transition: none; }
}

/* ---------- tweaks panel (hats.js, ?tweaks) ---------- */
.lil-gui.root { z-index: 50; pointer-events: auto; }
.tweaks-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 49;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  color: var(--muted);
  font: 500 12px/1 var(--font);
  cursor: pointer;
}
