/* ==========================================================================
   Atrium · application
   Same palette and type as the homepage: oxblood ground, cream type, stone for
   the one action. Newsreader for the questions, Albert Sans for text and labels.
   One question per screen; a photograph beside it on desktop.
   ========================================================================== */

:root {
  --bone: #580f0f;      /* page: oxblood */
  --card: #6b1a18;      /* raised surfaces */
  --snow: #fff9f2;      /* text on photographs */
  --ink: #fff9f2;       /* main text: cream */
  --ink-2: #f0e3dd;
  --ink-3: #d8beb7;
  --pine: #3f0a0b;
  --signal: #c9c6b5;    /* stone */
  --signal-deep: #fff9f2;
  --on-gold: #580f0f;   /* text on a stone button */
  --error: #ffc2a6;

  --signal-rgb: 201, 198, 181;
  --ink-rgb: 255, 249, 242;
  --bone-rgb: 88, 15, 15;
  --shade-rgb: 43, 7, 8;

  --edge: rgba(var(--signal-rgb), 0.36);
  --radius: 10px;

  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mark: "Bodoni Moda", "Bodoni 72", Didot, serif;          /* the wordmark only */
  --caps: "Albert Sans", "Helvetica Neue", Arial, sans-serif;
  --mark-ink: var(--ink);
  --mark-accent: var(--signal);
  --sans: "Albert Sans", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(20px, 5vw, 88px);
  --photo-w: 44%;
  --top-h: 84px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, p, fieldset, ol, ul { margin: 0; }
/* even lines in headings, no single word left on the last line of a paragraph */
h1, h2 { text-wrap: balance; }
p, li, small { text-wrap: pretty; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--signal); color: var(--on-gold); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
[hidden] { display: none !important; }
.dot { color: var(--signal); padding: 0 0.2em; }

/* soft window light and paper grain, as on the homepage.
   Both run 160px past the screen's edges: iOS 26 Safari shows the page under its status bar and
   floating toolbar, and an overlay that stopped at the edge left flat, darker bands there. */
body::before {
  content: ""; position: fixed; inset: -160px 0; z-index: 99; pointer-events: none;
  background:
    radial-gradient(90% 70% at 20% -10%, rgba(247, 240, 222, 0.05), transparent 62%),
    linear-gradient(112deg, transparent 8%, rgba(247, 240, 222, 0.03) 15%, transparent 23%, transparent 41%, rgba(247, 240, 222, 0.024) 49%, transparent 58%);
}
body::after {
  content: ""; position: fixed; inset: -160px 0; z-index: 100; pointer-events: none; opacity: 0.085;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- buttons ---------- */
.btn {
  --bg: var(--signal); --fg: var(--on-gold);
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 54px; padding: 16px 28px 15px;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--bg); border-radius: 999px;
  font-family: var(--sans); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; white-space: nowrap; touch-action: manipulation;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.2s var(--ease);
}
.btn:active { transform: scale(0.985); }
.btn[disabled] { opacity: 0.7; cursor: progress; }
.btn__arrow { width: 22px; height: 11px; flex: none; transition: transform 0.45s var(--ease); }
.btn--signal { --bg: var(--signal); --fg: var(--on-gold); }
.btn--ghost { --bg: transparent; --fg: var(--signal); border-color: rgba(var(--signal-rgb), 0.6); }
.btn--big { min-height: 60px; padding: 18px 32px 17px; font-size: 0.8rem; }

.link-quiet {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 0.95rem; text-decoration: none; color: var(--ink);
  background: linear-gradient(var(--signal), var(--signal)) 0 calc(100% - 10px) / 100% 1px no-repeat;
}

@media (hover: hover) {
  .btn:hover .btn__arrow { transform: translateX(5px); }
  .btn--signal:hover { --bg: var(--signal-deep); }
  .btn--ghost:hover { --bg: var(--signal); --fg: var(--on-gold); border-color: var(--signal); }
}

/* ---------- progress: one gold line across the top ---------- */
.ap-progress {
  position: fixed; inset: 0 0 auto 0; z-index: 70; height: 3px;
  background: rgba(var(--ink-rgb), 0.08);
  transition: opacity 0.4s var(--ease);
}
.ap-progress__fill {
  display: block; height: 100%; background: var(--signal);
  transform-origin: left; transform: scaleX(var(--p, 0));
  transition: transform 0.6s var(--ease);
}
[data-stage="intro"] .ap-progress { opacity: 0; }

/* ---------- top bar ---------- */
.ap-top {
  position: fixed; top: 0; left: 0; z-index: 60;
  width: calc(100% - var(--photo-w));
  height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(10px, env(safe-area-inset-top)) var(--gutter) 0;
  background: linear-gradient(to bottom, rgba(var(--bone-rgb), 0.97) 62%, rgba(var(--bone-rgb), 0));
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; flex: none; }
.brand__sigil { flex: none; width: 32px; height: 32px; }
.brand__name { font: 500 1rem/1 var(--mark); letter-spacing: 0.34em; text-transform: uppercase; font-variation-settings: "opsz" 28; }
.ap-top__step, .ap-top__mail, .kicker, .gate__label, .ap-photo__cap {
  font-family: var(--caps); font-size: 0.76rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.ap-top__step { color: var(--signal); }
.ap-top__step span { color: var(--ink-3); letter-spacing: 0.14em; }
.ap-top__step b { font-weight: inherit; }
@media (max-width: 520px) { .ap-top__step b { display: none; } }
.ap-top__mail { color: var(--ink-2); text-decoration: none; letter-spacing: 0.14em; text-transform: none; font-family: var(--sans); font-size: 0.86rem; font-weight: 400; }
@media (hover: hover) { .ap-top__mail:hover { color: var(--signal); } }
[data-stage="intro"] .ap-top__step,
[data-stage="step"] .ap-top__mail,
[data-stage="done"] .ap-top__step { display: none; }

/* ---------- layout: questions left, photograph right ---------- */
.ap { display: grid; grid-template-columns: minmax(0, 1fr) var(--photo-w); min-height: 100vh; min-height: 100dvh; }
.ap-main {
  display: flex; align-items: center;
  min-height: 100vh; min-height: 100dvh;
  padding: calc(var(--top-h) + 4vh) var(--gutter) 8vh;
}
.ap-form { width: 100%; max-width: 620px; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.ap-noscript { color: var(--ink-2); }

.ap-photo { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; background: var(--pine); }
.ap-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.04);
  transition: opacity 0.9s var(--ease), transform 7s var(--ease);
}
.ap-photo img.is-on { opacity: 1; transform: scale(1); }
.ap-photo img[data-photo="coffee"] { object-position: 24% 50%; } /* keep her face in the tall crop */
.ap-photo img[data-photo="laugh"] { object-position: 62% 50%; }
.ap-photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, rgba(var(--shade-rgb), 0.62), transparent 32%),
    linear-gradient(to right, rgba(var(--bone-rgb), 0.35), transparent 18%);
}
.ap-photo__cap {
  position: absolute; left: 32px; right: 32px; bottom: 30px; z-index: 2;
  color: var(--snow); letter-spacing: 0.2em;
  display: flex; align-items: center; gap: 14px;
}
.ap-photo__cap::before { content: ""; width: 28px; height: 1px; background: var(--signal); flex: none; }

/* ---------- screens ---------- */
.screen { opacity: 0; transform: translateY(14px); transition: opacity 0.55s var(--ease), transform 0.65s var(--ease); }
.screen.is-in { opacity: 1; transform: none; }
.screen :is(h1, h2):focus { outline: none; }

.kicker { color: var(--signal); }

/* intro */
.intro__title {
  margin-top: 18px;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.35rem, 4vw, 3.65rem); line-height: 1.02; letter-spacing: -0.012em;
  text-wrap: balance;
}
.intro__title em { white-space: nowrap; }
.intro__title em, .done__title em { font-style: italic; color: var(--signal); }
/* /membership's headline is a full sentence, so it sits a size down and wraps freely */
.intro__title--long { font-size: clamp(2.3rem, 3.7vw, 3.4rem); line-height: 1.04; }
.intro__title--long em { display: block; white-space: normal; }
.intro__lede { margin-top: 22px; color: var(--ink-2); font-size: 1.04rem; max-width: 52ch; }
.intro__note { margin-top: 10px; color: var(--ink-3); font-size: 0.9rem; }

.gate {
  margin-top: 30px; padding: 22px 24px 20px;
  border: 1px solid var(--edge); border-radius: var(--radius);
  background: rgba(var(--ink-rgb), 0.025);
}
.gate__label { color: var(--signal); }
.gate__list { margin-top: 12px; display: grid; gap: 8px; }
.gate__list li { position: relative; padding-left: 26px; font-size: 0.98rem; }
.gate__list li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em;
  width: 12px; height: 7px; border-left: 1.5px solid var(--signal); border-bottom: 1.5px solid var(--signal);
  transform: translateY(-50%) rotate(-45deg);
}

.intro__cta { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.intro__time { color: var(--ink-3); font-size: 0.9rem; }

.after { margin-top: 44px; padding-top: 26px; border-top: 1px solid rgba(var(--ink-rgb), 0.12); display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.after__n { display: block; font-family: var(--caps); font-size: 0.8rem; letter-spacing: 0.1em; color: var(--signal); line-height: 1; }
.after h2 { margin-top: 10px; font-size: 0.98rem; font-weight: 600; }
.after p { margin-top: 4px; color: var(--ink-2); font-size: 0.9rem; line-height: 1.5; }

/* a question */
.q { border: 0; padding: 0; min-width: 0; }
.q__lead { color: var(--ink-2); font-size: 1.04rem; margin-bottom: 8px; }
.q__title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.87rem, 2.96vw, 2.61rem); line-height: 1.08; letter-spacing: -0.01em;
  max-width: 22ch;
}
.q__help { margin-top: 12px; color: var(--ink-2); font-size: 0.98rem; max-width: 50ch; }
.q > .q__title + .opts, .q > .q__help + .opts, .q > .q__title + .field, .q > .q__title + .field-row { margin-top: 30px; }
.q > .q__help + .tcards { margin-top: 28px; }

/* answer rows */
.opts { display: grid; gap: 10px; }
.opts--tight { gap: 8px; }
.opt { position: relative; display: block; cursor: pointer; touch-action: manipulation; }
.opt input, .tcard input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.opt__box {
  display: flex; align-items: center; gap: 16px;
  min-height: 62px; padding: 13px 20px;
  border: 1px solid rgba(var(--ink-rgb), 0.18); border-radius: var(--radius);
  background: rgba(var(--ink-rgb), 0.02);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.opts--tight .opt__box { min-height: 56px; }
.opt__dot {
  display: grid; place-items: center; flex: none;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid rgba(var(--ink-rgb), 0.4);
  transition: border-color 0.25s var(--ease);
}
.opt__dot::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--signal);
  transform: scale(0); transition: transform 0.3s var(--ease);
}
.opt__text strong { display: block; font-weight: 500; font-size: 1.04rem; line-height: 1.35; }
.opt__text small { display: block; color: var(--ink-2); font-size: 0.9rem; line-height: 1.4; margin-top: 2px; }
@media (hover: hover) { .opt:hover .opt__box { border-color: rgba(var(--signal-rgb), 0.7); } }
.opt:active .opt__box { background: rgba(var(--signal-rgb), 0.07); } /* the press shows under a thumb */
.opt input:checked + .opt__box { border-color: var(--signal); background: rgba(var(--signal-rgb), 0.1); }
.opt input:checked + .opt__box .opt__dot { border-color: var(--signal); }
.opt input:checked + .opt__box .opt__dot::after { transform: scale(1); }
.opt input:focus-visible + .opt__box { outline: 2px solid var(--signal); outline-offset: 3px; }
.opt--quiet { margin-top: 10px; }
.opt--quiet .opt__box { min-height: 54px; }

/* trip cards */
.tcards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tcard { position: relative; display: block; cursor: pointer; touch-action: manipulation; }
.tcard__box {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 16 / 10; border-radius: var(--radius);
  border: 1px solid rgba(var(--ink-rgb), 0.14);
  background: var(--pine);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.tcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter 0.4s var(--ease); filter: saturate(0.9) brightness(0.92); }
.tcard__box::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(var(--shade-rgb), 0.82), rgba(var(--shade-rgb), 0.1) 62%); }
.tcard__text { position: absolute; left: 16px; right: 44px; bottom: 13px; z-index: 1; color: var(--snow); }
.tcard__text strong { display: block; font-family: var(--serif); letter-spacing: -0.015em; font-weight: 500; font-size: 1.26rem; line-height: 1.1; }
.tcard__text small { display: block; margin-top: 3px; font-size: 0.82rem; color: rgba(var(--ink-rgb), 0.78); }
.tcard__tick {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid rgba(var(--ink-rgb), 0.7); background: rgba(var(--shade-rgb), 0.3);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.tcard__tick::after {
  content: ""; position: absolute; left: 8px; top: 7px; width: 9px; height: 5px;
  border-left: 1.6px solid var(--on-gold); border-bottom: 1.6px solid var(--on-gold);
  transform: rotate(-45deg) scale(0); transition: transform 0.3s var(--ease);
}
@media (hover: hover) {
  .tcard:hover .tcard__box { border-color: rgba(var(--signal-rgb), 0.7); }
  .tcard:hover img { transform: scale(1.04); }
}
.tcard input:checked + .tcard__box { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal); }
.tcard input:checked + .tcard__box img { filter: none; }
.tcard input:checked + .tcard__box .tcard__tick { background: var(--signal); border-color: var(--signal); }
.tcard input:checked + .tcard__box .tcard__tick::after { transform: rotate(-45deg) scale(1); }
.tcard input:focus-visible + .tcard__box { outline: 2px solid var(--signal); outline-offset: 3px; }

/* text fields */
.field { margin-top: 24px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.field-row .field { margin-top: 24px; }
.field label {
  display: flex; justify-content: space-between; gap: 8px;
  font-family: var(--caps); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
}
.opt-tag { opacity: 0.75; }
.field input, .field textarea {
  display: block; width: 100%; margin-top: 4px;
  min-height: 48px; padding: 10px 0;
  border: 0; border-bottom: 1px solid rgba(var(--ink-rgb), 0.24); border-radius: 0;
  background: transparent; color: var(--ink);
  font-family: var(--sans); font-size: 1.125rem; line-height: 1.4; /* 18px keeps iOS from zooming */
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px var(--bone) inset; -webkit-text-fill-color: var(--ink); caret-color: var(--ink); }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--signal); box-shadow: 0 1px 0 0 var(--signal); }
/* free-text boxes get edges, or on a phone they read as empty space */
.field textarea {
  margin-top: 14px; min-height: 124px; padding: 12px 14px;
  border: 1px solid rgba(var(--ink-rgb), 0.24); border-radius: var(--radius);
  background: rgba(var(--ink-rgb), 0.025);
}
.field textarea:focus { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal); }
.field [aria-invalid="true"] { border-bottom-color: var(--error); }
.field__hint { margin-top: 7px; color: var(--ink-3); font-size: 0.86rem; line-height: 1.45; }
/* while a field shows an error, its hint steps aside so the two don't say the same thing twice */
.field:has([aria-invalid="true"]) .field__hint { display: none; }
.field__err { margin-top: 8px; color: var(--error); font-size: 0.88rem; }
.field__err:empty { display: none; }
.q > .field__err { margin-top: 14px; }

/* consent to texts: sending the request is the agreement */
.consent { margin-top: 28px; max-width: 60ch; color: var(--ink-3); font-size: 0.8rem; line-height: 1.55; }

/* ---------- action bar ---------- */
.ap-bar { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.ap-bar__next { order: 1; min-width: 200px; }
.ap-bar__back {
  order: 2; display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  color: var(--ink-2); font-size: 0.92rem;
}
.ap-bar__back svg { width: 18px; height: 10px; }
@media (hover: hover) { .ap-bar__back:hover { color: var(--signal); } }
.ap-bar__hint { order: 3; margin-left: auto; color: var(--ink-3); font-size: 0.82rem; }
kbd { font-family: var(--sans); font-size: 0.76rem; padding: 2px 6px; border: 1px solid rgba(var(--ink-rgb), 0.25); border-radius: 3px; }
.ap-bar__err { order: 4; width: 100%; color: var(--error); font-size: 0.9rem; }
.ap-bar__err a { color: inherit; }
[data-stage="intro"] .ap-bar, [data-stage="done"] .ap-bar { display: none; }
@media not (hover: hover) { .ap-bar__hint { display: none; } }

/* ---------- done ---------- */
.done__title {
  margin-top: 16px;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.09rem, 3.57vw, 3.31rem); line-height: 1.03; letter-spacing: -0.012em;
}
.done__lede { margin-top: 20px; color: var(--ink-2); font-size: 1.04rem; max-width: 52ch; }
.done__text { margin-top: 16px; color: var(--ink-2); max-width: 52ch; }
.done__text a { color: var(--ink); text-decoration-color: var(--signal); text-underline-offset: 3px; }
.done .link-quiet { margin-top: 22px; }

.done__lede b { color: var(--ink); font-weight: 500; white-space: nowrap; }

.intro__legal { margin-top: 36px; color: var(--ink-3); font-size: 0.82rem; }
.intro__legal a, .consent a { color: inherit; text-decoration-color: rgba(var(--signal-rgb), 0.6); text-underline-offset: 3px; }

/* ---------- privacy page ---------- */
.legal { --photo-w: 0px; }
.legal .brand { text-decoration: none; }
.legal__main { max-width: 720px; margin: 0 auto; padding: calc(var(--top-h) + 6vh) var(--gutter) 12vh; }
.legal__title { margin-top: 14px; font-family: var(--serif); font-weight: 400; font-size: clamp(2.44rem, 4.7vw, 3.74rem); line-height: 1.02; letter-spacing: -0.015em; }
.legal__lede { margin-top: 20px; color: var(--ink-2); font-size: 1.08rem; }
.legal section { margin-top: 44px; padding-top: 26px; border-top: 1px solid rgba(var(--ink-rgb), 0.12); }
.legal h2 { font-family: var(--serif); letter-spacing: -0.015em; font-weight: 500; font-size: 1.44rem; line-height: 1.2; }
.legal section p, .legal section ul { margin-top: 12px; color: var(--ink-2); }
.legal section b { color: var(--ink); font-weight: 500; }
.legal section ul { display: grid; gap: 6px; }
.legal section li { position: relative; padding-left: 20px; }
.legal section li::before { content: ""; position: absolute; left: 0; top: 0.78em; width: 8px; height: 1px; background: var(--signal); }
.legal section a { color: var(--ink); text-decoration-color: var(--signal); text-underline-offset: 3px; }
.legal__back { margin-top: 48px; }

/* ==========================================================================
   PHONES AND SMALL TABLETS
   ========================================================================== */
@media (max-width: 900px) {
  :root { --photo-w: 0px; --top-h: 68px; }
  .ap { grid-template-columns: minmax(0, 1fr); }

  .ap-top { width: 100%; padding-top: max(6px, env(safe-area-inset-top)); }
  .ap-top__mail { display: none; }

  /* the photograph becomes a band above the intro, and steps aside after */
  .ap-photo { display: none; order: -1; position: relative; height: 38vh; height: 38svh; min-height: 260px; }
  [data-stage="intro"] .ap-photo { display: block; }
  .ap-photo::after { background: linear-gradient(to top, var(--bone) 0%, rgba(var(--bone-rgb), 0) 46%), linear-gradient(to bottom, rgba(var(--shade-rgb), 0.55), transparent 30%); }
  .ap-photo__cap { left: var(--gutter); right: var(--gutter); bottom: 34px; font-size: 0.64rem; }
  [data-stage="intro"] .ap-top { position: absolute; background: none; color: var(--snow); }
  /* after sending there's no step to show, so the bar scrolls away with the page */
  [data-stage="done"] .ap-top { position: absolute; }
  .field label { letter-spacing: 0.15em; }

  .ap-main { align-items: flex-start; min-height: 0; padding: calc(var(--top-h) + 18px) var(--gutter) calc(120px + var(--safe-b)); }
  /* the Begin bar is tucked away by the time the footer shows, so the page can end close under it */
  [data-stage="intro"] .ap-main { padding-top: 6px; padding-bottom: calc(52px + var(--safe-b)); }

  /* Edges. Words scrolling up dissolve into the oxblood before they reach the clock and battery,
     and the ground runs on under Safari's bars, so the page never ends in a hard line.
     The top one waits until the page moves, so the photograph meets the top of the screen untouched. */
  .ap::before, .ap::after { content: ""; position: fixed; left: 0; right: 0; pointer-events: none; }
  .ap::before {
    top: -160px; height: calc(160px + env(safe-area-inset-top, 0px) + 44px); z-index: 55;
    background: linear-gradient(to bottom, var(--bone) calc(100% - 44px), rgba(var(--bone-rgb), 0));
    opacity: 0; transition: opacity 0.3s var(--ease);
  }
  .is-scrolled .ap::before { opacity: 1; }
  .ap::after {
    bottom: -160px; height: 196px; z-index: 64;
    background: linear-gradient(to top, var(--bone) 160px, rgba(var(--bone-rgb), 0));
  }
  [data-stage="done"] .ap-main { padding-bottom: 64px; }

  .intro__title { margin-top: 14px; }
  .intro__lede { font-size: 1rem; }
  .gate { padding: 18px 18px 16px; }
  .intro__cta .btn { width: 100%; }
  .intro__time { width: 100%; text-align: center; margin-top: -2px; }
  .after { grid-template-columns: 1fr; gap: 18px; margin-top: 36px; }
  .after li { display: grid; grid-template-columns: 34px 1fr; column-gap: 8px; }
  .after__n { grid-row: span 2; padding-top: 2px; }
  .after h2 { margin-top: 0; }

  /* full-width questions: one line fewer, and all five answers fit above the bar on most phones */
  .q__title { font-size: clamp(1.7rem, 7.4vw, 2.2rem); max-width: none; }
  .q__lead { margin-bottom: 6px; }
  .q__help { margin-top: 10px; }
  .q > .q__title + .opts, .q > .q__help + .opts, .q > .q__title + .field, .q > .q__title + .field-row { margin-top: 22px; }
  .opts { gap: 8px; }
  .opt__box { min-height: 56px; padding: 11px 16px; gap: 14px; }
  .opts--tight .opt__box { min-height: 52px; }
  .q > .q__help + .tcards { margin-top: 22px; }
  .tcards { gap: 10px; }
  .tcard__box { aspect-ratio: 4 / 5; }
  .tcard__text { left: 12px; right: 12px; bottom: 11px; }
  .tcard__text strong { font-size: 1.08rem; }
  .tcard__text small { font-size: 0.76rem; }
  .tcard__tick { top: 9px; right: 9px; }

  /* the action bar sits under the thumb. No hard edge: the page fades into it, like the header at the top. */
  .ap-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 65;
    margin: 0; gap: 10px; flex-wrap: nowrap;
    padding: 10px var(--gutter) calc(12px + var(--safe-b));
    background: var(--bone);
  }
  .ap-bar::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 36px; pointer-events: none;
    background: linear-gradient(to top, var(--bone) 8%, rgba(var(--bone-rgb), 0.85) 40%, rgba(var(--bone-rgb), 0));
  }
  /* iOS 26 Safari floats its toolbar over the page, and a bar fixed at the bottom stops above it.
     This keeps the ground going underneath, so the page doesn't show through below the button. */
  .ap-bar::after {
    content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 160px; pointer-events: none;
    background: var(--bone);
  }
  .ap-bar__back { order: 0; flex: none; justify-content: center; width: 54px; min-height: 54px; padding: 0; border: 1px solid rgba(var(--ink-rgb), 0.2); border-radius: 50%; }
  .ap-bar__back:active { background: rgba(var(--ink-rgb), 0.06); }
  .ap-bar__back span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ap-bar__next { order: 1; flex: 1; min-width: 0; }
  .ap-bar__err { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(100% + 10px); padding: 12px 14px; border-radius: var(--radius); background: var(--card); border: 1px solid rgba(240, 165, 138, 0.4); }

  /* on the intro the bar carries only "Begin", and tucks away while the real button shows */
  [data-stage="intro"] .ap-bar { display: flex; transition: transform 0.45s var(--ease); }
  [data-stage="intro"] .ap-bar__back { display: none; }
  [data-stage="intro"] .ap-bar.is-tucked { transform: translateY(calc(100% + 40px)); }
}

/* tablets: the bar's buttons line up with the 620px form column instead of stretching edge to edge */
@media (min-width: 700px) and (max-width: 900px) {
  .ap-bar { padding-right: max(var(--gutter), calc(100% - var(--gutter) - 620px)); }
}

/* phones held sideways: a shorter photograph and slimmer bars, so the question isn't squeezed out */
@media (max-width: 900px) and (max-height: 500px) {
  :root { --top-h: 56px; }
  .ap-photo { height: 46vh; height: 46svh; min-height: 0; }
  .ap-bar { padding-top: 8px; padding-bottom: calc(8px + var(--safe-b)); }
  .ap-bar__back, .ap-bar__next { min-height: 48px; }
  .ap-bar__back { width: 48px; }
  .ap-main { padding-bottom: calc(96px + var(--safe-b)); }
}

/* big phones sideways (932x430) get the two-column layout: slimmer header, question starts at the top */
@media (min-width: 901px) and (max-height: 500px) {
  :root { --top-h: 60px; }
  .ap-main { align-items: flex-start; padding-top: calc(var(--top-h) + 14px); padding-bottom: 28px; }
}

@media (max-width: 380px) {
  .field-row { grid-template-columns: 1fr; }
  .tcard__text strong { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .screen { transform: none; }
}

/* keep "Never off." together on phones (the membership headline is too long to hold on one line, so it wraps) */
#intro-title:not(.intro__title--long) em { white-space: nowrap; }

/* legibility: Newsreader's text optical size for anything under headline size */
.tcard__text strong, .legal h2 { font-variation-settings: "opsz" 12; font-weight: 500; letter-spacing: 0; }
.intro__title, .done__title, .legal__title, .q__title, h1, h2 { font-variation-settings: "opsz" 60; font-weight: 420; }
