:root {
  /* the whole site sits on the oil-painting texture: light type and light portraits on a dark, warm ground */
  --paper: #1c1a1b;
  --paper-2: #262325;
  --ink: #f2ece2;
  --ink-soft: #cfc6ba;
  --muted: #b3a99d;   /* 4.5:1 or better on the dark ground, even at 10px */
  --line: rgba(242, 236, 226, .18);
  --accent: #f0643f;
  /* one typeface for everything around the portraits (the portraits' own words stay Archivo Narrow), set a touch tight */
  --serif: "DM Sans", system-ui, sans-serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --narrow: "DM Sans", system-ui, sans-serif;
  --track: -.012em;
  --ease: cubic-bezier(.6, 0, .2, 1);
  --hdr: 64px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #1c1a1b; color: var(--ink); font: 400 16.5px/1.55 var(--serif); letter-spacing: var(--track); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.locked { overflow: hidden; }
/* the painting stays still behind everything, so the splash, the portraits and the messages share one ground */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(16, 15, 16, .42), rgba(16, 15, 16, .42)), url(../assets/splash/texture.jpg) center / cover; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
[hidden] { display: none !important; }
em { font-style: italic; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow { font: 500 11px/1.3 var(--sans); letter-spacing: 0.112em; text-transform: uppercase; color: var(--muted); margin: 0 0 18px; }
.eyebrow b { color: var(--ink); font-weight: 600; }
.btn {
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 999px;
  padding: 13px 24px; font: 500 14px/1 var(--sans); letter-spacing: -0.005em; transition: background .3s, color .3s, transform .3s var(--ease);
  white-space: nowrap;   /* a call to action always reads on one line */
}
@media (hover: hover) { .btn:hover { background: transparent; color: var(--ink); } }
.link { background: none; border: 0; padding: 4px 0; font: 500 13px/1.2 var(--sans); letter-spacing: -0.005em; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px; transition: text-decoration-color .3s; }
.link:hover { text-decoration-color: var(--ink); }
.found.error { color: var(--accent); }

/* ---------- header + timeline ---------- */
.top { position: fixed; inset: 0 0 auto 0; z-index: 30; height: var(--hdr); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; }
/* over the messages, a soft shade behind the header keeps it readable as the letters pass under it */
.top::before { content: ''; position: absolute; inset: 0 0 -24px; z-index: -1; background: linear-gradient(rgba(18, 17, 18, .97) 72%, rgba(18, 17, 18, 0)); opacity: 0; transition: opacity .4s; pointer-events: none; }
body.on-board .top::before { opacity: 1; }
.mark { font: 500 15px/1 var(--serif); color: var(--ink); text-decoration: none; }
.mark span { font: 500 10px/1 var(--sans); letter-spacing: 0.112em; text-transform: uppercase; color: var(--muted); margin-left: 8px; }

.rail { position: fixed; right: 28px; top: 50%; transform: translateY(-50%); z-index: 25; display: flex; flex-direction: column; padding: 6px 0; opacity: 0; transition: opacity .6s; --p: 0; }
body:not([data-state="hero"]) .rail { opacity: 1; }
body[data-state="hero"] .rail, body:not([data-state]) .rail { pointer-events: none; }   /* hidden on the opening screen: never in the way of a tap */
.rail::before, .rail::after { content: ''; position: absolute; right: 2px; top: 22px; width: 1px; pointer-events: none; }
.rail::before { bottom: 22px; background: rgba(242, 236, 226, .1); }
.rail::after { height: calc((100% - 44px) * var(--p)); background: rgba(242, 236, 226, .32); transition: height .7s var(--ease); }
.rail button { position: relative; display: block; background: none; border: 0; padding: 6px 20px 6px 0; text-align: right; color: var(--muted); font: 500 11px/1 var(--sans); letter-spacing: 0.06em; }
.rail button span { position: absolute; right: calc(100% + 6px); top: 50%; transform: translate(6px, -50%); white-space: nowrap; opacity: 0; transition: .35s var(--ease); pointer-events: none; text-transform: uppercase; letter-spacing: 0.087em; font-size: 10px;
  padding: 7px 11px; border-radius: 999px; background: rgba(18, 17, 18, .94); border: 1px solid rgba(242, 236, 226, .12); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }   /* on a dark pill, so it reads over the letter pages too */
.rail button::after { content: ''; position: absolute; right: 0; top: 50%; width: 5px; height: 5px; border-radius: 50%; box-sizing: border-box; background: rgba(242, 236, 226, .26); transform: translateY(-50%); transition: .4s var(--ease); }
.rail button.done::after { background: rgba(242, 236, 226, .5); }
.rail button.on { color: var(--ink); }
.rail button.on::after { background: var(--ink); transform: translateY(-50%) scale(1.3); }
.rail button:hover span { opacity: 1; transform: translate(0, -50%); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(240, 100, 63, .5); } 100% { box-shadow: 0 0 0 12px rgba(240, 100, 63, 0); } }
.rail button.ping::after { background: var(--accent); animation: ping 1s var(--ease) 2; }

/* ---------- stage: one sticky portrait, notes scroll past it ---------- */
main { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; z-index: 1; overflow: hidden; }
/* portraits stand on the bottom edge of the screen */
.frame { position: absolute; bottom: 0; left: 31%; transform: translateX(-50%); opacity: 0; transition: opacity 1.2s var(--ease); }
body.ready .frame { opacity: 1; }
/* while the splash is up, the page underneath waits unseen and fades in as the figure lifts away */
.stage, .top { opacity: var(--reveal, 1); }
.stage { translate: 0 var(--rise, 0px); }
.hero .note { opacity: calc(var(--no, 0) * var(--reveal, 1)); }
/* the splash lets taps through, but not to the opening portrait behind it: its words can be read once the splash has
   lifted, in the hero section, not while the figure is in front */
body.on-splash .top, body.on-splash .note, body.on-splash .famart { pointer-events: none !important; }
.portrait { display: block; }
.famart { position: absolute; left: 0; z-index: 2; pointer-events: none; opacity: 0; visibility: hidden; }
.famscene { position: absolute; z-index: 1; pointer-events: none; visibility: hidden; transition: opacity .2s; }
.travel { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; }
/* the family: the painting on the left, a little wider than the portraits; the text on the right in a bold condensed sans */
/* painted facets */
.sec.painted .note { left: 67vw; width: min(380px, 27vw); }
.sec.painted .fline { font: 600 clamp(30px, 2.6vw, 44px)/1.06 var(--narrow); letter-spacing: -0.035em; margin-bottom: 14px; }
.sec.painted .story p { font: 400 15px/1.55 var(--sans); }
.loading { position: absolute; left: 34%; top: 50%; transform: translate(-50%, -50%); margin: 0; font: 500 11px var(--sans); letter-spacing: 0.124em; text-transform: uppercase; color: var(--muted); transition: opacity .6s; }
body.ready .loading { opacity: 0; }
.loupe {
  /* the word under the pointer: dark on light, 13px, well above 4.5:1 contrast on any part of the picture */
  position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; padding: 6px 10px; border-radius: 4px; background: var(--ink); color: #1a1718;
  font: 700 13px/1 var(--narrow); letter-spacing: 0.048em; text-transform: uppercase; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
  opacity: 0; transition: opacity .15s;
}
.loupe.on { opacity: 1; }
.loupe.mine { background: var(--accent); color: #1a1718; }

.flow { position: relative; z-index: 2; margin-top: -100vh; margin-top: -100svh; pointer-events: none; }
.sec { min-height: 125vh; display: flex; align-items: center; padding: 0 0 0 62vw; }
.note { position: fixed; left: 62vw; top: 50%; z-index: 2; width: min(360px, 28vw); pointer-events: none; visibility: hidden; opacity: var(--no, 0); transform: translateY(calc(-50% + var(--ny, 0px))); will-change: opacity, transform; }
.note.vis { visibility: visible; }
.note.live { pointer-events: auto; }
/* the closing note is part of the page again: it scrolls away as the messages arrive */
.final .note { position: relative; left: auto; top: auto; transform: translateY(var(--ny, 0px)); }
.note h1, .note h2 { font: 300 clamp(34px, 3.2vw, 50px)/1.05 var(--serif); letter-spacing: -0.035em; margin: 0 0 16px; }
.note h1 em, .note h2 em { font-weight: 300; }
.note .kicker { font: italic 400 19px/1.35 var(--serif); margin: 0 0 12px; color: var(--ink); }
.note .lede { font-size: 16px; color: var(--ink-soft); margin: 0 0 22px; }
.note blockquote { margin: 0 0 18px; padding: 16px 0 0; border-top: 1px solid var(--line); }
.note blockquote p { margin: 0 0 10px; font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.note cite { display: block; font: normal 500 12px/1.4 var(--sans); color: var(--ink); }
.note cite span { display: block; font-weight: 400; color: var(--muted); }
.pending-photo { font: 500 10px/1.4 var(--sans); letter-spacing: 0.087em; text-transform: uppercase; color: var(--muted); margin: 0; }
.hero { min-height: 110vh; position: relative; }
.hero .note { width: min(420px, 30vw); }
.hero h1 { font-size: clamp(40px, 4vw, 62px); }
.hero h1, .hero h1 em { font-weight: 500; letter-spacing: -0.035em; }
.hero .count { font: 400 12px/1 var(--sans); color: var(--muted); margin: 18px 0 0; }
.final .row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-bottom: 18px; }
/* thanked (once your message is in): the closing line, in italics, sits just under the paragraph before it */
.final .note.thanked .lede:not(.lede--close) { margin-bottom: 8px; }
.final .row .link, .final .note > .link, .top .link { white-space: nowrap; }   /* each on one line; without the room, the link moves under the button */
body.finding .note.vis { opacity: calc(var(--no, 0) * .25) !important; }

/* ---------- the messages: cards scattered round the count in three depths, the front ones turning over now and then;
   the wall itself is wall.html. The cards are placed by app.js (teaser). ---------- */
.wall { position: relative; z-index: 3; height: 100vh; height: 100svh; min-height: 600px; overflow: clip; }
.wall__field { position: absolute; inset: 0; }
.wall__layer { position: absolute; inset: 0; pointer-events: none; will-change: transform; }
.wall__layer[data-depth="2"] { z-index: 1; }
.wall__layer[data-depth="1"] { z-index: 2; }
.wall__layer[data-depth="0"] { z-index: 4; }
.wall__head { position: absolute; left: 50%; top: 50%; z-index: 3; width: min(640px, 92vw); transform: translate(-50%, -50%); text-align: center; }
.wall__head::before { content: ""; position: absolute; left: 50%; top: 50%; width: 125%; height: 190%; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(20, 18, 19, .92) 55%, rgba(20, 18, 19, 0)); z-index: -1; pointer-events: none; }
.wall__head .eyebrow { margin-bottom: 14px; }
.wall__head h2 { font: 600 clamp(36px, 3.6vw, 54px)/1.05 var(--serif); letter-spacing: -0.04em; margin: 0 0 14px; text-wrap: balance; }   /* set like the facet titles */
.wall__head .lede { margin: 0 0 26px; color: var(--ink-soft); font: 400 clamp(17px, 1.5vw, 21px)/1.5 var(--serif); }
.wall__cta { display: inline-block; text-decoration: none; }
.wall__cta:focus-visible { outline-offset: 4px; }

/* a card: two faces back to back; turning it over shows the other one */
.tcard { position: absolute; perspective: 1400px; rotate: var(--rot, 0deg); transition: height .45s cubic-bezier(.3, .7, .2, 1), top .45s cubic-bezier(.3, .7, .2, 1); }
.wall__layer[data-depth="0"] .tcard { pointer-events: auto; }
.tcard__in { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(var(--turn, 0deg)); transition: transform 1.05s cubic-bezier(.65, 0, .3, 1); }
.tcard__face { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 20px 22px 18px; overflow: hidden; border-radius: 12px;
  background: rgba(32, 29, 30, .94); border: 1px solid rgba(242, 236, 226, .1); box-shadow: 0 18px 40px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .04);
  -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.tcard__face--b { transform: rotateY(180deg); }
/* a shared photo: set inside the same card as the messages, the picture filling its frame, the name beneath */
.tcard__face.photo { padding: 10px 10px 0; }
.tcard__img { display: block; flex: 1; min-height: 0; width: 100%; object-fit: cover; border-radius: 7px; background: #0d0b0c; }   /* (the card takes the picture's shape: see photoShape) */
.tcard__cap { margin: 0; padding: 9px 4px 11px; font: 600 13px/1.2 var(--sans); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard__face.mine { border-color: rgba(240, 100, 63, .55); }
.tcard__face::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; background: #121011; opacity: var(--wash, 0); pointer-events: none; }   /* the cards further back, dimmer */
.tcard__name, .tcard__rel, .tcard__cap { flex: none; }   /* (only the greeting itself gives way when space is short) */
.tcard__name { margin: 0; font: 600 15px/1.3 var(--sans); letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard__rel { margin: 3px 0 0; font: 400 12.5px/1.35 var(--sans); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard__rel em { font-style: normal; color: var(--accent); }
.tcard__t { flex: 0 1 auto; min-height: 0; margin-top: 12px; overflow: hidden; font: 400 14.5px/1.55 var(--sans); color: var(--ink-soft); text-wrap: pretty; overflow-wrap: anywhere; }
.tcard__t.cut { -webkit-mask-image: linear-gradient(#000 calc(100% - 1.55em), transparent); mask-image: linear-gradient(#000 calc(100% - 1.55em), transparent); }   /* (whole lines only, the last fading: see fitText) */
.tcard__t p { margin: 0 0 8px; }
.tcard__t p:last-child { margin-bottom: 0; }
/* while it turns: the card lifts a little off the page, and each face darkens as it goes edge-on */
@keyframes tcardLift { 0%, 100% { scale: 1; } 50% { scale: 1.045; } }
@keyframes tcardShade { 0%, 100% { opacity: 0; } 50% { opacity: .55; } }
.tcard.turning { animation: tcardLift 1.05s cubic-bezier(.45, 0, .3, 1); z-index: 1; }
.tcard__face::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; background: linear-gradient(100deg, rgba(10, 9, 9, .9), rgba(10, 9, 9, .55)); opacity: 0; pointer-events: none; }
.tcard.turning .tcard__face::after { animation: tcardShade 1.05s cubic-bezier(.45, 0, .3, 1); }
.tcard.turning .tcard__face { box-shadow: 0 30px 52px rgba(0, 0, 0, .46), inset 0 1px 0 rgba(255, 255, 255, .04); transition: box-shadow .5s; }
/* reduced motion: no turning, the new message fades in where the old one was */
.tcard.fading .tcard__in { opacity: 0; transition: opacity .35s; }
@media (prefers-reduced-motion: reduce) { .tcard__in { transition: opacity .35s !important; } }

/* phones: just the heading and the button through to the wall, no cards */
@media (max-width: 820px), (max-width: 1100px) and (orientation: portrait) {
  .wall { height: auto; min-height: 0; padding: 112px 24px 96px; overflow: visible; }
  .wall__field { position: static; }
  .wall__layer { display: none; }
  .wall__head { position: static; width: auto; transform: none; text-align: center; }
  .wall__head::before { display: none; }
  .wall__head .eyebrow { margin-bottom: 12px; }
  .wall__head h2 { font-size: 34px; margin-bottom: 18px; }
  .wall__head .lede { display: none; }
}
body.on-board .rail, body.on-board .findpill { opacity: 0; pointer-events: none; }
/* ---------- footer ---------- */
.foot { text-align: center; padding: 40px 0 60px; font: 400 11px var(--sans); letter-spacing: 0.087em; text-transform: uppercase; color: var(--muted); }

/* ---------- toast + find ---------- */
.findpill { position: fixed; left: 34%; bottom: 22px; transform: translateX(-50%); z-index: 26; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; font: 500 12px/1 var(--sans); letter-spacing: -0.005em; transition: opacity .4s, background .3s, color .3s; }
body.finding .findpill { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.toast {
  position: fixed; right: 32px; bottom: 28px; z-index: 45; width: min(340px, calc(100vw - 32px));
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; box-shadow: 0 20px 50px rgba(29, 26, 23, .1);
  opacity: 0; transform: translateY(10px); transition: .5s var(--ease);
}
.toast.open { opacity: 1; transform: none; }
.toast__t { font: 400 20px/1.25 var(--serif); margin: 0 0 12px; }
.toast__w { display: grid; gap: 4px; margin: 0 0 12px; font: 400 13px/1.4 var(--sans); color: var(--ink-soft); }
.toast__w b { display: inline-block; min-width: 88px; font: 500 10px/1 var(--sans); letter-spacing: 0.087em; text-transform: uppercase; color: var(--accent); }
.toast__s { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.toast__a { display: flex; gap: 20px; }

/* ---------- composer: docked beside the portrait, no overlay ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.scrim { position: absolute; inset: 0; background: rgba(18, 17, 18, .78); backdrop-filter: blur(6px); opacity: 0; transition: opacity .45s var(--ease); }
.sheet.open .scrim { opacity: 1; }
.composer { position: fixed; left: 62vw; top: 50%; width: min(420px, 32vw); z-index: 40; transform: translateY(calc(-50% + 16px)); opacity: 0; pointer-events: none; transition: opacity .55s var(--ease), transform .55s var(--ease); }
.composer.open { opacity: 1; transform: translateY(-50%); pointer-events: auto; }
body.composing .flow .note, body.composing .findpill, body.composing .toast { opacity: 0 !important; pointer-events: none; transition: opacity .4s var(--ease); }
.panel { position: relative; }
.panel h2 { font: 600 clamp(26px, 2.1vw, 34px)/1.1 var(--serif); letter-spacing: -0.035em; margin: 0 0 18px; padding-right: 36px; text-wrap: balance; }   /* set like the facet titles */
.composer .x { right: -13px; top: -12px; }
/* everything except the message steps back while the words travel */
.composer > .panel > :not(.msgwrap) { transition: opacity .4s var(--ease); }
.composer.sending > .panel > :not(.msgwrap) { opacity: 0; pointer-events: none; }
.x { position: absolute; right: 14px; top: 12px; width: 38px; height: 38px; border: 0; background: none; font: 300 26px/1 var(--serif); color: var(--muted); }
.x:hover { color: var(--ink); }
.msgwrap { position: relative; }
textarea, .msgpreview { width: 100%; min-height: 140px; max-height: 40vh; padding: 16px 18px; font: 400 20px/1.45 var(--serif); border-radius: 8px; white-space: pre-wrap; overflow-wrap: break-word; overflow-y: auto; margin: 0;
  /* the two must set every letter in the same place, or the caret drifts off the words and the lines break apart (text
     then hidden out of the box): the same tracking (a textarea does not inherit the body's), the same room kept for a
     scrollbar (Windows, or a Mac with a mouse: the box's own narrows its text once it scrolls), and iOS's own rules for
     breaking a textarea's lines */
  letter-spacing: var(--track); scrollbar-gutter: stable; line-break: after-white-space; -webkit-nbsp-mode: space; }
/* the textarea's own text is invisible; the mirror beneath it shows the same text with recognised words picked out */
textarea { position: relative; display: block; border: 1px solid var(--line); background: transparent; color: transparent; caret-color: var(--ink); resize: none; outline: none; transition: border-color .3s, opacity .4s; }
textarea::placeholder { color: var(--muted); }
textarea:focus { border-color: var(--ink-soft); }
textarea { overscroll-behavior: contain; }
textarea.err { border-color: var(--accent); }
.msgwrap { background: var(--paper-2); border-radius: 8px; }
.msgpreview { position: absolute; inset: 0; border: 1px solid transparent; color: var(--ink); pointer-events: none; overflow: hidden; transition: color .6s var(--ease); }
.msgpreview mark { background: none; color: var(--accent); box-shadow: inset 0 -.38em rgba(240, 100, 63, .16); border-radius: 2px; transition: opacity .25s, color .4s; }
.msgpreview mark.gone { opacity: 0; }
.composer.sending textarea { border-color: transparent; }
.composer.sending .msgwrap { background: transparent; transition: background .5s; }
.composer.emptied .msgpreview { color: rgba(242, 236, 226, 0); transition: color 1s var(--ease); }
.found { min-height: 1.4em; margin: 8px 0 0; font: 400 12px/1.4 var(--sans); color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 8px 0 0; align-items: start; }   /* (the line above holds the words found as you type) */
.two label span { display: block; white-space: nowrap; font: 500 12.5px/1 var(--sans); letter-spacing: 0; color: var(--muted); margin-bottom: 6px; }
.two label i { font-style: normal; text-transform: none; letter-spacing: 0; }
.two input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 8px 0; font: 400 16px var(--serif); color: var(--ink); outline: none; }
.two input:focus { border-bottom-color: var(--ink); }
.two input::placeholder { color: var(--muted); opacity: .55; }
/* the connection: one of the profile's relationships, set like the name beside it, with the profile step's small
   chevron; "Choose one" in the placeholder's colour until one is chosen */
.two select { appearance: none; -webkit-appearance: none; width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 20px 8px 0; font: 400 16px var(--serif); color: var(--ink); outline: none; cursor: pointer;
  background: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%) right 6px center / 6px 6px no-repeat, linear-gradient(-45deg, transparent 50%, var(--ink-soft) 50%) right 0 center / 6px 6px no-repeat; }
.two select:invalid { color: var(--muted); }
.two select option { color: #2a211b; }   /* (the list itself is the browser's own, on white) */
/* signing in, inside the box: the message, details and button step aside for the sign-in steps */
.panel.authing > :is(.msgwrap, .found, .two, .media, .signed, .panel__foot, .fine) { display: none; }
.auth[hidden], .auth__s[hidden], .signed[hidden], .js-auth-desig[hidden] { display: none; }
.auth { animation: authIn .35s var(--ease); }
@keyframes authIn { from { opacity: 0; transform: translateY(6px); } }
.auth__lead { margin: 0 0 18px; font: 400 16px/1.5 var(--serif); color: var(--ink-soft); }
.auth__lead b { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.auth__f { display: block; margin: 0 0 16px; }
.auth__f span { display: block; font: 500 12.5px/1 var(--sans); color: var(--muted); margin-bottom: 6px; }
.auth__f i { font-style: normal; opacity: .8; }
.auth__f input, .auth__f select { width: 100%; box-sizing: border-box; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 8px 0; font: 400 17px var(--serif); color: var(--ink); outline: none; border-radius: 0; }
.auth__f select { appearance: none; -webkit-appearance: none; background: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%) right 6px center / 6px 6px no-repeat, linear-gradient(-45deg, transparent 50%, var(--ink-soft) 50%) right 0 center / 6px 6px no-repeat; padding-right: 20px; cursor: pointer; }
.auth__f input:focus, .auth__f select:focus { border-bottom-color: var(--ink); }
.auth__f input[name="authCode"] { font: 500 26px/1.1 var(--sans); letter-spacing: .35em; }
.auth .two { margin: 0 0 16px; }
.auth__go { display: block; width: 100%; margin-top: 6px; }
.auth__go:disabled { opacity: .6; cursor: progress; }
.auth__or { display: flex; align-items: center; gap: 12px; margin: 16px 0; font: 500 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.auth__or::before, .auth__or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth__google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px 18px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .35); font: 500 14px/1 var(--sans); color: var(--ink); cursor: pointer; transition: background .25s, border-color .25s; }
.auth__google:hover { background: rgba(255, 255, 255, .6); border-color: rgba(42, 33, 27, .4); }
/* pressed, and then while Google opens (the page takes a moment to go): it darkens and says so */
.auth__google:active, .auth__google.going { background: rgba(42, 33, 27, .14); border-color: rgba(42, 33, 27, .55); }
.auth__google.going { cursor: progress; opacity: .8; }
.auth__google svg { width: 18px; height: 18px; flex: none; }
.auth__alt { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 0; }
.auth__alt .link, .auth__back { font-size: 13px; }
.auth__err { margin: 12px 0 0; font: 400 13px/1.45 var(--sans); color: var(--accent); }
.auth__err:empty { display: none; }
.auth__back { display: block; margin: 18px auto 0; }
.signed { margin: 14px 0 0; font: 400 12.5px/1.4 var(--sans); color: var(--muted); }
.signed b { font-weight: 500; color: var(--ink-soft); }
.signed .link { font-size: 12.5px; padding: 0; }
/* the optional photo or video under the details; the button on its own row, the full width, the note on approval beneath it */
.panel .media { margin: 16px 0 0; }
.panel__foot { margin-top: 22px; }
.panel__foot .btn { display: block; width: 100%; }
.fine { font: 400 12.5px/1.5 var(--sans); color: var(--muted); margin: 10px 0 0; text-align: center; }
.flyer { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; white-space: nowrap; line-height: 1; will-change: transform; display: grid; place-items: center; }
.flyer > span { grid-area: 1 / 1; }
.flyer .f-b { font-family: "Archivo Narrow", "Arial Narrow", sans-serif; font-weight: 700; letter-spacing: -0.005em; opacity: 0; }
.flight { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 69; pointer-events: none; overflow: visible; }
.flight path { fill: none; stroke: var(--accent); stroke-width: 1; stroke-linecap: butt; opacity: 0; }

/* ---------- word sheet ---------- */
.sheet { align-items: flex-end; }
.sheet__panel { position: relative; width: min(560px, 100vw); max-height: 80svh; overflow: auto; background: var(--paper); border: 1px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0; padding: 30px 36px 36px; transform: translateY(100%); transition: transform .5s var(--ease); box-shadow: 0 -20px 60px rgba(29, 26, 23, .1); }
.sheet.open .sheet__panel { transform: none; }
.sheet h3 { font: 600 clamp(34px, 6vw, 48px)/1 var(--narrow); text-transform: uppercase; letter-spacing: -0.005em; margin: 0 0 18px; }
.sheet h3.mine { color: var(--accent); }
.sheet blockquote { margin: 0 0 18px; }
.sheet blockquote p { font: 400 21px/1.45 var(--serif); margin: 0 0 12px; }
.sheet blockquote.pending p { color: var(--ink-soft); }
.sheet cite { font: normal 500 13px/1.4 var(--sans); display: block; }   /* (on its own line, under "Read the full greeting") */
.sheet cite span { display: block; font-weight: 400; color: var(--muted); }
.rel { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rel button { text-align: left; width: 100%; border: 0; border-top: 1px solid var(--line); background: none; padding: 12px 0 4px; font: 400 15px/1.45 var(--serif); color: var(--ink-soft); }
.rel button span { display: block; font: 500 12px var(--sans); color: var(--ink); margin-top: 4px; }

/* ---------- mobile ---------- */
@media (max-width: 820px), (max-width: 1100px) and (orientation: portrait) {
  :root { --hdr: 54px; }
  .top { padding: 0 18px; }
  .mark span { display: none; }
  .frame, .loading { left: 50%; top: calc(var(--hdr) + 2px); bottom: auto; transform: translate(-50%, 0); }
  .sec { padding: 0; min-height: 110svh; }
  /* the same gap under every portrait: the text starts just below the portrait's box (portraits sit on its bottom edge) */
  .note, .hero .note { left: 0; right: 0; top: calc(var(--hdr) + 2px + var(--stageH, 50svh) + 22px); bottom: auto; width: auto; padding: 0 20px; transform: translateY(var(--ny, 0px)); }
  .final { min-height: 100svh; align-items: flex-end; padding: 0 18px calc(64px + env(safe-area-inset-bottom)); }   /* the closing page keeps the others' gutters, its paper inside the screen */
  .final .note { left: auto; right: auto; top: auto; bottom: auto; flex: 1; min-width: 0; }
  .note .eyebrow { margin-bottom: 10px; }
  .note h1, .note h2, .hero h1 { font-size: 30px; margin-bottom: 10px; }
  .note .lede { font-size: 15px; margin-bottom: 16px; }
  .hero .count { display: inline-block; margin: 0 0 0 14px; vertical-align: middle; }
  .note .btn { padding: 12px 22px; }
  .final .row { margin-bottom: 10px; }
  /* the header: frosted paper, so the portrait and text pass softly underneath */
  .top { background: rgba(26, 24, 25, .62); -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1); border-bottom: 1px solid rgba(242, 236, 226, .07); }
  .rail { top: auto; bottom: 0; left: 0; right: 0; transform: none; flex-direction: row; justify-content: center; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--paper) 45%); }
  .rail::before, .rail::after { display: none; }
  .rail button { padding: 4px 9px 14px; text-align: center; }
  .rail button span { display: none; }
  .rail button::after { right: 50%; top: auto; bottom: 2px; transform: translateX(50%); width: 4px; height: 4px; }
  .rail button.on::after { transform: translateX(50%) scale(1.5); }
  /* the bottom of the screen belongs to the facet text now: these sit just under the header instead */
  .findpill { left: auto; right: 14px; bottom: auto; top: calc(var(--hdr) + 10px); transform: none; }
  body:has(.toast.open) .findpill { opacity: 0; pointer-events: none; }
  .toast { right: 12px; left: 12px; width: auto; top: calc(var(--hdr) + 8px); bottom: auto; }
  /* mobile: a sheet over the lower half only, so the portrait above stays visible */
  .composer { left: 0; right: 0; top: auto; bottom: 0; width: auto; transform: translateY(24px); background: var(--paper); border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: 0 -16px 40px rgba(29, 26, 23, .08); padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 62svh; overflow: auto; }
  .composer.open { transform: none; }
  /* once the words lift off, the sheet slides away so they can be seen landing */
  .composer.emptied { transform: translateY(105%); transition: transform .8s var(--ease) .15s, opacity .8s; }
  .composer .x { right: 6px; top: 6px; }
  /* the whole sheet fits on the first screen: compact heading, a shorter box, name and connection side by side */
  .composer { padding-top: 18px; }
  .panel h2 { font-size: 22px; margin-bottom: 10px; }
  textarea, .msgpreview { min-height: 92px; max-height: 26svh; font-size: 16px; padding: 12px 14px; }
  .found { margin: 6px 0 0; }
  .composer .fine { margin-top: 10px; }
  .two { grid-template-columns: 1fr; gap: 12px; margin-top: 6px; }   /* phones: one field under the other */
  .two label span { font-size: 12px; }
  .two input { font-size: 15px; padding: 6px 0; }
  .two select { font-size: 15px; padding: 6px 20px 6px 0; }
  .panel .media { margin-top: 14px; }
  .panel__foot { margin-top: 18px; }
  /* once the words lift off, the sheet slips away a little sooner and softer */
  .composer.emptied { transition: transform .9s cubic-bezier(.4, 0, .2, 1) .05s, opacity .9s; }
  .sheet__panel { padding: 24px 20px calc(30px + env(safe-area-inset-bottom)); }
  .letter p { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; } html { scroll-behavior: auto; } }

/* ---------- desktop reader: the message takes the note's place, tied to its word by a hairline ---------- */
.reader { position: fixed; left: 64vw; top: 50%; width: min(360px, 28vw); z-index: 20; transform: translateY(calc(-50% + 12px)); opacity: 0; pointer-events: none; transition: opacity .32s var(--ease), transform .4s var(--ease); }   /* closing: away quickly, a little down */
body.reading-word .reader { opacity: 1; transform: translateY(-50%); pointer-events: auto; transition: opacity .55s var(--ease) .12s, transform .65s var(--ease) .12s; }   /* opening: once the page has gone */
/* closing a word: the reader goes first, then the page comes back, rising into place (no overlap of the two) */
@keyframes noteBack { from { opacity: 0; translate: 0 14px; } }
body.word-closing .flow .note { animation: noteBack .62s var(--ease) .2s backwards; }
body.reading-word .flow .note { opacity: 0 !important; pointer-events: none; transition-duration: .35s; }
.reader .x { right: -8px; top: -10px; }
.reader__body { max-height: calc(100vh - 2 * var(--hdr) - 24px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }   /* (the last resort: the greeting gives up lines first, see clampQuote) */
.reader h3 { font: 600 40px/1 var(--narrow); text-transform: uppercase; letter-spacing: -0.005em; margin: 0 0 22px; }
.reader h3.mine { color: var(--accent); }
.reader blockquote { margin: 0 0 22px; padding: 0 0 0 18px; border-left: 1px solid var(--ink); }
.reader blockquote p { font: 400 23px/1.42 var(--serif); margin: 0 0 14px; }
/* a long greeting: cut at 12 lines, fading out, with a link to the whole of it on the wall */
.quote__t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 12; line-clamp: 12; overflow: hidden; overflow-wrap: anywhere; }
.quote__t.cut { -webkit-mask-image: linear-gradient(#000 calc(100% - 2.6em), transparent); mask-image: linear-gradient(#000 calc(100% - 2.6em), transparent); }
.quote__more { display: inline-block; margin: 0 0 16px; font-size: 13px; }
.quote__more[hidden] { display: none; }
.rel button .rel__t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; font: inherit; color: inherit; margin-top: 0; }   /* (the other greetings: three lines each, in the button's own type; the name span after it keeps .rel button span) */
.reader blockquote.pending p { color: var(--ink-soft); }
.reader blockquote u, .sheet blockquote u { text-decoration-thickness: 1px; text-underline-offset: 4px; }
.reader cite { font: normal 500 13px/1.4 var(--sans); display: block; }
.reader cite span { display: block; font-weight: 400; color: var(--muted); }
.reader .rel button { font-size: 14px; }
.leadsvg { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 19; }
.lead { fill: none; stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 600; stroke-dashoffset: 600; opacity: 0; transition: stroke-dashoffset .8s var(--ease) .1s, opacity .3s; }
.lead.on { stroke-dashoffset: 0; opacity: .7; }
@media (max-width: 820px), (max-width: 1100px) and (orientation: portrait) { .reader, .leadsvg { display: none; } }

/* ---------- facet note: one sentence, annotated onto the portrait ---------- */
.fnote .eyebrow span { margin-left: 10px; padding-left: 12px; border-left: 1px solid var(--line); color: var(--ink); }
.fnote .fline { font: 300 clamp(30px, 2.5vw, 42px)/1.16 var(--serif); letter-spacing: -0.035em; margin: 0 0 22px; text-wrap: balance; }
.fnote .js-story { color: var(--ink-soft); }
.story { overflow: hidden; max-height: 0; opacity: 0; transition: max-height .6s var(--ease), opacity .5s var(--ease), margin .6s var(--ease); }
.story.open { max-height: 420px; opacity: 1; margin-top: 16px; }
.story p { font: 400 16px/1.6 var(--serif); color: var(--ink-soft); margin: 0 0 12px; }
.pending-photo { margin-top: 22px; }
.annot { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 3; opacity: 0; }
.annot path { fill: none; }
.annot .halo { stroke: var(--paper); stroke-width: 4; opacity: .9; }
.annot .ln { stroke: var(--ink); stroke-width: 1; opacity: .8; }
.annot circle { fill: var(--paper); stroke: var(--ink); stroke-width: 1; opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.4); transition: opacity .4s, transform .5s var(--ease); }
.annot circle.on { opacity: 1; transform: scale(1); }
@media (max-width: 820px), (max-width: 1100px) and (orientation: portrait) {
  .annot { display: none; }
  .fnote .fline { font-size: 27px; }
}

/* ---------- splash: the opening screen, which lifts away to reveal the portrait ----------
   It is also the loading screen: the portraits are prepared behind it, and scrolling opens once they are ready. */
body.booting { overflow: hidden; }
/* nothing under the splash is painted while it is loading: the time goes into preparing the portraits */
body.booting main, body.booting .wall, body.booting .rail, body.booting .foot { visibility: hidden; }
main { margin-top: -100vh; margin-top: -100svh; }   /* the page starts underneath the splash */
.flow__gap { height: 120vh; height: 120svh; }        /* scroll that only lifts the splash; the opening portrait waits */
.splash {
  --fh: min(86svh, 64vw);                             /* the figure's height; everything is placed from it */
  --ly: calc(100svh - var(--fh) * .53);               /* the line the words and logos sit on: level with his neck */
  position: relative; z-index: 40; height: 100vh; height: 100svh; overflow-x: clip; color: #fff; pointer-events: none;
}
.splash__fig { position: absolute; left: 50%; bottom: 0; scale: var(--fsc, 1); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, transparent, #000 var(--mk, 0%)); mask-image: linear-gradient(to top, transparent, #000 var(--mk, 0%));   /* as he rises, the cut-off at the bottom melts away */ height: var(--fh); width: auto; max-width: none; translate: -50% var(--fy, 0px); opacity: var(--fo, 1); z-index: 1; animation: splashRise 1.6s cubic-bezier(.2, .7, .2, 1) backwards; }
.splash__w, .splash__logo { position: absolute; top: var(--ly); translate: 0 calc(-50% + var(--wy, 0px)); margin: 0; z-index: 2; }
.splash__w { font: 300 clamp(40px, 4.6vw, 78px)/1.2 "Noto Sans Devanagari", var(--sans); white-space: nowrap; opacity: var(--wo, 1); animation: splashIn 1.2s cubic-bezier(.2, .7, .2, 1) .5s backwards; }
.splash__w--l { right: calc(50% + var(--fh) * .315); color: #e0331f; }
.splash__w--r { left: calc(50% + var(--fh) * .25); animation-delay: .7s; }
.splash__logo { height: auto; opacity: var(--wo, 1); animation: splashIn 1.2s cubic-bezier(.2, .7, .2, 1) 1s backwards; }
.splash__logo--hero { left: 7vw; width: clamp(92px, 8.4vw, 150px); margin-top: -4px; }   /* 4px higher than the VIDA logo */
.splash__logo--vida { right: 7vw; width: clamp(100px, 9.2vw, 164px); }
@keyframes splashRise { from { opacity: 0; transform: translateY(5%); } to { opacity: 1; transform: none; } }
@keyframes splashIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* at the bottom: a thin loading line, then the invitation to scroll */
.splash__cue { position: absolute; left: 50%; bottom: 26px; translate: -50% 0; z-index: 2; display: grid; justify-items: center; opacity: var(--wo, 1); }
.splash__bar { grid-area: 1 / 1; display: block; width: 132px; height: 2px; border-radius: 1px; background: rgba(255, 255, 255, .26); overflow: hidden; transition: opacity .6s; }
.splash__bar i { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: 0 50%; transition: transform .35s var(--ease); }
.splash__scroll { grid-area: 1 / 1; font: 500 11px/1 var(--sans); letter-spacing: 0.198em; text-transform: uppercase; color: rgba(255, 255, 255, .85); padding-bottom: 34px; opacity: 0; transition: opacity .8s var(--ease) .2s; position: relative; }
.splash__scroll::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 1px; height: 24px; background: linear-gradient(rgba(255, 255, 255, .9), rgba(255, 255, 255, 0)); transform-origin: top; animation: splashCue 2.2s var(--ease) infinite; }
@keyframes splashCue { 0% { transform: scaleY(0); } 45% { transform: scaleY(1); transform-origin: top; } 55% { transform: scaleY(1); transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
body.ready .splash__bar { opacity: 0; }
body.ready .splash__scroll { opacity: 1; }
@media (max-width: 820px), (max-width: 1100px) and (orientation: portrait) {
  /* phones: the logos across the top, both words on one line above his head, the figure filling the lower part */
  .splash { --fh: min(64svh, 150vw); }
  .famart { left: 0; }
  .sec.painted .note { left: 18px; right: 18px; width: auto; }   /* the same gutter on both sides */
  .sec.painted .fline { font-size: 32px; }
  .splash__logo { top: calc(env(safe-area-inset-top, 0px) + 26px); translate: 0 var(--wy, 0px); }
  .splash__logo--hero { left: 20px; width: 92px; }
  .splash__logo--vida { right: 20px; width: 100px; }
  .splash__w { top: calc((100svh - var(--fh)) * .72); font-size: clamp(40px, 11.5vw, 58px); }
  .splash__w--l { right: calc(50% + 8px + var(--fh) * .035); }   /* centred over his head, not the image */
  .splash__w--r { left: calc(50% + 8px - var(--fh) * .035); }
  .splash__cue { bottom: calc(env(safe-area-inset-bottom, 0px) + 34px); }
}

/* short phones: drop the secondary line so the button still sits on the first screen */
@media (max-width: 820px) and (max-height: 700px) {
  .hero .lede, .final .lede { display: none; }
  .note h1, .note h2, .hero h1 { font-size: 27px; }
  .fnote .fline { font-size: 23px; }
}

/* desktop: a plain timeline on the right (a line, a dot per facet, the one you are on marked; its name on hover), and
   the text beside the portraits set larger */
@media (min-width: 821px) and (orientation: landscape), (min-width: 1101px) {
  .rail { right: 30px; }
  .rail button { height: 40px; padding: 0 22px 0 0; }
  .rail button b { display: none; }
  .rail button span { font-size: 11px; color: var(--ink); }
  .rail button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
  .eyebrow { font-size: 12px; }
  .hero .note { width: min(500px, 33vw); }
  .hero h1 { font-size: clamp(46px, 4.5vw, 72px); }
  .note h2 { font-size: clamp(40px, 3.8vw, 60px); }
  .note .lede { font-size: 18px; line-height: 1.5; }
  .hero .count { font-size: 13px; }
  .btn { font-size: 15px; padding: 14px 26px; }
  .link { font-size: 14px; }
  body .sec.painted .note { left: 63vw; width: min(460px, 30vw); }
  .sec.painted .fline { font-size: clamp(36px, 3.3vw, 56px); line-height: 1.05; margin-bottom: 18px; }
  .sec.painted .story p { font-size: 17px; line-height: 1.6; }
  .final .note { width: min(460px, 32vw); }
}

/* ---------- writing only at the end: the header link appears on the closing portrait and the messages ---------- */
/* the header's links: the original site, the greetings wall, and writing a message (always there) */
.top__nav { display: flex; align-items: center; gap: 26px; }
.top__nav a[aria-current] { text-decoration-color: var(--ink); }
.top__menu { display: none; }
/* the music button: a small speaker at the right of the header (waves when playing, a cross when off) */
.top__sound { order: 3; display: grid; place-items: center; width: 36px; height: 36px; margin: 0 -8px 0 14px; padding: 0; border: 0; background: none; color: var(--ink-soft); cursor: pointer; transition: color .25s; }
.top__sound:hover { color: var(--ink); }
.top__sound svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.top__sound .spk { fill: currentColor; stroke: none; }
.top__sound .w1, .top__sound .w2 { display: none; } .top__sound.on .w1, .top__sound.on .w2 { display: inline; } .top__sound.on .x { display: none; }
.top__sound.on .w2 { animation: soundPulse 2.4s ease-in-out infinite; }
@keyframes soundPulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .top__sound.on .w2 { animation: none; } }
/* the music is playing muted until the first tap (browsers allow no sound before one): the speaker invites it */
.top__sound.waiting { color: var(--ink); animation: soundWait 1.8s ease-in-out infinite; }
@keyframes soundWait { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .top__sound.waiting { animation: none; } }
.top__nav { order: 2; margin-left: auto; }
/* phones: the links behind a menu button, opening as a panel under the header */
@media (max-width: 820px), (orientation: portrait) and (max-width: 1100px) {
  .top__sound { order: 2; margin: 0 4px 0 auto; }
  .top__menu { order: 3; display: grid; place-content: center; gap: 6px; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
  .top__menu i { display: block; width: 20px; height: 1.5px; border-radius: 1px; background: currentColor; transition: transform .3s var(--ease); }
  .top__menu[aria-expanded="true"] i:first-child { transform: translateY(3.75px) rotate(45deg); }
  .top__menu[aria-expanded="true"] i:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .top__nav { position: fixed; left: 0; right: 0; top: var(--hdr); z-index: 31; flex-direction: column; align-items: stretch; gap: 0; padding: 6px 18px 14px;
    background: #161415; border-bottom: 1px solid rgba(242, 236, 226, .08); box-shadow: 0 18px 30px rgba(0, 0, 0, .45);
    opacity: 0; transform: translateY(-8px); visibility: hidden; transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s linear .25s; }
  .top__nav.open { opacity: 1; transform: none; visibility: visible; transition: opacity .25s var(--ease), transform .25s var(--ease); }
  .top__nav .link { display: block; padding: 15px 0; font-size: 17px; text-align: left; text-decoration: none; border-bottom: 1px solid rgba(242, 236, 226, .08); }
  .top__nav .link:last-child { border-bottom: 0; }
}

/* ---------- a photo or a video with the message ---------- */
.media { margin: 0; }
.media__add { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: 500 13px/1.3 var(--sans); color: var(--ink); }
.media__add[hidden], .media__item[hidden] { display: none; }
.media__add span { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.media__add:hover span { text-decoration-color: var(--ink); }
.media__add i { font-style: normal; color: var(--muted); font-size: 12px; }
.media__add::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; font: 400 15px/1 var(--sans); color: var(--ink-soft); }
.media__add input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.media__add:focus-within::before { border-color: var(--ink); }
.media__item { display: flex; align-items: center; gap: 12px; }
.media__thumb { width: 56px; height: 42px; flex: none; border-radius: 6px; overflow: hidden; background: rgba(242, 236, 226, .06); }
.media__thumb img, .media__thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media__name { flex: 1; min-width: 0; font: 400 13px/1.3 var(--sans); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media__item .link { font-size: 13px; }
.media__err { margin: 6px 0 0; font: 400 12.5px/1.4 var(--sans); color: var(--accent); }
.media__err:empty { display: none; }
/* in the word reader */
.quote__media { display: block; width: 100%; max-height: 260px; object-fit: contain; border-radius: 6px; margin: 12px 0 4px; background: #0d0b0c; }
@media (max-width: 820px), (orientation: portrait) and (max-width: 1100px) {
  .hero .count { display: block; margin: 16px 0 0; }
}

/* =====================================================================================================================
   TRIAL: one letter, page by page
   The text beside the paintings is written on a letter: a plain sheet of good paper (assets/paper.webp: a warm white,
   a light tooth, soft mottling and fibres, an edge cut softly by hand), folded in three and opened again. Every facet is the next page
   of it, the pages still to come showing beneath; moving on, the page lifts away and the next is underneath
   (placeNotes in app.js). The message box is the visitor's own page of the same letter.
   ===================================================================================================================== */
.note, .composer .panel {
  --ink: #2a211b; --ink-soft: #3f332a; --muted: #5f4c3a; --line: rgba(72, 52, 34, .25); --paper: #efe4cf; --accent: #963820;   /* all 4.5:1+ on the letter */
  --tilt: -1deg; isolation: isolate; box-sizing: border-box; color: var(--ink);
}
.note::before, .composer .panel::before, .note::after {
  content: ''; position: absolute; inset: -6px; pointer-events: none;
  background: url("../assets/paper.webp") center / 100% 100% no-repeat;   /* a plain sheet of good paper, faintly folded */
}
.note::before, .composer .panel::before { z-index: -1; filter: drop-shadow(0 22px 28px rgba(0, 0, 0, .42)) drop-shadow(0 3px 5px rgba(0, 0, 0, .3)); }
/* the pages still to come, beneath this one (none under the last) */
.note::after { z-index: -2; translate: 9px 11px; rotate: 1.8deg; filter: brightness(.74) drop-shadow(0 10px 14px rgba(0, 0, 0, .4)); }
.final .note::after { display: none; }
.note { padding: 70px 56px 52px; rotate: calc(var(--tilt) + var(--nr, 0deg)); scale: var(--ns, 1); transform-origin: 85% 0; aspect-ratio: 25 / 32; will-change: opacity, transform, rotate, scale; backface-visibility: hidden; }
.final .note { aspect-ratio: auto; }
.note > * { filter: opacity(var(--nt, 1)); }   /* the writing on the page fades apart from the sheet while pages turn (a filter, so it stacks with the story's own opacity) */
.note .eyebrow { color: var(--muted); }
.fnote .eyebrow b, .fnote .eyebrow span { color: color-mix(in srgb, var(--ink2, var(--ink)) 60%, #1c140f); }   /* the facet's colour, deep enough to read on the letter */
.fnote .eyebrow span { border-left-color: var(--line); }
.note h1, .note h2, .fnote .fline { color: var(--ink); }
.note h1 em, .note h2 em { color: #6e4026; }
.note .lede, .story p, .sec.painted .story p { color: var(--ink-soft); }
.note .count { color: var(--muted); }
.note .link, .fnote .js-story { color: var(--ink); text-decoration-color: rgba(42, 33, 27, .32); }
.note .link:hover { text-decoration-color: var(--ink); }
.note .btn { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (hover: hover) { .note .btn:hover { background: transparent; color: var(--ink); } }

/* the message box: the visitor's own page of the letter (the type stays the site's own) */
.composer .panel { padding: 50px 48px 36px; rotate: -.6deg; }
.composer .panel h2 { color: var(--ink); }
.composer .x { right: 22px; top: 22px; color: var(--ink); }
.composer .x:hover { color: var(--ink); }
.msgwrap { background: rgba(255, 250, 238, .35); border-radius: 8px; }
textarea { border-color: rgba(72, 52, 34, .28); caret-color: var(--ink); }
textarea:focus { border-color: rgba(72, 52, 34, .55); }
textarea::placeholder { color: var(--muted); opacity: 1; }
.msgpreview { color: var(--ink); }
.msgpreview mark { color: var(--accent); box-shadow: inset 0 -.38em rgba(180, 70, 43, .14); }
.composer .found { color: var(--accent); }
.two input { color: var(--ink); border-bottom-color: var(--line); }
.two input::placeholder { color: var(--muted); opacity: 1; }
.composer .btn { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (hover: hover) { .composer .btn:hover { background: transparent; color: var(--ink); } }
.composer .link { color: var(--ink); text-decoration-color: rgba(42, 33, 27, .32); }
.composer .fine { color: var(--muted); }
.media__add::before { border-color: rgba(42, 33, 27, .3); color: var(--ink-soft); }
.media__thumb { background: rgba(42, 33, 27, .08); }
.composer.sending .msgwrap { background: transparent; }

@media (min-width: 821px) and (orientation: landscape), (min-width: 1101px) {
  body .sec.painted .note { width: min(500px, 32vw); }
  .hero .note, .final .note { width: min(520px, 34vw); }
  .composer { width: min(500px, 35vw); left: 60.5vw; }
}
@media (max-width: 820px), (orientation: portrait) and (max-width: 1100px) {
  .note, .hero .note { left: 18px; right: 18px; padding: 40px 34px 34px; aspect-ratio: auto; --tilt: 0deg; transform-origin: 50% 0; }
  .note::before, .note::after { inset: -4px; }
  .note::after { translate: 0 8px; rotate: 0deg; scale: .965 1; }   /* straight and centred, the pages beneath showing along the bottom, never past the screen's edge */
  .composer { background: none; border: 0; box-shadow: none; padding: 10px 8px 0; max-height: 74svh; overscroll-behavior: contain; }
  .composer .panel { rotate: 0deg; padding: 46px 30px calc(26px + env(safe-area-inset-bottom)); }
  .composer .panel::before { inset: -4px -4px -24px; }
  .composer .x { right: 16px; top: 16px; }
}
.note.lifting { z-index: 3; }
.note.lifting::after { opacity: 0; }
.note::after { transition: opacity .25s; }

/* the facet story on the page: desktop shows what fits (cut at a whole line, fading out), phones open it on request */
.fnote .js-story[hidden] { display: none; }
@media (min-width: 821px) and (orientation: landscape), (min-width: 1101px) {
  .fnote .story { max-height: none; opacity: 1; margin: 0 0 14px; font-size: 17px; transition: none; }
  .fnote.clamped .story { -webkit-mask-image: linear-gradient(#000 calc(100% - 1.7em), transparent); mask-image: linear-gradient(#000 calc(100% - 1.7em), transparent); }
  .fnote.expanded { aspect-ratio: auto; }
  .fnote .story p:last-child { margin-bottom: 0; }
  /* the titles, a size down */
  .hero h1 { font-size: clamp(46px, 4vw, 66px); line-height: 1.02; }
  .note h2, .final .note h2 { font-size: clamp(30px, 2.6vw, 42px); }
  .sec.painted .fline, .fnote .fline { font-size: clamp(26px, 2.1vw, 34px); line-height: 1.1; margin-bottom: 16px; }
  .sec.painted .story p { font-size: 16px; line-height: 1.6; }
}
@media (max-width: 820px), (orientation: portrait) and (max-width: 1100px) {
  .note, .hero .note { transform: translateY(calc(var(--ny, 0px) - var(--fit, 0px))); }
  .note.refit { transition: transform .6s var(--ease); }   /* sliding up for its story, or back down */
  .fnote.expanded .story { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(42, 33, 27, .3) transparent; }
  .note h1, .note h2, .hero h1 { font-size: 25px; }
  .hero h1 { font-size: 35px; line-height: 1.05; }
  .sec.painted .fline, .fnote .fline { font-size: 22px; }
}
/* short phones too: the opening message is shown in full (the letter slides up over the portrait to make room) */
@media (max-width: 820px) and (max-height: 700px) {
  .hero .lede { display: block; font-size: 14px; line-height: 1.5; margin-bottom: 10px; }
  .hero .note { padding: 30px 26px 24px; }
  /* and the thank-you once your message is in: what it says is the point of it */
  .final .note.thanked .lede { display: block; font-size: 14px; line-height: 1.5; margin-bottom: 14px; }
}
@media (min-width: 821px) and (orientation: landscape), (min-width: 1101px) {
  /* every page the same shape, never taller than the screen; what does not fit waits behind "Read more" */
  .fnote { aspect-ratio: auto; --cap: calc(100vh - var(--hdr) - 56px); min-height: min(calc(min(500px, 32vw) * 1.28), var(--cap)); max-height: var(--cap); }   /* the letter's shape at least, growing with its text up to the screen; never clipped (that drew a box round it) */
  .fnote.expanded .story { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(42, 33, 27, .3) transparent; }
}

/* accessibility: touch targets at least 24px on phones; a clear focus ring everywhere, on the dark ground and on the letter */
@media (max-width: 820px), (orientation: portrait) and (max-width: 1100px) { .rail button { min-width: 26px; } }
:focus-visible { outline: 2px solid #f2ece2; outline-offset: 3px; border-radius: 3px; }
.note :focus-visible, .composer :focus-visible { outline-color: #2a211b; }
.composer textarea:focus-visible, .two input:focus-visible { outline: 2px solid #2a211b; outline-offset: 2px; }
.media__add:focus-within { outline: 2px solid #2a211b; outline-offset: 3px; border-radius: 4px; }

/* the closing page's title is set like the facet titles before it (its second line keeps the opening's brown italic) */
.final .note h2, .final .note h2 em { font-weight: 600; letter-spacing: -0.035em; }
@media (min-width: 821px) and (orientation: landscape), (min-width: 1101px) { .final .note h2 { font-size: clamp(26px, 2.1vw, 34px); line-height: 1.1; } }
@media (max-width: 820px), (orientation: portrait) and (max-width: 1100px) { .final .note h2 { font-size: 22px; } }

/* Writing a message: the message itself has no border or focus ring (its tinted panel is the field); only a message
   too short to send shows its orange edge. Every one-line field (name, connection, email, code, first and last name,
   the relation, the designation) has one fine line to write on, in the paper's line colour (the same as the "or"
   divider), unchanged while typing, and no focus ring. */
.composer textarea, .composer textarea:focus, .composer textarea:focus-visible { border-color: transparent; outline: none; }
.composer textarea.err { border-color: var(--accent); }
.composer .two input, .composer .two input:focus, .composer .two input:focus-visible,
.composer .two select, .composer .two select:focus, .composer .two select:focus-visible,
.composer .auth__f input, .composer .auth__f input:focus, .composer .auth__f input:focus-visible,
.composer .auth__f select, .composer .auth__f select:focus, .composer .auth__f select:focus-visible { border-bottom: 1px solid var(--line); outline: none; }
/* the same for adding a photo or video: no ring round its +, no underline, no focus ring (a faint disc keeps the + a button) */
.composer .media__add::before { border-color: transparent; background: rgba(42, 33, 27, .08); }
.composer .media__add span { text-decoration: none; }
.composer .media__add:focus-within { outline: none; }

/* ---------- one whole greeting, over the page (the wall, and the portrait's "Read the full greeting") ---------- */
.mcard__name { margin: 0; font: 600 19px/1.25 var(--sans); letter-spacing: -0.015em; color: var(--ink); }
.mcard__rel { margin: 5px 0 0; font: 400 13px/1.4 var(--sans); color: var(--muted); }
.mw__reader { width: min(680px, calc(100vw - 32px)); max-height: calc(100svh - 48px); padding: 0; border: 1px solid rgba(242, 236, 226, .14); border-radius: 14px;
  background: #1f1c1d; color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); overflow: auto; overscroll-behavior: contain; }
.mw__reader::backdrop { background: rgba(12, 11, 11, .74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mw__reader[open] { animation: readerIn .45s var(--ease); }
.mw__reader[open]::backdrop { animation: readerFade .45s var(--ease); }
@keyframes readerIn { from { opacity: 0; transform: translateY(14px); } }
@keyframes readerFade { from { opacity: 0; } }
.mw__reader .x { position: sticky; float: right; top: 10px; margin: 10px 10px -48px 0; z-index: 2; border-radius: 50%; background: rgba(31, 28, 29, .8); color: var(--ink-soft); }
.mw__reader .x:hover { color: var(--ink); }
.mw__reader-body { padding: 40px 44px 40px; }
.mw__reader-media { display: block; width: calc(100% + 88px); max-height: 60svh; object-fit: contain; margin: -40px -44px 28px; background: #0d0b0c; }
.mw__reader .mcard__name { font-size: 24px; padding-right: 40px; }
.mw__reader-t { margin-top: 20px; font: 400 18px/1.65 var(--sans); color: var(--ink-soft); text-wrap: pretty; overflow-wrap: anywhere; }
.mw__reader-t p { margin: 0 0 14px; }
body:has(.mw__reader[open]) { overflow: hidden; }
@media (max-width: 820px), (max-width: 1100px) and (orientation: portrait) {
  .mw__reader-body { padding: 30px 24px 28px; }
  .mw__reader-media { width: calc(100% + 48px); margin: -30px -24px 22px; }
  .mw__reader-t { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .mw__reader[open], .mw__reader[open]::backdrop { animation: none; } }
