/* ---------------------------------------------------------------
   FONTS — self-hosted (OFL), no CDN
   Zilla Slab: captions / headings / display
   Comic Neue: body copy, UI controls, speech-bubble voice
   JetBrains Mono: the step counter only (a real measurement, not costume)
   --------------------------------------------------------------- */
@font-face {
  font-family: "Zilla Slab";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/zilla-slab-400.woff2") format("woff2");
}
@font-face {
  font-family: "Zilla Slab";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/zilla-slab-700.woff2") format("woff2");
}
@font-face {
  font-family: "Comic Neue";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/comic-neue-400.woff2") format("woff2");
}
@font-face {
  font-family: "Comic Neue";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/comic-neue-700.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/jetbrains-mono-400.woff2") format("woff2");
}

/* ---------------------------------------------------------------
   TOKENS — riso-zine palette: putty paper, ink navy, two spot
   colours (alert orange, info teal) plus a highlight yellow.
   --------------------------------------------------------------- */
:root {
  --bg: #eceee2;
  --panel: #fffef9;
  --panel-tint: #f7f5ea;
  --ink: #1c2541;
  --ink-soft: #4a5270;
  --accent-alert: #ff5a36;
  --accent-alert-soft: #ffe4d9;
  --accent-info: #2e7d6b;
  --accent-info-soft: #dcece6;
  --accent-highlight: #ffc93c;
  --border-w: 3px;
  --radius-panel: 4px;
  --font-display: "Zilla Slab", Georgia, "Times New Roman", serif;
  --font-body: "Comic Neue", "Trebuchet MS", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10152a;
    --panel: #1b2138;
    --panel-tint: #212843;
    --ink: #ede8dc;
    --ink-soft: #b7bbd0;
    --accent-alert: #ff8563;
    --accent-alert-soft: #3a2a2e;
    --accent-info: #57c2a4;
    --accent-info-soft: #1c3630;
    --accent-highlight: #ffd166;
  }
}
:root[data-theme="dark"] {
  --bg: #10152a;
  --panel: #1b2138;
  --panel-tint: #212843;
  --ink: #ede8dc;
  --ink-soft: #b7bbd0;
  --accent-alert: #ff8563;
  --accent-alert-soft: #3a2a2e;
  --accent-info: #57c2a4;
  --accent-info-soft: #1c3630;
  --accent-highlight: #ffd166;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.halftone {
  background-image: radial-gradient(currentColor 1.1px, transparent 1.1px);
  background-size: 9px 9px;
}

/* ---------------------------------------------------------------
   TOP BAR
   --------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: var(--border-w) solid var(--ink);
  background: var(--panel);
  flex-wrap: wrap;
}
.wordmark {
  font-family: var(--font-display); font-weight: 700; font-style: italic;
  font-size: 1.3rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none;
}
.wordmark span { color: var(--accent-info); font-style: normal; }
.wordmark:focus-visible { outline: 2.5px solid var(--accent-info); outline-offset: 3px; }
.tagline { color: var(--ink-soft); font-size: 0.85rem; max-width: 40ch; text-align: right; }

/* ---------------------------------------------------------------
   STAGE — one slide visible at a time
   --------------------------------------------------------------- */
.stage-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: clamp(1.2rem, 5vw, 2.4rem) clamp(1rem, 4vw, 1.5rem);
  cursor: pointer;
}
.stage { width: 100%; max-width: 640px; position: relative; }

.slide { display: none; }
.slide.active { display: block; }
.slide.enter-right { animation: inRight 0.5s cubic-bezier(.2,.8,.2,1); }
.slide.enter-left  { animation: inLeft 0.5s cubic-bezier(.2,.8,.2,1); }
@keyframes inRight {
  from { opacity: 0; transform: translateX(38px) rotate(1.4deg); }
  to   { opacity: 1; transform: translateX(0) rotate(var(--tilt, 0deg)); }
}
@keyframes inLeft {
  from { opacity: 0; transform: translateX(-38px) rotate(-1.4deg); }
  to   { opacity: 1; transform: translateX(0) rotate(var(--tilt, 0deg)); }
}

.card {
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-panel);
  background: var(--panel);
  padding: clamp(1.5rem, 5vw, 2.4rem);
  position: relative;
  cursor: default;
}
.card--left  { --tilt: -0.6deg; box-shadow: -7px 7px 0 var(--ink); transform: rotate(var(--tilt)); }
.card--right { --tilt: 0.6deg;  box-shadow: 7px 7px 0 var(--ink); transform: rotate(var(--tilt)); }

/* cover */
.cover { text-align: center; }
.cover .halftone-corner {
  position: absolute; top: -14px; right: -14px; width: 84px; height: 84px;
  color: var(--accent-info); opacity: 0.55; border-radius: 50%; pointer-events: none;
}
.mascot { width: 88px; height: 88px; margin: 0 auto; }
.cover h1 {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 5vw, 2.3rem);
  line-height: 1.15; margin: 1rem 0 0.6rem; text-wrap: balance;
}
.cover p.sub { color: var(--ink-soft); font-size: 1.02rem; max-width: 40ch; margin: 0 auto; }
.cover p.meta {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft);
  margin: 0.7rem 0 0; text-transform: uppercase; letter-spacing: 0.06em;
}
.cover .cta {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.4rem;
  font-family: var(--font-body); font-weight: 700; font-size: 0.92rem; color: var(--accent-info);
}
.cta-arrow { display: inline-block; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateX(0);} 50% { transform: translateX(5px);} }

/* step card head */
.card-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1rem; }
.step-icon {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center;
}
.step-icon svg { width: 22px; height: 22px; }
.card--alert .step-icon { background: var(--accent-alert-soft); color: var(--accent-alert); }
.card--info  .step-icon { background: var(--accent-info-soft);  color: var(--accent-info); }
.card--good  .step-icon { background: var(--accent-highlight);  color: var(--ink); }

.card h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; margin: 0; text-wrap: balance; }

.card-body { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 540px) {
  .card-body { grid-template-columns: 1fr auto; align-items: start; }
}
.card p.explain { max-width: 44ch; line-height: 1.55; color: var(--ink); margin: 0; }
.client-email {
  font-family: var(--font-mono); font-weight: 600; font-size: 0.92em;
  background: var(--panel-tint); border: 1.5px solid var(--ink-soft);
  border-radius: 3px; padding: 0.05em 0.4em; white-space: nowrap;
}
.card a { color: var(--accent-info); font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.card a:hover, .card a:focus-visible { color: var(--ink); }
.card ul.bullets { margin: 0; padding-left: 1.1rem; color: var(--ink); line-height: 1.6; max-width: 42ch; }

.template-block {
  margin-top: 1rem; border: 1.5px dashed var(--ink-soft); border-radius: 3px;
  background: var(--panel-tint); overflow: hidden;
}
.template-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 0.5rem 0.75rem; border-bottom: 1.5px dashed var(--ink-soft);
}
.template-head span {
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.copy-btn {
  font-family: var(--font-body); font-weight: 700; font-size: 0.78rem; color: var(--ink);
  background: var(--panel); border: 2px solid var(--ink); border-radius: 999px;
  padding: 0.3rem 0.7rem; cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.copy-btn:hover { background: var(--accent-highlight); }
.copy-btn:active { transform: scale(0.94); }
.copy-btn:focus-visible { outline: 2.5px solid var(--accent-info); outline-offset: 2px; }
.copy-btn.copied { background: var(--accent-info-soft); color: var(--accent-info); border-color: var(--accent-info); }
.copy-btn svg { width: 14px; height: 14px; }
.template-body {
  margin: 0; padding: 0.85rem; font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.65;
  color: var(--ink); white-space: pre-wrap; word-break: break-word; max-height: 280px; overflow-y: auto;
}

.action-box {
  margin-top: 0.9rem; display: flex; gap: 0.55rem; align-items: flex-start; font-size: 0.9rem;
  padding: 0.65rem 0.85rem; border-radius: 3px; border: 1.5px dashed var(--ink-soft);
}
.action-box b { display: block; font-family: var(--font-display); font-weight: 700; }
.action-icon { flex: none; width: 19px; height: 19px; color: var(--accent-info); margin-top: 0.15rem; }
.action-icon svg { width: 100%; height: 100%; }

.art {
  width: 132px; height: 132px; border: 2.5px solid var(--ink); border-radius: 10px;
  background: var(--panel-tint); display: flex; align-items: center; justify-content: center;
  position: relative; flex: none; margin: 0 auto;
}
.art::after {
  content: ""; position: absolute; inset: 6px; border-radius: 6px;
  background-image: radial-gradient(currentColor 1px, transparent 1px);
  background-size: 8px 8px; color: var(--ink); opacity: 0.06;
}
.art svg { width: 76px; height: 76px; position: relative; z-index: 1; }

.faq { margin-top: 1.1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.faq summary {
  cursor: pointer; font-weight: 700; font-family: var(--font-display); padding: 0.55rem 0.2rem;
  list-style: none; display: flex; align-items: center; gap: 0.5rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+"; font-family: var(--font-display); font-size: 1.05rem; width: 1.3rem;
  text-align: center; color: var(--accent-info);
}
.faq[open] summary::before { content: "\2013"; }
.faq-item { border-bottom: 1.5px solid var(--ink); }
.faq-item:last-child { border-bottom: none; }
.faq p { margin: 0 0 0.75rem 1.8rem; color: var(--ink-soft); max-width: 48ch; line-height: 1.5; font-size: 0.92rem; }
.faq summary:focus-visible { outline: 2.5px solid var(--accent-info); outline-offset: 2px; border-radius: 2px; }

.closing { text-align: center; background: var(--accent-info-soft); }
.checklist { text-align: left; max-width: 300px; margin: 1rem auto 0; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.92rem; }
.checklist li { display: flex; gap: 0.55rem; align-items: center; list-style: none; }
.checklist svg { width: 17px; height: 17px; color: var(--accent-info); flex: none; }
.replay {
  margin-top: 1.3rem; display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-body); font-weight: 700; font-size: 0.82rem; color: var(--ink-soft);
}

/* ---------------------------------------------------------------
   NAV BAR
   --------------------------------------------------------------- */
.navbar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center; gap: clamp(0.7rem, 3vw, 1.4rem);
  padding: 0.8rem clamp(1rem, 4vw, 2rem);
  background: var(--panel); border-top: var(--border-w) solid var(--ink);
  flex-wrap: wrap;
}
.nav-btn {
  font-family: var(--font-body); font-weight: 700; font-size: 0.86rem; color: var(--ink);
  background: var(--panel-tint); border: 2px solid var(--ink); border-radius: 999px;
  padding: 0.45rem 0.95rem; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.nav-btn:hover { background: var(--accent-highlight); }
.nav-btn:active { transform: scale(0.94); }
.nav-btn:disabled { opacity: 0.35; cursor: default; background: var(--panel-tint); transform: none; }
.nav-btn:focus-visible { outline: 2.5px solid var(--accent-info); outline-offset: 2px; }

.dots { display: flex; align-items: center; gap: 0.4rem; }
.dot {
  width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink);
  background: transparent; padding: 0; cursor: pointer; opacity: 0.5;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}
.dot:hover { transform: scale(1.25); }
.dot.done { background: var(--ink-soft); opacity: 0.8; }
.dot.current { background: var(--accent-info); border-color: var(--accent-info); opacity: 1; transform: scale(1.3); }
.dot:focus-visible { outline: 2.5px solid var(--accent-info); outline-offset: 2px; }

.counter {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft);
  min-width: 6.5ch; text-align: center; font-variant-numeric: tabular-nums;
}

footer {
  max-width: 640px; margin: 0 auto; padding: 1.4rem clamp(1rem, 4vw, 1.5rem) 1.6rem;
  color: var(--ink-soft); font-size: 0.78rem; line-height: 1.6; text-align: center;
}
.sr-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------
   HOME PAGE
   --------------------------------------------------------------- */
.home-wrap { align-items: flex-start; }
.home-stage { display: flex; flex-direction: column; gap: 1.6rem; padding-top: 1rem; }
.guide-list { display: flex; flex-direction: column; gap: 0.9rem; }
.guide-card {
  display: flex; align-items: center; gap: 0.9rem;
  border: var(--border-w) solid var(--ink); border-radius: var(--radius-panel);
  background: var(--panel); padding: 1rem 1.2rem; text-decoration: none; color: var(--ink);
  box-shadow: 5px 5px 0 var(--ink); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.guide-card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.guide-card:focus-visible { outline: 2.5px solid var(--accent-info); outline-offset: 3px; }
.guide-card .step-icon { background: var(--accent-info-soft); color: var(--accent-info); }
.guide-card-text { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.guide-card-text b { font-family: var(--font-display); font-size: 1.05rem; }
.guide-card-text span { color: var(--ink-soft); font-size: 0.88rem; }
.guide-card-arrow { font-weight: 700; color: var(--accent-info); font-size: 1.1rem; }

@media (prefers-reduced-motion: reduce) {
  .slide.enter-right, .slide.enter-left { animation: none; }
  .cta-arrow { animation: none; }
  .guide-card { transition: none; }
}
