/* realQuest Tech — home page. Light mode only (PRD §3). */

:root {
  --paper: #F4F3EE;
  --white: #FFFFFF;
  --ink: #111111;
  --muted: #55534C;
  --accent: #C23B00;
  --highlight: #FFE14D;

  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --rule: 2px solid var(--ink);
  --rule-heavy: 4px solid var(--ink);
  --gutter: clamp(16px, 4vw, 40px);
  /* viewport-fit=cover: keep content clear of the notch and home indicator */
  --gutter-l: max(var(--gutter), env(safe-area-inset-left));
  --gutter-r: max(var(--gutter), env(safe-area-inset-right));
  --max: 1120px;

  /* iOS-style glass */
  --glass-bg: rgba(244, 243, 238, .58);
  --glass-edge: rgba(255, 255, 255, .75);
  --glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -1px 0 rgba(17, 17, 17, .04),
    0 10px 30px rgba(17, 17, 17, .12),
    0 1px 3px rgba(17, 17, 17, .08);

  /* Glass text fields. Edge stays dark enough for 3:1 non-text contrast (WCAG 1.4.11). */
  --field-bg: rgba(255, 255, 255, .6);
  --field-edge: 1.5px solid rgba(17, 17, 17, .5);
  --field-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 2px 6px rgba(17, 17, 17, .06),
    0 1px 2px rgba(17, 17, 17, .06);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* --header-h is kept in sync with the sticky header by main.js */
  scroll-padding-top: calc(var(--header-h, 80px) + 8px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
/* Lock page scroll behind the open dialog (stops iOS scrolling the page underneath) */
html:has(dialog[open]) { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.65 var(--mono);
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
a, button { touch-action: manipulation; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter-r) 0 var(--gutter-l);
}

.skip {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 8px; }

.display {
  font-family: var(--display);
  font-weight: 900;
  font-stretch: 62%;
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

/* ---------- Header (iOS-style glass, floating) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: max(12px, env(safe-area-inset-top)) var(--gutter-r) 0 var(--gutter-l);
  pointer-events: none; /* only the glass bar itself is clickable */
}
.header-inner {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  max-width: calc(var(--max) - 2 * var(--gutter));
  margin: 0 auto;
  padding: 6px 8px 6px 20px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow: var(--glass-shadow);
}
.logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  /* clear space ≥ dot diameter */
  padding: 4px 0;
}
.logo img { height: 32px; width: auto; }

.nav { display: flex; flex-wrap: wrap; gap: 0 2px; }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  text-transform: lowercase;
  transition: background-color .2s ease, box-shadow .2s ease;
}
.nav a:active {
  background: rgba(255, 255, 255, .7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 4px rgba(17, 17, 17, .08);
}
@media (hover: hover) {
  .nav a:hover {
    background: rgba(255, 255, 255, .7);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 4px rgba(17, 17, 17, .08);
  }
}
/* Hamburger (small screens only) */
.menu-toggle {
  display: none;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.menu-toggle:active { background: rgba(255, 255, 255, .7); }
.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .25s ease, background-color .15s ease;
}
.menu-icon { position: relative; }
.menu-icon::before,
.menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 680px) {
  .site-header { padding-top: max(8px, env(safe-area-inset-top)); }
  .header-inner {
    flex-wrap: wrap;
    gap: 0;
    padding: 4px 6px 4px 16px;
    border-radius: 26px;
  }
  .logo img { height: 28px; }
  .menu-toggle { display: inline-flex; }
  .header-inner nav { display: none; flex: 1 1 100%; }
  .site-header.is-open .header-inner nav { display: block; animation: fade-up .25s ease-out; }
  .nav {
    flex-direction: column;
    gap: 2px;
    margin: 6px 0 8px -8px;
    padding-top: 8px;
    border-top: 1px solid rgba(17, 17, 17, .1);
  }
  .nav a { display: flex; min-height: 48px; padding: 0 12px; font-size: 15px; }
}

/* Glass fallback where backdrop-filter isn't supported */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .header-inner, .dialog { background: rgba(244, 243, 238, .96); }
}

/* ---------- Buttons (iOS-style glass pills) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  /* glossy top highlight over each variant's tint */
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 55%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  backdrop-filter: blur(14px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .45),
    inset 0 -1px 0 rgba(0, 0, 0, .12),
    0 6px 18px rgba(17, 17, 17, .14),
    0 1px 2px rgba(17, 17, 17, .1);
  font: 700 15px/1 var(--mono);
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .5),
      inset 0 -1px 0 rgba(0, 0, 0, .12),
      0 12px 28px rgba(17, 17, 17, .18),
      0 2px 4px rgba(17, 17, 17, .1);
  }
}
.btn:active { transform: scale(.97); filter: none; }
.btn-dark { background-color: rgba(17, 17, 17, .88); color: var(--white); }
.btn-accent { background-color: rgba(194, 59, 0, .94); color: var(--white); }
.btn-light {
  background-color: rgba(255, 255, 255, .85);
  border-color: rgba(255, 255, 255, .95);
  color: var(--ink);
}
.btn-outline-light {
  background-color: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .7);
  color: var(--white);
  /* no saturate boost: it turns the accent band behind into bright red and kills text contrast */
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.btn-ghost {
  background-color: rgba(255, 255, 255, .55);
  border-color: rgba(17, 17, 17, .15);
  color: var(--ink);
}
.band-accent .btn { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 8px 22px rgba(80, 20, 0, .3); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; filter: none; }
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:hover, .btn:active { transform: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(56px, 10vw, 128px) 0 clamp(56px, 9vw, 112px);
  border-bottom: var(--rule-heavy);
}
.hero-title {
  font-size: clamp(44px, 8.5vw, 108px);
  margin-bottom: clamp(28px, 4vw, 44px);
}
.hero-title > span { display: block; }
.hero-title s {
  color: var(--muted);
  text-decoration: none;
}
/* Each part gets its own strike line so it can be drawn in, and still works when the phrase wraps */
.strike-part {
  display: inline-block;
  position: relative;
}
.strike-part::after {
  content: "";
  position: absolute;
  left: -0.04em;
  right: -0.04em;
  top: 50%;
  height: 0.11em;
  margin-top: -0.07em;
  background: var(--accent);
  transform-origin: left center;
  animation: strike .45s cubic-bezier(.6, 0, .25, 1) .75s backwards;
}
.strike-part:first-child::after { right: -0.3em; } /* bridges the word space */
.strike-part + .strike-part::after { animation-delay: 1.15s; }
@media (max-height: 500px) and (orientation: landscape) {
  .hero { padding: 40px 0 48px; }
  .hero-title { font-size: clamp(40px, 7vw, 72px); }
}
.lede {
  max-width: 60ch;
  font-size: clamp(15px, 1.3vw, 17px);
  margin-bottom: 32px;
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(48px, 7vw, 88px) 0;
  border-bottom: var(--rule-heavy);
}
.kicker {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-title {
  font-size: clamp(32px, 4.8vw, 58px);
  margin-bottom: 24px;
  max-width: 16ch;
}
.section-copy {
  max-width: 58ch;
  color: var(--muted);
  margin-bottom: 40px;
}

/* The idea: 4-step loop */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: var(--rule);
  margin-top: 40px;
  counter-reset: step;
}
.steps li {
  padding: 24px 24px 8px 0;
  position: relative;
}
.steps li + li { padding-left: 24px; border-left: var(--rule); }
.step-num {
  display: block;
  font: 900 40px/1 var(--display);
  font-stretch: 62%;
  color: var(--accent);
  margin-bottom: 16px;
}
.steps h3 {
  font: 700 16px/1.3 var(--mono);
  margin-bottom: 8px;
}
.steps h3::after { content: " →"; color: var(--accent); }
.steps li:last-child h3::after { content: " ↺"; }
.steps p { color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li { padding-bottom: 24px; }
  .steps li:nth-child(3) { padding-left: 0; border-left: 0; }
  .steps li:nth-child(n+3) { border-top: var(--rule); }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 20px 0 16px; border-left: 0; }
  .steps li + li { border-top: var(--rule); }
}

/* Coming soon */
.band-white { background: var(--white); }
/* Quest log: shipped tool as a featured card, upcoming tools as a compact list */
.log-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}
.dot-live { background: #1F9D55; animation: none; box-shadow: 0 0 0 4px rgba(31, 157, 85, .18); }

/* Glass card over soft colour glows, so the blur has something to frost */
.tool-stage {
  position: relative;
  isolation: isolate;
  margin-bottom: 56px;
}
.tool-stage::before {
  content: "";
  position: absolute;
  inset: -24px -8px;
  z-index: -1;
  background:
    radial-gradient(38% 55% at 12% 22%, rgba(194, 59, 0, .55), transparent 70%),
    radial-gradient(34% 50% at 88% 30%, rgba(255, 225, 77, .75), transparent 70%),
    radial-gradient(40% 55% at 62% 92%, rgba(31, 157, 85, .32), transparent 70%);
  filter: blur(28px);
  pointer-events: none;
}
.tool-card {
  display: grid;
  gap: 24px;
  padding: clamp(20px, 3.5vw, 36px);
  border: 1px solid var(--glass-edge);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .38));
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -1px 0 rgba(17, 17, 17, .04),
    0 24px 60px rgba(17, 17, 17, .14),
    0 2px 6px rgba(17, 17, 17, .08);
}
.tool-head { display: flex; align-items: center; gap: 18px; }
.tool-icon {
  flex: none;
  width: 64px;
  height: 64px;
  padding: 8px;
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  background: rgba(255, 255, 255, .8);
  box-shadow: inset 0 1px 0 #fff, 0 6px 16px rgba(17, 17, 17, .12);
}
.tool-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.tool-live {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
}
.tool-title { margin: 0; font-size: clamp(28px, 3.6vw, 42px); }
.tool-pitch { max-width: 60ch; font-size: clamp(15px, 1.3vw, 17px); }
.tool-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid rgba(17, 17, 17, .14);
}
.tool-features > div { padding: 20px 24px 0 0; }
.tool-features > div + div { padding-left: 24px; border-left: 1px solid rgba(17, 17, 17, .14); }
.tool-features h5 { margin: 0 0 4px; font-size: 15px; }
.tool-features p { margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
  box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(17, 17, 17, .1);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.tool-cta { justify-self: start; }
@media (max-width: 680px) {
  .tool-features { grid-template-columns: 1fr; }
  .tool-features > div { padding: 18px 0 0; }
  .tool-features > div + div { margin-top: 18px; padding-left: 0; border-left: 0; border-top: 1px solid rgba(17, 17, 17, .14); }
}
@media (max-width: 520px) {
  .tool-card { border-radius: 20px; }
  .tool-head { gap: 14px; }
  .tool-icon { width: 52px; height: 52px; padding: 6px; border-radius: 14px; }
  .tool-cta { justify-self: stretch; }
}

/* Hero: link to the newest tool */
.news {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 4px 14px 4px 4px;
  border: var(--rule);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .18s ease;
}
.news-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--white);
  font-size: 12px;
}
@media (hover: hover) {
  .news:hover { transform: translateY(-2px); }
}

.quest-log {
  border-top: var(--rule-heavy);
  margin-bottom: 48px;
}
.quest-log li {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-bottom: var(--rule);
}
.q-num { font-weight: 700; color: var(--accent); }
.q-name {
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 700;
  overflow-wrap: anywhere;
}
@media (max-width: 520px) {
  .quest-log li { grid-template-columns: 44px 1fr; gap: 10px; padding: 16px 0; }
  .q-num { font-size: 13px; }
}

/* Sign-up sits centred under the log as the section's single call to action */
.notify {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}
.notify .notify-row { text-align: left; }
.notify .privacy { max-width: 46ch; margin: 0 auto; }
.field-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}
/* Email + button share one capsule, like an iOS search field */
.notify-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: var(--field-edge);
  border-radius: 999px;
  background: var(--field-bg);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: var(--field-shadow);
}
.notify-row:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.notify-row:has(.input[aria-invalid="true"]) { border-color: var(--accent); }
.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: var(--field-edge);
  border-radius: 16px;
  background: var(--field-bg);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: var(--field-shadow);
  color: var(--ink);
  font: 400 16px/1.4 var(--mono);
  transition: background-color .18s ease, box-shadow .18s ease;
}
.input:focus { background: rgba(255, 255, 255, .85); }
.input::placeholder { color: #77756D; }
.input[aria-invalid="true"] { border-color: var(--accent); box-shadow: var(--field-shadow), inset 0 0 0 1px var(--accent); }
.notify-row .input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 6px 10px 16px;
  border: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}
.notify-row .input:focus { background: transparent; }
.notify-row .input:focus-visible { outline: none; } /* ring is drawn on the capsule */
.notify-row:focus-within { background: rgba(255, 255, 255, .85); }
.notify-row .btn,
.notify-row .btn:hover {
  flex: none;
  min-height: 44px;
  padding: 0 20px;
  transform: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 1px 3px rgba(17, 17, 17, .18);
}
@media (max-width: 380px) {
  .notify-row .btn { padding: 0 14px; }
}
.form-msg {
  min-height: 1.65em;
  margin: 10px 0 4px;
  font-size: 14px;
  font-weight: 700;
}
.form-msg.is-error { color: var(--accent); }
.form-msg.is-success { color: var(--ink); }
.form-msg.is-success::before { content: "✓ "; color: var(--accent); }
.privacy { font-size: 13px; color: var(--muted); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* House rules */
.rules {
  counter-reset: rule;
  border-top: var(--rule);
  margin-top: 40px;
}
.rules li {
  counter-increment: rule;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: var(--rule);
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 700;
}
.rules li::before {
  content: counter(rule, decimal-leading-zero);
  font: 900 32px/1 var(--display);
  font-stretch: 62%;
  color: var(--accent);
}
@media (max-width: 520px) {
  .rules li { grid-template-columns: 48px 1fr; }
  .rules li::before { font-size: 26px; }
}

/* Send a problem (CTA band) */
.band-accent { background: var(--accent); color: var(--white); }
.band-accent .kicker { color: var(--white); }
.band-accent .section-copy { color: var(--white); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
/* Closing CTA band is centred */
.band-accent .wrap { text-align: center; }
.band-accent .section-title,
.band-accent .section-copy { margin-left: auto; margin-right: auto; }
.band-accent .cta-row { justify-content: center; }
@media (max-width: 520px) {
  .hero .btn { width: 100%; }
  .cta-row { flex-direction: column; align-items: stretch; max-width: 360px; margin: 0 auto; }
}
.cta-email { margin-top: 22px; font-size: 14px; }
.cta-email a { font-weight: 700; text-underline-offset: 4px; }
.footer-email { font-weight: 700; text-underline-offset: 4px; display: inline-block; padding: 12px 0; }

/* ---------- Footer ---------- */
.site-footer { padding: 32px 0 max(40px, calc(env(safe-area-inset-bottom) + 24px)); font-size: 14px; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
}
.footer-inner p:first-child { margin-right: auto; }
.social { display: flex; gap: 4px; }
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: var(--field-edge);
  border-radius: 50%;
  background: var(--field-bg);
  box-shadow: var(--field-shadow);
  transition: background-color .18s ease, color .18s ease;
}
.social a:active { background: var(--ink); color: var(--white); }
@media (hover: hover) {
  .social a:hover { background: var(--ink); color: var(--white); }
}
.social svg { width: 20px; height: 20px; fill: currentColor; }
@media (max-width: 520px) {
  .footer-inner { flex-direction: column; text-align: center; gap: 4px; }
  .footer-inner p:first-child { margin-right: 0; }
  .social { margin-top: 8px; gap: 10px; }
}

/* ---------- Dialog ---------- */
.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  border: 1px solid var(--glass-edge);
  border-radius: 28px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  color: var(--ink);
  box-shadow: var(--glass-shadow), 0 30px 80px rgba(17, 17, 17, .25);
}
.dialog:focus-visible { outline: none; }
.dialog::backdrop {
  background: rgba(17, 17, 17, .2);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.problem-form { padding: 28px; }
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.dialog-head h2 { font-size: clamp(28px, 6vw, 38px); }
.dialog-close {
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--glass-edge);
  border-radius: 50%;
  background: rgba(255, 255, 255, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 4px rgba(17, 17, 17, .1);
  font: 700 24px/1 var(--mono);
  cursor: pointer;
}
.problem-form textarea { resize: vertical; margin-bottom: 18px; }
.req, .opt { font-weight: 400; color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* Phones: the dialog becomes an iOS-style bottom sheet */
@media (max-width: 520px) {
  .dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - max(24px, env(safe-area-inset-top)));
    margin: auto 0 0;
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    animation: sheet-up .32s cubic-bezier(.2, .7, .2, 1);
  }
  .problem-form {
    padding: 22px max(20px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }
  .dialog-head { margin-bottom: 16px; }
  .problem-form textarea { min-height: 120px; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .btn { width: 100%; }
}
@keyframes sheet-up {
  from { transform: translateY(100%); }
}

/* ---------- Simple pages (thanks / 404) ---------- */
.simple {
  min-height: 70vh;
  min-height: 70svh;
  display: flex;
  align-items: center;
  padding: 64px 0;
}
.simple .display { font-size: clamp(40px, 7vw, 80px); margin-bottom: 24px; }
.simple p { max-width: 52ch; margin-bottom: 28px; }

/* ---------- Legal / info pages (privacy, about) ---------- */
.legal { padding: 56px 0 72px; }
.legal .wrap > * { max-width: 68ch; }
.legal .display { font-size: clamp(40px, 7vw, 72px); margin: 8px 0 16px; }
.legal h2 { font: 900 clamp(22px, 3vw, 28px)/1.2 var(--display); margin: 40px 0 12px; }
.legal h3 { font-size: 15px; margin: 24px 0 8px; }
.legal p, .legal ul, .legal ol { margin-bottom: 16px; }
.legal ul, .legal ol { padding-left: 1.25em; list-style: revert; }
.legal li + li { margin-top: 6px; }
.legal a { text-underline-offset: 3px; }
.legal a:hover { color: var(--accent); }
.legal-updated { color: var(--muted); font-size: 13px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-weight: 700; text-underline-offset: 4px; display: inline-block; padding: 12px 0; }
@media (max-width: 520px) {
  .footer-links { justify-content: center; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Motion ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(0.3em); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
}
@keyframes drop-in {
  from { opacity: 0; transform: translateY(-14px) scale(.98); }
}
@keyframes strike {
  from { transform: scaleX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.7); }
}

/* Page load: header drops in, hero lines rise one after another, then the strike is drawn */
.header-inner { animation: drop-in .6s cubic-bezier(.2, .7, .2, 1) backwards; }
.hero-title > span { animation: rise .7s cubic-bezier(.2, .7, .2, 1) .1s backwards; }
.hero-title > span + span { animation-delay: .3s; }
.hero .lede { animation: fade-up .6s ease-out .45s backwards; }
.hero .btn { animation: fade-up .6s ease-out .6s backwards; }

/* Scroll reveal (classes added by main.js, so content stays visible without JS) */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease-out, transform .7s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

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