/* Stillbird — /start interactive quiz funnel.
   Sharp monochrome editorial UI; rounded corners ONLY on real iPhone hardware, Dynamic Island and iOS banners (WEB-31). */

:root {
  --ink: #000;
  --paper: #fff;
  --secondary: #5c5c5c;
  --surface: #f4f4f4;
  --lived: #e4e4e4;
  --ahead: #f3f3f3;
  --other: #a3a3a3;
  --rule: #d8d8d8;
  --red: #d93025;
  --green: #1a6647;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #fff;
    --paper: #000;
    --secondary: #989898;
    --surface: #141414;
    --lived: #262626;
    --ahead: #171717;
    --other: #6e6e6e;
    --rule: #2c2c2c;
    --red: #ff5a4f;
    --green: #2e9e6b;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, "Arial Nova", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 500; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 0.18em; }
svg, canvas { display: block; }
.tabular { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.skip {
  position: absolute; left: 12px; top: -100px;
  background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 20;
}
.skip:focus { top: 12px; }

/* ---------- Shell ---------- */

.app-shell {
  min-height: 100dvh;
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.q-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.q-header-left { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: none; border: 2px solid var(--ink);
  cursor: pointer; font-size: 17px; line-height: 1; padding: 0;
}
.icon-btn[hidden] { display: none; }
.icon-btn:active { background: var(--ink); color: var(--paper); }

.q-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 500; font-size: 17px; letter-spacing: -0.02em; }
.brand-mark .ink { fill: var(--ink); }
.brand-mark .paper { fill: var(--paper); }
.brand-mark .wing { fill: none; stroke: var(--paper); stroke-width: 3; }

.q-progress {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  min-width: 80px;
}
.q-progress i { display: block; height: 4px; background: var(--lived); }
.q-progress i.done, .q-progress i.now { background: var(--ink); }

.q-step-count { font-size: 13px; color: var(--secondary); font-weight: 500; min-width: 34px; text-align: right; }

/* ---------- Stage ---------- */

.q-stage {
  flex: 1;
  padding: 20px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.q-stage:focus { outline: none; }

.step-enter { animation: stepIn .22s ease; }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step-enter { animation: none; } }

.step-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--secondary);
}

.step-title {
  font-size: clamp(28px, 7.6vw, 38px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.step-title .accent-red { color: var(--red); }

.step-sub { font-size: 15px; color: var(--secondary); line-height: 1.4; }

/* ---------- Inline Still Header ---------- */

.still-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
}
.still-stage-box { width: 62px; height: 62px; flex: none; display: grid; place-items: center; }
.still-stage-box svg { width: 62px; height: 62px; }
.still-path { fill: var(--ink); }
.still-bubble {
  display: inline-block;
  background: var(--ink); color: var(--paper);
  font-size: 13px; font-weight: 700; padding: 4px 9px;
  letter-spacing: -0.01em;
}
.still-row-text { display: grid; gap: 4px; justify-items: start; }
.still-row-note { font-size: 13px; color: var(--secondary); }

/* ---------- Selectable Chips & Cards ---------- */

.feed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  background: var(--paper);
  border: 2px solid var(--rule);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.choice-card:hover { border-color: var(--ink); }
.choice-card.on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}
.choice-card .c-main { display: grid; gap: 2px; }
.choice-card .c-title { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.choice-card .c-sub { font-size: 12px; color: var(--secondary); line-height: 1.25; }
.choice-card.on .c-sub { color: color-mix(in srgb, var(--paper) 72%, transparent); }
.choice-card .c-box {
  width: 16px; height: 16px; flex: none;
  border: 2px solid currentColor;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.choice-card.on .c-box { background: var(--paper); color: var(--ink); border-color: var(--paper); }

.choice-stack { display: grid; gap: 10px; }

.callout-dark {
  background: var(--ink);
  color: var(--paper);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
}
.callout-dark .still-path { fill: var(--paper); }
.callout-dark strong { display: block; font-size: 14px; margin-bottom: 3px; }
.callout-dark p { font-size: 14px; line-height: 1.38; opacity: 0.88; }

/* ---------- Step 2: Hours Slider + Year Grid ---------- */

.hours-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.hours-num { font-size: clamp(40px, 11vw, 56px); font-weight: 500; letter-spacing: -0.045em; line-height: 0.95; }
.hours-bird-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hours-bird-wrap svg { width: 68px; height: 68px; }

.q-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 34px; background: transparent; cursor: pointer;
}
.q-range::-webkit-slider-runnable-track { height: 3px; background: var(--ink); }
.q-range::-moz-range-track { height: 3px; background: var(--ink); }
.q-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -11.5px;
  background: var(--ink); border: 3px solid var(--paper); outline: 2px solid var(--ink);
}
.q-range::-moz-range-thumb {
  width: 22px; height: 22px; background: var(--ink); border: 3px solid var(--paper); border-radius: 0; outline: 2px solid var(--ink);
}

.preset-row { display: flex; gap: 8px; }
.chip-btn {
  flex: 1; padding: 8px 10px; background: var(--paper);
  border: 2px solid var(--rule); cursor: pointer;
  font-size: 14px; font-weight: 500; text-align: center;
}
.chip-btn:hover { border-color: var(--ink); }
.chip-btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.verdict-box {
  border: 2px solid var(--ink);
  padding: 14px;
  display: grid;
  gap: 10px;
}
.verdict-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.verdict-days { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; color: var(--red); }
.verdict-week { font-size: 13px; color: var(--secondary); }
.year-canvas { width: 100%; height: auto; }

/* ---------- Step 3: Life in Weeks ---------- */

.age-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.age-row .chip-btn { padding: 8px 4px; font-size: 13px; }

.life-card {
  border: 2px solid var(--ink);
  padding: 12px;
  display: grid;
  gap: 10px;
}
.life-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.life-meta strong { font-size: 18px; letter-spacing: -0.02em; }
.life-meta span { font-size: 12px; color: var(--red); font-weight: 600; }
.life-canvas { width: 100%; height: 158px; display: block; }
.life-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; font-size: 11px; color: var(--secondary); }
.life-legend span { display: inline-flex; align-items: center; gap: 5px; }
.life-legend i { width: 9px; height: 9px; display: block; }
.lg-lived { background: var(--ink); }
.lg-sleep { background: var(--other); opacity: 0.45; }
.lg-feeds { background: var(--red); }
.lg-ahead { background: var(--lived); }

.goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.goal-grid .chip-btn { text-align: left; padding: 10px 11px; font-size: 13px; }

/* ---------- Step 5: Interactive Phone Preview (Hardware Rounded!) ---------- */

.seg-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border: 2px solid var(--ink); }
.seg-tabs.three { grid-template-columns: repeat(3, 1fr); }
.seg-tabs button {
  padding: 9px 8px; border: 0; background: var(--paper); color: var(--ink);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.seg-tabs button + button { border-left: 2px solid var(--ink); }
.seg-tabs button.on { background: var(--ink); color: var(--paper); }

/* Real iPhone hardware silhouette stays rounded (WEB-31). */
.hw-phone {
  width: min(100%, 312px);
  margin: 0 auto;
  background: #000;
  padding: 9px;
  border-radius: 42px;
  border: 2px solid #2c2c2e;
}
.hw-screen {
  background: #15181c;
  color: #fff;
  border-radius: 34px;
  overflow: hidden;
  position: relative;
  min-height: 256px;
}

.hw-feed-top {
  display: flex; justify-content: space-around; align-items: center;
  padding: 12px 16px 8px; background: #000; border-bottom: 1px solid #2f3336;
  font-size: 12px; font-weight: 600;
}
.hw-feed-top .dim { color: #71767b; font-weight: 500; }

.hw-feed-cards { padding: 12px; display: grid; gap: 10px; }
.hw-post {
  background: #1d2228; padding: 10px 12px; display: grid; gap: 6px;
  border-left: 2px solid #343a40;
}
.hw-post-head { display: flex; justify-content: space-between; font-size: 11px; color: #8e98a3; }
.hw-post-title { font-size: 13px; font-weight: 500; color: #e7e9ea; line-height: 1.3; }
.hw-post-meta { font-size: 11px; color: #6c757d; }

.safari-overlay {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.safari-disc {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: #000;
  border: 2px solid #fff;
  display: grid; place-items: center;
  flex: none;
}
.safari-disc svg { width: 52px; height: 52px; }
.safari-disc .still-path { fill: #fff; }
.safari-word {
  background: #fff; color: #000;
  font-size: 13px; font-weight: 700;
  padding: 5px 10px;
  white-space: nowrap;
}
.safari-timer {
  position: absolute;
  right: 14px;
  bottom: 24px;
  text-align: right;
}
.safari-timer strong { display: block; font-size: 20px; letter-spacing: -0.03em; line-height: 1; }
.safari-timer span { font-size: 11px; color: #9aa2aa; }
.safari-timer.hot strong { color: #ff5a4f; }

.demo-controls {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}
.demo-controls .action-btn {
  padding: 10px 12px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
  font-size: 14px; font-weight: 600; cursor: pointer; text-align: center;
}
.demo-controls .chip-btn { flex: none; padding: 10px 12px; font-size: 13px; }

/* Dynamic Island hardware pill inside hw-screen */
.hw-island-wrap { padding: 14px 12px 18px; display: grid; gap: 14px; }
.hw-island {
  margin: 0 auto;
  background: #000;
  color: #fff;
  border: 1px solid #2f3336;
  border-radius: 28px;
  transition: width .28s ease, padding .28s ease;
}
.hw-island.compact {
  width: 200px; padding: 6px 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.hw-island.expanded {
  width: 100%; padding: 14px 16px; border-radius: 30px;
  display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center;
}
.hw-island svg .still-path { fill: #fff; }
.isl-fact { font-size: 11px; color: #9ea6ae; }
.isl-question { font-size: 14px; font-weight: 600; line-height: 1.25; margin-top: 2px; }
.hw-lock-card {
  background: #1c1c1e; color: #fff;
  border-radius: 22px; padding: 14px;
  display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center;
  border: 1px solid #303034;
}
.hw-lock-card svg .still-path { fill: #fff; }

/* ---------- Step 6: Interactive iOS Widget Gallery ---------- */

.widget-frame {
  border: 2px solid var(--ink);
  padding: 14px;
  background: var(--paper);
  display: grid;
  gap: 12px;
}

.score-black {
  background: #000; color: #fff; padding: 14px;
  display: grid; gap: 10px;
}
.score-head { display: flex; justify-content: space-between; align-items: baseline; }
.score-big { font-size: 42px; font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.score-big small { font-size: 14px; opacity: 0.7; margin-left: 2px; }
.score-bar-wrap { position: relative; padding-top: 34px; }
.score-bird-perch { position: absolute; top: 0; width: 34px; height: 34px; transform: translateX(-50%); transition: left .22s ease; }
.score-bird-perch .still-path { fill: #fff; }
.score-bar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; height: 9px; }
.score-bar i { border: 1px solid #fff; display: block; }
.score-bar i.on { background: #fff; }

/* Thermal Receipt (StillReceiptWidget.swift) */
.receipt-card {
  border: 2px solid var(--ink);
  padding: 15px 16px;
  background: var(--paper);
  display: grid;
  gap: 10px;
}
.receipt-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.receipt-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.receipt-date { font-size: 11px; color: var(--secondary); margin-top: 2px; }
.receipt-perf { border: 0; border-top: 1px dashed var(--ink); margin: 0; opacity: 0.45; }
.receipt-rows { display: grid; gap: 8px; }
.r-row { display: grid; gap: 3px; }
.r-line { display: flex; align-items: baseline; gap: 6px; font-size: 13px; font-weight: 600; }
.r-dots { flex: 1; border-bottom: 1px dotted var(--other); transform: translateY(-3px); }
.r-bar-bg { height: 3px; background: var(--lived); }
.r-bar-fill { height: 100%; background: var(--ink); }
.receipt-totals { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.r-stat small { display: block; font-size: 10px; letter-spacing: 0.08em; color: var(--secondary); text-transform: uppercase; }
.r-stat strong { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.r-stamp {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  padding: 3px 6px; border: 1.5px solid var(--ink); text-transform: uppercase;
}
.r-stamp.committed { background: var(--ink); color: var(--paper); }
.barcode { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; align-items: end; height: 22px; }
.barcode i { display: block; background: var(--ink); }
.barcode i.dim { background: var(--lived); }

/* Still Says + Breath / Shield */
.says-box {
  display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center;
  border: 2px solid var(--ink); padding: 12px;
}
.poke-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  display: grid; place-items: center; width: 76px; height: 76px;
}
.poke-btn svg { width: 72px; height: 72px; }
.says-bubble { border: 1.5px solid var(--ink); padding: 9px 11px; }
.says-bubble strong { display: block; font-size: 14px; }
.says-bubble p { font-size: 13px; color: var(--secondary); margin-top: 2px; }
.says-chips { display: flex; gap: 6px; margin-top: 8px; }
.says-chips button {
  padding: 5px 9px; font-size: 12px; font-weight: 600; border: 1.5px solid var(--ink);
  background: var(--paper); cursor: pointer;
}
.says-chips button.primary { background: var(--ink); color: var(--paper); }

.breath-box {
  border: 2px solid var(--ink); padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.breath-box.shield-on { background: #000; color: #fff; border-color: #000; }
.breath-box.shield-on .still-path { fill: #fff; }
.breath-box.shield-on .step-sub { color: #9ea6ae; }
.breath-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; }
.breath-badge i { width: 7px; height: 7px; background: var(--green); display: block; }
.breath-actions { display: flex; gap: 8px; margin-top: 8px; }
.breath-actions button {
  padding: 7px 11px; font-size: 12px; font-weight: 600;
  border: 1.5px solid currentColor; background: transparent; cursor: pointer;
}
.breath-actions button.fill { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.breath-box.shield-on .breath-actions button.fill { background: #fff; color: #000; border-color: #fff; }

/* ---------- Step 7: Notification Preview (Hardware Rounded Banner) ---------- */

.hw-banner {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 20px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 11px;
  align-items: start;
}
.hw-banner-icon {
  width: 36px; height: 36px; border-radius: 9px; background: #000;
  display: grid; place-items: center;
}
.hw-banner-icon svg { width: 28px; height: 28px; }
.hw-banner-icon .still-path { fill: #fff; }
.hw-banner-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--secondary); }
.hw-banner-title { font-size: 14px; font-weight: 600; margin-top: 2px; }
.hw-banner-body { font-size: 13px; color: var(--secondary); margin-top: 1px; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 2px solid var(--rule); cursor: pointer; background: var(--paper); width: 100%; text-align: left;
}
.toggle-row.on { border-color: var(--ink); }
.toggle-pill {
  width: 44px; height: 24px; border: 2px solid var(--ink); padding: 2px;
  display: flex; align-items: center; flex: none;
}
.toggle-pill i { width: 16px; height: 16px; background: var(--ink); display: block; transition: transform .15s ease; }
.toggle-row.on .toggle-pill { background: var(--ink); }
.toggle-row.on .toggle-pill i { background: var(--paper); transform: translateX(20px); }

/* ---------- Step 8: Receipt Actions ---------- */

.final-actions { display: grid; gap: 10px; }
.final-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-outline {
  padding: 12px 14px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  font-size: 14px; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none;
}
.btn-outline:active { background: var(--ink); color: var(--paper); }
.coming-soon-box {
  border: 2px solid var(--ink); background: var(--surface);
  padding: 14px; text-align: center; display: grid; gap: 6px;
}
.coming-soon-box strong { font-size: 16px; }
.coming-soon-box p { font-size: 13px; color: var(--secondary); }

/* ---------- Sticky Footer Continue Bar ---------- */

.q-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 95%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 8px;
}
.q-footer[hidden] { display: none; }

.q-hint { font-size: 12px; color: var(--secondary); text-align: center; }

.q-continue {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
}
.q-continue:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}
.q-continue:not(:disabled):active { transform: translateY(1px); }

@media (max-width: 390px) {
  .q-stage { padding: 14px 14px 18px; gap: 12px; }
  .q-header, .q-footer { padding-left: 14px; padding-right: 14px; }
}
@media (max-height: 700px) {
  .q-stage { padding-top: 12px; padding-bottom: 14px; gap: 11px; }
  .step-title { font-size: clamp(24px, 6.8vw, 32px); }
  .choice-card { padding: 10px 12px; }
  .choice-stack { gap: 8px; }
  .life-canvas { height: 132px; }
  .hw-post { padding: 8px 10px; gap: 4px; }
}
