/* the home: a drawer of prints in daylight that floods to night and lands in the river, as in the app; then how it works on
   stacked prints, the promises lit word by word, the price, questions. Without motion (reduced, or no script)
   every section simply sits in order, complete. Motion lives under html.motion, driven by home.js. */

/* ---------- hero, at rest ---------- */
.hero { position: relative; }
.stage { position: relative; }
.day { padding-top: clamp(28px, 6vw, 72px); }
.hero-copy { text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero-copy h1 { font-size: clamp(44px, 7vw, 96px); line-height: 1; letter-spacing: -0.025em; max-width: 13ch; }
.hero-copy .lede { margin-top: var(--space-lg); }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: var(--space-xl); }
.cta-price { margin-top: var(--space-md); color: var(--text-quiet); font-size: 15px; }
.cta-price .text-link { padding: 4px 0; }

.collage { position: relative; max-width: var(--wrap); height: clamp(330px, 40vw, 520px); margin: clamp(24px, 4vw, 48px) auto 0; }
.cp { position: absolute; left: var(--x); top: var(--y); }
.cp .polaroid { --s0: .72; transform: rotate(var(--r)) scale(var(--s0)); transform-origin: 0 0; will-change: transform; }
.src {
  position: absolute; z-index: 2; left: 6px; top: -14px; transform: rotate(calc(var(--r) * -.4));
  padding: 5px 10px 6px; border-radius: var(--radius-pill); background: var(--night); color: var(--cream);
  font: 600 12px/1 var(--sans); white-space: nowrap; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .5);
}
.src::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
@media (max-width: 700px) {
  .hero-copy h1 { font-size: 38px; }
  .hero-copy .lede { font-size: 17px; margin-top: var(--space-md); }
  .cta-row { margin-top: var(--space-lg); }
  .cp { left: var(--xm); top: var(--ym); }
  .cp .polaroid { --s0: .52; }
  .src { font-size: 11px; padding: 4px 8px 5px; top: -12px; left: 2px; }
  .cp:nth-child(n+4) .src { display: none; } /* on a phone only the top row says where it came from */
}

.night { padding: var(--section) 0 clamp(24px, 4vw, 48px); }
.night-row { display: grid; gap: clamp(28px, 4vw, 56px); }
@media (min-width: 1000px) { .night-row { grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr); align-items: start; } }
.land h2 { font-size: clamp(36px, 5vw, 68px); max-width: 12ch; }
.land .lede { margin-top: var(--space-md); max-width: 34ch; }
.land-cta { margin-top: var(--space-lg); }

/* the river, as in the app: every year newest first (a row of its photos each), then one year down to its days.
   A picture of the app, not a control: it has no buttons of its own (aria-hidden) */
.rv { position: relative; padding-right: 26px; }
.rv-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.rv-now { position: relative; flex: 1; height: 1.15em; font: italic 500 22px/1.1 var(--serif); color: var(--accent); }
.rv-now span { position: absolute; left: 0; top: 0; white-space: nowrap; transition: opacity .35s ease, transform .35s var(--ease-paper); }
.rv-now .b { opacity: 0; transform: translateY(40%); }
.rv-zoom { flex: none; display: flex; gap: 3px; padding: 3px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line); font: 650 12px/1 var(--sans); color: var(--text-quiet); }
.rv-zoom span { padding: 8px 10px; border-radius: var(--radius-pill); transition: background-color .3s ease, color .3s ease; }
.rv-zoom .y { background: var(--hover); color: var(--text); }
.zoomed .rv-now .a { opacity: 0; transform: translateY(-40%); }
.zoomed .rv-now .b { opacity: 1; transform: none; }
.zoomed .rv-zoom .y { background: none; color: var(--text-quiet); }
.zoomed .rv-zoom .d { background: var(--hover); color: var(--text); }
.rv-view { position: relative; }
.rv-days { display: none; }
.rv-g { display: grid; grid-template-columns: repeat(var(--c), 1fr); gap: 3px; grid-auto-flow: dense; }
.rv-t { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 2px; background: var(--surface); }
.rv-t img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-row { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 8px; align-items: center; margin-top: 4px; }
.rv-years .rv-g { --c: 6; }
.rv-yl { font: italic 500 17px/1 var(--serif); color: var(--accent-text); }
.rv-today { margin: 0 0 8px; }
.rv-today .rv-yl { font: 600 12px/1 var(--sans); color: var(--text-quiet); }
.rv-slot { display: flex; align-items: center; justify-content: center; height: 44px; border: 1.5px dashed var(--control-line); border-radius: 6px; color: var(--text-quiet); font: italic 500 16px/1 var(--serif); }
.rv-big { display: flex; align-items: baseline; gap: 12px; margin: 0 0 4px; }
.rv-big b { font: italic 450 clamp(64px, 8vw, 104px)/.84 var(--serif); letter-spacing: -.045em; color: var(--accent); }
.rv-big span { color: var(--text-quiet); font-size: 13px; }
.rv-ch { margin-top: 20px; }
.rv-ch header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.rv-ch h4 { font: 500 20px/1.15 var(--serif); }
.rv-ch header span { color: var(--text-quiet); font-size: 13px; white-space: nowrap; }
.rv-days .rv-g { --c: 4; }
.rv-lead { grid-column: 1 / span 2; grid-row: 1 / span 2; }
.alt .rv-lead { grid-column: -3 / -1; }
.rv-more b { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(12, 10, 7, .55); color: var(--cream); font: 600 15px/1 var(--sans); }
.rv-spine { position: absolute; right: 0; top: 62px; bottom: 12px; width: 18px; display: flex; flex-direction: column; }
.rv-spine i { flex: 1; display: flex; align-items: center; justify-content: flex-end; }
.rv-spine i::after { content: ""; height: 3px; width: calc(3px + var(--w) * 12px); border-radius: 2px; background: var(--control-line); opacity: .6; }
.rv-thumb { position: absolute; left: 0; right: 0; top: 0; height: 2px; border-radius: 2px; background: var(--accent); transform: translateY(var(--ty, 0)); }
@media (max-width: 999px) { .rv-years .rv-t:nth-child(n+7) { display: none; } }
@media (min-width: 1000px) { .rv-years .rv-g { --c: 10; } .rv-years .rv-t:nth-child(n+11) { display: none; } .rv-days .rv-g { --c: 6; } }
.cp:first-child .polaroid img { aspect-ratio: 2 / 3; object-position: 100% 50%; } /* the same crop as its place on the timeline */

/* ---------- how it works: three prints that stack as you scroll ---------- */
.how { padding: var(--section) 0; }
.how-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-md) var(--space-xl); margin-bottom: clamp(48px, 7vw, 88px); }
.how-head h2 { font-size: clamp(40px, 5.6vw, 76px); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(48px, 8svh, 96px); }
.card {
  position: relative; top: calc(clamp(84px, 11svh, 112px) + var(--i, 0) * 16px);
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center;
  padding: clamp(28px, 4vw, 56px); border-radius: var(--radius-sheet); box-shadow: var(--shadow-photo);
  transform-origin: 50% 0;
}
.card:nth-child(2) { --i: 1; }
.card:nth-child(3) { --i: 2; }
.tab {
  display: inline-block; margin-bottom: var(--space-lg); padding: 7px 14px 8px; border-radius: 10px;
  background: var(--tab); color: var(--night); font: 650 14px/1 var(--sans); letter-spacing: .01em;
}
.card h3 { font-size: clamp(28px, 3.2vw, 44px); line-height: 1.05; max-width: 15ch; }
.card p { margin-top: var(--space-md); color: var(--text-soft); font-size: 17px; max-width: 44ch; }

/* they stack only when each fits on the screen (home.js sets .stacking) */
.stacking .card { position: sticky; }

/* a piece of the real app on each print */
.frag { border-radius: 18px; padding: clamp(22px, 3vw, 32px); min-height: 260px; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); }
.card .frag p { margin: 0; font-size: 15px; color: var(--text-quiet); max-width: none; }
.frag-label { font: 650 12px/1 var(--sans) !important; letter-spacing: .12em; text-transform: uppercase; }
.card .frag .frag-num { margin-top: 10px; font: 500 clamp(56px, 6vw, 78px)/1 var(--serif); letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.card .frag .frag-of { margin-top: 8px; }
.frag-bar { height: 6px; margin-top: 18px; border-radius: var(--radius-pill); background: var(--hover); overflow: hidden; }
.frag-bar i { display: block; height: 100%; width: calc(var(--done, .63) * 100%); background: var(--accent); border-radius: inherit; }
.card .frag .frag-note { margin-top: 18px; display: flex; align-items: center; gap: 8px; color: var(--text-soft); }
.frag-note svg { color: var(--accent-text); flex: none; }
.card .frag .frag-title { font: italic 500 clamp(24px, 2.4vw, 30px)/1.15 var(--serif); color: var(--text); }
.card .frag .frag-year { font: italic 450 clamp(52px, 5vw, 68px)/.84 var(--serif); letter-spacing: -.04em; color: var(--accent); }
.frag-ch { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-top: 14px; }
.card .frag-memory .frag-title { font-style: normal; font-size: clamp(20px, 2vw, 24px); }
.frag-grid { margin-top: 12px; display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; }
.frag-grid span:first-child { grid-row: span 2; }
.frag-grid span { position: relative; overflow: hidden; border-radius: 2px; }
.frag-grid img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--back-sage); }
.frag-grid b { position: absolute; left: 5px; bottom: 5px; padding: 3px 7px; white-space: nowrap; border-radius: var(--radius-pill); background: rgba(23, 20, 15, .78); color: var(--cream); font: 650 11px/1.2 var(--sans); }
.frag-check { width: 72px; height: 72px; margin-bottom: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.frag-check path { stroke-dasharray: 40; }
.card .frag-safe .frag-title { font-style: normal; font-size: clamp(28px, 3vw, 36px); }
.card .frag-safe .frag-of { margin-top: 10px; }
.card .frag-safe .frag-note { margin-top: 6px; }

@media (max-width: 820px) {
  .card { grid-template-columns: 1fr; top: calc(76px + var(--i, 0) * 12px); }
  .frag { min-height: 0; }
}

/* ---------- promises, lit word by word ---------- */
.promises { padding: var(--section) 0; }
.promises-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.promises h2 { font-size: clamp(40px, 5vw, 64px); }
.said { font: 500 clamp(28px, 3.4vw, 46px)/1.2 var(--serif); letter-spacing: -.01em; color: var(--text); text-wrap: pretty; }
.promises .text-link { margin-top: var(--space-xl); color: var(--text); text-decoration-color: var(--accent-text); font-weight: 600; }
@media (max-width: 860px) { .promises-grid { grid-template-columns: 1fr; } }

/* ---------- pricing ---------- */
.pricing { padding: var(--section) 0; }
.pricing-head { max-width: 720px; margin-bottom: var(--space-2xl); }
.pricing-head h2 { font-size: clamp(40px, 5vw, 64px); }
.plans { display: grid; grid-template-columns: 1fr 1.15fr; gap: var(--space-lg); align-items: stretch; max-width: 980px; }
.plan { border: 1px solid var(--line); border-radius: var(--radius-sheet); padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; transition: transform var(--duration-fan) var(--ease-paper), border-color var(--duration-fan) ease; }
.plan-family { background: var(--bg-raise); border-color: var(--accent); }
@media (hover: hover) { .plan:hover { transform: translateY(-4px); } }
.plan h3 { font-size: 28px; }
.price { margin-top: var(--space-lg); display: flex; align-items: baseline; gap: 8px; }
.amt { font: 500 clamp(56px, 5vw, 72px)/1 var(--serif); letter-spacing: -0.03em; }
.per { color: var(--text-quiet); font-size: 17px; }
.price-alt { color: var(--text-quiet); margin-top: 8px; font-size: 15px; line-height: 1.5; }
.plan ul { list-style: none; margin: var(--space-lg) 0 var(--space-xl); padding: 0; flex: 1; }
.plan li { position: relative; padding: 10px 0 10px 28px; color: var(--text-soft); font-size: 16px; border-top: 1px solid var(--line); }
.plan li::before { content: ""; position: absolute; left: 2px; top: 18px; width: 12px; height: 7px; border-left: 2px solid var(--accent-text); border-bottom: 2px solid var(--accent-text); transform: rotate(-45deg); }
.plan .btn { width: 100%; }
.lapse { margin-top: var(--space-2xl); max-width: 64ch; color: var(--text-quiet); font-size: 17px; }
.lapse strong { color: var(--text); font-weight: 650; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } .plan-family { order: -1; } }

/* ---------- questions ---------- */
.faq { padding: var(--section) 0; border-top: 1px solid var(--line); }
.faq-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.faq h2 { font-size: clamp(40px, 5vw, 64px); }
.qa { border-top: 1px solid var(--line); }
.qa:last-child { border-bottom: 1px solid var(--line); }
.qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  min-height: 72px; padding: 18px 0; cursor: pointer; list-style: none;
  font: 500 clamp(20px, 2vw, 24px)/1.25 var(--serif); color: var(--text);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary:hover { color: var(--accent-text); }
.plus { position: relative; flex: none; width: 36px; height: 36px; border: 1px solid var(--control-line); border-radius: 50%; transition: transform var(--duration-fan) var(--ease-paper), background-color var(--duration-quick) ease; }
.plus::before, .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.6px; margin: -.8px 0 0 -6px; background: currentColor; border-radius: 1px; }
.plus::after { transform: rotate(90deg); }
.qa[open] .plus { transform: rotate(45deg); background: var(--hover); }
.qa p { padding: 0 56px 24px 0; color: var(--text-soft); max-width: 62ch; }
@media (max-width: 860px) { .faq-grid { grid-template-columns: 1fr; } .qa p { padding-right: 0; } }

/* ---------- the close ---------- */
.final { background: var(--bg-raise); }
.final .btn-lg { flex: none; }

/* ---------- motion (html.motion: allowed and home.js running) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* the hero pins for a while; the flood and the landing are scrubbed by scroll in home.js */
  .motion .hero { height: 360svh; }
  /* the tall screen (Safari's bar hidden), so scrolling never opens a white strip under it; the content keeps to the
     short screen (--bar: the room the bar takes when shown) */
  .motion .stage { --bar: calc(100lvh - 100svh); position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; }
  .motion .day { position: absolute; inset: 0; z-index: 3; padding-top: clamp(84px, 13svh, 128px); pointer-events: none; }
  .motion .day a { pointer-events: auto; }
  .motion .collage { position: absolute; z-index: 2; left: 0; right: 0; top: var(--ctop, 55%); bottom: var(--bar, 0px); height: auto; margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
  .motion .night { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; padding: clamp(84px, 12svh, 128px) 0 var(--bar, 0px); clip-path: inset(100% 0 0 0); }
  .motion .night-row { flex: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
  .motion .rv { height: 100%; min-height: 0; display: flex; flex-direction: column; }
  .motion .rv-view { flex: 1; min-height: 0; overflow: hidden; -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 88%, transparent); }
  .motion .rv-layer { position: absolute; left: 0; right: 0; top: 0; transform-origin: 50% var(--zy, 0px); will-change: transform, opacity; }
  .motion .rv-days { display: block; opacity: 0; transform-origin: 50% 0; }
  .motion .hero:not(.landed) .rv-land img { opacity: var(--lit, 0); }
  .motion .hero.landed .collage { visibility: hidden; }
  .motion .cp .polaroid { transform-origin: 50% 50%; background: color-mix(in srgb, var(--photo-paper) calc(100% - var(--shed, 0) * 100%), transparent); }
  .motion .cp figcaption { opacity: calc(1 - var(--shed, 0) * 1.6); }
  @media (min-width: 1000px) { .motion .night-row { grid-template-rows: none; align-items: center; } .motion .rv { height: min(76svh, 700px); } .motion .night { justify-content: center; padding-bottom: calc(4svh + var(--bar, 0px)); } .motion .night-row { flex: none; } }
  @media (max-width: 999px) { .motion .rv-today { display: none; } .motion .land .lede { display: none; } .motion .land h2 { font-size: 34px; } .motion .land-cta { margin-top: var(--space-md); min-height: 44px; padding-block: 10px; } .motion .night-row { gap: 18px; } }

  /* headlines rise in, word by word, once they're in view */
  .motion [data-rise] .rw { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
  .motion [data-rise] .rw > span { display: inline-block; transform: translateY(108%); transition: transform 1s var(--ease-paper) calc(var(--w, 0) * 55ms); }
  .motion [data-rise].in .rw > span { transform: none; }

  /* the app pieces on the prints come alive when seen */
  .motion .frag-bar i { transition: width 1.6s var(--ease-paper); }
  .motion .frag-grid img { opacity: 0; }
  .motion .card.in .frag-grid img { animation: develop 1.3s cubic-bezier(.3, .6, .2, 1) both; }
  .motion .card.in .frag-grid span:nth-child(2) img { animation-delay: .15s; } .motion .card.in .frag-grid span:nth-child(3) img { animation-delay: .3s; }
  @keyframes develop { 0% { opacity: 0; filter: grayscale(1) brightness(1.5) contrast(.5) blur(3px); } 30% { opacity: 1; } 100% { opacity: 1; } }
  .motion .frag-check { transform: scale(.6); opacity: 0; transition: transform var(--duration-fan) var(--ease-paper), opacity .2s ease; }
  .motion .frag-check path { stroke-dashoffset: 40; transition: stroke-dashoffset .5s var(--ease-paper) .25s; }
  .motion .card.in .frag-check { transform: none; opacity: 1; }
  .motion .card.in .frag-check path { stroke-dashoffset: 0; }
  .motion .card { transform: scale(calc(1 - var(--cover, 0) * .06)); filter: brightness(calc(1 - var(--cover, 0) * .35)); }


  .qa p { animation: qa-open var(--duration-fan) var(--ease-paper); }
  @keyframes qa-open { from { opacity: 0; transform: translateY(-6px); } }
}
