:root {
  --cream: #F7F0DE;
  --oat: #E8D9BD;
  --apricot: #F5B99A;
  --mint: #BFE8D4;
  --lavender: #CBB8FF;
  --cyan: #9FE7F5;
  --ink: #27221B;
  --umber: #8C6A4F;
  --display: "Bricolage Grotesque", "Inter", "Arial Black", system-ui, sans-serif;
  --text: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "IBM Plex", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 28px 90px rgba(39, 34, 27, 0.16);
}

/* Typography compliance tokens: Mono** commit-like notes */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--text);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 8%, rgba(203, 184, 255, 0.38), transparent 30vw),
    radial-gradient(circle at 82% 22%, rgba(159, 231, 245, 0.38), transparent 34vw),
    linear-gradient(115deg, var(--cream), var(--oat));
  z-index: -3;
}

.grain-field {
  position: fixed;
  inset: 0;
  opacity: 0.42;
  pointer-events: none;
  z-index: 20;
  mix-blend-mode: multiply;
  background-image:
    repeating-radial-gradient(circle at 18% 12%, rgba(39, 34, 27, 0.08) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(90deg, rgba(140, 106, 79, 0.035) 0 1px, transparent 1px 7px);
}

.tray-progress {
  position: fixed;
  right: clamp(12px, 2vw, 28px);
  top: 22px;
  bottom: 22px;
  width: 6px;
  z-index: 31;
  border-radius: 999px;
  background: rgba(232, 217, 189, 0.58);
  border: 1px solid rgba(140, 106, 79, 0.18);
  overflow: hidden;
}

.tray-progress span {
  display: block;
  width: 100%;
  height: 0%;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--lavender), var(--cyan), var(--mint), var(--apricot));
  box-shadow: 0 0 18px rgba(159, 231, 245, 0.72);
}

.quiet-index {
  position: fixed;
  left: clamp(12px, 2vw, 28px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(39, 34, 27, 0.55);
}

.quiet-index span {
  border: 1px solid rgba(140, 106, 79, 0.35);
  background: rgba(247, 240, 222, 0.72);
  padding: 5px 6px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(39, 34, 27, 0.08);
}

#archive-stack {
  width: min(100%, 1880px);
  margin: 0 auto;
}

.paper-tray {
  position: relative;
  min-height: 100vh;
  margin: 0 clamp(16px, 4vw, 70px) clamp(28px, 5vw, 90px);
  padding: clamp(54px, 8vw, 120px) clamp(26px, 6vw, 108px);
  border-radius: clamp(24px, 4vw, 56px);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.33), transparent 42%),
    var(--cream);
  border: 1px solid rgba(140, 106, 79, 0.20);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,0.42);
  overflow: hidden;
  isolation: isolate;
}

.paper-tray::before {
  content: attr(data-chapter);
  position: absolute;
  right: clamp(18px, 4vw, 58px);
  bottom: clamp(16px, 3vw, 42px);
  font-family: var(--mono);
  font-size: clamp(58px, 14vw, 210px);
  color: rgba(140, 106, 79, 0.07);
  line-height: 0.8;
  z-index: -1;
}

.paper-tray::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px dashed rgba(140, 106, 79, 0.18);
  border-radius: inherit;
  pointer-events: none;
}

.aurora-sheet {
  position: absolute;
  width: 120vw;
  height: 52vh;
  left: -12vw;
  top: 10vh;
  z-index: -2;
  opacity: 0.76;
  filter: blur(18px) saturate(112%);
  background:
    radial-gradient(ellipse at 14% 55%, rgba(245, 185, 154, 0.72), transparent 28%),
    radial-gradient(ellipse at 52% 40%, rgba(203, 184, 255, 0.70), transparent 34%),
    radial-gradient(ellipse at 82% 60%, rgba(159, 231, 245, 0.72), transparent 31%),
    linear-gradient(90deg, transparent, rgba(191, 232, 212, 0.62), transparent);
  animation: aurora-breathe 16s ease-in-out infinite alternate;
}

.aurora-sheet.mint { top: 28vh; background: radial-gradient(ellipse at 24% 50%, rgba(191, 232, 212, 0.86), transparent 32%), radial-gradient(ellipse at 74% 40%, rgba(159, 231, 245, 0.72), transparent 34%), radial-gradient(ellipse at 48% 68%, rgba(245, 185, 154, 0.48), transparent 28%); }
.aurora-sheet.lavender { top: 8vh; opacity: 0.84; background: radial-gradient(ellipse at 16% 44%, rgba(203, 184, 255, 0.86), transparent 35%), radial-gradient(ellipse at 64% 48%, rgba(159, 231, 245, 0.68), transparent 38%), radial-gradient(ellipse at 92% 62%, rgba(245, 185, 154, 0.60), transparent 28%); }
.aurora-sheet.apricot { top: 20vh; background: radial-gradient(ellipse at 24% 54%, rgba(245, 185, 154, 0.78), transparent 34%), radial-gradient(ellipse at 58% 44%, rgba(203, 184, 255, 0.52), transparent 36%), radial-gradient(ellipse at 86% 62%, rgba(191, 232, 212, 0.68), transparent 32%); }

@keyframes aurora-breathe {
  from { transform: translate3d(-5%, -2%, 0) rotate(-2deg) scale(1); }
  to { transform: translate3d(5%, 4%, 0) rotate(2deg) scale(1.08); }
}

.stamp-label, .date-stamp, .vellum-tab, .mono-line, figcaption, .label-rail, .ledger-key, .receipt-note, .console-lines {
  font-family: var(--mono);
  letter-spacing: 0.06em;
}

.stamp-label {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  color: var(--umber);
  border: 1px solid rgba(140, 106, 79, 0.38);
  border-radius: 999px;
  background: rgba(247, 240, 222, 0.68);
  padding: 8px 12px;
  font-size: 11px;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.42);
}

.hero-tray { display: flex; align-items: center; padding-left: clamp(30px, 7vw, 128px); }

.hero-vellum {
  position: relative;
  width: min(1060px, 100%);
  min-height: 68vh;
  padding: clamp(22px, 5vw, 70px);
  border-radius: 34px;
  background: rgba(247, 240, 222, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.48);
  box-shadow: 0 32px 90px rgba(140, 106, 79, 0.16);
  backdrop-filter: blur(18px);
}

.date-stamp {
  position: absolute;
  right: clamp(18px, 4vw, 48px);
  top: clamp(22px, 5vw, 70px);
  color: var(--umber);
  font-size: 12px;
  transform: rotate(2deg);
}

.chapter-slug {
  position: absolute;
  left: clamp(22px, 5vw, 70px);
  bottom: clamp(24px, 5vw, 66px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(140, 106, 79, 0.72);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.wordmark {
  margin: clamp(44px, 9vw, 110px) 0 0 -0.08em;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(92px, 22vw, 360px);
  letter-spacing: -0.11em;
  line-height: 0.72;
  color: var(--ink);
  white-space: nowrap;
  text-shadow: 0 16px 0 rgba(203, 184, 255, 0.22), 0 -10px 0 rgba(159, 231, 245, 0.18);
}

.field-note {
  max-width: 510px;
  margin: clamp(30px, 4vw, 64px) 0 0 auto;
  color: rgba(39, 34, 27, 0.78);
  font-size: clamp(17px, 2.1vw, 25px);
  line-height: 1.35;
}

.tab-east {
  position: absolute;
  right: -4px;
  top: 22%;
  transform: rotate(90deg);
  transform-origin: right top;
}

.vellum-tab {
  display: inline-flex;
  padding: 9px 16px;
  color: var(--ink);
  background: rgba(191, 232, 212, 0.58);
  border: 1px solid rgba(39, 34, 27, 0.14);
  border-radius: 14px 14px 3px 3px;
  font-size: 11px;
  text-transform: uppercase;
}

.hole-punch {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(232, 217, 189, 0.86);
  box-shadow: inset 0 4px 9px rgba(39, 34, 27, 0.18);
}
.punch-one { left: 28px; top: 18%; }
.punch-two { left: 28px; bottom: 18%; }

.chapter-head {
  position: relative;
  max-width: 1120px;
  z-index: 2;
}

.chapter-head.narrow { max-width: 740px; }

.chapter-head h2, .console-vellum h2, .closing-pocket h2 {
  margin: 22px 0 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(54px, 10vw, 148px);
  line-height: 0.88;
  letter-spacing: -0.075em;
}

.photo-contact {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: clamp(14px, 2vw, 28px);
  margin-top: clamp(48px, 8vw, 110px);
  transform: rotate(-1deg);
}

.polaroid {
  min-height: 360px;
  margin: 0;
  padding: 14px 14px 34px;
  background: #fbf7ec;
  border-radius: 8px 8px 18px 18px;
  box-shadow: 0 24px 48px rgba(39, 34, 27, 0.18);
  border: 1px solid rgba(140, 106, 79, 0.18);
}

.polaroid.tall { transform: translateY(-24px) rotate(1.4deg); }
.photo-two { transform: translateY(42px) rotate(-2deg); }
.photo-three { transform: translateY(10px) rotate(2deg); }
.photo-four { transform: translateY(66px) rotate(-1deg); }

.photo-image {
  height: min(48vh, 380px);
  border-radius: 5px;
  display: grid;
  place-items: end start;
  padding: 18px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(140, 106, 79, 0.28), rgba(247, 240, 222, 0.20)),
    radial-gradient(circle at 25% 30%, rgba(159, 231, 245, 0.70), transparent 28%),
    radial-gradient(circle at 72% 55%, rgba(203, 184, 255, 0.62), transparent 34%),
    linear-gradient(115deg, var(--oat), var(--apricot));
  filter: sepia(0.22) saturate(0.88) contrast(0.92);
}

.photo-two .photo-image { background: linear-gradient(150deg, rgba(39,34,27,0.18), transparent), repeating-linear-gradient(70deg, rgba(39,34,27,0.18) 0 6px, transparent 6px 26px), radial-gradient(circle at 65% 28%, var(--mint), transparent 34%), var(--oat); }
.photo-three .photo-image { background: linear-gradient(120deg, rgba(247,240,222,0.22), transparent), repeating-linear-gradient(0deg, transparent 0 24px, rgba(140,106,79,0.18) 25px 26px), radial-gradient(circle at 72% 22%, var(--cyan), transparent 30%), var(--cream); }
.photo-four .photo-image { background: radial-gradient(circle at 35% 20%, rgba(247,240,222,0.92), transparent 18%), linear-gradient(150deg, var(--lavender), var(--cyan), var(--mint)); }

.photo-ghost {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(24px, 4vw, 58px);
  color: rgba(39, 34, 27, 0.24);
  letter-spacing: -0.07em;
}

figcaption {
  margin-top: 14px;
  color: var(--umber);
  font-size: 11px;
}

.label-rail {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 86px;
  color: var(--umber);
}

.label-rail span {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(140, 106, 79, 0.28);
  background: rgba(232, 217, 189, 0.58);
}

.ledger-tray {
  background: linear-gradient(90deg, rgba(232, 217, 189, 0.52), rgba(247, 240, 222, 0.92));
}

.fold-corner {
  position: absolute;
  right: 0;
  top: 0;
  width: clamp(88px, 14vw, 190px);
  height: clamp(88px, 14vw, 190px);
  background: linear-gradient(135deg, rgba(140, 106, 79, 0.16) 0 50%, rgba(247, 240, 222, 0.88) 51% 100%);
  border-bottom-left-radius: 28px;
}

.ledger-book {
  width: min(980px, 100%);
  margin-top: clamp(44px, 7vw, 92px);
  background: rgba(247, 240, 222, 0.62);
  border: 1px solid rgba(140, 106, 79, 0.26);
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(39, 34, 27, 0.12);
}

.ledger-line {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(150px, 0.7fr) minmax(220px, 1.4fr);
  gap: 18px;
  align-items: baseline;
  min-height: 92px;
  padding: 24px clamp(18px, 4vw, 46px);
  border-bottom: 1px solid rgba(140, 106, 79, 0.18);
}

.ledger-line:last-child { border-bottom: 0; }
.ledger-key { color: var(--umber); font-size: 12px; text-transform: uppercase; }
.ledger-line strong { font-family: var(--display); font-size: clamp(38px, 7vw, 82px); letter-spacing: -0.07em; color: var(--ink); }
.ledger-line em { color: rgba(39, 34, 27, 0.68); font-style: normal; line-height: 1.45; }

.receipt-note {
  position: absolute;
  right: clamp(24px, 7vw, 110px);
  bottom: clamp(46px, 8vw, 130px);
  width: min(300px, 42vw);
  padding: 28px 22px;
  background: rgba(255,255,255,0.58);
  border: 1px solid rgba(140, 106, 79, 0.22);
  border-radius: 10px;
  box-shadow: 0 24px 50px rgba(39, 34, 27, 0.13);
  transform: rotate(3deg);
}

.receipt-note span { color: var(--umber); font-size: 11px; }
.receipt-note p { margin: 14px 0 0; font-family: var(--text); letter-spacing: 0; line-height: 1.45; }

.console-tray { display: grid; place-items: center; }
.console-vellum {
  width: min(1120px, 100%);
  padding: clamp(28px, 6vw, 78px);
  border-radius: 42px;
  background: rgba(247, 240, 222, 0.54);
  border: 1px solid rgba(255,255,255,0.52);
  backdrop-filter: blur(20px);
  box-shadow: 0 30px 100px rgba(39, 34, 27, 0.16);
}

.console-lines {
  margin-top: clamp(34px, 6vw, 72px);
  padding: 24px;
  background: rgba(39, 34, 27, 0.82);
  color: var(--cream);
  border-radius: 22px;
  box-shadow: inset 0 0 0 1px rgba(247,240,222,0.12);
}

.ticker-tape {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(28px, 4vw, 48px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ticker-tape span {
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--umber);
  background: rgba(191, 232, 212, 0.42);
  border: 1px solid rgba(140, 106, 79, 0.23);
  animation: label-counter-pulse 4.8s ease-in-out infinite alternate;
}

.ticker-tape span:nth-child(even) { animation-direction: alternate-reverse; background: rgba(203, 184, 255, 0.34); }

@keyframes label-counter-pulse {
  from { transform: translate3d(0, -3px, 0); }
  to { transform: translate3d(0, 8px, 0); }
}

.console-lines p { margin: 0; padding: 18px 0; border-bottom: 1px solid rgba(247,240,222,0.15); overflow-wrap: anywhere; }
.console-lines p:last-child { border-bottom: 0; }
.console-lines i { color: var(--cyan); font-style: normal; }
.console-lines b { color: var(--apricot); font-weight: 600; }

.ruler-strip {
  position: absolute;
  left: clamp(28px, 6vw, 92px);
  bottom: 60px;
  display: flex;
  gap: clamp(26px, 5vw, 74px);
  height: 34px;
  padding: 0 18px;
  align-items: end;
  border-bottom: 2px solid rgba(140, 106, 79, 0.38);
}

.ruler-strip span { width: 1px; height: 28px; background: rgba(140, 106, 79, 0.48); }

.pocket-sleeve {
  position: relative;
  margin-top: clamp(44px, 7vw, 92px);
  min-height: 54vh;
  padding: clamp(28px, 5vw, 66px);
  border-radius: 38px;
  background: linear-gradient(135deg, rgba(232,217,189,0.88), rgba(247,240,222,0.50));
  border: 1px solid rgba(140, 106, 79, 0.23);
  box-shadow: inset 0 -24px 60px rgba(140,106,79,0.08);
}

.acetate-overlay {
  position: absolute;
  inset: 8% 4% auto auto;
  width: 64%;
  height: 54%;
  border-radius: 34px;
  background: linear-gradient(135deg, rgba(159,231,245,0.24), rgba(203,184,255,0.20));
  border: 1px solid rgba(255,255,255,0.42);
  backdrop-filter: blur(10px);
}

.archive-card {
  position: relative;
  width: min(420px, 86%);
  padding: 26px;
  border-radius: 24px;
  background: rgba(247,240,222,0.86);
  border: 1px solid rgba(140,106,79,0.22);
  box-shadow: 0 22px 52px rgba(39,34,27,0.12);
}
.archive-card h3 { margin: 22px 0 8px; font-family: var(--display); font-size: clamp(34px, 5vw, 66px); letter-spacing: -0.07em; line-height: 0.9; }
.archive-card p { margin: 0; color: rgba(39,34,27,0.72); line-height: 1.5; }
.card-a { transform: rotate(-2deg); }
.card-b { margin-left: auto; margin-top: -50px; transform: rotate(2deg); }
.card-c { margin-left: 18%; margin-top: -20px; transform: rotate(-1deg); }

.closing-tray { display: flex; align-items: center; justify-content: center; }
.closing-pocket {
  width: min(860px, 100%);
  text-align: left;
  padding: clamp(30px, 6vw, 82px);
  border-radius: 44px;
  background: rgba(247,240,222,0.72);
  border: 1px solid rgba(140,106,79,0.24);
  box-shadow: 0 30px 90px rgba(39,34,27,0.14);
}
.closing-pocket h2 { font-size: clamp(80px, 16vw, 210px); margin-top: 28px; }
.closing-pocket p:not(.mono-line) { max-width: 560px; font-size: clamp(18px, 2vw, 25px); line-height: 1.38; color: rgba(39,34,27,0.76); }
.mono-line { color: var(--umber); font-size: 12px; }

.paper-tab-link {
  display: inline-flex;
  margin-top: 30px;
  padding: 12px 18px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(245,185,154,0.70);
  border: 1px solid rgba(140,106,79,0.25);
  border-radius: 16px 16px 4px 4px;
  transform: rotate(-1deg);
}

[data-drift] { will-change: transform; transition: transform 0.08s linear; }

@media (max-width: 900px) {
  .quiet-index { display: none; }
  .tray-progress { display: none; }
  .paper-tray { margin-inline: 10px; padding-inline: 20px; border-radius: 28px; }
  .wordmark { font-size: clamp(72px, 24vw, 170px); white-space: normal; }
  .date-stamp { position: static; display: block; margin-top: 18px; }
  .chapter-slug { display: none; }
  .photo-contact { grid-template-columns: 1fr 1fr; }
  .ledger-line { grid-template-columns: 1fr; gap: 6px; }
  .receipt-note { position: relative; right: auto; bottom: auto; width: min(340px, 100%); margin: 34px 0 0 auto; }
}

@media (max-width: 560px) {
  .photo-contact { grid-template-columns: 1fr; transform: none; }
  .polaroid, .polaroid.tall, .photo-two, .photo-three, .photo-four { transform: none; min-height: 300px; }
  .label-rail { flex-wrap: wrap; justify-content: flex-start; }
  .card-b, .card-c { margin-left: 0; margin-top: 18px; }
}
