:root {
  /* ---- Brand palette: the one place colours are defined for the public pages ---- */
  --bg: #FFFBF5;            /* page background */
  --ink: #1F1A2E;          /* body text and headings */
  --ink-soft: #4A4458;     /* secondary text (about 9:1 on the page colour) */
  --btn: #6B3FA8;          /* primary buttons, selected pill, emphasis */
  --btn-hover: #5A3391;
  --btn-ink: #FFFFFF;      /* text on primary buttons */
  --tint: #F3ECFB;         /* tint panels */
  --logo-purple: #A97BDD;
  --logo-orange: #F5B14E;
  --line: #E6DCF3;         /* hairlines, card borders */
  --field-line: #BFAEDB;   /* input borders */
  --error-bg: #FDE8EC;
  --error-ink: #8F1032;
  --error: #B3261E;     /* pricing-form error text */
  --green: #64c466;
  --white: #FFFFFF;
  /* ---- Fonts (Nunito + Inter are loaded from Google Fonts in views/layout.js) ---- */
  --font-head: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font: var(--font-body);
}
/* Admin sign-in screens (views/admin.js) keep their original purple look and system fonts. */
html.admin-theme {
  --ink: #17082e; --soft: rgba(255, 255, 255, 0.86); --purple: #772bf6; --purple-deep: #4c14b0; --lilac: #b88be8; --orange: #f59a2a;
  --font-head: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-body: var(--font-head); --font: var(--font-head);
  background: var(--purple-deep);
}
html.admin-theme body { color: #fff; background: var(--purple-deep); }
html.admin-theme .backdrop { background: var(--purple-deep); }
html.admin-theme .column { background: var(--purple); }
@media (min-width: 470px) { html.admin-theme .column { box-shadow: 0 0 60px rgba(0, 0, 0, 0.35); } }
html.admin-theme :focus-visible { outline: 3px solid var(--btn); outline-offset: 3px; }
html.admin-theme h1, html.admin-theme h2, html.admin-theme h3 { font-weight: 600; }
html.admin-theme .btn { border: 2.5px solid var(--ink); background: var(--lilac); color: var(--ink); font-weight: 600; }
html.admin-theme .btn:hover { background: #c79ff0; }
html.admin-theme .btn-orange { background: var(--orange); border-color: var(--orange); }
html.admin-theme .btn-orange:hover { background: #ffa83b; }
html.admin-theme .btn-outline { background: transparent; border-color: #fff; color: #fff; }
html.admin-theme .btn-outline:hover { background: rgba(255, 255, 255, 0.12); }
html.admin-theme .field-error { color: #fff; background: #5a0f2e; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Soft scroll-snap on the landing page. Delete the next rule (or the "snap" class) to remove it. */
html.snap { scroll-snap-type: y proximity; }
body { margin: 0; font-family: var(--font-body); font-weight: 400; color: var(--ink); background: var(--bg); line-height: 1.4; }
img { max-width: 100%; height: auto; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px var(--ink); }

.backdrop { min-height: 100vh; min-height: 100svh; display: flex; justify-content: center; background: var(--bg); }
.column { width: 100%; max-width: 430px; background: var(--bg); position: relative; container-type: inline-size; }
@media (min-width: 470px) { .column { box-shadow: 0 0 0 1px var(--line); } }

.screen { min-height: 100vh; min-height: 100svh; padding: 36px 24px 40px; display: flex; flex-direction: column; align-items: center; text-align: center; scroll-snap-align: start; }
.brand { font-family: var(--font-head); font-size: 1.35rem; font-weight: 800; margin: 8px 0 16px; letter-spacing: 0.01em; }
h1, h2, h3 { margin: 0; font-family: var(--font-head); font-weight: 800; }
p { margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; min-width: 200px; padding: 12px 32px; border-radius: 999px; border: 0; background: var(--btn); color: var(--btn-ink); font: inherit; font-size: 1.1rem; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-orange { background: var(--orange); border-color: var(--orange); }
.btn-orange:hover { background: #ffa83b; }
.btn-outline { background: transparent; border-color: #fff; color: #fff; }
.btn-outline:hover { background: rgba(255, 255, 255, 0.12); }
.logo { width: 100%; max-width: 300px; height: auto; }

/* Landing 1 */
.s1 { justify-content: flex-start; }
.s1 .lede { font-size: 1rem; color: var(--ink-soft); margin-bottom: 4vh; max-width: 340px; }
.s1 h1 { font-size: clamp(2.4rem, 11vw, 3.1rem); line-height: 1.12; font-weight: 800; }
.s1 .sub { font-size: 1.3rem; margin: 22px 0 26px; font-weight: 500; }
.s1 .logo { max-width: min(340px, 34svh); margin-top: auto; }

.s1, .s2 { position: relative; padding-bottom: 72px; }
.s1 { padding-bottom: 84px; }
.s2 { padding-top: 28px; }
.scroll-down { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; animation: nudge 2.4s ease-in-out infinite; }
.scroll-down:hover { background: var(--tint); }
@keyframes nudge { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }
@media (prefers-reduced-motion: reduce) { .scroll-down { animation: none; } }

.band { background: var(--tint); text-align: center; display: grid; gap: 8px; align-self: stretch;
  /* full-bleed inside the hero: cancel the hero's side padding, then pad the content back in */
  margin: 16px calc(-1 * max(24px, env(safe-area-inset-right))) 0 calc(-1 * max(24px, env(safe-area-inset-left)));
  padding: 16px max(24px, env(safe-area-inset-right)) max(60px, calc(env(safe-area-inset-bottom) + 48px)) max(24px, env(safe-area-inset-left)); }
.band p { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; line-height: 1.3; color: var(--ink); }
.band p.hl { color: var(--btn); font-weight: 800; }

/* Landing 2 */
.s2 { justify-content: flex-start; }
.s2 h2 { font-size: 1.7rem; font-weight: 800; line-height: 1.2; margin: 0 0 8px; }
.s2-sub { font-size: 0.95rem; color: var(--ink-soft); max-width: 300px; margin: 0 0 6px; }
.story { width: 100%; display: flex; flex-direction: column; gap: 2px; }
.story .row { display: grid; grid-template-columns: 1fr 28px 1fr; align-items: center; gap: 4px; }
.story figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.story figure img { width: 70px; }
.story figcaption { font-size: 0.85rem; color: var(--ink-soft); max-width: 120px; }
.story .arrow { font-size: 1.5rem; color: var(--ink); }
.story .op { font-size: 2rem; font-weight: 800; font-family: var(--font-head); color: var(--btn); line-height: 1; padding: 2px 0; }
.node { width: 90px; height: 90px; border-radius: 50%; border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; line-height: 1.15; color: var(--ink); justify-self: center; }
.n-goal { background: var(--logo-purple); }
.n-true { background: #4aa850; font-size: 0.9rem; }
.story .hats { align-items: center; }
.story .hats figcaption { max-width: 220px; }
.cycle { width: 100%; max-width: 262px; height: auto; }
.hat circle { stroke: var(--ink); stroke-width: 3; }
.hat text { font-size: 14px; font-weight: 700; fill: var(--ink); font-family: var(--font-head); }
.h-yellow circle { fill: #f6d54a; } .h-teal circle { fill: #6be4cf; } .h-blue circle { fill: #5dbdf5; }
.h-green circle { fill: #64c466; } .h-orange circle { fill: var(--logo-orange); }

/* Landing 3 */
.s3 { justify-content: flex-start; gap: 14px; }
.shot { position: relative; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; padding: 8px; }
.shot img { width: 100%; }
.shot-bare { background: transparent; border: 0; padding: 0; border-radius: 0; overflow: visible; }
.shot-bare .preview-tag { top: 0; right: auto; left: 50%; transform: translateX(-50%); }
.preview-tag { position: absolute; top: 8px; right: 8px; z-index: 1; background: var(--ink); color: #fff; font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; letter-spacing: 0.04em; text-transform: uppercase; }
.cards { list-style: none; padding: 0; margin: 0 0 8px; width: 100%; display: grid; gap: 10px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.cards li { padding: 4px 2px; }
.cards h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.cards p { font-size: 0.88rem; color: var(--ink-soft); }
.s3 .btn { margin-top: 10px; }
.closing { font-size: 0.95rem; color: var(--ink-soft); max-width: 300px; }

/* Plans */
.plans .bullets { text-align: left; list-style: disc; padding-left: 1.2rem; margin: 18px 0 26px; font-size: 1.05rem; align-self: stretch; max-width: 330px; margin-inline: auto; }
.plans .bullets li { margin-bottom: 8px; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pill { min-height: 52px; padding: 10px 22px; border-radius: 999px; border: 2px solid var(--btn); background: var(--white); color: var(--btn); font: inherit; font-size: 1.05rem; font-weight: 500; cursor: pointer; }
.pill .amt { font-family: var(--font-head); font-weight: 800; }
.pill[aria-checked="true"] { background: var(--btn); color: var(--btn-ink); }
.pill[aria-checked="false"]:hover { background: var(--tint); }
.plans .btn { margin-bottom: 0; }
.plans .swap { max-width: 300px; margin-top: auto; }

/* Sign-up form (pricing page) */
.plans form { width: 100%; margin: 0 0 26px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.field { width: 100%; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field-label { font-weight: 500; font-size: 0.95rem; color: var(--ink); }
.plans input[type="email"], .admin-card input[type="email"] { width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 12px; border: 2px solid var(--field-line); font: inherit; font-size: 1rem; color: var(--ink); background: #fff; }
.plans input[type="email"]:focus { border-color: var(--btn); outline: none; box-shadow: 0 0 0 3px var(--tint); }
.plans input::placeholder { color: #6f6580; }
.field-error { color: var(--error); font-size: 0.95rem; font-weight: 500; width: 100%; text-align: left; margin: 0; }
.field-error[hidden] { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Confirmation page */
.confirm .car { max-width: 340px; margin: 6px 0 14px; }
.confirm-body { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.confirm-body .cheer { width: 160px; animation: bob 2.4s ease-in-out infinite; will-change: transform; }
.confirm h1 { font-size: 1.6rem; font-weight: 800; line-height: 1.25; margin: 4px 0 4px; }
.confirm p { font-size: 1.05rem; margin: 0; }
.confirm .on-list { font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; color: var(--btn); }
@media (prefers-reduced-motion: reduce) { .confirm-body .cheer { animation: none; } }

/* Admin login screens */
.admin-card { justify-content: center; gap: 14px; }
.admin-card .mark { width: 120px; height: 120px; background: #fff; border-radius: 28px; display: flex; align-items: center; justify-content: center; padding: 14px; }
.admin-card h1 { font-size: 1.9rem; }
.admin-card p { color: var(--soft); max-width: 330px; }
.admin-card form { width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: left; margin-top: 8px; }
.admin-card label { font-size: 0.95rem; }
.admin-card .btn { width: 100%; }
.admin-card a.btn { width: auto; }
.admin-card .note { background: rgba(255, 255, 255, 0.14); border-radius: 14px; padding: 14px 18px; }
.on-purple { background: #5a0f2e; }

/* ---- Device polish ---- */
html { background: var(--bg); }
a, button, [role="radio"] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* Notches, rounded corners and the iOS home bar (landscape + portrait) */
.screen {
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
  padding-bottom: max(40px, calc(env(safe-area-inset-bottom) + 24px));
}
/* Short screens (small Android, iPhone SE, landscape phones): keep sections 1 and 2 close to one screen */
@media (max-height: 740px) {
  .screen { padding-top: 24px; padding-bottom: 28px; }
  .s1 .lede { margin-bottom: 4vh; }
  .s1 h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
  .s1 .sub { margin: 10px 0 10px; font-size: 1.15rem; }
  .s1 .logo { max-width: min(190px, 28svh); }
  .band { gap: 3px; padding-top: 12px; margin-top: 10px; }
  .band p { font-size: 0.98rem; }
  .s2 h2 { font-size: 1.5rem; margin: 0 0 12px; }
  .story .row { grid-template-columns: 1fr 22px 1fr; }
  .s2-sub { font-size: 0.85rem; margin: 0 0 2px; }
  .story figure img { width: 58px; }
  .story figcaption { font-size: 0.78rem; }
  .node { width: 80px; height: 80px; font-size: 0.85rem; }
  .n-true { font-size: 0.8rem; }
  .cycle { max-width: 218px; }
  .story .op { font-size: 1.5rem; }
  .plans .bullets { margin: 6px auto 16px; }
  .plans .swap { max-width: 200px; }
  .confirm .car { max-width: 220px; margin-bottom: 8px; }
  .confirm h1 { font-size: 1.35rem; }
}
/* Landscape phones: the column is 430px wide on a short screen; let content flow naturally */
@media (orientation: landscape) and (max-height: 500px) {
  .screen { min-height: 0; }
  .s1 .logo { max-width: 200px; margin-top: 16px; }
    html.snap { scroll-snap-type: none; }
}

/* ---- Desktop only: liquid mirror sides ---- */
.liquid { display: none; }
@media (min-width: 900px) {
  .backdrop { position: relative; isolation: isolate; }
  .column { position: relative; z-index: 2; }
  .liquid { display: block; position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
  .liquid-defs { position: absolute; }
  .liquid-side { position: absolute; top: 0; bottom: 0; width: calc((100vw - 430px) / 2); overflow: hidden; contain: layout paint; }
  .liquid-side.left { left: 0; }
  /* The right side is the left side mirrored, like a reflection across the column */
  .liquid-side.right { right: 0; transform: scaleX(-1); }
  .goo { position: absolute; inset: -10%; filter: url(#goo); }
  .b { position: absolute; border-radius: 50%; will-change: transform; }
  .b1 { width: 64%; aspect-ratio: 1; left: 8%; top: -6%;  background: radial-gradient(circle at 32% 26%, #fff 0 5%, #efe1ff 11%, #a46bff 38%, #5a1fd0 68%, #2b0b6e 100%); animation: liq1 19s ease-in-out infinite alternate; }
  .b2 { width: 46%; aspect-ratio: 1; left: 44%; top: 14%; background: radial-gradient(circle at 30% 24%, #fff 0 5%, #ffe4b8 13%, #f59a2a 44%, #a85a00 78%, #5a2d00 100%); animation: liq2 23s ease-in-out infinite alternate; }
  .b3 { width: 72%; aspect-ratio: 1; left: -14%; top: 30%; background: radial-gradient(circle at 34% 28%, #fff 0 4%, #e9ddff 10%, #8a52f2 40%, #3f13a8 72%, #1d0752 100%); animation: liq3 27s ease-in-out infinite alternate; }
  .b4 { width: 38%; aspect-ratio: 1; left: 50%; top: 42%; background: radial-gradient(circle at 30% 25%, #fff 0 5%, #ffd2ee 13%, #e04fb8 44%, #8a1f78 80%, #3d0838 100%); animation: liq4 21s ease-in-out infinite alternate; }
  .b5 { width: 58%; aspect-ratio: 1; left: 20%; top: 64%; background: radial-gradient(circle at 32% 26%, #fff 0 5%, #e2f0ff 12%, #7aa7ff 40%, #3b2fc4 74%, #170a63 100%); animation: liq5 25s ease-in-out infinite alternate; }
  .b6 { width: 34%; aspect-ratio: 1; left: 6%; top: 80%; background: radial-gradient(circle at 30% 25%, #fff 0 5%, #ffe9c4 13%, #f59a2a 46%, #8f4a00 82%, #4a2500 100%); animation: liq6 18s ease-in-out infinite alternate; }
  .b7 { width: 44%; aspect-ratio: 1; left: 52%; top: 84%; background: radial-gradient(circle at 32% 26%, #fff 0 5%, #efe1ff 12%, #a46bff 40%, #5a1fd0 70%, #2b0b6e 100%); animation: liq7 22s ease-in-out infinite alternate; }
  /* Soft diagonal glints sweeping over the metal, plus an inner shadow toward the column */
  .sheen { position: absolute; inset: 0; mix-blend-mode: soft-light; background:
      linear-gradient(115deg, transparent 20%, rgba(255,255,255,.55) 34%, transparent 46%, transparent 62%, rgba(255,255,255,.35) 72%, transparent 84%),
      linear-gradient(to right, transparent 55%, rgba(20,4,60,.55) 100%);
    background-size: 220% 100%, 100% 100%; animation: sheen 14s ease-in-out infinite alternate; }
}
@keyframes liq1 { to { transform: translate(18%, 34%) scale(1.12); } }
@keyframes liq2 { to { transform: translate(-30%, 46%) scale(.85); } }
@keyframes liq3 { to { transform: translate(26%, -18%) scale(1.08); } }
@keyframes liq4 { to { transform: translate(-38%, -34%) scale(1.2); } }
@keyframes liq5 { to { transform: translate(-12%, -40%) scale(.9); } }
@keyframes liq6 { to { transform: translate(40%, -52%) scale(1.25); } }
@keyframes liq7 { to { transform: translate(-30%, -46%) scale(.95); } }
@keyframes sheen { from { background-position: 0% 0, 0 0; } to { background-position: 100% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .b, .sheen { animation: none !important; } }

/* ---- Desktop liquid mirror (see public/js/mirror.js) ---- */
.mirror { display: none; }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .backdrop { position: relative; overflow: hidden; }
  .mirror { display: block; position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: var(--purple-deep); animation: mirror-drift 28s ease-in-out infinite alternate; }
  .mirror-fx { position: absolute; inset: -6%; filter: url(#liquid) blur(22px) saturate(1.35) brightness(1.05); }
  .mirror-stage { position: absolute; left: 50%; top: 0; width: 430px; transform-origin: 0 0; will-change: transform; }
  .mirror-column { box-shadow: none; }
  /* soft glass sheen + vignette so the real column stays the focus */
  .mirror-sheen { position: absolute; inset: 0; background:
    radial-gradient(120% 90% at 50% 40%, rgba(255, 255, 255, 0) 35%, rgba(24, 6, 64, 0.55) 100%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, 0.07) 62%, rgba(255, 255, 255, 0) 100%); }
  .column { z-index: 1; }
}
@keyframes mirror-drift { from { transform: scale(1.04) translate3d(-1.2%, 0, 0); } to { transform: scale(1.1) translate3d(1.2%, -1%, 0); } }
@media (prefers-reduced-motion: reduce) { .mirror { animation: none !important; } }

/* ---- Desktop: full-width layout, no side bands. Phones and tablets keep the 430px column. ---- */
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .column { max-width: none; box-shadow: none; }
  .screen {
    padding: 56px max(48px, calc((100% - 1160px) / 2)) 56px;
    justify-content: center;
  }
  .btn { min-width: 240px; font-size: 1.2rem; }

  /* Landing 1: text left, mascot right */
  .s1 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr 1fr auto; column-gap: 64px; align-content: center; text-align: left; justify-items: start; }
  .s1 .brand, .s1 .lede { grid-column: 1 / -1; justify-self: center; text-align: center; }
  .s1 .brand { font-size: 4.5rem; line-height: 1.05; margin: 0 0 12px; }
  .s1 .lede { font-size: 1.15rem; margin-bottom: 4vh; }
  .s1 h1 { grid-column: 1; grid-row: 3; align-self: end; font-size: clamp(3.4rem, 5.4vw, 5rem); line-height: 1.08; }
  .s1 .sub { grid-column: 1; grid-row: 4; align-self: start; font-size: 1.7rem; margin: 20px 0 0; }
  .s1 .logo { grid-column: 2; grid-row: 3 / 5; align-self: center; justify-self: center; max-width: min(520px, 42vh * 1.3); margin: 0; }
  .s1 
  /* Landing 2: three big columns (problem + Solmira hats = outcome), filling the screen */
  .s2 { padding-bottom: 96px; padding-left: max(32px, calc((100% - 1360px) / 2)); padding-right: max(32px, calc((100% - 1360px) / 2)); }
  .s2 h2 { font-size: clamp(2.2rem, 3.4vw, 3.2rem); margin: 0 0 8px; }
  .s2-sub { font-size: 1.2rem; max-width: none; margin: 0 0 5vh; }
  .s1 .band { grid-column: 1 / -1; grid-row: 5; align-self: end; justify-self: stretch; grid-template-columns: repeat(3, 1fr); gap: 32px;
    margin: 28px calc(-1 * max(48px, calc((100cqw - 1160px) / 2))) 0;
    padding: 32px max(48px, calc((100cqw - 1160px) / 2)) 84px; }
  .band p { font-size: 1.5rem; }
  .story { flex-direction: row; align-items: center; justify-content: center; gap: clamp(8px, 2vw, 36px); }
  .story .row { flex: none; display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 1.6vw, 22px); }
  .story figure { width: auto; }
  .story figure img { width: clamp(120px, 13vw, 210px); }
  .story figcaption { font-size: clamp(1rem, 1.25vw, 1.3rem); max-width: 240px; }
  .story .arrow { font-size: clamp(2rem, 2.8vw, 3rem); transform: rotate(90deg); line-height: 1; }
  .story .op { font-size: clamp(2.6rem, 4vw, 4.4rem); padding: 0; }
  .node { width: clamp(150px, 17vw, 260px); height: clamp(150px, 17vw, 260px); font-size: clamp(1.3rem, 1.9vw, 2rem); }
  .n-true { font-size: clamp(1.1rem, 1.6vw, 1.7rem); }
  .story .hats { flex: none; }
  .story .hats figcaption { max-width: none; margin-top: 6px; }
  .cycle { width: clamp(300px, 38vw, 560px); max-width: none; }
  .scroll-down svg { width: 34px; height: 34px; }

  /* Landing 3: previews stacked, each as wide as the page allows */
  .s3 { display: flex; flex-direction: column; align-items: center; gap: 20px; }
  .s3 .shot { width: 100%; max-width: 1000px; }
  .s3 .shot img { width: 100%; height: auto; }
  .s3 .cards { width: 100%; max-width: 1000px; margin-bottom: 20px; }
  .s3 .btn { margin-top: 8px; }
  .s3 .closing { max-width: none; font-size: 1.05rem; }
  .cards h3 { font-size: 1.25rem; } .cards p { font-size: 1.05rem; }

  /* Plans: details left, mascot right */
  .plans { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 64px; align-content: center; justify-items: start; text-align: left; }
  .plans .brand { grid-column: 1 / -1; justify-self: center; font-size: 1.6rem; margin-bottom: 4vh; }
  .plans .bullets { grid-column: 1; margin: 0 0 32px; max-width: none; font-size: 1.3rem; }
  .plans .btn { grid-column: 1; margin: 0; }
  .plans form { grid-column: 1; max-width: 520px; align-items: flex-start; margin: 0; }
  .plans .swap { grid-column: 2; grid-row: 2 / 9; align-self: center; justify-self: center; max-width: 480px; margin: 0; }

  /* Confirmation: car sticker left, items stacked right */
  .confirm { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 64px; align-content: center; align-items: center; }
  .confirm .car { grid-column: 1; width: 100%; max-width: 560px; margin: 0; justify-self: center; }
  .confirm-body { grid-column: 2; max-width: 480px; width: 100%; }
  .confirm h1 { font-size: clamp(2rem, 3vw, 2.6rem); }
  .confirm p { font-size: 1.2rem; }
  .confirm .on-list { font-size: 1.6rem; }

  /* Admin sign-in screens: centered content on the full purple */
  .admin-card form { max-width: 440px; }
}

/* ---- Tap to zoom (phones and touch devices only) ---- */
.zoom-zones { position: absolute; inset: 0; }
.zoom-btn { position: absolute; top: 0; bottom: 0; padding: 0; border: 0; background: transparent; cursor: zoom-in; border-radius: 14px; }
.zoom-zones .zoom-btn:nth-child(1) { left: 0; width: 31.2%; }
.zoom-zones .zoom-btn:nth-child(2) { left: 34.4%; width: 31.2%; }
.zoom-zones .zoom-btn:nth-child(3) { left: 68.8%; width: 31.2%; }
.zoom-full { inset: 0; width: 100%; }
.zoom-badge { position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; }
.zoom-hint { font-size: 0.9rem; color: var(--ink-soft); margin-top: -6px; }
html.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; background: rgba(14, 4, 36, 0.95); }
.lightbox[hidden] { display: none; }
.lb-bar { display: flex; justify-content: flex-end; padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 0 10px; }
.lb-close { width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.lb-stage { flex: 1; min-height: 0; display: flex; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y pinch-zoom; padding: 8px max(8px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-bottom)); }
.lb-stage img { margin: auto; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lb-stage.wide img { max-width: none; max-height: none; width: max(240vw, 900px); border-radius: 12px; background: #fff; }
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .zoom-zones, .zoom-full, .zoom-hint { display: none; }
}


/* Hero brain: only the eyebrows bounce, in the same 2.4s ease-in-out loop as the down arrows */
.brain { position: relative; }
.brain > img { display: block; width: 100%; height: auto; max-width: none; }
.brain > .brow { position: absolute; top: 28.55%; width: 12.5%; height: auto; will-change: transform; animation: brow-bounce 2.4s ease-in-out infinite; }
.brain > .brow-l { left: 27.83%; }
.brain > .brow-r { left: 59.85%; }
@keyframes brow-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-45%); } }
@media (prefers-reduced-motion: reduce) { .brain > .brow { animation: none; } }

/* Landing screen 2: the two faces and the brain bounce in step with the down arrows (same 2.4s ease-in-out loop) */
.story figure > img, .cycle > image { animation: bob 2.4s ease-in-out infinite; will-change: transform; }
.cycle > image { transform-box: fill-box; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .story figure > img, .cycle > image { animation: none; } }

/* "Build my plan!" bounces 3 times (same 2.4s bob as the down arrows) each time it scrolls into view; landing.js toggles .bounce */
#build-plan.bounce { animation: bob 2.4s ease-in-out 3; }
@media (prefers-reduced-motion: reduce) { #build-plan.bounce { animation: none; } }

/* Pricing button: zooms once each time the plan choice scrolls into view (plans.js toggles .zoom) */
#plan-cta.zoom { animation: cta-zoom 1.2s ease-in-out 1; }
@keyframes cta-zoom { 0%, 100% { scale: 1; } 50% { scale: 1.12; } }
@media (prefers-reduced-motion: reduce) { #plan-cta.zoom { animation: none; } }

/* Confirmation page: the hand (the face's pointing-hand outline) bounces gently, in the same 2.4s loop as the down arrows.
   Layers come from scripts/split-car-hand.py; the stroke fades out where it meets the body outline and the car. */
.confirm .car { position: relative; width: 100%; }
.confirm .car img { display: block; width: 100%; height: auto; max-width: none; }
.confirm .car .hand-layer { position: absolute; inset: 0; animation: hand-bounce 2.4s ease-in-out infinite; will-change: transform; pointer-events: none; }
.confirm .car .hand { position: absolute; left: 5.854%; top: 44.014%; width: 28.67%; height: auto; }
@keyframes hand-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(2.3%); } }
@media (prefers-reduced-motion: reduce) { .confirm .car .hand-layer { animation: none; } }

/* Zoom viewer: make sideways panning obvious and easy (touch scrolls natively; mouse/pen drag; arrow keys) */
.lb-stage { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.55) transparent; overscroll-behavior: contain; }
.lb-stage::-webkit-scrollbar { height: 8px; width: 8px; }
.lb-stage::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.55); border-radius: 4px; }
.lb-stage.wide { cursor: grab; }
.lb-stage.wide.dragging { cursor: grabbing; }
.lb-stage img { user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.lb-hint { position: absolute; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; padding: 8px 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #17082e; font-size: 0.9rem; font-weight: 600; white-space: nowrap; pointer-events: none; transition: opacity 0.4s; }
.lb-hint[hidden] { display: none; }
.lb-hint.gone { opacity: 0; }

/* Landing title "Solmira.app": 3x the size (phones: 3x, capped so the 11 characters always fit the screen width) */
.s1 .brand { font-size: min(4.05rem, 14.5vw); line-height: 1.05; margin: 0 0 12px; }
@media (min-width: 900px) and (hover: hover) and (pointer: fine) { .s1 .brand { font-size: 4.5rem; } }

/* Keep room for the down arrow at the bottom of screens 1 and 2 (placed last so no earlier .screen padding rule overrides it) */
.screen.s1 { padding-bottom: 0; }   /* the band is the hero's footer and holds the down arrow */
.screen.s2 { padding-bottom: 88px; }
@media (max-height: 740px) { .screen.s2 { padding-top: 20px; padding-bottom: 76px; } .s2 h2 { font-size: 1.5rem; } }

/* Landing headline typewriter (landing.js): letters stay in the layout, so nothing jumps while typing */
.s1 h1 .tw { opacity: 0; }
.s1 h1 .tw.tw-on { opacity: 1; }
.s1 h1 .tw.tw-caret { box-shadow: 2px 0 0 var(--btn); }
.s1 h1.tw-done .tw-caret { animation: tw-blink 1.06s steps(1) infinite; }
@keyframes tw-blink { 50% { box-shadow: 2px 0 0 transparent; } }

/* Hat circles: all five fly in from the bottom together each time the diagram scrolls into view (landing.js sets .armed on load and toggles .play) */
@media (prefers-reduced-motion: no-preference) {
  .cycle.armed .hat { opacity: 0; transform: translateY(90px); }
  .cycle.armed.play .hat { animation: hat-fly 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both; }
  /* Then the stressed face + "Input Goal" row flies in from the left (starts when the hats finish: 0.25s delay + 0.8s) */
  .story.armed .from-left { opacity: 0; transform: translateX(-80vw); }
  .story.armed .from-right { opacity: 0; transform: translateX(80vw); }
  .story.armed.play .from-left { animation: from-left 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.05s both; }
  .story.armed.play .from-right { animation: from-right 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.05s both; } /* same moment as the left row */
}
@keyframes from-left { 0% { opacity: 0; transform: translateX(-80vw); } 100% { opacity: 1; transform: translateX(0); } }
/* "Build my plan!" screen: phones fly in from the left (0.25s delay, 0.8s), then the weekly chart rises from the bottom right after (starts at 1.05s). Once only: landing.js never removes .play */
@media (prefers-reduced-motion: no-preference) {
  .s3.armed .fly-left { opacity: 0; transform: translateX(-80vw); }
  .s3.armed .fly-bottom { opacity: 0; transform: translateY(120px); }
  .s3.armed.play .fly-left { animation: fly-left 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both; }
  .s3.armed.play .fly-bottom { animation: fly-bottom 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.05s both; }
}
@keyframes fly-left { 0% { opacity: 0; transform: translateX(-80vw); } 100% { opacity: 1; transform: translateX(0); } }
@keyframes fly-bottom { 0% { opacity: 0; transform: translateY(120px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes from-right { 0% { opacity: 0; transform: translateX(80vw); } 100% { opacity: 1; transform: translateX(0); } }
@keyframes hat-fly { 0% { opacity: 0; transform: translateY(90px); } 100% { opacity: 1; transform: translateY(0); } }

/* The side rows and phones wait off screen (translateX 80vw) until they fly in; clip them so the page never scrolls sideways */
.s2, .s3 { overflow-x: clip; }

/* Pricing page: Input Goal, the brain and Goal finished take turns in one spot, one swap every 4 seconds, forever (plans.js).
   Phones: the old one leaves to the left. Desktop (wide, mouse): the old one leaves to the right. The new one always enters from the right. */
.swap { position: relative; width: 100%; aspect-ratio: 512 / 391; overflow: hidden; container-type: inline-size; }
.swap .it { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.swap .it img { width: 100%; height: auto; display: block; }
.swap .node { text-align: center; width: 74cqw; height: 74cqw; max-height: 100%; font-size: 12cqw; border-width: 4px; }
.swap .n-true { font-size: 11cqw; }
.swap:not(.on) .sw-goal, .swap:not(.on) .sw-done { display: none; } /* no script or reduced motion: just the brain */
.swap.on .it { opacity: 0; }
.swap.on .it.cur, .swap.on .it.in, .swap.on .it.out { opacity: 1; }
.swap.on .it.in { animation: sw-in 0.4s ease-out both; }
.swap.on .it.out { animation: sw-out-left 0.4s ease-in both; }
@keyframes sw-in { 0% { transform: translateX(105%); } 100% { transform: translateX(0); } }
@keyframes sw-out-left { 0% { transform: translateX(0); } 100% { transform: translateX(-105%); } }
@keyframes sw-out-right { 0% { transform: translateX(0); } 100% { transform: translateX(105%); } }
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .swap.on .it.out { animation-name: sw-out-right; }
}

/* Hidden QR page (/hi): brain, wordmark, three big link buttons. Made for phones. */
.hub { justify-content: center; gap: 0; }
.hub-brain { width: min(200px, 46vw); height: auto; margin: 0 0 12px; }
.hub-title { font-family: var(--font-head); font-weight: 800; font-size: clamp(2.2rem, 11vw, 3rem); line-height: 1.05; margin: 0 0 28px; color: var(--ink); }
.hub-links { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.hub-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60px; padding: 10px 18px; border-radius: 999px; border: 2px solid var(--btn); background: var(--white); color: var(--btn); text-decoration: none; }
.hub-btn:hover { background: var(--tint); }
.hub-btn:focus-visible { outline: 3px solid var(--tint); outline-offset: 2px; box-shadow: 0 0 0 2px var(--btn); }
.hub-l { font-weight: 500; font-size: 1.05rem; line-height: 1.2; }
.hub-s { font-size: 0.8rem; line-height: 1.2; margin-top: 2px; color: var(--ink-soft); }
.hub-primary { background: var(--btn); color: var(--btn-ink); }
.hub-primary:hover { background: var(--btn-hover); }
.hub-primary .hub-s { color: #E6DAF5; }
