/* ============================================================
   Eighty. — a book for Phyllis
   Light linen album. Photographs stay large and still.
   Not a craft-store theme. Not four Pinterest boards.
   ============================================================ */

:root {
  /* Phyllis purple — aubergine ink, plum accent, lilac wash, antique gold.
     Classy, never candy. Panda and Deere live in the details, not the paint. */
  --paper:  #f4f0f8;
  --linen:  #faf7fc;
  --ink:    #241b2e;
  --ink-2:  #4a3a58;
  --muted:  #7d6f8a;
  --line:   rgba(46, 32, 60, .14);
  --brick:  #5e3d75;   /* now plum — kept the var name so every rule follows */
  --navy:   #3a2b4a;   /* now aubergine */
  --stone:  #e3dced;   /* now lilac stone */

  --display: "Newsreader", "Palatino Linotype", Palatino, Georgia, 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));
  --shadow: 0 18px 40px rgba(26, 29, 36, .12);
}

*, *::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: 20px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--stone);
}
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brick); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--brick); outline-offset: 3px; }

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

.book {
  width: min(1180px, calc(100% - 24px));
  margin: 16px auto 48px;
  background-color: var(--paper);
  background-image: url("textures/quilt.jpg");
  background-size: 460px;
  background-repeat: repeat;
  box-shadow: 0 30px 70px rgba(26,29,36,.22);
  overflow: clip;
  position: relative;
}

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

.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) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .mark {
  font-family: var(--display); font-weight: 700; font-size: 24px;
  letter-spacing: -.02em; text-decoration: none; color: var(--ink);
  margin-right: auto;
}
.nav .mark em { font-style: italic; color: var(--brick); font-weight: 500; }
.nav a:not(.mark) {
  text-decoration: none; color: var(--ink-2);
  min-height: 48px; display: inline-flex; align-items: center;
  padding: 0 12px; font-size: 16px; font-weight: 600;
}
.nav a.is-on { color: var(--brick); }

.kicker {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--brick); 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: 36em; }

.cover {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  padding: clamp(28px, 5vw, 56px) clamp(22px, 4vw, 56px) 24px;
  min-height: min(78vh, 680px);
}
.cover .eighty {
  font-family: var(--display);
  font-size: clamp(72px, 12vw, 120px);
  line-height: .82;
  letter-spacing: -.06em;
  color: var(--navy);
  margin: 0 0 6px;
  font-weight: 700;
}
.cover h1 { font-size: clamp(34px, 5vw, 54px); 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 20px;
}
.stamp {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 118px; height: 118px; border: 2px solid var(--navy); border-radius: 50%;
  color: var(--navy); transform: rotate(-8deg);
  font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase;
}
.stamp b { font-size: 28px; letter-spacing: 0; font-family: var(--display); line-height: 1; }
.stamp small { font-size: 10px; }

.print {
  background: #fbfaf6;
  padding: 14px 14px 40px;
  box-shadow: var(--shadow);
  transform: rotate(1.6deg);
  position: relative;
}
.print img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.print.film img { filter: contrast(.97) saturate(.92); }
.print figcaption {
  position: absolute; left: 0; right: 0; bottom: 10px;
  font-family: var(--hand); font-size: 24px; text-align: center; color: var(--navy);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 12px 22px;
  border: 1.5px solid var(--ink); background: transparent;
  color: var(--ink); font-weight: 650; font-size: 17px;
  text-decoration: none; border-radius: 1px;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--brick); border-color: var(--brick); color: #fff8f4; }
.btn.primary:hover { background: #6e2e24; border-color: #6e2e24; color: #fff; }
.btn.ghost { border-color: var(--line); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.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: 48px; padding: 8px 16px;
  border: 1px solid var(--line); background: transparent;
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; 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;
}
.reel .print {
  flex: 0 0 min(70vw, 300px); scroll-snap-align: start;
  cursor: pointer; border: 0; padding: 0; background: transparent; text-align: left;
}
.reel .print .frame { background: #fbfaf6; padding: 12px 12px 36px; box-shadow: var(--shadow); }
.reel .print img { width: 100%; height: 360px; object-fit: cover; aspect-ratio: auto; }
.reel .print:nth-child(even) { transform: rotate(-1.2deg); }

.composer-card {
  background: var(--linen);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 40px);
}
.prompt-line {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  margin: 16px 0 8px; font-family: var(--mono); font-size: 14px; color: var(--navy);
}
.prompt-next { border: 0; background: none; color: var(--brick); min-height: 44px; font-weight: 600; }
.cx-text, .cx-name, .cx-email, .gate input, textarea, .settings input {
  width: 100%; background: transparent; border: 0; border-bottom: 1.5px solid var(--ink);
  padding: 12px 2px; font-size: 20px; resize: vertical;
}
.cx-text { min-height: 150px; line-height: 1.6; }
.cx-note { font-size: 15px; color: var(--muted); }
.cx-hp { position: absolute; left: -9999px; }
.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-tick {
  width: 52px; height: 52px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; margin-bottom: 10px;
}
.composer-card.hot { outline: 3px dashed var(--brick); }

.toasts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px; align-items: start;
}
.toast-card {
  background: #fbfaf6; border: 1px solid var(--line);
  padding: 22px 20px 16px; min-height: 150px;
}
.toast-card .who { font-family: var(--hand); font-size: 28px; color: var(--navy); margin-bottom: 8px; }
.toast-card .txt { white-space: pre-wrap; font-size: 17px; }
.toast-card .when {
  margin-top: 14px; font-family: var(--mono); font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.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 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px 12px;
}
.sheet button {
  border: 0; background: #fbfaf6; padding: 8px 8px 28px;
  box-shadow: var(--shadow); cursor: pointer; text-align: left;
}
.sheet button img { width: 100%; height: 170px; object-fit: cover; }
.sheet button span {
  display: block; margin-top: 8px; font-family: var(--hand);
  font-size: 20px; color: var(--navy); text-align: center;
}

.scan {
  display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center;
  background: var(--linen); border: 1px solid var(--line); padding: 24px 28px;
}
.scan .qr { background: #fff; padding: 10px; }
.scan h3 { font-size: 30px; }
.scan code { font-family: var(--mono); font-size: 13px; color: var(--brick); 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(--brick); }
.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: 15px;
  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); }

.lb {
  position: fixed; inset: 0; z-index: 80; background: rgba(26,29,36,.93);
  display: none; color: #f3eee6;
}
.lb.on { display: grid; place-items: center; padding: 24px; }
.lb img { max-width: min(92vw, 1100px); max-height: 78vh; object-fit: contain; }
.lb .cap { margin-top: 14px; text-align: center; font-family: var(--display); font-size: 24px; }
.lb .x, .lb .navbtn {
  position: absolute; border: 0; background: transparent; color: #fff;
  min-width: 56px; min-height: 56px; font-size: 32px;
}
.lb .x { top: 12px; right: 16px; }
.lb .prev { left: 8px; top: 50%; }
.lb .next { right: 8px; top: 50%; }

.notice {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 14px 18px; z-index: 90;
}

body.album { background: #121418; }
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: 130px 1fr;
  position: relative; color: #f3eee6;
}
.chapter .year {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--display); font-size: clamp(48px, 9vw, 84px);
  font-weight: 700; color: #c4b8a4; 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 .meta {
  position: absolute; left: 24px; right: 24px; bottom: 28px; max-width: 520px;
  background: color-mix(in srgb, #121418 55%, transparent);
  padding: 16px 18px; backdrop-filter: blur(8px);
}
.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(#121418, transparent);
}
.album-nav a, .album-nav button {
  color: #f3eee6; text-decoration: none; border: 1px solid rgba(243,238,230,.25);
  background: transparent; min-height: 48px; padding: 0 14px; font-size: 15px; font-weight: 600;
}

body.night { background: #121418; color: #f3eee6; 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.2s ease; transform: scale(1.06);
  animation: ken 16s linear forwards;
}
.stage img.on { opacity: 1; }
@keyframes ken { to { transform: scale(1.16); } }
.lower { position: fixed; left: 40px; right: 40px; bottom: 48px; max-width: 720px; z-index: 3; }
.lower .yr { font-family: var(--mono); letter-spacing: .2em; text-transform: uppercase; font-size: 13px; color: #c4b8a4; }
.lower h2 { font-family: var(--display); font-size: clamp(32px, 5vw, 64px); margin: 4px 0 8px; }
.lower .story { font-size: 22px; background: rgba(18,20,24,.5); padding: 14px 16px; backdrop-filter: blur(6px); }
.hud { position: fixed; top: 16px; right: 18px; z-index: 4; display: flex; gap: 8px; }
.hud .btn { color: #f3eee6; border-color: rgba(243,238,230,.35); background: rgba(18,20,24,.55); min-height: 48px; }
.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(--brick); }

body.print-page { background: var(--stone); }
.print-tools { max-width: 860px; margin: 20px auto; padding: 22px; 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;
}
@media print {
  .print-tools, .nav, .skip { display: none !important; }
  body.print-page { background: #fff; }
  .pcard { break-inside: avoid; }
}

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--stone); }
.gate-box { width: min(420px, 100%); background: var(--paper); padding: 36px 28px; text-align: center; box-shadow: var(--shadow); }
.desk { display: none; background: var(--paper); min-height: 100vh; }
.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: var(--paper); z-index: 20;
}
.bar h1 { font-size: 28px; flex: 1; }
.tabs { display: flex; gap: 8px; padding: 16px 18px 0; flex-wrap: wrap; }
.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; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.photo-grid figure { margin: 0; background: #fbfaf6; padding: 6px; }
.photo-grid img { width: 100%; height: 130px; object-fit: cover; cursor: pointer; }

@media (max-width: 860px) {
  .book { width: 100%; margin: 0; box-shadow: none; }
  .nav { overflow-x: auto; }
  .nav a:not(.mark) { flex: 0 0 auto; white-space: nowrap; }
  .cover { grid-template-columns: 1fr; min-height: 0; }
  .cover .print { margin: 8px auto 0; max-width: 420px; }
  .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: 52px; text-shadow: 0 2px 16px #000;
  }
  .scan { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stamp, .reel .print, .cover .print { transform: none !important; }
  .stage img { animation: none; transform: none; }
}

/* ============================================================
   The Phyllis seal — line-art panda in a gold double ring
   ============================================================ */
.seal {
  display: block; width: 78px; height: 78px; margin: 0 0 14px;
}
