/* ============================================================
   Fifty. — a paper album for Tim
   Art direction: Kodachrome family book on a walnut table.
   Not a dark-gold 3D demo. Photographs stay still and large.
   ============================================================ */

:root {
  --paper:     #efe4cf;
  --paper-2:   #e6d6b8;
  --linen:     #f6eee0;
  --ink:       #1c1612;
  --ink-2:     #3b3229;
  --muted:     #6d6154;
  --line:      rgba(28, 22, 18, .14);
  --rust:      #b33a1a;
  --rust-deep: #7c2410;
  --navy:      #24364a;
  --brass:     #a07a3e;
  --moss:      #3f4d34;
  --walnut:    #2a1d14;

  --display: "Cormorant Garamond", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --body:    "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand:    "Caveat", "Segoe Script", cursive;
  --mono:    "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --page: min(1120px, calc(100% - 40px));
  --print-border: 14px;
  --shadow: 0 18px 40px rgba(28, 22, 18, .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--walnut);
  background-image: url("textures/walnut.jpg");
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
}
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--rust-deep); text-underline-offset: 3px; }
a:hover { color: var(--rust); }
:focus-visible { outline: 3px solid var(--rust); outline-offset: 3px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 10000;
  background: var(--rust); color: #fff; padding: 12px 18px; font-weight: 700;
}
.skip:focus { left: 0; }

/* book sitting on the table */
.book {
  width: min(1180px, calc(100% - 28px));
  margin: 18px auto 40px;
  background-color: var(--paper);
  background-image:
    linear-gradient(180deg, rgba(239, 228, 207, .78), rgba(232, 219, 193, .82)),
    url("textures/paper.jpg");
  background-size: cover;
  background-position: center top;
  box-shadow:
    0 1px 0 rgba(255,255,255,.35) inset,
    0 40px 80px rgba(0,0,0,.45),
    -18px 0 0 -8px #cbb896;
  border-radius: 2px 10px 10px 2px;
  overflow: clip;
  position: relative;
}
.book::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 18px;
  background: linear-gradient(90deg, rgba(28,22,18,.18), transparent 70%);
  pointer-events: none; z-index: 5;
}

.wrap { width: var(--page); margin-inline: auto; }
.band { padding: clamp(36px, 6vw, 72px) 0; }

/* ------------------------------------------------ nav */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .mark {
  font-family: var(--display); font-weight: 700; font-size: 22px;
  letter-spacing: -.02em; text-decoration: none; color: var(--ink);
  margin-right: auto;
  white-space: nowrap; flex: 0 0 auto;
}
.nav .mark em { font-style: italic; color: var(--rust); font-weight: 600; }
.nav a:not(.mark) {
  text-decoration: none; color: var(--ink-2);
  min-height: 44px; display: inline-flex; align-items: center;
  padding: 0 12px; font-size: 15px; font-weight: 600;
}
.nav a:hover { color: var(--rust); }
.nav a.is-on { color: var(--rust); }

/* ------------------------------------------------ type */
.kicker {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--rust); font-weight: 500; margin: 0 0 12px;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; margin: 0; }
.lede { color: var(--ink-2); max-width: 38em; }
.muted { color: var(--muted); }

/* ------------------------------------------------ cover */
.cover {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 28px;
  align-items: center;
  padding: clamp(28px, 5vw, 56px) clamp(22px, 4vw, 56px) 20px;
  min-height: min(78vh, 680px);
}
.cover .fifty {
  font-family: var(--display);
  font-size: clamp(64px, 11vw, 112px);
  line-height: .86;
  letter-spacing: -.06em;
  color: var(--rust);
  margin: 0 0 4px;
  font-weight: 700;
  text-shadow: 1px 1px 0 rgba(255,255,255,.35);
}
.cover h1 {
  font-size: clamp(36px, 5vw, 58px);
  line-height: .95;
  margin: 0 0 14px;
}
.cover h1 span { display: block; font-style: italic; font-weight: 500; color: var(--ink-2); font-size: .62em; }
.cover .when {
  font-family: var(--mono); font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 22px;
}
.cover .lede { margin: 0 0 26px; font-size: 18px; }

.stamp {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 118px; height: 118px;
  border: 3px solid var(--rust);
  border-radius: 50%;
  color: var(--rust);
  transform: rotate(-11deg);
  font-family: var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--paper) 70%, transparent);
}
.stamp b { font-size: 28px; letter-spacing: 0; font-family: var(--display); line-height: 1; }
.stamp small { font-size: 10px; }

.print {
  background: #f7f2ea;
  padding: var(--print-border);
  padding-bottom: calc(var(--print-border) + 28px);
  box-shadow: var(--shadow);
  transform: rotate(2.2deg);
  position: relative;
}
.print.film { background: #faf6ee; }
.print img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover;
  filter: contrast(1.04) saturate(.92);
}
.print.film img { filter: contrast(.95) sepia(.18) saturate(.85); }
.print figcaption {
  position: absolute; left: 0; right: 0; bottom: 8px;
  font-family: var(--hand); font-size: 22px; text-align: center;
  color: var(--navy);
}
.cover .print { max-width: 460px; margin-left: auto; }

/* ------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 22px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-weight: 650; font-size: 16px;
  text-decoration: none;
  border-radius: 2px;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--rust); border-color: var(--rust); color: #fff7ee; }
.btn.primary:hover { background: var(--rust-deep); border-color: var(--rust-deep); color: #fff; }
.btn.ghost { border-color: var(--line); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------ decade rail */
.decade-bar {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 14px;
  scrollbar-width: none;
}
.decade-bar::-webkit-scrollbar { display: none; }
.decade-bar button {
  flex: 0 0 auto;
  min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--line); background: transparent;
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase;
}
.decade-bar button[aria-pressed="true"] {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}

.reel {
  display: flex; gap: 22px; overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 10px 4px 28px;
  scrollbar-width: thin;
}
.reel::-webkit-scrollbar { height: 8px; }
.reel::-webkit-scrollbar-thumb { background: rgba(28,22,18,.25); }
.reel .print {
  flex: 0 0 min(72vw, 340px);
  scroll-snap-align: start;
  cursor: pointer; border: 0; padding: 0; background: transparent;
  text-align: left;
}
.reel .print .frame {
  background: #f7f2ea;
  padding: 12px 12px 36px;
  box-shadow: var(--shadow);
}
.reel .print img { width: 100%; height: 380px; object-fit: cover; }
.reel .print:nth-child(even) { transform: rotate(-1.4deg); }
.reel .print:nth-child(3n) { transform: rotate(1.8deg); }

/* ------------------------------------------------ composer */
.composer-card {
  background: var(--linen);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 40px);
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(36, 54, 74, .08) 32px
    );
  background-position: 0 92px;
}
.composer-card h2 { font-size: clamp(32px, 5vw, 48px); margin-bottom: 6px; }
.prompt-line {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  margin: 18px 0 10px; font-family: var(--mono); font-size: 13px; color: var(--navy);
}
.prompt-next {
  border: 0; background: none; color: var(--rust); min-height: 44px; font-weight: 600;
}
.cx-text, .cx-name, .cx-email, .gate input, .replybox textarea, .helper textarea, .settings input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  padding: 12px 2px;
  font-size: 20px; /* iOS will not zoom */
  resize: vertical;
}
.cx-text { min-height: 140px; line-height: 32px; }
.cx-note, .cx-email-wrap small { font-size: 14px; color: var(--muted); }
.cx-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.cx-prev { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.cx-prev figure { margin: 0; position: relative; width: 72px; height: 72px; }
.cx-prev img { width: 100%; height: 100%; object-fit: cover; }
.cx-prev button {
  position: absolute; top: -6px; right: -6px; width: 28px; height: 28px;
  border-radius: 50%; border: 0; background: var(--ink); color: #fff;
}
.cx-name-sheet h3, .cx-thanks h3 { font-size: 32px; margin-bottom: 12px; }
.cx-tick {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--moss); color: #fff;
  display: grid; place-items: center; font-size: 24px; margin-bottom: 10px;
}
.composer-card.hot { outline: 3px dashed var(--rust); }

/* ------------------------------------------------ toasts */
.toasts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  align-items: start;
}
.toast-card {
  background: #f3ead8;
  border: 1px solid var(--line);
  padding: 22px 20px 18px;
  box-shadow: 0 10px 24px rgba(28,22,18,.12);
  min-height: 160px;
}
.toast-card:nth-child(3n) { background: #f7f0e2; transform: rotate(-.8deg); }
.toast-card:nth-child(4n) { background: #eadfc8; transform: rotate(1.1deg); }
.toast-card .who {
  font-family: var(--hand); font-size: 26px; color: var(--navy); margin-bottom: 8px;
}
.toast-card .txt { white-space: pre-wrap; font-size: 16.5px; }
.toast-card .when { margin-top: 14px; font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.toast-card .reply {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-style: italic; color: var(--ink-2);
}
.toast-card img { width: 100%; height: 120px; object-fit: cover; margin: 10px 0; cursor: pointer; }

/* ------------------------------------------------ sheet of prints */
.sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px 14px;
}
.sheet button {
  border: 0; background: #f7f2ea; padding: 8px 8px 28px;
  box-shadow: var(--shadow); cursor: pointer; text-align: left;
}
.sheet button img { width: 100%; height: 160px; object-fit: cover; }
.sheet button.film img { filter: contrast(.95) sepia(.16) saturate(.86); }
.sheet button span {
  display: block; margin-top: 8px;
  font-family: var(--hand); font-size: 18px; color: var(--navy); text-align: center;
}

/* ------------------------------------------------ qr card */
.scan {
  display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center;
  background: var(--linen);
  border: 1px solid var(--line);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}
.scan .qr { background: #fff; padding: 10px; }
.scan h3 { font-size: 28px; }
.scan code { font-family: var(--mono); font-size: 13px; color: var(--rust); word-break: break-all; }

.stats { display: flex; gap: 36px; flex-wrap: wrap; }
.stats b {
  display: block; font-family: var(--display); font-size: 44px; line-height: 1; color: var(--rust);
}
.stats span { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

footer.site {
  padding: 28px 22px 40px; text-align: center;
  color: var(--muted); font-size: 14px;
  border-top: 1px solid var(--line);
}
footer.site nav { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
footer.site a { text-decoration: none; font-weight: 600; color: var(--ink-2); }

/* ------------------------------------------------ lightbox */
.lb {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(28, 22, 18, .92);
  display: none; color: #f6eee0;
}
.lb.on { display: grid; place-items: center; padding: 24px; }
.lb img { max-width: min(92vw, 1100px); max-height: 78vh; object-fit: contain; box-shadow: 0 20px 60px #000; }
.lb .cap { margin-top: 14px; text-align: center; font-family: var(--display); font-size: 22px; }
.lb .x, .lb .navbtn {
  position: absolute; border: 0; background: transparent; color: #fff;
  min-width: 52px; min-height: 52px; font-size: 28px;
}
.lb .x { top: 12px; right: 16px; }
.lb .prev { left: 8px; top: 50%; }
.lb .next { right: 8px; top: 50%; }

/* toast notice */
.notice {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 12px 18px; z-index: 90; font-size: 15px;
  box-shadow: var(--shadow);
}

/* ------------------------------------------------ album page */
body.album {
  background: #120e0b;
}
body.album .book { display: none; }
.chapters { height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory; }
.chapter {
  height: 100dvh; scroll-snap-align: start;
  display: grid; grid-template-columns: 140px 1fr;
  position: relative; color: #f6eee0;
}
.chapter .year {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--display); font-size: clamp(48px, 10vw, 92px);
  font-weight: 700; color: #b33a1a; padding: 40px 10px;
  display: grid; place-items: center;
}
.chapter .shot {
  position: relative; overflow: hidden;
}
.chapter .shot img {
  width: 100%; height: 100%; object-fit: cover;
}
.chapter .shot.film img { filter: contrast(.96) sepia(.12) saturate(.88); }
.chapter .meta {
  position: absolute; left: 24px; right: 24px; bottom: 28px;
  max-width: 520px;
  background: color-mix(in srgb, #1c1612 55%, transparent);
  padding: 16px 18px;
  backdrop-filter: blur(8px);
}
.chapter .meta .kicker { color: #e8c9a0; }
.chapter .meta h2 { font-size: clamp(28px, 4vw, 44px); }
.album-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; gap: 8px; padding: 12px 16px;
  background: linear-gradient(#120e0b, transparent);
}
.album-nav a, .album-nav button {
  color: #f6eee0; text-decoration: none; border: 1px solid rgba(246,238,224,.25);
  background: transparent; min-height: 44px; padding: 0 14px;
  font-size: 14px; font-weight: 600;
}

/* ------------------------------------------------ night / TV */
body.night { background: #0b0908; color: #f6eee0; overflow: hidden; }
.stage { position: fixed; inset: 0; }
.stage img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 1.1s ease;
  transform: scale(1.08);
  animation: ken 14s linear forwards;
}
.stage img.on { opacity: 1; }
@keyframes ken {
  from { transform: scale(1.08) translate3d(0,0,0); }
  to   { transform: scale(1.18) translate3d(-1.5%, -1%, 0); }
}
.lower {
  position: fixed; left: 40px; right: 40px; bottom: 48px; z-index: 3;
  max-width: 720px;
}
.lower .yr { font-family: var(--mono); letter-spacing: .2em; text-transform: uppercase; color: #e0b57a; font-size: 13px; }
.lower h2 { font-family: var(--display); font-size: clamp(32px, 5vw, 64px); margin: 4px 0 8px; }
.lower .story {
  font-size: 20px; max-width: 40em;
  background: color-mix(in srgb, #0b0908 50%, transparent);
  padding: 14px 16px; backdrop-filter: blur(6px);
}
.hud {
  position: fixed; top: 16px; right: 18px; z-index: 4;
  display: flex; gap: 8px;
}
.hud .btn {
  color: #f6eee0;
  border-color: rgba(246,238,224,.35);
  min-height: 44px;
  background: rgba(11, 9, 8, .55);
  backdrop-filter: blur(8px);
}
.progress {
  position: fixed; left: 0; right: 0; top: 0; height: 3px; background: rgba(255,255,255,.15); z-index: 5;
}
.progress > i { display: block; height: 100%; width: 0; background: var(--rust); }

/* ------------------------------------------------ print cards */
body.print-page { background: #ddd3c2; }
.print-tools {
  max-width: 860px; margin: 20px auto; padding: 18px;
  background: var(--paper);
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; padding: 18px; }
.pcard {
  background: #fff; padding: 22px; min-height: 280px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  border: 1px solid #ddd;
}
.pcard h2 { font-size: 28px; }
.pcard .qr { width: 168px; height: 168px; }
@media print {
  .print-tools, .nav, .skip { display: none !important; }
  body.print-page { background: #fff; }
  .cards { padding: 0; }
  .pcard { break-inside: avoid; }
}

/* ------------------------------------------------ admin */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-box {
  width: min(420px, 100%);
  background: var(--paper);
  background-image:
    linear-gradient(180deg, rgba(239, 228, 207, .7), rgba(239, 228, 207, .75)),
    url("textures/paper.jpg");
  background-size: cover;
  padding: 36px 28px; text-align: center; box-shadow: var(--shadow);
}
.gate-box h1 { font-size: 40px; margin-bottom: 8px; }
.gate-box .btn { width: 100%; margin-top: 12px; }
.desk { display: none; }
.desk.on { display: block; }
.bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: color-mix(in srgb, var(--paper) 90%, transparent);
  z-index: 20;
}
.bar h1 { font-size: 26px; flex: 1; }
.tabs { display: flex; gap: 8px; padding: 16px 18px 0; flex-wrap: wrap; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.panel { display: none; padding: 18px; }
.panel.on { display: block; }
.acard {
  background: var(--linen); border: 1px solid var(--line);
  padding: 16px 18px; margin: 0 auto 12px; max-width: 860px;
}
.acard.is-hidden { opacity: .5; }
.acard .head { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.acard .head b { color: var(--rust); text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.mailpill { font-size: 13px; color: var(--navy); border: 1px solid var(--line); padding: 2px 10px; border-radius: 999px; text-decoration: none; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.photo-grid figure { margin: 0; background: #f7f2ea; padding: 6px; }
.photo-grid img { width: 100%; height: 130px; object-fit: cover; cursor: pointer; }

/* ------------------------------------------------ mobile */
@media (max-width: 860px) {
  body { background-attachment: scroll; }
  .book { width: 100%; margin: 0; border-radius: 0; box-shadow: none; }
  .book::before { display: none; }
  .nav { overflow-x: auto; scrollbar-width: none; }
  .nav a:not(.mark) { flex: 0 0 auto; white-space: nowrap; }
  .cover { grid-template-columns: 1fr; min-height: 0; padding-top: 28px; }
  .cover .row { align-items: center; }
  .cover .print { margin: 8px auto 0; transform: rotate(1deg); max-width: 360px; }
  .chapter { grid-template-columns: 1fr; }
  .chapter .year {
    writing-mode: horizontal-tb; transform: none;
    position: absolute; left: 16px; top: 64px; z-index: 2; padding: 0;
    font-size: 56px; text-shadow: 0 2px 16px #000;
  }
  .scan { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .nav a:not(.mark) { padding: 0 8px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stamp { transform: none; }
  .reel .print, .toast-card, .cover .print { transform: none !important; }
  .stage img { animation: none; transform: none; }
}

/* ============================================================
   Production additions: clear public screens + Claude's river,
   translated into the light walnut-and-paper art direction.
   ============================================================ */
.nav .nav-add { color: var(--rust); font-weight: 700; }
.fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; box-shadow: 0 12px 30px rgba(28,22,18,.32); }
.preview-mode { position: relative; z-index: 70; padding: 8px 18px; background: #f4c66f; color: #2a1d14; text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; }
.page-head { padding-top: clamp(54px, 8vw, 94px); padding-bottom: 24px; }
.page-head h1 { font-size: clamp(52px, 9vw, 92px); line-height: .92; margin-bottom: 18px; }
.page-head .lede { font-size: 19px; }
.page-head .stats, .page-head .row { margin-top: 24px; }
.section-title { font-size: clamp(38px, 6vw, 58px); line-height: .98; margin-bottom: 18px; }

.river-band {
  overflow: hidden;
  background: rgba(246, 238, 224, .48);
  border-block: 1px solid var(--line);
}
.river-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; }
.river-heading h2 { font-size: clamp(40px, 6vw, 64px); line-height: .95; }
.river-hint {
  flex: 0 0 auto; font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--rust); border: 1px solid var(--rust);
  padding: 9px 12px; transform: rotate(-2deg);
}
.river { width: 100%; overflow: hidden; cursor: pointer; padding-block: 5px; }
.river-row { width: 100%; overflow: hidden; margin: 12px 0; }
.river-track {
  display: flex; width: max-content; gap: 12px;
  animation: paper-river var(--dur) linear infinite;
  animation-direction: var(--dir);
  will-change: transform;
}
.river.paused .river-track { animation-play-state: paused; }
.river-tile {
  width: calc(var(--tile-h) * 1.34); height: var(--tile-h); flex: 0 0 auto;
  border: 0; background: #faf6ee; padding: 6px 6px 17px;
  box-shadow: 0 7px 18px rgba(28,22,18,.23); transform: rotate(.5deg);
  pointer-events: none;
}
.river.paused .river-tile { pointer-events: auto; }
.river-tile:nth-child(3n) { transform: rotate(-1deg); }
.river-tile img { width: 100%; height: 100%; object-fit: cover; }
.river-tile img.film { filter: contrast(.96) sepia(.16) saturate(.86); }
@keyframes paper-river { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }

.door-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 26px; }
.paper-door {
  min-height: 250px; padding: 24px; color: var(--ink); text-decoration: none;
  background: #f7f0e2; border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .18s ease;
}
.paper-door:nth-child(2) { background: #eadfc8; transform: rotate(-.7deg); }
.paper-door:nth-child(3) { transform: rotate(.7deg); }
.paper-door:hover { color: var(--ink); transform: translateY(-4px); }
.paper-door h3 { font-size: 34px; margin: 18px 0 10px; }
.paper-door p { color: var(--ink-2); }
.door-no { font-family: var(--mono); color: var(--rust); font-size: 12px; letter-spacing: .18em; }

.preview-band { display: grid; grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: center; }
.real-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center; padding: 24px; }
.real-stack .print { margin: 0; }
.real-stack .print:first-child { transform: rotate(-4deg); }
.real-stack .print:last-child { transform: rotate(4deg) translateY(18px); }
.real-stack .print img { aspect-ratio: 1; }
.real-photo img { aspect-ratio: 3/2; }

.paper-callout, .privacy-note {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: var(--linen); border: 1px solid var(--line); padding: 28px 32px;
  box-shadow: var(--shadow);
}
.paper-callout h2, .privacy-note h2 { font-size: 38px; }
.story-wall { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.empty-paper { background: var(--linen); padding: 42px; text-align: center; border: 1px solid var(--line); }
.empty-paper h2 { font-size: 42px; }
.photo-section-head { justify-content: space-between; align-items: end; margin-bottom: 24px; }
.add-head { max-width: 900px; margin-left: max(20px, calc((100% - min(1120px, calc(100% - 40px))) / 2)); }
.open-note { display: inline-block; margin-top: 18px; padding: 8px 12px; border: 1px solid var(--rust); color: var(--rust); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.privacy-note { display: block; max-width: 760px; margin: auto; }

/* Claude app lightbox markup, paper-framed rather than dark-themed. */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none; place-items: center;
  background: rgba(28,22,18,.92); padding: 24px; color: var(--paper);
}
.lightbox.open { display: grid; }
.lightbox figure { margin: 0; max-width: min(92vw, 1120px); text-align: center; }
.lightbox figure img { max-height: 80vh; margin: auto; border: 10px solid #f7f2ea; box-shadow: 0 22px 70px #000; }
.lightbox figcaption { margin-top: 12px; font-family: var(--display); font-size: 23px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); min-width: 52px; min-height: 64px; border: 0; background: rgba(0,0,0,.35); color: #fff; font-size: 46px; }
.lb-prev { left: 8px; }.lb-next { right: 8px; }
.toast { position: fixed; z-index: 110; left: 50%; bottom: 18px; transform: translate(-50%, 120%); background: var(--ink); color: var(--paper); padding: 12px 18px; opacity: 0; transition: .2s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 760px) {
  .door-grid, .preview-band { grid-template-columns: 1fr; }
  .paper-door:nth-child(n) { transform: none; }
  .river-heading { align-items: start; flex-direction: column; }
  .river-row:nth-child(3) { display: none; }
  .real-stack { padding: 8px 22px 32px; }
  .paper-callout { align-items: start; flex-direction: column; }
  .page-head { padding-inline: 20px; }
}
@media (prefers-reduced-motion: reduce) { .river-track { animation: none; } .paper-door { transition: none; } }

/* Full private desk */
.admin-note { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 13px; text-align: left; }
.admin-book { width: min(1280px, calc(100% - 24px)); min-height: calc(100vh - 28px); }
.connection { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--moss); }
.admin-app .stats { padding-block: 24px 4px; }
.admin-intro { max-width: 860px; margin: 0 auto 22px; }
.admin-intro h2 { font-size: clamp(34px, 5vw, 48px); }
.admin-card { max-width: 860px; margin: 0 auto 16px; padding: 22px; background: var(--linen); border: 1px solid var(--line); box-shadow: 0 9px 22px rgba(28,22,18,.1); }
.admin-card.is-hidden, .admin-photo.is-hidden { opacity: .52; border-style: dashed; }
.admin-card-head { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.story-state { color: var(--rust); }
.admin-card label, .admin-photo label, .slot-form label { display: block; margin-top: 16px; font-size: 12px; font-family: var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.admin-card input, .admin-card textarea, .admin-photo input, .slot-form input, .slot-form select { width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--line); background: rgba(255,255,255,.42); font-family: var(--body); font-size: 17px; text-transform: none; letter-spacing: 0; }
.admin-card textarea { min-height: 96px; resize: vertical; }
.admin-card .row, .admin-photo .row { margin-top: 16px; }
.btn.danger { color: #812411; border-color: #812411; }
.btn.danger:hover { background: #812411; color: #fff; }
.admin-photo-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 16px; max-width: 1120px; margin: auto; }
.admin-photo { background: var(--linen); border: 1px solid var(--line); padding: 12px; }
.admin-photo > img { width: 100%; height: 220px; object-fit: cover; }
.admin-photo .btn { min-height: 42px; padding: 8px 11px; font-size: 13px; }
.slot-form { max-width: 680px; margin: 0 auto; background: var(--linen); padding: 24px; border: 1px solid var(--line); }
.slot-form select, .slot-form input { min-height: 50px; }
.slot-form .btn { margin-top: 22px; }
.slot-preview { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; align-items: center; max-width: 900px; margin: 36px auto; }
.slot-preview .print { margin: 0; }
.slot-preview img { aspect-ratio: 4/3; }
.contact-list { max-width: 760px; margin: auto; background: var(--linen); padding: 24px; border: 1px solid var(--line); }
@media (max-width: 700px) { .admin-book { width: 100%; margin: 0; }.bar h1 { flex-basis: 100%; }.slot-preview { grid-template-columns: 1fr; }.admin-photo-grid { grid-template-columns: 1fr; } }
