/* Aesthetic Passport — marketing site
   Direction A: the app's own world. Cream paper, champagne object,
   espresso ink, one caramel accent. Fraunces for feeling, system sans
   for facts, mono for the dossier labels. */

:root {
  --paper: #FAF7F1;
  --card: #FFFFFF;
  --champagne: #E9DCC8;
  --champagne-deep: #E0D0B8;
  --ink: #3E2F22;
  --text: #1A1917;
  --muted: #55503F;
  --faint: #857F73;
  --accent: #8A6748;
  --accent-tint: #F1E8DC;
  --line: #E2DDD2;
  --good: #3E6B4F;
  --radius: 16px;
  --serif: "Fraunces", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--paper);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 680px; }

/* ── The dossier device: mono entry labels, engraved rules ── */
.entry {
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.18em;
  color: var(--faint);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.entry::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* ── Type scale ── */
h1, h2, .serif { font-family: var(--serif); font-weight: 550; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); line-height: 1.06; }
h2 { font-size: clamp(1.7rem, 4.4vw, 2.5rem); line-height: 1.15; margin-bottom: 14px; }
h3 { font-size: 1.12rem; margin-bottom: 6px; }
.lede { font-size: clamp(1.05rem, 2.4vw, 1.25rem); color: var(--muted); max-width: 34em; }
.fine { font-size: 0.85rem; color: var(--faint); }

/* ── Nav ── */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
nav.site {
  display: flex; align-items: center; gap: 22px;
  padding: 14px 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text); }
.brand img { width: 26px; height: 26px; }
.brand:hover { text-decoration: none; }
nav.site .links { margin-left: auto; display: flex; gap: 22px; align-items: center; }
nav.site .links a { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 640px) { nav.site .links a.hide-sm { display: none; } }

.btn {
  display: inline-block;
  background: var(--ink); color: var(--champagne);
  font: 600 0.98rem/1 var(--sans);
  padding: 14px 22px; border-radius: 999px;
  border: 0; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(62,47,34,0.18); }
.btn.small { padding: 10px 16px; font-size: 0.9rem; }
.btn.quiet { background: var(--accent-tint); color: var(--accent); }

/* ── Hero ── */
.hero { padding: 34px 0 30px; overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px;
  align-items: center;
  min-height: min(700px, calc(100svh - 140px));
}
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { margin: 10px 0 18px; }
.hero .lede { margin-bottom: 26px; }

/* Waitlist form */
form.waitlist { display: flex; gap: 10px; max-width: 430px; }
form.waitlist input[type="email"] {
  flex: 1; min-width: 0;
  font: 1rem var(--sans); color: var(--text);
  padding: 13px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card);
}
form.waitlist input[type="email"]:focus { outline: 2px solid var(--accent); border-color: transparent; }
@media (max-width: 480px) {
  form.waitlist { flex-direction: column; }
  form.waitlist .btn { width: 100%; text-align: center; }
}
.form-note { margin-top: 10px; }

/* ── The phone (CSS bezel, no PNG frame) ── */
.phone-stage { position: relative; display: flex; justify-content: center; padding: 12px 0; }
.phone {
  width: min(300px, 74vw);
  border-radius: 46px;
  background: #17130F;
  padding: 11px;
  box-shadow:
    0 30px 60px -18px rgba(62,47,34,0.35),
    0 8px 20px rgba(62,47,34,0.14),
    inset 0 0 0 2px #2C241C;
  position: relative;
}
.phone::before {   /* the island */
  content: "";
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  width: 34%; height: 24px; border-radius: 999px;
  background: #17130F; z-index: 2;
}
.phone img { border-radius: 36px; }
.phone.tilt { transform: rotate(2.2deg); }
.phone.small { width: min(250px, 66vw); }

/* Floating moment cards beside the hero phone */
.moment {
  position: absolute;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 12px 30px rgba(62,47,34,0.12);
  max-width: 240px;
  font-size: 0.85rem;
}
.moment .who { font-weight: 650; }
.moment .what { color: var(--muted); }
.moment.m1 { top: 12%; right: -4px; }
.moment.m2 { bottom: 14%; left: -8px; }
.moment .stamp {
  display: inline-block;
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.14em;
  color: var(--good);
  border: 1.5px solid var(--good);
  border-radius: 4px;
  padding: 4px 7px;
  transform: rotate(-2.5deg);
}
@media (max-width: 480px) {
  .moment { max-width: 190px; font-size: 0.78rem; }
  .moment.m1 { right: -6px; }
  .moment.m2 { left: -6px; }
}

/* ── Sections ── */
section { padding: 72px 0; }
section.tinted { background: var(--accent-tint); }
section.champagne {
  background: linear-gradient(180deg, var(--champagne), var(--champagne-deep));
}

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split.flip > .media { order: 2; }
@media (max-width: 860px) { .split.flip > .media { order: 0; } }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 34px; }
@media (max-width: 780px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
}
.step .num { font: 600 12px var(--mono); letter-spacing: 0.16em; color: var(--accent); }
.step h3 { margin-top: 10px; }
.step p { color: var(--muted); font-size: 0.97rem; }

/* Promise cards (privacy section) */
.promises { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 34px; }
@media (max-width: 780px) { .promises { grid-template-columns: 1fr; } }
.promise {
  background: var(--paper);
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  border-radius: var(--radius); padding: 26px 24px;
}
.promise h3 { font-family: var(--serif); font-size: 1.35rem; }
.promise p { color: var(--muted); font-size: 0.97rem; margin-top: 8px; }

/* Trust chips, rebuilt in HTML */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.chip {
  font: 600 0.82rem var(--sans);
  padding: 7px 12px; border-radius: 999px;
  display: inline-flex; gap: 6px; align-items: center;
}
.chip.verified { background: #E7F0E9; color: var(--good); }
.chip.added { background: var(--accent-tint); color: var(--accent); }

/* Social proof */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 34px; }
@media (max-width: 780px) { .quotes { grid-template-columns: 1fr; } }
blockquote {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
  font-size: 0.98rem; color: var(--muted);
}
blockquote footer { margin-top: 14px; font-size: 0.88rem; color: var(--faint); }

/* FAQ */
details {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
details summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; font-weight: 400; }
details[open] summary::after { content: "\2212"; }
details p { margin-top: 12px; color: var(--muted); max-width: 60ch; }

/* Final CTA card */
.cta-card {
  background: linear-gradient(160deg, var(--champagne), var(--champagne-deep));
  border-radius: 24px;
  padding: clamp(34px, 6vw, 64px);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 50px -20px rgba(62,47,34,0.3);
}
.cta-card h2 { color: var(--ink); }
.cta-card .lede { margin: 10px auto 26px; }
.cta-card form.waitlist { margin: 0 auto; }
.cta-card .rosette-bg {
  position: absolute; right: -70px; top: -70px; width: 260px; opacity: 0.14;
  pointer-events: none;
}

/* Footer */
footer.site {
  border-top: 1px solid var(--line);
  padding: 40px 0 60px; margin-top: 40px;
  color: var(--faint); font-size: 0.9rem;
}
footer.site .cols { display: flex; gap: 30px; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; }
footer.site a { color: var(--muted); }
footer.site .brand { color: var(--muted); }
footer.site nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* Legal pages */
.legal { padding: 56px 0 80px; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 8px; }
.legal h2 { font-size: 1.35rem; margin: 34px 0 10px; }
.legal p, .legal li { color: var(--muted); max-width: 68ch; }
.legal ul { padding-left: 22px; margin: 10px 0; }
.legal .updated { color: var(--faint); margin-bottom: 26px; }

/* Scroll reveal (JS adds .in; motion is entrance-only, never jacked) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}


/* ═══════════ THE CREATIVE LAYER ═══════════
   The site hands you the object. Paper grain, guilloché engraving,
   a living credential in 3D, perforated page edges, ink stamps. */

/* Paper grain over everything (banknote tactility) */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 999;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27260%27%20height%3D%27260%27%3E%3Cfilter%20id%3D%27n%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%270.85%27%20numOctaves%3D%272%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20values%3D%270%200%200%200%200.24%200%200%200%200%200.18%200%200%200%200%200.12%200%200%200%200.05%200%27%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%27260%27%20height%3D%27260%27%20filter%3D%27url%28%23n%29%27%2F%3E%3C%2Fsvg%3E");
}

/* Perforated page edges between passport pages */
section.tinted, section.champagne { border-top: 3px dotted color-mix(in srgb, var(--ink) 18%, transparent); }

/* ── The credential object ── */
.cred-stage {
  position: relative; display: flex; flex-direction: column;
  align-items: center; gap: 14px; padding: 18px 0;
  perspective: 1300px;
  animation: credEnter 0.9s cubic-bezier(0.2, 0.8, 0.3, 1) 0.1s both;
}
@keyframes credEnter {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
.cred {
  width: min(430px, 88vw); aspect-ratio: 1.6;
  border-radius: 24px; padding: 24px 26px;
  display: flex; flex-direction: column;
  color: var(--ink); position: relative;
  background-image:
    url("/assets/img/guilloche.svg"),
    linear-gradient(150deg, #EFE4D1 0%, #E9DCC8 45%, #E0D0B8 100%);
  background-size: cover, cover;
  box-shadow:
    0 34px 70px -24px rgba(62,47,34,0.45),
    0 10px 26px rgba(62,47,34,0.16),
    inset 0 1px 0 rgba(255,255,255,0.55);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.3, 1);
  will-change: transform;
}
.cred.live { transition: transform 0.06s linear; }
.cred-sheen {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,0.55) 50%, transparent 58%);
  background-size: 250% 100%;
  background-position: var(--shx, 130%) 0;
  mix-blend-mode: soft-light;
}
.cred-head { display: flex; justify-content: space-between; align-items: center; }
.cred-brand { font: 600 11px/1 var(--mono); letter-spacing: 0.32em; opacity: 0.75; }
.cred-head img { opacity: 0.85; }
.cred-body { margin-top: auto; }
.cred-label { font: 600 9.5px/1 var(--mono); letter-spacing: 0.22em; opacity: 0.55; }
.cred-name {
  font-family: var(--serif); font-weight: 550;
  font-size: clamp(1.5rem, 5.2vw, 2.05rem); line-height: 1.05;
  margin: 5px 0 0; min-height: 1.1em; overflow-wrap: anywhere;
}
.cred-row { display: flex; gap: 28px; margin-top: 16px; }
.cred-val { font: 600 0.92rem var(--sans); margin-top: 4px; }
.mrz {
  margin-top: 16px; padding-top: 10px;
  border-top: 1px solid rgba(62,47,34,0.25);
  font: 500 10.5px/1.55 var(--mono); letter-spacing: 0.12em;
  opacity: 0.65; white-space: nowrap; overflow: hidden;
}
.mrz span { display: block; }
.cred-input {
  font: 1rem var(--sans); color: var(--text);
  padding: 12px 18px; border-radius: 999px; text-align: center;
  border: 1px solid var(--line); background: var(--card);
  width: min(330px, 80vw); margin-top: 8px;
}
.cred-input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.cred-hint { font-size: 0.85rem; color: var(--faint); }
.cred-stage .moment.m1 { top: -3%; right: -10px; }
.cred-stage .moment.m2 { bottom: 24%; left: -26px; max-width: 200px; }
@media (max-width: 560px) {
  .cred-stage .moment.m1 { top: -6%; right: -4px; }
  .cred-stage .moment.m2 { bottom: 18%; left: -4px; }
}
/* Idle float where there is no cursor to follow */
@media (pointer: coarse) {
  .cred { animation: credFloat 7s ease-in-out infinite; }
}
@keyframes credFloat {
  0%, 100% { transform: rotateX(0deg) rotateY(-2deg); }
  50% { transform: rotateX(2.5deg) rotateY(2deg); }
}

/* Engraving comes into focus */
.reveal { opacity: 0; transform: translateY(18px); filter: blur(9px); transition: opacity 0.7s ease, transform 0.7s ease, filter 0.7s ease; }
.reveal.in { opacity: 1; transform: none; filter: none; }

/* Guilloché under the final CTA too */
.cta-card {
  background-image: url("/assets/img/guilloche.svg"), linear-gradient(160deg, var(--champagne), var(--champagne-deep));
  background-size: cover, cover;
}

/* The ink stamp (thanks page) */
.seal {
  width: 150px; height: 150px; margin: 0 auto 24px; display: block;
  color: var(--good); transform: rotate(-6deg);
  animation: sealLand 0.5s cubic-bezier(0.2, 1.4, 0.3, 1) both;
}
@keyframes sealLand {
  0% { transform: scale(1.7) rotate(-16deg); opacity: 0; }
  60% { transform: scale(0.94) rotate(-4deg); opacity: 1; }
  100% { transform: scale(1) rotate(-6deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .cred, .seal, .cred-stage { animation: none; }
  .cred { transform: none; }
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
}


/* ═══ REVIEW PASS: staging the wow ═══ */

/* Type your name ON the document */
.cred-name[contenteditable] { outline: none; caret-color: var(--accent); cursor: text; min-width: 40px; }
.cred-name[contenteditable]:empty::before { content: attr(data-ph); opacity: 0.45; }
.cred-name[contenteditable]:hover, .cred-name[contenteditable]:focus {
  border-bottom: 1px dashed rgba(62,47,34,0.35);
  margin-bottom: -1px;
}
.cred-input { display: none; }

/* The ledger (passport entries, not SaaS cards) */
.ledger { margin-top: 30px; border-top: 1px solid var(--line); }
.entry-row {
  display: grid; grid-template-columns: 96px 1fr; gap: 8px 22px;
  align-items: start; padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.entry-row .entry-num {
  font-family: var(--serif); font-weight: 550;
  font-size: 2.8rem; line-height: 0.9; color: var(--accent);
}
.entry-row h3 { margin-bottom: 6px; }
.entry-row p { color: var(--muted); max-width: 60ch; }
@media (max-width: 640px) {
  .entry-row { grid-template-columns: 56px 1fr; }
  .entry-row .entry-num { font-size: 2rem; }
}

/* The NO RECORD stamp */
.stamp-host { position: relative; overflow: hidden; }
.page-stamp {
  position: absolute; right: 7%; top: 16%;
  font: 700 clamp(1.2rem, 2.6vw, 2rem)/1.15 var(--mono);
  letter-spacing: 0.14em; text-align: center;
  color: var(--ink);
  border: 4px solid currentColor; border-radius: 12px;
  padding: 12px 20px;
  pointer-events: none;
}
.page-stamp.reveal { transform: rotate(-9deg) scale(1.6); filter: none; transition: none; }
.page-stamp.reveal.in { animation: pageStampIn 0.55s cubic-bezier(0.2, 1.4, 0.3, 1) 0.3s both; }
@keyframes pageStampIn {
  from { opacity: 0; transform: rotate(-16deg) scale(1.7); }
  65% { opacity: 0.16; transform: rotate(-8deg) scale(0.96); }
  to { opacity: 0.13; transform: rotate(-9deg) scale(1); }
}
@media (max-width: 780px) { .page-stamp { right: 4%; top: 6%; } }

/* The moment cards breathe */
.moment { animation: momentFloat 5.5s ease-in-out infinite alternate; }
.moment.m2 { animation-delay: 2.2s; }
@keyframes momentFloat { from { translate: 0 0; } to { translate: 0 -8px; } }
@media (prefers-reduced-motion: reduce) {
  .moment { animation: none; }
  .page-stamp.reveal { transform: rotate(-9deg); }
  .page-stamp.reveal.in { animation: none; opacity: 0.13; }
}


/* ═══════════════ THE BOOKLET (cinematic scene) ═══════════════ */

/* Fallback first: without .cinema the booklet reads as stacked pages. */
.stage-scroll { position: relative; }
.stage { padding: 40px 0 10px; }
.book { width: min(560px, 92vw); margin: 0 auto; }
.sheet .pg, .pg.last { position: relative; }
.pg {
  background: #FBF7EE;
  background-image: url("/assets/img/guilloche.svg");
  background-size: cover;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(22px, 4.5vw, 40px);
  margin: 0 0 18px;
  box-shadow: 0 14px 30px -18px rgba(62,47,34,0.25);
  display: flex; flex-direction: column;
  min-height: 340px;
}
.pg.cover {
  background: linear-gradient(155deg, #EDE0CB, #E3D3B9 60%, #DCC9AB);
  align-items: center; justify-content: center; text-align: center;
  gap: 18px; min-height: 420px;
}
.cover-rosette { width: 74px; height: 74px; opacity: 0.9; }
.cover-title {
  font-family: var(--serif); font-weight: 550;
  font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.2;
  letter-spacing: 0.16em; color: var(--ink);
}
.cover-sub { font: 600 10.5px var(--mono); letter-spacing: 0.3em; color: rgba(62,47,34,0.6); }

.pg-head { font: 600 10px var(--mono); letter-spacing: 0.22em; color: rgba(62,47,34,0.55); }
.pg-label { font: 600 9.5px var(--mono); letter-spacing: 0.22em; color: rgba(62,47,34,0.55); }
.pg-val { font: 600 0.92rem var(--sans); color: var(--ink); margin-top: 4px; }
.pg-mid { margin: auto 0; }
.pg-title { font-size: clamp(1.5rem, 3.2vw, 2.1rem); line-height: 1.12; margin: 10px 0 12px; }
.pg-copy { color: var(--muted); font-size: clamp(0.95rem, 1.6vw, 1.05rem); max-width: 46ch; }
.pg-copy.small { font-size: 0.9rem; margin-top: 12px; }
.pg-cue { margin-top: auto; padding-top: 18px; font: 600 11px var(--mono); letter-spacing: 0.18em; color: var(--accent); }
.pg-hint { font-size: 0.8rem; color: var(--faint); margin-top: 10px; }
.pg-center { align-items: center; justify-content: center; text-align: center; gap: 16px; }
.pg-foot-note { font: 600 10px var(--mono); letter-spacing: 0.2em; color: rgba(62,47,34,0.5); }

.pg .cred-name { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.pg .cred-row { margin-top: 18px; }
.pg .mrz { margin-top: auto; }

.pg-ledger > div { display: grid; grid-template-columns: 52px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.pg-ledger > div:last-child { border-bottom: 0; }
.pg-ledger .entry-num { font-size: 1.7rem; }
.pg-ledger h3 { font-size: 0.98rem; margin-bottom: 2px; }
.pg-ledger p { color: var(--muted); font-size: 0.88rem; }

.pg-rules > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.pg-rules > div:last-child { border-bottom: 0; }
.pg-rules h3 { font-family: var(--serif); font-size: 1.08rem; }
.pg-rules p { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }

.pg-photo { width: min(240px, 60%); }
.pg-photo img { border-radius: 18px; box-shadow: 0 16px 34px -14px rgba(62,47,34,0.4); }
.pg-photo.tall { width: min(260px, 64%); }

.ink-stamp {
  font: 700 clamp(1.3rem, 2.4vw, 1.9rem)/1.15 var(--mono);
  letter-spacing: 0.12em; text-align: center;
  border: 4px solid currentColor; border-radius: 12px;
  padding: 12px 22px; pointer-events: none;
}
.ink-stamp.stamp-a { color: rgba(62,47,34,0.55); transform: rotate(-9deg); }
.ink-stamp.stamp-b { color: var(--good); opacity: 0.75; transform: rotate(-6deg); position: absolute; right: 8%; bottom: 22%; }
.scroll-hint { display: none; }

/* ── Cinema mode: the sticky stage and real page turns ── */
body.cinema .stage-scroll { height: 760vh; }
body.cinema .stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; padding: 0;
  display: flex; align-items: center; justify-content: center;
  perspective: 2400px; overflow: hidden;
}
body.cinema .book {
  position: relative; margin: 0;
  width: min(940px, 94vw);
  height: min(66vh, calc(min(940px, 94vw) * 0.68));
  transform-style: preserve-3d;
  will-change: transform;
}
body.cinema .book::after { /* the table shadow */
  content: ""; position: absolute; left: 8%; right: 8%; bottom: -7%;
  height: 26px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(62,47,34,0.28), transparent 70%);
  transform: translateZ(-60px);
}
body.cinema .sheet {
  position: absolute; left: 50%; top: 0;
  width: 50%; height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  will-change: transform;
}
body.cinema .sheet .pg {
  position: absolute; inset: 0; margin: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  min-height: 0;
  border-radius: 4px 14px 14px 4px;
  overflow: hidden;
}
body.cinema .sheet .pg.back {
  transform: rotateY(180deg);
  border-radius: 14px 4px 4px 14px;
}
body.cinema .sheet .pg::after { /* turn shading */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(62,47,34,0.5), transparent 60%);
  opacity: calc(var(--sh, 0) * 0.5);
}
body.cinema .pg.last {
  position: absolute; left: 50%; top: 0; width: 50%; height: 100%;
  margin: 0; border-radius: 4px 14px 14px 4px; min-height: 0; overflow: hidden;
}
body.cinema .pg.cover {
  background: linear-gradient(155deg, #EDE0CB, #E3D3B9 60%, #DCC9AB);
  box-shadow: inset 0 0 0 3px rgba(62,47,34,0.12);
}
/* spine shadow on left-lying pages */
body.cinema .sheet .pg.back::before, body.cinema .pg.last::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 26px;
  background: linear-gradient(90deg, rgba(62,47,34,0.16), transparent);
  pointer-events: none;
}
body.cinema .scroll-hint {
  display: block; position: absolute; bottom: 4.5vh; left: 50%;
  transform: translateX(-50%);
  font: 600 11px var(--mono); letter-spacing: 0.26em; color: var(--faint);
  animation: hintPulse 2.2s ease-in-out infinite;
}
@keyframes hintPulse { 0%,100% { opacity: 0.45; } 50% { opacity: 1; } }

/* stamps land in cinema mode */
body.cinema .ink-stamp { opacity: 0; }
body.cinema .ink-stamp.landed.stamp-a { animation: stampA 0.5s cubic-bezier(0.2,1.4,0.3,1) both; }
body.cinema .ink-stamp.landed.stamp-b { animation: stampB 0.5s cubic-bezier(0.2,1.4,0.3,1) both; }
@keyframes stampA {
  from { opacity: 0; transform: rotate(-16deg) scale(1.7); }
  65% { opacity: 1; transform: rotate(-8deg) scale(0.95); }
  to { opacity: 1; transform: rotate(-9deg) scale(1); }
}
@keyframes stampB {
  from { opacity: 0; transform: rotate(-12deg) scale(1.7); }
  65% { opacity: 0.8; transform: rotate(-5deg) scale(0.95); }
  to { opacity: 0.75; transform: rotate(-6deg) scale(1); }
}
.scroll-hint.gone { animation: none !important; opacity: 0 !important; transition: opacity 0.3s; }
@media (prefers-reduced-motion: reduce) {
  .scroll-hint { animation: none; }
}





/* ── Mobile performance: cheap frames or no frames ── */
@media (max-width: 699px), (pointer: coarse) {
  body::after { display: none; }              /* grain costs a recomposite per frame */
}
@media (max-width: 699px) {
  body.cinema .sheet .pg::after { display: none; }   /* no per-frame turn shading */
  body.cinema .pg, body.cinema .pg.last {
    box-shadow: 0 6px 18px -10px rgba(62,47,34,0.3); /* one cheap shadow, not three */
  }
  body.cinema .book::after { display: none; }        /* table shadow off on phones */
}


/* ═══ SNAP MODE: the booklet on the phone, one page per swipe ═══
   Each swipe snaps to the next page; the leaf turns via a CSS
   transition on the compositor. No JavaScript runs during motion. */
html.snap { scroll-snap-type: y proximity; }
.snapper { height: 100vh; height: 100svh; scroll-snap-align: start; }

body.cinema-snap .stage-scroll { position: relative; }
body.cinema-snap .stage {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  margin-bottom: calc(-100vh); margin-bottom: calc(-100svh);
  display: flex; align-items: center; justify-content: center;
  perspective: 1500px; overflow: hidden; padding: 0;
}
body.cinema-snap .book {
  position: relative;
  width: min(90vw, 420px);
  height: min(72svh, 146vw);
  margin: 0;
}
body.cinema-snap .sheet { position: static; transform: none !important; }
body.cinema-snap .sheet .pg, body.cinema-snap .pg.last, body.cinema-snap .pg.finale {
  position: absolute; inset: 0; margin: 0; min-height: 0;
  border-radius: 16px; overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-origin: left center;
  transform: rotateY(0deg);
  transition: transform 0.75s cubic-bezier(0.3, 0.05, 0.2, 1), box-shadow 0.3s ease;
  box-shadow: 0 12px 28px -14px rgba(62,47,34,0.38);
  will-change: transform;
}
body.cinema-snap .pg.turned {
  transform: rotateY(-140deg);
  box-shadow: none;
}
body.cinema-snap .pg { padding: 26px 24px; }
body.cinema-snap .pg.cover { box-shadow: inset 0 0 0 3px rgba(62,47,34,0.12), 0 12px 28px -14px rgba(62,47,34,0.38); }
body.cinema-snap .pg-title { font-size: 1.5rem; }
body.cinema-snap .pg-copy { font-size: 0.95rem; }
body.cinema-snap .pg-photo { width: min(210px, 56%); }
body.cinema-snap .scroll-hint {
  display: block; position: absolute; bottom: 4.5svh; left: 50%;
  transform: translateX(-50%);
  font: 600 11px var(--mono); letter-spacing: 0.26em; color: var(--faint);
  animation: hintPulse 2.2s ease-in-out infinite;
}
body.cinema-snap .ink-stamp { opacity: 0; }
body.cinema-snap .ink-stamp.landed.stamp-a { animation: stampA 0.5s cubic-bezier(0.2,1.4,0.3,1) 0.55s both; }
body.cinema-snap .ink-stamp.landed.stamp-b { animation: stampB 0.5s cubic-bezier(0.2,1.4,0.3,1) 0.55s both; }


/* ═══════════ MATERIALITY: texture, light, ceremony ═══════════ */

/* The arrival: a breath of gold before the paper */
.veil {
  position: fixed; inset: 0; z-index: 10001;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  animation: veilOut 0.5s ease 0.9s forwards;
  pointer-events: none;
}
@keyframes veilOut { to { opacity: 0; visibility: hidden; } }
.veil-rosette {
  width: 64px; height: 64px; display: block;
  animation: veilIn 0.9s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
@keyframes veilIn {
  from { opacity: 0; transform: scale(0.6) rotate(-30deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) { .veil { display: none; } }

/* Gold foil (rosette on the cover, veil, finale) */
.cover-rosette.foil, .veil-rosette {
  background: linear-gradient(135deg, #8A6748 0%, #C9A96E 30%, #F0DFB6 48%, #C9A96E 62%, #8A6748 100%);
  background-size: 220% 220%;
  -webkit-mask: url("/assets/img/rosette.svg") center / contain no-repeat;
  mask: url("/assets/img/rosette.svg") center / contain no-repeat;
  animation: foilShine 5.5s ease-in-out infinite;
}
span.cover-rosette { width: 76px; height: 76px; display: block; }
span.cover-rosette.small { width: 54px; height: 54px; margin: 0 auto 6px; }
@keyframes foilShine {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
}

/* The cover becomes leather: grain, deboss, spine */
.pg.cover {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27220%27%20height%3D%27220%27%3E%3Cfilter%20id%3D%27l%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%270.55%27%20numOctaves%3D%273%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20values%3D%270%200%200%200%200.30%200%200%200%200%200.22%200%200%200%200%200.13%200%200%200%200.10%200%27%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%27220%27%20height%3D%27220%27%20filter%3D%27url%28%23l%29%27%2F%3E%3C%2Fsvg%3E"), url("/assets/img/guilloche.svg"), linear-gradient(155deg, #EDE0CB, #E3D3B9 60%, #D8C4A4);
  background-size: 220px 220px, cover, cover;
}
.pg.cover::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 34px;
  background: linear-gradient(90deg, rgba(62,47,34,0.30), rgba(255,255,255,0.14) 60%, transparent);
  border-radius: inherit; pointer-events: none;
}
.cover-title {
  font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  letter-spacing: 0.2em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.38), 0 -1px 1px rgba(46,33,20,0.35);
}
.cover-sub { text-shadow: 0 1px 0 rgba(255,255,255,0.3); }

/* The fore-edge: a real block of pages */
.fore-edge { display: none; }
body.cinema .fore-edge, body.cinema-snap .fore-edge {
  display: block; position: absolute; top: 9px; bottom: 9px; width: 7px;
  border-radius: 2px; z-index: 1;
  background: repeating-linear-gradient(to bottom, #F4ECDC 0 1.5px, #D8CAB1 1.5px 3px);
  box-shadow: 1px 0 2px rgba(62,47,34,0.18);
}
.fore-edge.r { right: -7px; }
.fore-edge.l { left: -7px; opacity: var(--open, 0); }
body.cinema-snap .fore-edge.l { display: none; }

/* Ink that bled into the paper */
.ink-stamp { filter: url(#inkbleed); }

/* The stage is lit, not flat */
body.cinema .stage::before, body.cinema-snap .stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 46%, rgba(233,220,200,0.55), transparent 70%),
    radial-gradient(ellipse 120% 100% at 50% 50%, transparent 55%, rgba(62,47,34,0.10));
}

/* Desktop turn drama: brighter crease light on the moving leaf */
body.cinema .sheet .pg::after {
  background:
    linear-gradient(90deg, rgba(62,47,34,0.5), transparent 55%),
    linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.35) 48%, transparent 62%);
}

/* The finale page */
.pg.finale {
  align-items: center; justify-content: center; text-align: center;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27220%27%20height%3D%27220%27%3E%3Cfilter%20id%3D%27l%27%3E%3CfeTurbulence%20type%3D%27fractalNoise%27%20baseFrequency%3D%270.55%27%20numOctaves%3D%273%27%20stitchTiles%3D%27stitch%27%2F%3E%3CfeColorMatrix%20values%3D%270%200%200%200%200.30%200%200%200%200%200.22%200%200%200%200%200.13%200%200%200%200.10%200%27%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%27220%27%20height%3D%27220%27%20filter%3D%27url%28%23l%29%27%2F%3E%3C%2Fsvg%3E"), url("/assets/img/guilloche.svg"), linear-gradient(155deg, #EDE0CB, #E3D3B9 60%, #D8C4A4);
  background-size: 220px 220px, cover, cover;
}
body.cinema .pg.finale { display: none; }

/* The hand becomes a ring (desktop) */
#cursor {
  position: fixed; left: 0; top: 0; width: 26px; height: 26px;
  margin: -13px 0 0 -13px; border-radius: 50%;
  border: 1.5px solid rgba(62,47,34,0.5);
  pointer-events: none; z-index: 10000;
  transition: width 0.22s, height 0.22s, margin 0.22s, background-color 0.22s, opacity 0.3s;
}
#cursor.on {
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  background-color: rgba(138,103,72,0.12);
}
body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }


/* ═══ GL3D: the passport as a real object ═══ */
#gl { display: none; }
body.gl3d #gl {
  display: block; position: fixed; inset: 0; z-index: 0;
  width: 100vw; height: 100vh; height: 100svh;
}
#glPages { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#glPages .pg {
  position: absolute; left: 0; top: 0; margin: 0; min-height: 0;
  background: none !important; border: 0; box-shadow: none;
  opacity: 0; transition: opacity 0.35s ease;
  pointer-events: none; overflow: hidden;
}
#glPages .pg.live { opacity: 1; pointer-events: auto; }
#glPages .pg.cover { display: none; }        /* the 3D cover carries itself */
body.gl3d .book, body.gl3d .fore-edge { display: none; }
body.gl3d .stage::before { display: none; }  /* the scene lights itself */
body.gl3d header.site { background: color-mix(in srgb, var(--paper) 72%, transparent); }

#glPages .mrz { font-size: 9px; letter-spacing: 0.1em; }
#glPages .pg .entry { font-size: 10px; }
