/* Remembrance — by My Front Page. Classic theme (ivory / warm charcoal / muted gold). */
:root {
  --bg: #F7F3EE;
  --bg-2: #EFE8DF;
  --card: #FFFDFA;
  --ink: #3A3532;
  --ink-soft: #6E655F;
  --line: #E2D8CC;
  --accent: #B08D57;
  --accent-deep: #8C6C3D;
  --accent-soft: #EADFCB;
  --ok: #5E8B6A;
  --warn: #B9874A;
  --sea: #CFDCE3;
  --land: #E9E1D3;
  --header-h: 64px;
  --footer-h: 58px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; } /* no double-tap zoom */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-width: 320px;
}
a { color: var(--accent-deep); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: .005em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Locked header & footer ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  background: rgba(247, 243, 238, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--serif); font-size: 26px; line-height: 1; }
.brand-by { display: block; font-family: var(--sans); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-top: 3px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions .btn-primary { gap: .3em; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  text-decoration: none; color: var(--ink); cursor: pointer;
  font-size: 16px; font-weight: 600; transition: background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #FBF8F3; }
.btn-primary:hover { background: #2A2624; }
.btn-gold { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-gold:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { border-color: var(--line); }
.btn-lg { height: 54px; padding: 0 30px; font-size: 18px; }
.view-toggle { display: none; height: 36px; padding: 0 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.has-toggle .view-toggle { display: inline-flex; }

.site-footer {
  position: fixed; inset: auto 0 0 0; height: var(--footer-h); z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 20px 0 28px; font-size: 14px; color: var(--ink-soft);
  background: rgba(239, 232, 223, .96);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.foot-nav { display: flex; align-items: center; gap: 6px; }
.foot-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
  border-radius: 999px; border: 1px solid transparent; background: transparent;
  color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.foot-btn svg { width: 19px; height: 19px; flex: none; color: var(--accent-deep); }
@media (hover: hover) { .foot-btn:hover { background: var(--card); border-color: var(--line); } }
.foot-primary { background: var(--ink); color: #FBF8F3; }
.foot-primary svg { color: #E8D3AE; }
@media (hover: hover) { .foot-primary:hover { background: #2A2624; border-color: #2A2624; } }
.foot-btn:active { transform: scale(.96); }
.foot-view { display: none; border-color: var(--line); background: var(--card); }
.has-toggle .foot-view { display: inline-flex; }
.foot-view[aria-pressed="true"] svg { color: var(--ink); }

main.page { padding-top: var(--header-h); padding-bottom: var(--footer-h); }

/* ---------- Landing hero ---------- */
.hero {
  min-height: min(calc(100vh - var(--header-h) - var(--footer-h)), 900px);
  display: grid; grid-template-columns: 1fr 1.15fr; align-items: center; gap: 40px;
  padding: 40px 6vw 48px; max-width: 1440px; margin: 0 auto;
}
.eyebrow { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-deep); font-weight: 700; }
.hero h1 { font-size: clamp(54px, 6vw, 88px); margin: 14px 0 6px; }
.beats { position: relative; height: 1.6em; margin-bottom: 4px; font-family: var(--serif); font-size: clamp(26px, 2.4vw, 34px); color: var(--ink-soft); }
.beat { position: absolute; inset: 0; opacity: 0; transform: translateY(10px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.beat.on { opacity: 1; transform: none; }
.hero-lede { max-width: 520px; color: var(--ink-soft); margin: 10px 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.price-chip { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); font-weight: 700; font-size: 14px; }

/* The animated "life journal" stage */
.stage {
  position: relative; aspect-ratio: 16 / 11; width: 100%;
  border-radius: 22px; overflow: hidden;
  background: linear-gradient(160deg, #FBF8F3 0%, #F1E9DD 100%);
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(58, 53, 50, .35);
}
.stage svg.journey { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage .path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; transition: stroke-dashoffset 3.2s var(--ease); }
.stage .path-trip { stroke: #7FA3B8; stroke-dasharray: 6 9; stroke-dashoffset: 0; opacity: 0; transition: opacity 1s var(--ease) .6s; }
.stage[data-beat="2"] .path, .stage[data-beat="3"] .path, .stage[data-beat="4"] .path { stroke-dashoffset: 0; }
.stage[data-beat="2"] .path-trip, .stage[data-beat="3"] .path-trip, .stage[data-beat="4"] .path-trip { opacity: .9; }
.stage .land { fill: var(--land); }
.stage .sea-wave { fill: none; stroke: #D9E3E8; stroke-width: 2; }

.pin { position: absolute; transform: translate(-50%, -100%) scale(.6); opacity: 0; transition: opacity .6s var(--ease), transform .8s var(--ease); text-align: center; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); margin: 0 auto; }
.pin-label { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; padding: 3px 9px 3px 4px; background: #fff; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; box-shadow: 0 4px 12px -4px rgba(0,0,0,.18); }
.flag { width: 20px; height: 14px; border-radius: 2px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.stage[data-beat="2"] .pin, .stage[data-beat="3"] .pin, .stage[data-beat="4"] .pin { opacity: 1; transform: translate(-50%, -100%) scale(1); }
.pin:nth-of-type(2) { transition-delay: .5s; } .pin:nth-of-type(3) { transition-delay: 1.1s; } .pin:nth-of-type(4) { transition-delay: 1.7s; } .pin:nth-of-type(5) { transition-delay: 2.3s; }

.photo {
  position: absolute; width: 22%; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden;
  background: #fff; padding: 6px 6px 22px; box-shadow: 0 14px 28px -12px rgba(58,53,50,.45);
  opacity: 0; transform: translateY(18px) rotate(var(--r, -3deg)) scale(.92);
  transition: opacity 1s var(--ease), transform 1.2s var(--ease);
}
.photo .img { width: 100%; height: 100%; border-radius: 4px; overflow: hidden; }
.photo .img svg { width: 100%; height: 100%; display: block; animation: drift 12s ease-in-out infinite alternate; transform-origin: 60% 40%; }
.photo .cap { position: absolute; left: 0; right: 0; bottom: 3px; text-align: center; font-family: var(--serif); font-size: 13px; color: var(--ink-soft); }
.stage[data-beat="1"] .photo, .stage[data-beat="2"] .photo { opacity: 1; transform: rotate(var(--r, -3deg)); }
.stage[data-beat="2"] .photo { opacity: .35; }
.photo:nth-of-type(2) { transition-delay: .35s; } .photo:nth-of-type(3) { transition-delay: .7s; }
@keyframes drift { from { transform: scale(1.05) translate(0, 0); } to { transform: scale(1.16) translate(-3%, -2%); } }

.badge {
  position: absolute; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 10px; border-radius: 14px; background: #fff;
  box-shadow: 0 16px 30px -16px rgba(58,53,50,.45); font-weight: 600; font-size: 14.5px;
  opacity: 0; transform: translateY(16px); transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.badge small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 12.5px; line-height: 1.3; }
.badge .medal { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); flex: none; }
.stage[data-beat="3"] .badge { opacity: 1; transform: none; }
.badge:nth-of-type(2) { transition-delay: .45s; } .badge:nth-of-type(3) { transition-delay: .9s; }

.share {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  opacity: 0; transition: opacity 1s var(--ease); pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(251,248,243,.96) 0%, rgba(251,248,243,.88) 60%, rgba(251,248,243,.6) 100%);
}
.stage[data-beat="4"] .share { opacity: 1; }
.share-card { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 26px; border-radius: 16px; background: #fff; box-shadow: 0 20px 40px -20px rgba(58,53,50,.5); transform: scale(.9); transition: transform 1s var(--ease) .2s; }
.stage[data-beat="4"] .share-card { transform: none; }
.share-card .url { font-weight: 700; color: var(--ink); font-size: 15px; }
.share-card .t { font-family: var(--serif); font-size: 22px; }
.family { display: flex; gap: 22px; justify-content: center; margin-top: 26px; }
.person { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; position: relative; opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.person::after { content: "♥"; position: absolute; right: -4px; top: -6px; font-size: 16px; color: #C46B6B; opacity: 0; transition: opacity .6s var(--ease) 1.4s; }
.stage[data-beat="4"] .person { opacity: 1; transform: none; }
.stage[data-beat="4"] .person::after { opacity: 1; }
.person:nth-child(2) { transition-delay: .5s; } .person:nth-child(3) { transition-delay: .8s; } .person:nth-child(4) { transition-delay: 1.1s; }

.stage-dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; }
.stage-dots button { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: rgba(58,53,50,.22); cursor: pointer; transition: background .3s, width .3s; }
.stage-dots button.on { background: var(--accent); width: 24px; border-radius: 6px; }

/* ---------- Landing sections ---------- */
.section { max-width: 1200px; margin: 0 auto; padding: 72px 6vw; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.section-head h2 { font-size: clamp(36px, 3.4vw, 50px); margin: 10px 0 8px; }
.section-head p { color: var(--ink-soft); margin: 0; }
.purpose-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.purpose-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left;
  padding: 24px 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); cursor: pointer;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .5s var(--ease);
}
.purpose-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 22px 40px -26px rgba(58,53,50,.5); }
.purpose-card h3 { font-size: 24px; }
.purpose-card p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.55; }
.purpose-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); }
.purpose-icon svg { width: 30px; height: 30px; display: block; margin: 0; flex: none; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; counter-reset: s; }
.step3 { padding: 30px 26px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.step3::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; margin-bottom: 14px; }
.step3 h3 { font-size: 26px; margin-bottom: 6px; }
.step3 p { margin: 0; color: var(--ink-soft); }
.reassure { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.reassure div { padding: 22px; border-top: 2px solid var(--accent); }
.reassure strong { display: block; font-family: var(--serif); font-size: 22px; font-weight: 500; margin-bottom: 4px; }
.reassure span { color: var(--ink-soft); font-size: 15px; }
.cta-band { text-align: center; padding: 70px 6vw 90px; background: var(--bg-2); }
.cta-band h2 { font-size: clamp(36px, 3.6vw, 54px); margin-bottom: 18px; }
.director { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding: 40px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); }
.director h2 { font-size: 38px; margin-bottom: 8px; }
.director p { color: var(--ink-soft); margin: 0 0 18px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Story builder (full screen) ---------- */
body.builder { overflow: hidden; }
.builder-main {
  position: fixed; top: var(--header-h); bottom: var(--footer-h); left: 0; right: 0;
  display: grid; grid-template-rows: auto 1fr;
}
.progress { padding: 14px 40px 10px; border-bottom: 1px solid var(--line); background: var(--bg); }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
.progress-top strong { color: var(--ink); font-weight: 700; }
.track { position: relative; height: 22px; }
.track-line { position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--line); border-radius: 2px; }
.track-fill { position: absolute; left: 0; top: 10px; height: 2px; width: 0; background: var(--accent); border-radius: 2px; transition: width 1s var(--ease); }
.track-pin { position: absolute; top: 5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); transition: background .6s var(--ease), border-color .6s var(--ease), box-shadow .6s var(--ease); }
.track-pin.done { background: var(--accent); border-color: var(--accent); }
.track-pin.now { border-color: var(--accent); box-shadow: 0 0 0 5px rgba(176,141,87,.2); }
.track-traveller { position: absolute; top: 3px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); transition: left 1s var(--ease); }
.progress.halfway .track-fill { box-shadow: 0 0 12px rgba(176,141,87,.8); }

.builder-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; }
.q-pane { position: relative; overflow: hidden auto; padding: 32px 56px 32px; }
.preview-pane { position: relative; padding: 36px 44px; background: var(--bg-2); border-left: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; }

.q { max-width: 640px; animation: qIn .6s var(--ease) both; }
.q.out { animation: qOut .45s var(--ease) both; }
@keyframes qIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes qOut { to { opacity: 0; transform: translateX(-28px); } }
.q h1 { font-size: clamp(36px, 3vw, 46px); margin-bottom: 8px; }
.q .hint { color: var(--ink-soft); margin: 0 0 22px; }
.q-actions { display: flex; align-items: center; gap: 14px; margin-top: 24px; }
.skip { background: none; border: 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; font-size: 15px; }
.back { background: none; border: 0; color: var(--ink-soft); cursor: pointer; font-size: 15px; display: inline-flex; gap: 6px; align-items: center; padding: 0; margin-bottom: 18px; }
.back:hover { color: var(--ink); }

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.choice {
  display: flex; gap: 14px; align-items: center; text-align: left; padding: 14px 16px; min-height: 84px;
  border-radius: 18px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer;
  transition: border-color .4s var(--ease), transform .4s var(--ease), box-shadow .4s var(--ease), background .4s var(--ease);
  animation: cardIn .7s var(--ease) both;
}
.choice:nth-child(2) { animation-delay: .07s; } .choice:nth-child(3) { animation-delay: .14s; } .choice:nth-child(4) { animation-delay: .21s; } .choice:nth-child(5) { animation-delay: .28s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.choice:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 16px 30px -22px rgba(58,53,50,.55); }
.choice[aria-pressed="true"] { border-color: var(--accent); background: #FFF9EE; box-shadow: 0 0 0 3px rgba(176,141,87,.22); }
.choice .purpose-icon { flex: none; }
.choice strong { display: block; font-family: var(--serif); font-size: 21px; font-weight: 500; line-height: 1.2; }
.choice .ctext > span { display: block; color: var(--ink-soft); font-size: 14.5px; line-height: 1.45; margin-top: 3px; }
.choice.wide { grid-column: span 2; }

.field { display: block; margin-bottom: 18px; }
.field label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.input {
  width: 100%; height: 62px; padding: 0 20px; border-radius: 14px; border: 1.5px solid var(--line);
  background: #fff; font: inherit; font-size: 22px; color: var(--ink); transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(176,141,87,.18); }
.input-sm { height: 54px; font-size: 19px; }
.row2 { display: grid; grid-template-columns: 180px 1fr; gap: 14px; }

.address { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px dashed var(--line); font-size: 16px; }
.address .host { font-weight: 700; word-break: break-all; }
.address .host input { font: inherit; font-weight: 700; border: 0; border-bottom: 1.5px solid var(--accent); background: transparent; color: var(--ink); width: 13ch; min-width: 6ch; padding: 0 2px; }
.address .host input:focus { outline: none; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.status.ok { background: #E6F0E8; color: var(--ok); }
.status.warn { background: #F6EBDC; color: var(--warn); }
.status.wait { background: #EEE9E2; color: var(--ink-soft); }
.suggest { margin-top: 12px; }
.suggest p { margin: 0 0 8px; color: var(--ink-soft); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-size: 15px; font-weight: 600; transition: border-color .3s, background .3s; }
.chip:hover, .chip[aria-pressed="true"] { border-color: var(--accent); background: #FFF9EE; }

.cheer { min-height: 30px; margin-top: 18px; font-family: var(--serif); font-size: 22px; color: var(--accent-deep); opacity: 0; transform: translateY(6px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.cheer.on { opacity: 1; transform: none; }

/* Live preview of their page */
.mini { width: 100%; max-width: 560px; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 30px 60px -30px rgba(58,53,50,.5); border: 1px solid var(--line); }
.mini-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #F3EEE7; border-bottom: 1px solid var(--line); }
.mini-bar i { width: 10px; height: 10px; border-radius: 50%; background: #DDD3C6; display: inline-block; }
.mini-url { flex: 1; margin-left: 6px; padding: 5px 12px; border-radius: 999px; background: #fff; font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-url b { color: var(--ink); }
.mini-hero { position: relative; height: 270px; display: grid; place-items: center; text-align: center; color: #fff; overflow: hidden; background: linear-gradient(150deg, #6E5F52, #3A3532); transition: background 1.2s var(--ease); }
.mini-hero[data-purpose="celebrate"] { background: linear-gradient(150deg, #B9874A, #6E4F2A); }
.mini-hero[data-purpose="own"] { background: linear-gradient(150deg, #5F7A86, #2F4048); }
.mini-hero[data-purpose="history"] { background: linear-gradient(150deg, #7C7A5C, #3E3D2C); }
.mini-hero[data-purpose="other"] { background: linear-gradient(150deg, #7E6A80, #3E3240); }
.mini-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 35%, transparent 30%, rgba(0,0,0,.35) 100%); }
.mini-portrait { position: absolute; inset: 0; opacity: .09; animation: drift 14s ease-in-out infinite alternate; }
.mini-portrait svg { width: 100%; height: 100%; }
.mini-text { position: relative; z-index: 1; padding: 0 20px; }
.mini-title { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; opacity: .85; min-height: 18px; }
.mini-name { font-family: var(--serif); font-size: 42px; line-height: 1.05; margin: 8px 0 6px; min-height: 46px; }
.mini-name.placeholder { opacity: .45; font-style: italic; }
.mini-years { font-size: 15px; opacity: .9; min-height: 22px; letter-spacing: .06em; }
.mini-body { padding: 18px 20px 22px; }
.mini-sec { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; margin-bottom: 8px; }
.mini-map { position: relative; height: 120px; border-radius: 10px; overflow: hidden; background: var(--sea); }
.mini-map > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mini-pin { position: absolute; left: 30%; top: 66%; transform: translate(-50%, -100%) scale(0); transition: transform .8s cubic-bezier(.34,1.56,.64,1); }
.mini-pin.on { transform: translate(-50%, -100%) scale(1); }
.mini-pin .pin-label { font-size: 11.5px; }
.mini-skeleton { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.mini-skeleton div { height: 54px; border-radius: 8px; background: linear-gradient(90deg, #F3EEE7 0%, #FAF7F2 50%, #F3EEE7 100%); background-size: 200% 100%; animation: shimmer 2.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.preview-note { position: absolute; top: 16px; left: 0; right: 0; text-align: center; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.typeset span { opacity: 0; display: inline-block; animation: letter .5s var(--ease) forwards; }
@keyframes letter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.done-card { text-align: left; }
.done-list { list-style: none; padding: 0; margin: 16px 0 0; }
.done-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; color: var(--ink-soft); }
.done-list li b { color: var(--ink); }

/* ---------- Mobile view (only when the visitor switches to it) ---------- */
@media (max-width: 860px) {
  :root { --header-h: 58px; --footer-h: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .site-header { padding: 0 16px; }
  .header-actions .view-toggle { display: none !important; }
  .site-footer { padding: 0 6px env(safe-area-inset-bottom, 0px); justify-content: center; }
  .site-footer .copy { display: none; }
  .foot-nav { width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; }
  .foot-btn { flex-direction: column; justify-content: center; gap: 3px; height: 56px; padding: 0 2px; border-radius: 14px; font-size: 11.5px; line-height: 1.1; text-align: center; }
  .foot-btn svg { width: 23px; height: 23px; }
  .foot-view { border-color: transparent; background: transparent; }
  .foot-primary { background: var(--ink); }
  .brand-by { display: none; }
  .brand-name { font-size: 22px; }
  .header-actions .btn-ghost { display: none; }
  .hero { grid-template-columns: 1fr; padding: 28px 16px 40px; gap: 26px; }
  .hero h1 { font-size: 44px; }
  .beats { font-size: 24px; }
  .header-actions .btn-primary { height: 38px; padding: 0 14px; font-size: 14px; white-space: nowrap; }
  .header-actions .long { display: none; }
  .stage { aspect-ratio: 4 / 3.4; }
  .pin-label { font-size: 10px; padding: 2px 7px 2px 3px; gap: 4px; }
  .pin-label .flag { width: 15px; height: 10px; }
  .photo { width: 30%; padding: 4px 4px 16px; }
  .photo .cap { font-size: 10px; }
  .badge { font-size: 12px; padding: 7px 10px 7px 7px; gap: 7px; }
  .badge .medal { width: 26px; height: 26px; }
  .badge small { font-size: 10.5px; }
  .share-card .t { font-size: 18px; }
  .share-card .url { font-size: 12.5px; }
  .person { width: 40px; height: 40px; }
  .family-note { font-size: 16px; }
  .section { padding: 54px 16px; }
  .purpose-grid { grid-template-columns: 1fr; }
  .steps3, .reassure { grid-template-columns: 1fr; }
  .director { grid-template-columns: 1fr; padding: 24px; }
  .builder-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .q-pane { padding: 26px 16px 24px; }
  .preview-pane { padding: 12px 16px; border-left: 0; border-top: 1px solid var(--line); }
  .preview-note { display: none; }
  .mini-hero { height: 120px; }
  .mini-name { font-size: 28px; min-height: 30px; margin: 4px 0; }
  .mini-body { display: none; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice.wide { grid-column: auto; }
  .progress { padding: 10px 16px 8px; }
  #timeLeft { display: none; }
  .header-actions #saved { display: none; }
  .row2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; transition-delay: 0s !important; }
}

/* Beat 3: fade the map pins so the achievements are the focus */
.stage[data-beat="3"] .pin { opacity: .28; transition-delay: 0s; }
.family-note { margin: 14px 0 0; font-family: var(--serif); font-size: 20px; color: var(--ink-soft); opacity: 0; transition: opacity .8s var(--ease) 1.6s; }
.stage[data-beat="4"] .family-note { opacity: 1; }

/* ---------- A person's page (stage 1 placeholder) ---------- */
.person-hero {
  position: relative; min-height: calc(100vh - var(--header-h) - var(--footer-h));
  display: grid; place-items: center; text-align: center; overflow: hidden; color: #fff;
  background: linear-gradient(150deg, #6E5F52, #3A3532);
}
.person-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 30%, rgba(0,0,0,.4) 100%); }
.person-portrait { position: absolute; inset: 0; opacity: .08; animation: drift 16s ease-in-out infinite alternate; }
.person-portrait svg { width: 100%; height: 100%; }
.person-text { position: relative; z-index: 1; padding: 40px 6vw; max-width: 900px; opacity: 0; transform: translateY(14px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.person-hero[data-state="ready"] .person-text { opacity: 1; transform: none; }
.person-title { font-size: 14px; letter-spacing: .24em; text-transform: uppercase; opacity: .85; }
.person-name { font-size: clamp(48px, 7vw, 96px); margin: 14px 0 8px; }
.person-years { font-size: 18px; letter-spacing: .1em; opacity: .9; }
.person-note { max-width: 560px; margin: 26px auto 26px; opacity: .85; }

/* ---------- Mobile view: compact chrome so the content gets the room ---------- */
@media (max-width: 860px) {
  :root { --header-h: 50px; --footer-h: calc(54px + env(safe-area-inset-bottom, 0px)); }
  .site-header { padding: 0 12px; }
  .brand { gap: 9px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-name { font-size: 20px; }
  .header-actions .btn-primary, .header-actions .btn { height: 34px; padding: 0 14px; font-size: 14px; }
  .foot-btn { height: 48px; gap: 2px; font-size: 11px; border-radius: 12px; }
  .foot-btn svg { width: 21px; height: 21px; }

  /* Story builder */
  .progress { padding: 6px 14px 4px; }
  .progress-top { font-size: 12.5px; margin-bottom: 2px; }
  .track { height: 16px; }
  .track-line, .track-fill { top: 7px; }
  .track-pin { top: 3px; width: 10px; height: 10px; margin-left: -5px; }
  .track-traveller { top: 1px; width: 14px; height: 14px; margin-left: -7px; border-width: 2px; }
  .q-pane { padding: 16px 14px 18px; }
  .q h1 { font-size: 29px; margin-bottom: 4px; }
  .q .hint { font-size: 15px; line-height: 1.5; margin: 0 0 14px; }
  .back { margin-bottom: 8px; }
  .choice-grid { gap: 9px; }
  .choice { min-height: 0; padding: 10px 12px; gap: 12px; border-radius: 14px; }
  .choice .purpose-icon { width: 40px; height: 40px; border-radius: 12px; }
  .choice .purpose-icon svg { width: 22px; height: 22px; }
  .choice strong { font-size: 19px; }
  .choice .ctext > span { font-size: 13.5px; line-height: 1.35; margin-top: 1px; }
  .q-actions { margin-top: 16px; }
  .btn-lg { height: 48px; padding: 0 24px; font-size: 17px; }
  .input { height: 52px; font-size: 19px; }
  .cheer { margin-top: 10px; font-size: 19px; }

  /* Live preview becomes a slim strip */
  .preview-pane { padding: 6px 12px 8px; }
  .mini { border-radius: 12px; box-shadow: 0 10px 24px -18px rgba(58,53,50,.6); }
  .mini-bar { padding: 5px 10px; }
  .mini-bar i { display: none; }
  .mini-url { margin-left: 0; padding: 2px 10px; font-size: 12px; }
  .mini-hero { height: 62px; }
  .mini-portrait { display: none; }
  .mini-title { font-size: 9.5px; letter-spacing: .16em; min-height: 0; }
  .mini-name { font-size: 22px; min-height: 0; margin: 2px 0 0; }
  .mini-years { font-size: 11px; min-height: 0; }

  /* Home */
  .hero { padding: 20px 16px 32px; gap: 20px; }
  .hero h1 { font-size: 40px; margin: 8px 0 4px; }
  .section { padding: 40px 16px; }
}

/* ---------- Desktop view on phones / small tablets (861–1100px wide) ---------- */
@media (min-width: 861px) and (max-width: 1100px) {
  .builder-body { grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr); }
  .q-pane { padding: 28px 32px; }
  .preview-pane { padding: 46px 22px 28px; align-items: flex-start; }
  .choice-grid { grid-template-columns: 1fr; gap: 10px; }
  .choice { min-height: 0; padding: 12px 16px; }
  .choice strong { font-size: 21px; }
  .choice .ctext > span { font-size: 15px; }
  .hero-cta { flex-wrap: nowrap; }
}

/* ---------- Voice stories (microphone + AI proofread) ---------- */
.voice { display: flex; align-items: center; gap: 16px; padding: 14px 16px; margin-bottom: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.mic {
  position: relative; flex: none; width: 66px; height: 66px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--accent); color: #fff;
  box-shadow: 0 10px 22px -10px rgba(140,108,61,.7); transition: background .3s var(--ease), transform .2s var(--ease);
}
.mic svg { width: 30px; height: 30px; display: block; }
.mic:active { transform: scale(.95); }
.mic[data-state="recording"] { background: #B5523F; }
.mic[data-state="recording"]::before, .mic[data-state="recording"]::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #B5523F; animation: micPulse 1.6s ease-out infinite;
}
.mic[data-state="recording"]::after { animation-delay: .8s; }
@keyframes micPulse { from { transform: scale(1); opacity: .7; } to { transform: scale(1.7); opacity: 0; } }
.mic[data-state="busy"] { background: var(--ink-soft); cursor: progress; }
.mic[data-state="busy"] svg { animation: micBusy 1.2s ease-in-out infinite alternate; }
@keyframes micBusy { from { opacity: .4; } to { opacity: 1; } }
.voice-text strong { display: block; font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.2; }
.voice-text span { display: block; color: var(--ink-soft); font-size: 14.5px; }
textarea.input.story { height: auto; min-height: 150px; padding: 14px 16px; font-size: 18px; line-height: 1.6; resize: vertical; }
.ai-note { margin: 4px 0 6px; padding: 12px 14px; border-radius: 14px; font-size: 15px; line-height: 1.5; }
.ai-note.ok { background: #EAF2EC; color: #3E6B4C; }
.ai-note.info { background: var(--bg-2); color: var(--ink-soft); }
.ai-note.warn { background: #F7EBDD; color: #8A5A27; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ai-diff { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #fff; color: var(--ink); }
.ai-diff mark { background: #FFE9B8; color: inherit; border-radius: 3px; padding: 0 2px; }
@media (max-width: 860px) {
  .voice { padding: 10px 12px; gap: 12px; }
  .mic { width: 58px; height: 58px; }
  .voice-text strong { font-size: 19px; }
  .voice-text span { font-size: 13px; }
  textarea.input.story { min-height: 120px; font-size: 17px; }
}
.btn { white-space: nowrap; }

.ai-note .encourage { margin: 0 0 6px; font-family: var(--serif); font-size: 21px; line-height: 1.35; color: var(--ink); }
@media (max-width: 860px) { .ai-note .encourage { font-size: 19px; } }

/* ---------- Comforting motion in the story builder ---------- */
.track { overflow: visible; }
.track-glow { position: absolute; top: 10px; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,196,128,.9) 0%, rgba(232,196,128,0) 70%); animation: trackGlow 2s ease-out forwards; pointer-events: none; }
@keyframes trackGlow { from { transform: scale(1); opacity: .9; } to { transform: scale(7); opacity: 0; } }
.mote { position: absolute; top: 8px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; pointer-events: none;
  background: #E8C480; box-shadow: 0 0 8px 2px rgba(232,196,128,.7); opacity: 0; animation: moteRise 2.8s ease-out forwards; }
@keyframes moteRise { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 15% { opacity: .95; }
  100% { transform: translate(var(--drift, 0), -30px) scale(1.1); opacity: 0; } }
/* While the AI reads the story: a slow, calm breath instead of a spinner */
.mic[data-state="busy"] { background: var(--accent); animation: breathe 4.4s ease-in-out infinite; cursor: progress; }
.mic[data-state="busy"] svg { animation: none; opacity: .9; }
.mic[data-state="busy"]::before { content: ""; position: absolute; inset: -6px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,196,128,.45), rgba(232,196,128,0) 70%); animation: breatheHalo 4.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes breatheHalo { 0%, 100% { transform: scale(.9); opacity: .4; } 50% { transform: scale(1.35); opacity: 1; } }
/* The story floating into the live preview */
.float-card { position: fixed; z-index: 80; padding: 12px 14px; border-radius: 12px; background: #FFFDF8;
  box-shadow: 0 18px 40px -18px rgba(58,53,50,.55); font-family: var(--serif); font-size: 17px; line-height: 1.4; color: var(--ink); pointer-events: none; }
.mini.received { animation: received 1.6s ease-out .9s; }
@keyframes received { 0% { box-shadow: 0 30px 60px -30px rgba(58,53,50,.5), 0 0 0 0 rgba(232,196,128,0); }
  40% { box-shadow: 0 30px 60px -30px rgba(58,53,50,.5), 0 0 0 10px rgba(232,196,128,.45); }
  100% { box-shadow: 0 30px 60px -30px rgba(58,53,50,.5), 0 0 0 22px rgba(232,196,128,0); } }
.ai-note { animation: noteIn .7s cubic-bezier(.4,0,.2,1) both; }
@keyframes noteIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ai-note .encourage { animation: encourageIn 1.2s cubic-bezier(.4,0,.2,1) .15s both; }
@keyframes encourageIn { from { opacity: 0; letter-spacing: .02em; } to { opacity: 1; letter-spacing: 0; } }

.site-footer .copy a { color: inherit; font-weight: 600; text-decoration: none; }

/* ---------- First visit on a phone: choose a view ---------- */
.view-ask { position: fixed; inset: 0 0 var(--footer-h) 0; z-index: 90; display: grid; place-items: center; padding: 20px;
  background: rgba(58, 53, 50, .45); animation: askIn .45s ease both; }
.view-ask.closing { animation: askOut .35s ease both; }
@keyframes askIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes askOut { to { opacity: 0; } }
.view-ask-card { width: min(560px, 100%); padding: 28px 24px 22px; border-radius: 22px; background: var(--card); text-align: center;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); animation: cardRise .6s cubic-bezier(.4,0,.2,1) both; }
@keyframes cardRise { from { transform: translateY(16px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.view-ask-card h2 { font-size: 34px; margin-bottom: 6px; }
.view-ask-card > p { color: var(--ink-soft); margin: 0 0 18px; font-size: 18px; }
.view-ask-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.view-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 12px; border-radius: 18px; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); transition: border-color .3s, background .3s, transform .2s; }
.view-opt svg { width: 46px; height: 46px; color: var(--accent-deep); }
.view-opt strong { font-family: var(--serif); font-size: 24px; font-weight: 500; }
.view-opt span { color: var(--ink-soft); font-size: 15px; line-height: 1.35; }
.view-opt:active { transform: scale(.97); }
@media (hover: hover) { .view-opt:hover { border-color: var(--accent); background: #FFF9EE; } }
.view-ask-hint { margin: 16px 0 0 !important; font-size: 15.5px !important; }
.view-ask-pointer { position: fixed; z-index: 91; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center;
  color: #FBF8F3; font-weight: 700; font-size: 15px; pointer-events: none; animation: pointerBob 1.6s ease-in-out infinite; }
.view-ask-pointer span { padding: 6px 12px; border-radius: 999px; background: var(--ink); white-space: nowrap; }
.view-ask-pointer svg { width: 34px; height: 34px; color: var(--ink); filter: drop-shadow(0 2px 3px rgba(255,255,255,.6)); }
@keyframes pointerBob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }
html.asking-view .site-footer { z-index: 92; }
.foot-highlight { position: relative; background: #FFF4DF !important; border-color: var(--accent) !important; box-shadow: 0 0 0 4px rgba(176,141,87,.25); }
@media (max-width: 860px) {
  .view-ask-card { padding: 22px 16px 18px; }
  .view-ask-card h2 { font-size: 27px; }
  .view-ask-card > p { font-size: 16px; }
  .view-opt { padding: 16px 8px; }
  .view-opt svg { width: 38px; height: 38px; }
  .view-opt strong { font-size: 20px; }
  .view-opt span { font-size: 13.5px; }
}
/* In desktop layout on a phone the page is scaled down, so make the chooser big enough to read and tap. */
html.has-toggle[data-view="desktop"] .view-ask-card { width: min(880px, 100%); padding: 44px 40px 34px; border-radius: 30px; }
html.has-toggle[data-view="desktop"] .view-ask-card h2 { font-size: 54px; }
html.has-toggle[data-view="desktop"] .view-ask-card > p { font-size: 26px; margin-bottom: 26px; }
html.has-toggle[data-view="desktop"] .view-ask-options { gap: 20px; }
html.has-toggle[data-view="desktop"] .view-opt { padding: 34px 18px; border-radius: 26px; gap: 10px; }
html.has-toggle[data-view="desktop"] .view-opt svg { width: 76px; height: 76px; }
html.has-toggle[data-view="desktop"] .view-opt strong { font-size: 38px; }
html.has-toggle[data-view="desktop"] .view-opt span { font-size: 22px; }
html.has-toggle[data-view="desktop"] .view-ask-hint { font-size: 23px !important; margin-top: 24px !important; }
html.has-toggle[data-view="desktop"] .view-ask-pointer { font-size: 22px; }
html.has-toggle[data-view="desktop"] .view-ask-pointer span { padding: 10px 18px; }
html.has-toggle[data-view="desktop"] .view-ask-pointer svg { width: 50px; height: 50px; }
