/* Landing page, brand guide v1 (October 2026, docs/DECISIONS.md K-12): Letter Paper and Midnight
   Ink by day, Night Ink after dark, following the visitor's device. Persimmon is the one warm
   moment (the main button, a highlight; as text it is Persimmon Deep), Fountain Blue is for
   links and secondary buttons. Contributor colours mark loved ones' dots and initials only.
   Same values as app/lib/core/theme.dart and share.css. Contrast ratios are against the page. */
:root {
  --page: #F5F6F8;          /* Letter Paper */
  --raised: #FFFFFF;        /* Card White */
  --line: #DCE1EA;          /* Mist */
  --text: #1B2340;          /* Midnight Ink, 14.3:1 */
  --muted: #5A6278;         /* Slate, 5.6:1 */
  --accent: #E2714A;        /* Persimmon: fills only */
  --on-accent: #1B2340;     /* ink on Persimmon, 4.9:1 */
  --accent-text: #B3482A;   /* Persimmon Deep, 5.0:1 */
  --link: #33569A;          /* Fountain Blue, 6.6:1 */
  --on-voice: #FFFFFF;      /* initials on contributor colours */
  --shadow: 0 1px 2px rgba(27, 35, 64, .05), 0 18px 40px -20px rgba(27, 35, 64, .25);
  --c-you: #E2714A;         /* the archive's owner is always Persimmon */
  --c-mother: #3F8F86;      /* Sea Glass */
  --c-brother: #8A6BB0;     /* Heather */
  --c-friend: #6E8B3D;      /* Moss */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --step--1: 0.9375rem;
  --step-0: 1.125rem;       /* body text never below 18px (brand guide) */
  --step-1: 1.3rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 4.5vw, 2.9rem);
  --step-4: clamp(2.6rem, 7.5vw, 5.2rem);
  --measure: 62ch;
  --wide: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #10152A;        /* Night Ink */
    --raised: #1B2340;      /* Midnight Ink */
    --line: #2C3556;
    --text: #EEF1F6;        /* Moon Paper, 16:1 */
    --muted: #A3ABBE;       /* Fog, 7.9:1 */
    --accent: #F28B63;      /* Ember, 7.4:1 */
    --on-accent: #10152A;
    --accent-text: #F28B63;
    --link: #8FA8DA;        /* Dusk Blue, 7.6:1 */
    --on-voice: #10152A;
    --shadow: none;
    --c-you: #F28B63; --c-mother: #6FC1B6; --c-brother: #B79BDA; --c-friend: #A6C277;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--page); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--page); color: var(--text); font-family: var(--body); font-size: var(--step-0); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }
[id] { scroll-margin-top: 84px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.skip { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--text); color: var(--page); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.eyebrow { font-size: var(--step--1); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

/* buttons: at least 48px tall (44px in the header) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font: 600 var(--step-0)/1 var(--body);
  padding: 0.95em 1.4em; min-height: 48px; border-radius: 999px; text-decoration: none; white-space: nowrap;
  transition: transform .2s ease, background-color .2s ease;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn-ghost { color: var(--link); border: 1.5px solid var(--link); }
.btn-ghost:hover { background: color-mix(in srgb, var(--link) 8%, transparent); }
.btn-small { padding: 0.7em 1.1em; min-height: 44px; font-size: var(--step--1); }

/* header */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--page) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.top__row { display: flex; align-items: center; gap: 1rem; padding-block: 0.9rem; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 22px; width: auto; }
.top__nav { display: flex; gap: 1.6rem; margin-left: 1.4rem; font-size: var(--step--1); }
.top__nav a { text-decoration: none; color: var(--muted); }
.top__nav a:hover { color: var(--text); }
.top__actions { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }
.lang { min-width: 44px; min-height: 44px; border: 1.5px solid var(--line); background: transparent; border-radius: 999px; font: 600 13px/1 var(--body); color: var(--text); cursor: pointer; }
.lang:hover { border-color: var(--muted); }
@media (max-width: 760px) { .top__nav { display: none; } }
@media (max-width: 380px) { .btn-small { padding: 0.7em 0.9em; } }

/* hero: the family clips fill it, a Night Ink shade keeps the words readable. Over the video the
   hero always wears the after-dark colours, whatever the device asks for; the story card with it. */
.hero {
  --page: #10152A; --raised: rgba(27, 35, 64, .92); --line: #2C3556; --text: #EEF1F6;
  --muted: #D5DAE5; --accent: #F28B63; --on-accent: #10152A; --accent-text: #F28B63; --link: #B9C9EA;
  --on-voice: #10152A; --shadow: 0 18px 40px -18px rgba(0, 0, 0, .55);
  --c-you: #F28B63; --c-mother: #6FC1B6; --c-brother: #B79BDA; --c-friend: #A6C277;
  position: relative; isolation: isolate; overflow: hidden; color: var(--text); background: var(--page);
  display: flex; flex-direction: column; justify-content: center;
  min-height: calc(100vh - 76px); min-height: calc(100svh - 76px); /* the screen below the header */
}
.hero__poster, .hero__poster img, .hero__clips, .hero__video, .hero__shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__poster img, .hero__video { object-fit: cover; }
.hero__poster { z-index: -3; }
/* With script the still stays hidden: Night Ink shows until the first clip fades in, so a
   different picture never flashes before it. It appears only when no clip will play (less
   motion or data saving asked for, autoplay blocked, or a slow start). */
.js .hero__poster { opacity: 0; transition: opacity .6s ease; }
.js .hero.show-still .hero__poster { opacity: 1; }
/* Two players take turns: the next clip loads behind the one on screen, then fades in over it. */
.hero__clips { z-index: -2; }
.hero__video { opacity: 0; transition: opacity .5s ease; }  /* landing.js waits .6 s before reusing the one below */
.hero__video.is-on { opacity: 1; }
.hero__shade { z-index: -1; background: linear-gradient(90deg, rgba(16, 21, 42, .82) 0%, rgba(16, 21, 42, .6) 50%, rgba(16, 21, 42, .4) 100%), linear-gradient(0deg, rgba(16, 21, 42, .7) 0%, rgba(16, 21, 42, 0) 30%); }
@media (max-width: 860px) { .hero__shade { background: rgba(16, 21, 42, .7); } }
.hero__grid { width: 100%; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; padding-block: clamp(3rem, 8vw, 6.5rem) clamp(2rem, 4vw, 3rem); }
.hero h1 { margin-top: 1.1rem; font-size: var(--step-4); font-weight: 350; text-shadow: 0 2px 28px rgba(16, 21, 42, .5); }
.hero h1 em, .closing h2 em { font-style: italic; color: var(--accent-text); font-weight: 300; }
.hero .eyebrow, .lede { text-shadow: 0 1px 16px rgba(16, 21, 42, .6); }
.lede { margin-top: 1.5rem; font-size: var(--step-1); color: var(--muted); max-width: 34ch; line-height: 1.5; }
.actions { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 0.8rem; }
.hero .btn-ghost { background: rgba(16, 21, 42, .35); }
@media (max-width: 860px) { .hero__grid { grid-template-columns: 1fr; } }
.hero__foot { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 1.2rem; }
.hero__caption { font-size: var(--step--1); color: var(--muted); text-shadow: 0 1px 12px rgba(16, 21, 42, .7); }
.hero__toggle { display: none; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(238, 241, 246, .4); background: rgba(16, 21, 42, .5); color: #EEF1F6; place-items: center; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.js .hero__toggle { display: grid; }
.hero__toggle svg { width: 18px; height: 18px; fill: currentColor; }
.hero__toggle .i-play, .hero.is-paused .hero__toggle .i-pause { display: none; }
.hero.is-paused .hero__toggle .i-play { display: block; }
.hero__toggle:focus-visible { outline-color: #EEF1F6; }

/* the shared memory: a story card with what three loved ones added */
.memory {
  background: var(--raised); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  padding: clamp(1.3rem, 3vw, 2rem); min-width: 0;
  transform-origin: top center; animation: unfold 1.1s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes unfold { from { transform: perspective(900px) rotateX(-14deg); opacity: .4; } to { transform: none; opacity: 1; } }
.memory__meta { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--step--1); color: var(--muted); }
.memory__title { font-size: var(--step-2); margin-top: 0.9rem; }
.memory__told { margin-top: 0.9rem; font-family: var(--display); font-size: 1.15rem; line-height: 1.55; font-weight: 350; }
.voices { list-style: none; margin: 1.4rem 0 0; padding: 1.2rem 0 0; border-top: 1px solid var(--line); display: grid; gap: 1rem; }
.voice { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 0.8rem; align-items: start; animation: rise .7s ease both; }
.voice:nth-child(1) { animation-delay: .5s; }
.voice:nth-child(2) { animation-delay: .8s; }
.voice:nth-child(3) { animation-delay: 1.1s; }
@keyframes rise { from { transform: translateY(6px); opacity: .3; } to { transform: none; opacity: 1; } }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font: 600 0.8rem/1 var(--body); color: var(--on-voice); }
.who { font-size: var(--step--1); color: var(--muted); }
.who b { color: var(--text); font-weight: 600; }
.voice p { font-size: 1rem; margin-top: 0.15rem; }
@media (prefers-reduced-motion: reduce) { .memory, .voice { animation: none; } }

/* sections */
.band { border-top: 1px solid var(--line); }
.band > .wrap { padding-block: clamp(4rem, 9vw, 7rem); }
.section-head { max-width: var(--measure); display: grid; gap: 1.1rem; }
.section-head h2 { font-size: var(--step-3); }
.section-head > p:not(.eyebrow) { color: var(--muted); font-size: var(--step-1); line-height: 1.5; }

/* why now: a memory fading line by line */
.why { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.fading { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; font-family: var(--display); font-size: clamp(1.25rem, 2.6vw, 1.7rem); line-height: 1.35; font-weight: 350; }
.fading li:nth-child(2) { color: color-mix(in srgb, var(--text) 78%, var(--page)); }
.fading li:nth-child(3) { color: color-mix(in srgb, var(--text) 58%, var(--page)); }
.fading li:nth-child(4) { color: color-mix(in srgb, var(--text) 40%, var(--page)); }
.fading li:nth-child(5) { color: color-mix(in srgb, var(--text) 26%, var(--page)); font-style: italic; }
@media (max-width: 760px) { .why { grid-template-columns: 1fr; } }

/* together */
.together { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 3rem; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.together div { background: var(--page); padding: 1.6rem; display: grid; gap: 0.6rem; align-content: start; }
.together h3 { font-size: var(--step-1); }
.together p { color: var(--muted); font-size: 1rem; }
@media (max-width: 760px) { .together { grid-template-columns: 1fr; } }

/* a lifetime: chapters sized by years, dots are memories by contributor (landing.js) */
.thread-scroll { margin-top: 3rem; overflow-x: auto; padding-bottom: 0.5rem; }
.thread { min-width: 760px; padding: 0 6px; } /* room for the half dots at both ends */
.chapters { display: flex; gap: 4px; }
.chapter { min-width: 0; }
.chapter__bar { height: 10px; border-radius: 3px; background: var(--line); }
.chapter.is-now .chapter__bar { background: linear-gradient(90deg, var(--line), var(--accent)); }
.chapter__name { margin-top: 0.7rem; font-family: var(--display); font-size: 1.05rem; }
.chapter__years { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dots { position: relative; height: 34px; margin-bottom: 8px; }
.dot { position: absolute; bottom: 0; width: 10px; height: 10px; border-radius: 50%; transform: translateX(-50%); box-shadow: 0 0 0 2px var(--page); }
.dot.is-tall { bottom: 14px; }
.legend { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; font-size: var(--step--1); color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* plans */
.billing { margin-top: 2.2rem; display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; gap: 4px; }
.billing button { font: 500 var(--step--1)/1 var(--body); color: var(--muted); background: none; border: 0; padding: 0.7em 1.1em; min-height: 44px; border-radius: 999px; cursor: pointer; }
.billing button[aria-pressed="true"] { background: var(--text); color: var(--page); }
.billing small { color: var(--accent-text); margin-left: 0.3em; font-size: 0.85em; }
.billing button[aria-pressed="true"] small { color: inherit; opacity: .8; }
.plans { margin-top: 1.6rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.plan { border: 1px solid var(--line); border-radius: 16px; padding: 1.7rem; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.plan--featured { background: var(--raised); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.plan__tag { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); font-weight: 600; min-height: 1.1em; }
.plan h3 { font-size: var(--step-2); }
.plan__for { color: var(--muted); font-size: 1rem; }
.price { font-family: var(--display); font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.price span { font-family: var(--body); font-size: var(--step--1); color: var(--muted); margin-left: 0.25rem; }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; font-size: 1rem; }
.plan li { display: grid; grid-template-columns: 1rem minmax(0, 1fr); gap: 0.6rem; }
.plan li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 0.62em; }
.plan .btn { margin-top: auto; }
.plans-note { margin-top: 1.4rem; color: var(--muted); font-size: var(--step--1); }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; max-width: 480px; } }

/* promises */
.promises { margin-top: 2.6rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
.promises div { display: grid; gap: 0.5rem; align-content: start; border-top: 1px solid var(--line); padding-top: 1.1rem; }
.promises h3 { font-size: 1.2rem; }
.promises p { color: var(--muted); font-size: 1rem; }
@media (max-width: 860px) { .promises { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .promises { grid-template-columns: 1fr; } }

/* closing */
.band.closing > .wrap { padding-block: clamp(5rem, 11vw, 8rem); }
.closing__inner { text-align: center; display: grid; justify-items: center; gap: 1.4rem; }
.closing__mark img { height: 44px; width: auto; }
.closing h2 { font-size: var(--step-4); font-weight: 300; max-width: 16ch; }
.closing p { color: var(--muted); font-size: var(--step-1); max-width: 40ch; }

.foot { border-top: 1px solid var(--line); }
.foot__row { padding-block: 2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: var(--step--1); }
