/* The web funnel (stormless.app/start): the app's starting-point quiz in
   the browser, styled after the app's quiz (lib/src/features/funnel and
   lib/src/theme). Phone-first; on a wide window the form keeps a phone's
   width in the middle. */

:root {
  --paper: #ffffff;
  --surface: #ffffff;
  --sunk: #f2f5f4;
  --ink: #1a1e22;
  --ink-soft: #585c63;
  --muted: #69706e;
  --on-ink: #fffdf8;
  --line: #e3e8e6;
  --honey: #e7be58;
  --honey-lit: #f0cd72;
  --honey-deep: #e0b249;
  --honey-text: #7a5c14;
  --wash: #ffffff;
  --shade: 30, 48, 45;
  --zone-low: #b9ddb1;
  --zone-mid: #efd89b;
  --zone-high: #f4c3b4;
  --radius-card: 24px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

img { max-width: 100%; display: block; }

button { font: inherit; color: inherit; }

/* White pages, as the app's quiz since its November 2026 redesign (the
   honey wash across the top is gone). */
.wash { display: none; }

.app {
  position: relative;
  height: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}

/* ---- toolbar: back, the stage over a capsule ---- */

.bar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 6px 16px 4px;
}

.circle {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 2px rgba(var(--shade), 0.08), 0 6px 16px rgba(var(--shade), 0.08);
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.circle svg { width: 22px; height: 22px; }
.circle[hidden] { visibility: hidden; display: grid; }

.progress { flex: 1; text-align: center; }
.progress[hidden] { visibility: hidden; display: block; }
.progress .stage {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-soft);
}
.progress .track {
  display: block;
  height: 4px;
  margin-top: 7px;
  border-radius: 2px;
  background: rgba(26, 30, 34, 0.12);
  overflow: hidden;
}
.progress .fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: var(--ink);
  transition: width 350ms cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* ---- steps ---- */

.stage-area { position: relative; flex: 1; min-height: 0; }

.step {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: opacity 280ms ease, transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.step.enter { opacity: 0; transform: translateX(calc(5% * var(--dir, 1))); }
.step.leave {
  opacity: 0;
  transform: translateX(calc(-3% * var(--dir, 1)));
  pointer-events: none;
}

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  /* Never a sideways scroll. */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px 28px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 20px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 20px), transparent 100%);
}

.footer {
  padding: 4px 20px 12px;
  display: flex;
  flex-direction: column;
}

@media (prefers-reduced-motion: reduce) {
  .step, .progress .fill { transition-duration: 150ms; }
  .step.enter, .step.leave { transform: none; }
}

/* ---- type ---- */

.kicker {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.heading {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  line-height: 34px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
.heading.hero { font-size: 34px; line-height: 41px; letter-spacing: 0.012em; }
.heading.compact { font-size: 22px; line-height: 28px; letter-spacing: 0.006em; }

.sub {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.sub.strong { color: var(--ink); font-weight: 600; }
.sub.tight { margin-top: 0; }

.title3 { margin: 0; font-size: 20px; line-height: 1.2; font-weight: 600; }
.title2 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; }
.label { font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--ink-soft); }
.footnote { font-size: 13px; line-height: 1.35; color: var(--ink-soft); }
.subhead { font-size: 15px; line-height: 1.4; color: var(--ink-soft); }
.subhead.ink { color: var(--ink); }
.reading { font-size: 20px; line-height: 1.4; }
.display-line { font-family: var(--display); font-size: 20px; line-height: 25px; font-weight: 500; }

.feedback {
  min-height: 8px;
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 600;
  animation: arrive 220ms ease both;
}

.gap-8 { height: 8px; }
.gap-20 { height: 20px; }
.gap-24 { height: 24px; }
.gap-32 { height: 32px; }

@keyframes arrive { from { opacity: 0; } to { opacity: 1; } }
/* The build step's plate: 0.82 to 1 and back, 4 s each way. */
@keyframes breathe { 0%, 100% { transform: scale(0.82); } 50% { transform: scale(1); } }
.arrive { animation: arrive 400ms ease both; }

/* ---- buttons ---- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 26px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, box-shadow 200ms ease;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.4; cursor: default; transform: none; }
.btn[hidden] { display: none; }

.btn-dark {
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: 0 1px 2px rgba(26, 30, 34, 0.18), 0 8px 20px rgba(26, 30, 34, 0.14);
}

.btn-honey {
  min-height: 56px;
  border-radius: 28px;
  background: linear-gradient(to bottom, var(--honey-lit), var(--honey-deep));
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(138, 100, 22, 0.25), 0 10px 24px rgba(138, 100, 22, 0.22);
}

.btn-ghost {
  min-height: 44px;
  margin-top: 4px;
  background: none;
  color: var(--ink);
}
.btn-ghost:active { opacity: 0.5; transform: none; }

/* ---- answers ---- */

.tile {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  margin: 0 0 10px;
  padding: 16px;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  text-align: left;
  font-size: 17px;
  line-height: 1.3;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(var(--shade), 0.06), 0 4px 12px rgba(var(--shade), 0.06);
  transition: box-shadow 220ms ease, transform 160ms ease;
}
.tile:active { transform: scale(0.985); }
.tile .text { flex: 1; }
.tile[aria-pressed="true"], .tile[aria-checked="true"] {
  box-shadow: 0 2px 4px rgba(var(--shade), 0.08), 0 14px 32px rgba(var(--shade), 0.14);
}

.mark { flex: none; width: 24px; height: 24px; color: var(--ink-soft); }
.mark.small { width: 20px; height: 20px; }
[aria-pressed="true"] > .mark, [aria-checked="true"] > .mark { color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 10px 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px 10px 12px;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(var(--shade), 0.06), 0 4px 12px rgba(var(--shade), 0.06);
  transition: box-shadow 220ms ease, transform 160ms ease;
}
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] {
  box-shadow: 0 2px 4px rgba(var(--shade), 0.08), 0 14px 32px rgba(var(--shade), 0.14);
}

/* ---- cards ---- */

.card {
  margin: 0 0 12px;
  padding: 18px 20px 20px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 2px rgba(var(--shade), 0.05), 0 10px 28px rgba(var(--shade), 0.07);
}
.card > .label { display: block; margin-bottom: 8px; }

.note {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(var(--shade), 0.05), 0 6px 18px rgba(var(--shade), 0.06);
  font-size: 15px;
  line-height: 1.4;
}
.note svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--ink-soft); }

/* ---- photos (the app's, since November 2026) ---- */

.plate { overflow: hidden; border-radius: 20px; background: var(--sunk); }
.plate img { width: 100%; height: 100%; object-fit: cover; }
.plate.round { border-radius: 50%; }

/* A photo the column's width: the profile's topic, the lemon. */
.cover {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-card);
  background: var(--sunk);
  box-shadow: 0 1px 2px rgba(var(--shade), 0.06), 0 4px 12px rgba(var(--shade), 0.07), 0 12px 32px -4px rgba(var(--shade), 0.1);
}
.cover.lemon { aspect-ratio: 1000 / 664; }

/* ---- the first page: the app's mountain lake, the words on its foot ---- */

.step.photo-intro {
  position: fixed;
  inset: 0;
  z-index: 5;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  background: #24342f url(/assets/img/photos/lake-tall-1080.webp) 50% 30% / cover no-repeat;
  color: #fff;
}
@media (min-aspect-ratio: 4/5) {
  .step.photo-intro { background-image: url(/assets/img/photos/lake-wide-1920.webp); background-position: 50% 45%; }
}
.step.photo-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(8, 12, 14, 0.08) 0, rgba(8, 12, 14, 0) 26%, rgba(8, 12, 14, 0.45) 56%, rgba(8, 12, 14, 0.8) 100%);
}
.photo-intro .scroll, .photo-intro .footer { position: relative; width: 100%; max-width: 600px; margin: 0 auto; }
.photo-intro .scroll { display: flex; flex-direction: column; -webkit-mask-image: none; mask-image: none; }
/* The words sit at the foot; a long page still scrolls from its top. */
.photo-intro .scroll > :first-child { margin-top: auto; }
.photo-intro .kicker, .photo-intro .heading, .photo-intro .sub { color: #fff; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.3); }
.photo-intro .sub { color: rgba(255, 255, 255, 0.9); }
.photo-intro .legal, .photo-intro .legal a, .photo-intro .legal button { color: rgba(255, 255, 255, 0.8); }

/* ---- topics ---- */

/* Three to a row, all fifteen on one screen, as in the app's quiz: the
   pictures take the height that is left (--topic-side, set by fitTopics in
   funnel.js), and .tight names and rows when they get small. */
.topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--row-gap, 12px) 8px; }
.topic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: center;
}
.topic .plate { width: var(--topic-side, 100%); aspect-ratio: 1; border-radius: 16px; transition: transform 160ms ease; }
.topic:active .plate { transform: scale(0.95); }
.topic .name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  hyphens: manual;
  -webkit-hyphens: manual;
  overflow-wrap: anywhere;
}
.topics.tight .name { font-size: 11px; line-height: 1.2; }
/* Short screens: a smaller heading leaves the pictures more room. */
@media (max-height: 640px) {
  .scroll:has(> .topics) .heading { font-size: 22px; line-height: 28px; letter-spacing: 0.006em; }
  .scroll:has(> .topics) .gap-20 { height: 12px; }
}

/* ---- score gauge ---- */

.gauge { position: relative; height: 26px; }
.gauge .zones {
  position: absolute;
  inset: 8px 0 auto;
  height: 10px;
  display: flex;
  gap: 3px;
  border-radius: 5px;
  overflow: hidden;
}
.gauge .zones span:nth-child(3n + 1) { background: var(--zone-low); }
.gauge .zones span:nth-child(3n + 2) { background: var(--zone-mid); }
.gauge .zones span:nth-child(3n + 3) { background: var(--zone-high); }
.gauge .thumb {
  position: absolute;
  top: 2px;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 4px rgba(var(--shade), 0.12), 0 6px 14px rgba(var(--shade), 0.16);
  display: grid;
  place-items: center;
  transition: left 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gauge .thumb::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.bands { display: flex; margin-top: 6px; }
.bands span { text-align: center; font-size: 13px; line-height: 1.35; color: var(--ink-soft); }

/* ---- slider ---- */

.big-number {
  margin: 0;
  text-align: center;
  font-size: 56px;
  line-height: 1.1;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.range { width: 100%; margin: 16px 0 6px; accent-color: var(--ink); height: 32px; }
.ends { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; line-height: 1.35; color: var(--ink-soft); }
.ends span:last-child { text-align: right; }

/* ---- text answer ---- */

.field {
  display: block;
  width: 100%;
  min-height: 112px;
  padding: 16px;
  border: 0;
  border-radius: 16px;
  background: var(--sunk);
  font: inherit;
  font-size: 17px;
  line-height: 1.3;
  color: var(--ink);
  resize: none;
  outline: none;
  transition: background 200ms ease, box-shadow 200ms ease;
}
.field:focus { background: var(--surface); box-shadow: 0 1px 2px rgba(var(--shade), 0.06), 0 4px 12px rgba(var(--shade), 0.06); }
.field::placeholder { color: var(--ink-soft); }
.count { margin-top: 8px; padding-right: 4px; text-align: right; font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ---- lists on the reveal ---- */

.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { display: flex; gap: 12px; margin-bottom: 14px; font-size: 15px; line-height: 1.4; color: var(--ink-soft); transition: color 250ms ease; }
/* Not .done: that is the /start/done page's box, padding and all. */
.ticks li.ticked { color: var(--ink); }
.ticks .mark { width: 22px; height: 22px; }

.learned { list-style: none; margin: 0; padding: 0; }
.learned li { position: relative; margin-top: 6px; padding-left: 15px; font-size: 15px; line-height: 1.4; color: var(--ink-soft); }
.learned li::before { content: ""; position: absolute; left: 0; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-soft); }
.learned strong { color: var(--ink); font-weight: 600; }
.learned em { color: var(--ink); font-style: italic; }

.weeks { display: grid; grid-template-columns: auto 1fr; gap: 12px 12px; align-items: baseline; }
.weeks .wk { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.weeks .title { font-size: 15px; line-height: 1.4; font-weight: 600; }
.weeks .sessions { margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--muted); }

.day-row { display: flex; gap: 12px; padding: 6px 0; font-size: 15px; line-height: 1.4; }
.day-row svg { flex: none; width: 22px; height: 22px; color: var(--ink-soft); }
.day-row strong { font-weight: 600; }

.how ol { margin: 8px 0 0; padding-left: 0; list-style: none; counter-reset: how; }
.how li { counter-increment: how; margin-top: 4px; font-size: 15px; line-height: 1.4; }
.how li::before { content: counter(how) ".  "; }
.how strong { font-weight: 600; }

/* ---- consent (UK and EU) ---- */

.consent {
  margin: 0 0 12px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 2px rgba(var(--shade), 0.05), 0 6px 18px rgba(var(--shade), 0.06);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-soft);
}
.consent p { margin: 0 0 12px; }
.consent a { color: var(--ink); }
.consent .actions { display: flex; gap: 8px; }
.consent .actions .btn { min-height: 44px; font-size: 15px; border-radius: 22px; }
.consent .btn-light { background: var(--sunk); color: var(--ink); }

.legal { margin-top: 16px; text-align: center; font-size: 12px; line-height: 1.4; color: var(--muted); }
.legal a, .legal button { color: var(--muted); text-decoration: underline; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
/* Small text, but a 44px target: the padding reaches out, the margin keeps the line where it was. */
.legal a, .legal button { display: inline-block; padding: 14px 6px; margin: -14px -6px; }

/* ---- the done page ---- */

.done-page { overflow: auto; }
.done { max-width: 600px; margin: 0 auto; padding: calc(32px + env(safe-area-inset-top, 0px)) 20px calc(32px + env(safe-area-inset-bottom, 0px)); }
.store { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.store .btn svg { width: 20px; height: 20px; margin-right: 10px; }

.heading:focus, h1:focus { outline: none; }
