:root {
  color-scheme: light;
  /* Palette of the Sage app (~/Desktop/mockup/Sage/Theme.swift) */
  --cream: #F1F3EB;        /* background */
  --cream-deep: #E4EBDC;   /* backgroundDeep */
  --paper: #FBFAF5;        /* card */
  --beige: #F2EADD;        /* beige */
  --ink: #1E3326;          /* ink */
  --ink-soft: #5B6D5F;     /* inkSoft */
  --ink-faint: #9AA79C;    /* inkFaint */
  --line: #D6DDD0;         /* solid version of line (ink @ 9%) */
  --hairline: rgba(30, 51, 38, 0.09);
  --clay: #3F6A4C;         /* sageDeep: main accent */
  --clay-deep: #2F5139;    /* darker sageDeep (result card gradient) */
  --clay-wash: rgba(143, 174, 137, 0.28); /* sage wash */
  --mint: #D5E5CC;
  --sage: #8FAE89;
  --peach: #DFA284;
  --peach-ink: #A9603F;
  --blush: #D5E5CC;
  --hair: #E6DCCB;
  --radius: 18px;
  --display: "Fraunces", Georgia, serif;
  --body: "Hanken Grotesk", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(110% 55% at -15% -10%, rgba(213,229,204,.95) 0%, transparent 60%),
    radial-gradient(100% 55% at 115% 105%, var(--beige) 0%, transparent 62%),
    var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .4 0 0 0 0 .3 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  padding: max(10px, env(safe-area-inset-top)) 12px 8px;
  background: linear-gradient(var(--cream) 70%, rgba(241,243,235,0));
}
.brand {
  grid-column: 2; text-align: center;
  font-family: var(--display); font-style: italic; font-weight: 400; font-size: 17px; letter-spacing: .01em;
}
.back {
  grid-column: 1; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center;
}
.back:hover { background: rgba(30,51,38,.06); }
.back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.progress {
  grid-column: 1 / -1; height: 3px; margin: 10px 4px 0; border-radius: 3px; background: rgba(30,51,38,.08); overflow: hidden;
}
.progress span { display: block; height: 100%; width: 0; background: var(--clay); border-radius: 3px; transition: width .45s cubic-bezier(.2,.8,.2,1); }

/* ---------- layout ---------- */
main {
  position: relative; z-index: 1; flex: 1;
  width: 100%; max-width: 520px; margin: 0 auto; padding: 8px 20px 28px;
}
.screen { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.screen > * { animation: rise .55s cubic-bezier(.2,.8,.2,1) both; }
.screen > *:nth-child(2) { animation-delay: .05s; }
.screen > *:nth-child(3) { animation-delay: .1s; }
.screen > *:nth-child(4) { animation-delay: .15s; }
.screen > *:nth-child(5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.foot { position: relative; z-index: 1; text-align: center; padding: 8px 20px max(18px, env(safe-area-inset-bottom)); }
.foot p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.foot a { color: inherit; }

/* ---------- type ---------- */
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--clay-deep); margin: 6px 0 10px;
}
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -.015em; margin: 0; }
h1 { font-size: clamp(36px, 10vw, 50px); line-height: 1.02; font-variation-settings: "opsz" 144; }
h1 em, h2 em { font-style: italic; color: var(--clay); }
h2 { font-size: clamp(27px, 7.4vw, 34px); line-height: 1.1; font-variation-settings: "opsz" 96; }
.sub { color: var(--ink-soft); margin: 10px 0 20px; font-size: 17px; }
h3 { font-family: var(--display); font-weight: 500; font-size: 21px; margin: 0 0 8px; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 58px; padding: 0 24px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font: 600 17px/1 var(--body); letter-spacing: .01em;
  box-shadow: 0 10px 24px -12px rgba(30,51,38,.55);
  transition: transform .15s ease, background .2s ease, opacity .2s ease;
}
.btn:hover { background: #2B4535; }
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .35; cursor: default; box-shadow: none; }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn.clay { background: var(--clay); box-shadow: 0 12px 26px -12px rgba(47,81,57,.7); }
.btn.clay:hover { background: var(--clay-deep); }
.link {
  appearance: none; border: 0; background: none; cursor: pointer; color: var(--ink-soft);
  font: 500 15px var(--body); text-decoration: underline; text-underline-offset: 3px; padding: 12px; display: block; margin: 4px auto 0;
}
.sticky-cta {
  position: sticky; bottom: 0; padding: 14px 0 6px; margin-top: 18px;
  background: linear-gradient(rgba(241,243,235,0), var(--cream) 30%);
}

/* ---------- intro ---------- */
.intro { display: flex; flex-direction: column; gap: 0; padding-top: 4px; }
.ticks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 4px 0 22px; padding: 0; list-style: none; font-size: 15px; color: var(--ink); }
.ticks li { display: flex; align-items: center; gap: 6px; }
.ticks li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sage); }

/* ---------- options ---------- */
.options { display: grid; gap: 10px; }
.opt {
  appearance: none; cursor: pointer; text-align: left; width: 100%;
  display: flex; align-items: center; gap: 14px;
  min-height: 60px; padding: 14px 18px; border-radius: var(--radius);
  background: var(--paper); border: 1.5px solid transparent; color: var(--ink);
  font: 500 17px/1.3 var(--body);
  box-shadow: 0 0 0 1px var(--hairline), 0 6px 18px -14px rgba(30,51,38,.4);
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.opt:hover { border-color: var(--line); }
.opt:active { transform: scale(.99); }
.opt .mark {
  flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line);
  display: grid; place-items: center; transition: all .15s ease;
}
.opt.multi .mark { border-radius: 7px; }
.opt .mark svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.opt[aria-pressed="true"] { border-color: var(--clay); background: #EEF4E8; }
.opt[aria-pressed="true"] .mark { background: var(--clay); border-color: var(--clay); }
.opt[aria-pressed="true"] .mark svg { opacity: 1; }
.opt small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 14px; margin-top: 2px; }

/* ---------- photo face map ---------- */
.pmap-wrap { display: flex; justify-content: center; margin: 2px 0 6px; }
.pmap {
  position: relative; overflow: hidden; aspect-ratio: 4 / 5; width: min(100%, 380px, 37dvh);
  border-radius: 24px; background: var(--cream-deep);
  box-shadow: 0 0 0 1px var(--hairline), 0 18px 40px -26px rgba(30,51,38,.55);
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.intro .pmap { width: min(100%, 400px, 46dvh); }
.pmap-wrap.small .pmap { width: min(100%, 300px); }
.pmap-wrap.tiny .pmap { width: min(60vw, 210px); border-radius: 18px; }
.pm-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.pm-stage.animate { transition: transform .8s cubic-bezier(.45, 0, .2, 1); }
.pm-stage img { display: block; width: 100%; height: 100%; pointer-events: none; }
.pm-zones { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pz-hit ellipse { fill: transparent; pointer-events: none; }
.pmap-pick .pz-hit ellipse { pointer-events: all; cursor: pointer; }
.pz-shape { filter: drop-shadow(0 0 1.5px rgba(255,255,255,.95)); }
.pz-shape ellipse {
  fill: rgba(143,174,137,0); stroke: var(--clay-deep); stroke-width: 1.6; stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke; opacity: .5; transition: fill .25s ease, opacity .25s ease, stroke-width .25s ease;
}
.pz.on .pz-shape ellipse { fill: rgba(143,174,137,.34); opacity: 1; stroke-width: 2.2; }
.pz.current .pz-shape ellipse { opacity: 1; stroke-width: 2.4; animation: march 1.1s linear infinite; }
@keyframes march { to { stroke-dashoffset: -18; } }
.pmap-focus .pz:not(.on), .pmap-static .pz:not(.on) { display: none; }
.pmap-focus .pz.on:not(.current) .pz-shape ellipse { fill: none; opacity: .3; stroke-width: 1.4; }
.pmap-static .pz.on .pz-shape ellipse { fill: rgba(143,174,137,.22); }

.pm-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .25s ease; }
.pm-line line { stroke: var(--clay-deep); stroke-width: 1.2; opacity: .75; }
.pm-line circle { fill: #fff; stroke: var(--clay-deep); stroke-width: 1.4; }
.pm-line.on line { stroke: var(--clay); stroke-width: 1.8; opacity: 1; }
.pm-line.on circle { fill: var(--clay); stroke: #fff; }

.pl {
  position: absolute; top: 0; transform: translateY(-50%); z-index: 2;
  appearance: none; border: 1px solid var(--hairline); cursor: pointer; white-space: nowrap;
  padding: 6px 11px; border-radius: 999px; font: 600 13.5px/1.1 var(--body); color: var(--ink);
  background: rgba(251,250,245,.94); box-shadow: 0 4px 12px -6px rgba(30,51,38,.45);
  transition: background .2s ease, color .2s ease, opacity .25s ease;
}
.pl-l { left: 8px; }
.pl-r { right: 8px; }
.pl.on { background: var(--clay); color: #fff; border-color: var(--clay); }
.pmap:not(.pmap-pick) .pl { pointer-events: none; }
.pmap.zoomed .pl, .pmap.zoomed .pm-lines { opacity: 0; pointer-events: none; }
.pmap-focus .pl, .pmap-focus .pm-lines { display: none; }

/* intro: the callouts come in one by one, then everything stays still */
.pmap-intro .pl { opacity: 0; transition: opacity .5s ease calc(var(--i) * .18s); }
.pmap-intro .pm-line line { stroke-dasharray: 400; stroke-dashoffset: 400; transition: stroke-dashoffset .7s ease calc(var(--i) * .18s); }
.pmap-intro .pm-line circle, .pmap-intro .pz { opacity: 0; transition: opacity .4s ease calc(var(--i, 0) * .18s + .3s); }
.pmap-intro.revealed .pl, .pmap-intro.revealed .pm-line circle, .pmap-intro.revealed .pz { opacity: 1; }
.pmap-intro.revealed .pm-line line { stroke-dashoffset: 0; }

.pm-caption {
  position: absolute; left: 50%; bottom: 14px; z-index: 3; transform: translate(-50%, 8px); opacity: 0;
  background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px; white-space: nowrap;
  font: 600 15px/1 var(--body); pointer-events: none; transition: opacity .3s ease .15s, transform .3s ease .15s;
}
.pmap.zoomed .pm-caption { opacity: 1; transform: translate(-50%, 0); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.chip {
  appearance: none; cursor: pointer; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: 999px; padding: 11px 15px; font: 500 16px var(--body); min-height: 44px; transition: all .15s ease;
}
.chip[aria-pressed="true"] { background: var(--clay); border-color: var(--clay); color: #fff; }
.hint { text-align: center; color: var(--ink-soft); font-size: 15px; margin: 8px 0 0; min-height: 22px; }

/* ---------- text ---------- */
textarea, input[type="email"] {
  width: 100%; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: var(--radius); padding: 16px 18px; font: 400 17px/1.4 var(--body); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 130px; resize: vertical; }
textarea:focus, input[type="email"]:focus { border-color: var(--clay); box-shadow: 0 0 0 4px var(--clay-wash); }
.counter { text-align: right; font-size: 13px; color: var(--ink-soft); margin-top: 6px; }

/* ---------- building ---------- */
.building { text-align: center; padding-top: 40px; }
.ring { width: 150px; height: 150px; margin: 0 auto 26px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .track { stroke: var(--mint); }
.ring .bar { stroke: var(--clay); stroke-linecap: round; stroke-dasharray: 440; stroke-dashoffset: 440; transition: stroke-dashoffset .2s linear; }
.ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 38px; }
.steps-list { list-style: none; padding: 0; margin: 22px auto 0; max-width: 320px; text-align: left; }
.steps-list li { display: flex; gap: 10px; align-items: center; padding: 7px 0; color: var(--ink-soft); opacity: .35; transition: opacity .3s ease, color .3s ease; }
.steps-list li.done { opacity: 1; color: var(--ink); }
.steps-list li::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); }
.steps-list li.done::before { background: var(--sage) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--sage); }

/* ---------- gate + result ---------- */
.card {
  background: var(--paper); border-radius: 22px; padding: 22px 20px;
  box-shadow: 0 0 0 1px var(--hairline), 0 14px 34px -22px rgba(30,51,38,.45);
  margin: 0 0 14px;
}
.type-card { position: relative; overflow: hidden; color: var(--paper); background: linear-gradient(135deg, #4F7D5C, var(--clay) 50%, var(--clay-deep)); }
.type-card::after {
  content: ""; position: absolute; right: -110px; top: -110px; width: 200px; height: 200px; border-radius: 50%;
  border: 1.5px dashed rgba(213,229,204,.45);
}
.type-card .eyebrow { color: var(--mint); }
.type-card h2 { color: var(--paper); }
.type-card h2 em { color: var(--mint); }
.type-card p { color: rgba(251,247,241,.78); margin: 10px 0 0; font-size: 16px; }
.zone-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.zone-pills span { border: 1px dashed rgba(213,229,204,.75); color: var(--mint); border-radius: 999px; padding: 4px 11px; font-size: 13px; }
.zone-pills.light span { border-color: var(--clay); color: var(--clay-deep); }

.locked { position: relative; }
.locked .rows { filter: blur(5px); user-select: none; pointer-events: none; }
.locked .row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.locked .row b { font-family: var(--display); font-weight: 500; color: var(--clay); min-width: 46px; }
.locked .lock {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  font-weight: 600; font-size: 15px;
}
.locked .lock span { background: var(--paper); padding: 8px 14px; border-radius: 999px; box-shadow: 0 6px 16px -8px rgba(30,51,38,.4); }

.form { display: grid; gap: 10px; margin-top: 6px; }
.form .err { color: #B3261E; font-size: 14px; min-height: 20px; margin: 0; }
.fine { font-size: 14px; color: var(--ink-soft); text-align: center; margin: 4px 0 0; }
.fine a { color: inherit; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.result h2 { margin-bottom: 4px; }
.ex-steps { margin: 12px 0 0; padding-left: 22px; }
.ex-steps li { margin: 0 0 8px; padding-left: 4px; }
.ex-steps li::marker { font-family: var(--display); color: var(--clay); font-weight: 600; }
.ex-meta { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--clay); opacity: .8; }
.days { list-style: none; padding: 0; margin: 6px 0 0; }
.days li { display: grid; grid-template-columns: 54px 1fr auto; align-items: baseline; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--hairline); }
.days li:last-child { border-bottom: 0; }
.days b { font-family: var(--display); font-weight: 500; color: var(--clay); }
.days small { color: var(--ink-soft); font-size: 14px; }
.sent { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-soft); margin: 0 0 14px; }
.sent::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }
.program { text-align: center; background: linear-gradient(160deg, var(--mint), var(--paper) 70%); border: 1.5px dashed var(--clay); }
.program p { color: var(--ink-soft); margin: 6px 0 16px; }

@media (min-width: 700px) {
  main { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
