/*
  headscapades.com

  The palette is Palette from Headscapades/Support/Theme.swift, converted from
  its 0-1 components — the same conversion already done in
  Tools/Marketing/style.css, kept identical so the site, the App Store
  screenshots and the app all read as one thing.

  Tools/Marketing/style.css itself is not reusable here: it is authored at a
  fixed 1290x2796 screenshot canvas with a scaled phone inside it. This is the
  responsive sibling. Only the tokens and the type voice are shared.

  No web fonts, no CDN, no analytics, nothing fetched from a third party. The
  deck page carries a deck's contents in its URL, so the fewer parties that
  see a request, the better. See Tools/Web/README.md.
*/

:root {
  --ink: rgb(10, 10, 12);
  --ink-raised: rgb(18, 18, 22);
  --volt: rgb(208, 255, 61);
  --correct: rgb(46, 221, 133);
  --miss: rgb(255, 73, 74);
  --text-primary: rgb(245, 245, 245);
  --text-secondary: rgba(245, 245, 245, 0.56);
  --text-tertiary: rgba(245, 245, 245, 0.32);
  --hairline: rgba(255, 255, 255, 0.10);
  --surface: rgba(255, 255, 255, 0.055);

  --measure: 1080px;
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* The browser's own [hidden] rule is display:none at the lowest specificity,
   so any class that sets display beats it — .btn below is display:inline-flex,
   which silently made el.hidden = true do nothing to the buttons. The page
   shows and hides most of itself through that attribute, so it has to win. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--ink);
  color: var(--text-primary);
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Backdrop from Theme.swift: near-black with one soft light source, so the
   page reads as the same room as the app rather than as a generic dark site. */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 140vmax; height: 140vmax;
  right: -50vmax; top: -70vmax;
  background: radial-gradient(circle, rgba(208, 255, 61, 0.14) 0%, rgba(0, 0, 0, 0) 62%);
}
body::after {
  width: 110vmax; height: 110vmax;
  left: -45vmax; bottom: -55vmax;
  background: radial-gradient(circle, rgba(18, 18, 22, 0.95) 0%, rgba(0, 0, 0, 0) 65%);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Type ---------- */

/* The app's headline voice: compressed heavy caps. font-stretch picks up SF's
   width axis on Apple platforms and is ignored elsewhere, which degrades to
   plain heavy caps rather than to something wrong. */
.display {
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 900;
  font-stretch: 75%;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.accent { color: var(--volt); }
.t2 { color: var(--text-secondary); }
.t3 { color: var(--text-tertiary); }

/* ---------- Surfaces & buttons (HairlineSurface / VoltButtonStyle) ---------- */

.surface {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.4px;
  border-radius: 18px;
  padding: 17px 28px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.985); opacity: 0.82; }

.btn-volt { background: var(--volt); color: var(--ink); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--hairline);
  color: var(--text-primary);
  font-weight: 600;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); }

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

/* ---------- Header ---------- */

.masthead {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 0 0;
}
.masthead img {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: block;
}
/* On pages other than the landing page the masthead is also the way back. */
.masthead a {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}
.masthead .name {
  font-family: "SF Pro Display", -apple-system, system-ui, sans-serif;
  font-weight: 900;
  font-stretch: 75%;
  text-transform: uppercase;
  font-size: 22px;
  letter-spacing: -0.01em;
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(48px, 9vw, 104px) 0 clamp(40px, 6vw, 72px);
  text-align: center;
}

.hero h1 {
  font-size: clamp(52px, 11vw, 116px);
  margin-bottom: 24px;
}

.hero .sub {
  font-size: clamp(17px, 2.4vw, 23px);
  color: var(--text-secondary);
  max-width: 34ch;
  margin: 0 auto;
  text-wrap: balance;
}

.cta {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.cta-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ---------- Shots ---------- */

.shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 3vw, 40px);
  align-items: end;
  padding-bottom: clamp(40px, 7vw, 88px);
}

.shot { text-align: center; }

.shot figure {
  /* The screens are cropped out of the App Store posters, so they end on a
     hard horizontal edge. Fading the last fifth turns that cut into a
     deliberate vignette instead of a mistake. */
  -webkit-mask-image: linear-gradient(180deg, #000 76%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 76%, transparent 100%);
}

.shot img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.6));
}

.shot figcaption {
  margin-top: -8px;
  font-size: 14px;
  color: var(--text-secondary);
}
.shot figcaption strong {
  display: block;
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 2px;
}

/* ---------- Feature rows ---------- */

.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding-bottom: clamp(48px, 7vw, 96px);
}

.point { padding: 26px 24px 28px; }
.point h3 {
  font-family: "SF Pro Display", -apple-system, system-ui, sans-serif;
  font-size: 19px;
  font-weight: 800;
  margin: 12px 0 8px;
}
.point p { font-size: 15px; color: var(--text-secondary); }

/* ---------- Deck page ---------- */

.deck {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 0;
  text-align: center;
}

.deck h1 {
  font-size: clamp(40px, 9vw, 76px);
  margin-bottom: 20px;
}

.deck .sub {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--text-secondary);
  max-width: 40ch;
  margin: 0 auto 32px;
  text-wrap: balance;
}

.codebox {
  max-width: 560px;
  margin: 0 auto 28px;
  padding: 18px 20px;
  text-align: left;
}
.codebox .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.codebox code {
  display: block;
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
  word-break: break-all;
  /* A 600-character deck code is not something anyone reads. Show enough to
     recognise, not enough to dominate the page. */
  max-height: 4.4em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}

.steps {
  max-width: 560px;
  margin: 32px auto 0;
  text-align: left;
  padding: 22px 24px 24px;
  font-size: 15px;
  color: var(--text-secondary);
}
.steps ol { margin: 12px 0 0 20px; }
.steps li { margin-bottom: 8px; }

/* ---------- Document pages (privacy, support) ---------- */

/* Long-form prose, in the same room as the rest of the site: same palette, same
   compressed-caps headings, one column at a readable measure. The landing page
   is a poster and these are documents, so the only thing that changes is the
   density — nothing about the voice. */

.page-head {
  padding: clamp(40px, 7vw, 76px) 0 clamp(20px, 3vw, 34px);
}
.page-head h1 {
  font-size: clamp(38px, 8vw, 78px);
  margin: 12px 0 18px;
}
.page-head .sub {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--text-secondary);
  max-width: 46ch;
  text-wrap: balance;
}
.page-head .stamp {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.doc {
  max-width: 64ch;
  padding-bottom: clamp(48px, 7vw, 96px);
}

.doc > section {
  border-top: 1px solid var(--hairline);
  margin-top: 36px;
  padding-top: 32px;
  /* Anchors from the contents list should not land flush against the top. */
  scroll-margin-top: 24px;
}
.doc > section:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.doc h2 {
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(21px, 3vw, 26px);
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.doc h3 {
  font-family: "SF Pro Display", -apple-system, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin: 26px 0 8px;
}

.doc p,
.doc ul,
.doc ol {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.doc ul, .doc ol { padding-left: 20px; }
.doc li { margin-bottom: 8px; }
.doc li::marker { color: var(--text-tertiary); }
.doc strong { color: var(--text-primary); font-weight: 650; }

.doc a {
  color: var(--volt);
  text-decoration: none;
  border-bottom: 1px solid rgba(208, 255, 61, 0.32);
}
.doc a:hover { border-bottom-color: var(--volt); }

.doc code {
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  color: var(--text-primary);
}

/* Names of things on screen in the app — a tap path, a button. Kept on one
   line so "Settings ▸ Headscapades" never breaks across two. */
.doc .ui {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
}

/* An exact message the app shows, quoted so it can be matched by eye against
   what is on the screen. */
.doc .msg {
  margin: 2px 0 14px;
  padding: 10px 0 10px 16px;
  border-left: 2px solid var(--hairline);
  color: var(--text-primary);
  font-size: 15px;
}

.callout { padding: 20px 22px; margin: 0 0 6px; }
.callout .eyebrow { margin-bottom: 12px; }
.callout ul { margin-bottom: 0; }
.callout p:last-child { margin-bottom: 0; }

/* Unfinished text that must not reach the live site unnoticed. Loud on purpose:
   a placeholder in a privacy policy is worse than no policy. */
.todo {
  border-color: rgba(255, 73, 74, 0.45);
  background: rgba(255, 73, 74, 0.07);
}
.todo .eyebrow { color: var(--miss); }

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
}
.toc a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
}
/* The border shorthand above is also what cancels the volt underline `.doc a`
   gives every other link in here; this keeps it cancelled on hover too. */
.toc a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ---------- Interstitial banner (iOS auto-forward) ---------- */

.forward {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(24, 24, 28, 0.92);
  border: 1px solid var(--hairline);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  font-size: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}
.forward .spin {
  width: 16px; height: 16px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(208, 255, 61, 0.25);
  border-top-color: var(--volt);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.forward span { flex: 1; text-align: left; }
.forward button {
  background: none;
  border: 0;
  color: var(--volt);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 2px;
}

@media (prefers-reduced-motion: reduce) {
  .forward .spin { animation: none; }
  .btn { transition: none; }
}

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--hairline);
  padding: 28px 0 48px;
  font-size: 13px;
  color: var(--text-tertiary);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}
footer a { color: var(--text-secondary); text-decoration: none; }
footer a:hover { color: var(--text-primary); }
footer .links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

@media (max-width: 720px) {
  .shots { grid-template-columns: 1fr; gap: 8px; }
  .shot:not(:first-child) { display: none; }
  .cta .btn { width: 100%; }
}
