/* ============================================================
   CARLTON ARCHIVE — "The File Cabinet"
   A manila-folder, rubber-stamp, typewriter design system.
   Light = daylight archive room. Dark = the archive after hours.
   ============================================================ */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: 'Ultra';
  src: url('/assets/fonts/Ultra-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Anton';
  src: url('/assets/fonts/Anton-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Special Elite';
  src: url('/assets/fonts/SpecialElite-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Courier Prime';
  src: url('/assets/fonts/CourierPrime-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Courier Prime';
  src: url('/assets/fonts/CourierPrime-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Courier Prime';
  src: url('/assets/fonts/CourierPrime-400i.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('/assets/fonts/SourceSerif4-400.woff2') format('woff2');
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('/assets/fonts/SourceSerif4-400i.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --f-display: 'Ultra', 'Cooper Black', 'Georgia', serif;
  --f-headline: 'Anton', 'Arial Narrow Bold', sans-serif;
  --f-type: 'Special Elite', 'Courier New', monospace;
  --f-mono: 'Courier Prime', 'Courier New', monospace;
  --f-serif: 'Source Serif 4', Georgia, serif;

  --paper: #EFE5D0;
  --paper-high: #F8F2E2;
  --sheet: #FBF7EB;
  --manila: #E9D9B4;
  --manila-deep: #DECBA0;
  --ink: #241D13;
  --ink-soft: #5D5140;
  --ink-faint: #8B7C64;
  --stamp: #B23A2B;
  --stamp-deep: #8F2E22;
  --ballpoint: #2C4A82;
  --rule: rgba(36, 29, 19, 0.18);
  --rule-strong: rgba(36, 29, 19, 0.4);
  --shadow: rgba(36, 29, 19, 0.16);
  --shadow-deep: rgba(36, 29, 19, 0.3);
  --highlight: #F1DF8F;
  --blend-stamp: multiply;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --paper: #171209;
  --paper-high: #221B10;
  --sheet: #2B2418;
  --manila: #2C2313;
  --manila-deep: #382d19;
  --ink: #EFE4CB;
  --ink-soft: #BBAC8F;
  --ink-faint: #83755A;
  --stamp: #E0563F;
  --stamp-deep: #F06B52;
  --ballpoint: #86A5E0;
  --rule: rgba(239, 228, 203, 0.16);
  --rule-strong: rgba(239, 228, 203, 0.38);
  --shadow: rgba(0, 0, 0, 0.45);
  --shadow-deep: rgba(0, 0, 0, 0.65);
  --highlight: #6d5c20;
  --blend-stamp: screen;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-serif);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}
/* paper grain */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.055'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme='dark'] body::before { mix-blend-mode: screen; opacity: 0.35; }

a { color: var(--ballpoint); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--stamp); }
::selection { background: var(--highlight); color: var(--ink); }
:focus-visible { outline: 2px dashed var(--stamp); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; }
mark { background: var(--highlight); color: var(--ink); padding: 0 2px; border-radius: 2px; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 2; }

/* ---------- Typewriter label utility ---------- */
.tw {
  font-family: var(--f-type);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--rule);
}
.topbar .brand {
  font-family: var(--f-type); font-size: 0.82rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink); text-decoration: none;
}
.topbar .brand:hover { color: var(--stamp); }
.topbar nav { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.topbar nav a { font-family: var(--f-type); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; color: var(--ink-soft); }
.topbar nav a:hover { color: var(--stamp); }
.theme-btn {
  background: none; border: 1px solid var(--rule-strong); color: var(--ink-soft);
  font-family: var(--f-type); font-size: 0.72rem; letter-spacing: 0.1em;
  padding: 4px 10px; cursor: pointer; border-radius: 3px; text-transform: uppercase;
}
.theme-btn:hover { color: var(--stamp); border-color: var(--stamp); }

/* ---------- Stamps ---------- */
.stamp {
  display: inline-block;
  font-family: var(--f-type);
  font-size: 0.82rem;
  line-height: 1; /* Special Elite carries huge descent — kill the line box, center via padding */
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stamp);
  border: 3px double var(--stamp);
  border-radius: 6px;
  padding: 10px 14px 6px;
  transform: rotate(var(--rot, -3deg));
  opacity: 0.92;
  mix-blend-mode: var(--blend-stamp);
  white-space: nowrap;
}
.stamp.small { font-size: 0.62rem; padding: 7px 8px 4px; border-width: 2px; border-style: solid; letter-spacing: 0.12em; }
.stamp.big { font-size: clamp(0.9rem, 2.4vw, 1.35rem); padding: 14px 22px 9px; }

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 7vw, 84px) 0 30px; position: relative; }
.hero .kicker { margin-bottom: 18px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero h1 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.7rem, 9.2vw, 6.8rem);
  line-height: 0.98;
  margin: 0 0 10px;
  letter-spacing: 0.005em;
  text-wrap: balance;
  position: relative;
}
.hero .hero-stamp {
  position: absolute;
  top: clamp(-18px, -2vw, -30px);
  right: clamp(0px, 4vw, 60px);
  --rot: 7deg;
  animation: stamp-in 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) 0.25s both;
}
@keyframes stamp-in {
  from { transform: rotate(var(--rot)) scale(2.4); opacity: 0; }
  60% { opacity: 1; }
  to { transform: rotate(var(--rot)) scale(1); opacity: 0.92; }
}
.hero .lede {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.55;
  max-width: 46ch;
  color: var(--ink-soft);
  margin: 18px 0 26px;
}
.hero .lede strong { color: var(--ink); }
.hero .stats {
  display: flex; flex-wrap: wrap; gap: 10px 26px;
  font-family: var(--f-type); font-size: 0.8rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 10px 2px;
}
.hero .stats b { color: var(--stamp); font-weight: 400; }
.postmark {
  position: absolute; right: 8px; bottom: -8px;
  width: clamp(90px, 12vw, 150px); opacity: 0.5; pointer-events: none;
  color: var(--ink-faint);
  display: block;
}
@media (max-width: 720px) {
  .postmark { display: none; }
  .hero .hero-stamp { position: static; display: inline-block; margin-left: 8px; vertical-align: middle; --rot: -4deg; }
  .search-key { display: none; }
  .topbar { flex-wrap: wrap; }
  .topbar .brand, .theme-btn { white-space: nowrap; }
}

/* ---------- Search drawer ---------- */
.search-zone { position: relative; margin: 30px 0 8px; z-index: 40; }
.search-input-row { position: relative; }
.search-input {
  width: 100%;
  font-family: var(--f-type);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--paper-high);
  border: 1px solid var(--rule-strong);
  border-bottom: 4px solid var(--ink);
  border-radius: 6px 6px 2px 2px;
  padding: 16px 54px 14px 18px;
  box-shadow: 0 2px 0 var(--shadow);
}
.search-input:focus { outline: none; border-bottom-color: var(--stamp); }
.search-input::placeholder { color: var(--ink-faint); }
.search-key {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-family: var(--f-type); font-size: 0.75rem; color: var(--ink-faint);
  border: 1px solid var(--rule-strong); border-bottom-width: 3px;
  border-radius: 4px; padding: 2px 8px; pointer-events: none;
}
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--paper-high);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  box-shadow: 0 18px 40px var(--shadow-deep);
  max-height: min(430px, 60vh); overflow-y: auto;
  display: none;
}
.search-results.open { display: block; }
.search-results .sr {
  display: block; padding: 12px 16px; text-decoration: none; color: var(--ink);
  border-bottom: 1px dashed var(--rule);
}
.search-results .sr:last-child { border-bottom: 0; }
.search-results .sr:hover, .search-results .sr.active { background: var(--manila); }
.sr .sr-title { font-family: var(--f-display); font-size: 1.02rem; line-height: 1.2; }
.sr .sr-meta { font-family: var(--f-type); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--stamp); margin: 2px 0 4px; }
.sr .sr-snip { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.45; }
.search-empty { padding: 16px; font-family: var(--f-type); font-size: 0.8rem; color: var(--ink-faint); letter-spacing: 0.1em; }

/* ---------- Tag chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.chip {
  font-family: var(--f-type); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-soft); background: none;
  border: 1px solid var(--rule-strong); border-radius: 999px;
  padding: 4px 12px 3px; cursor: pointer; text-decoration: none;
}
.chip:hover { color: var(--stamp); border-color: var(--stamp); }
.chip.on { color: var(--paper-high); background: var(--stamp); border-color: var(--stamp); }
.chip[data-count]::after { content: ' ' attr(data-count); color: inherit; opacity: 0.6; }

/* ---------- Volume sections ---------- */
.vol-head { display: flex; align-items: baseline; gap: 16px; margin: 54px 0 6px; flex-wrap: wrap; }
.vol-head h2 {
  font-family: var(--f-headline); font-weight: 400;
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  letter-spacing: 0.05em; text-transform: uppercase; margin: 0;
}
.vol-head .vol-tag { font-family: var(--f-type); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.vol-lede { font-style: italic; color: var(--ink-soft); margin: 0 0 22px; max-width: 60ch; }

/* ---------- Folder index ---------- */
.folders { display: flex; flex-direction: column; gap: 18px; padding: 4px 0 10px; }
.folder {
  position: relative;
  background: var(--manila);
  border: 1px solid var(--rule);
  border-radius: 3px 10px 10px 10px;
  padding: 26px 22px 18px;
  margin-top: 16px;
  text-decoration: none; color: var(--ink);
  box-shadow: 0 2px 0 var(--shadow), 0 10px 24px -18px var(--shadow-deep);
  transform: rotate(var(--lean, 0deg));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 4px 18px;
  align-items: start;
}
.folder:nth-child(odd) { --lean: -0.3deg; }
.folder:nth-child(even) { --lean: 0.25deg; }
.folder:hover {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: 0 4px 0 var(--shadow), 0 22px 34px -18px var(--shadow-deep);
  z-index: 3;
}
.folder::before { /* tab */
  content: '';
  position: absolute; top: -15px; left: 14px;
  width: 148px; height: 16px;
  background: var(--manila-deep);
  border: 1px solid var(--rule);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}
.folder .fileno {
  position: absolute; top: -14px; left: 26px;
  font-family: var(--f-type); font-size: 0.66rem; letter-spacing: 0.22em;
  color: var(--ink-soft); line-height: 15px; text-transform: uppercase;
}
.folder h3 {
  grid-column: 2; grid-row: 1;
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  line-height: 1.14; margin: 0;
  text-wrap: balance;
}
.folder:hover h3 { color: var(--stamp-deep); }
.folder .f-no {
  grid-column: 1; grid-row: 1 / span 2;
  font-family: var(--f-headline); font-size: 2rem; line-height: 1;
  color: var(--ink-faint); opacity: 0.65;
  padding-top: 2px;
}
.folder .f-sum { grid-column: 2; margin: 6px 0 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.5; max-width: 62ch; }
.folder .f-meta {
  grid-column: 3; grid-row: 1 / span 2; justify-self: end;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  font-family: var(--f-type); font-size: 0.66rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); text-align: right;
}
.folder .f-tags { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.folder .f-tags .t {
  font-family: var(--f-type); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--rule-strong); border-radius: 999px; padding: 2px 9px 1px; color: var(--ink-soft);
}
.folder .read-stamp { --rot: -6deg; }
@media (max-width: 720px) {
  .folder { grid-template-columns: 1fr; padding: 24px 16px 16px; }
  .folder .f-no { display: none; }
  .folder h3, .folder .f-sum, .folder .f-tags { grid-column: 1; }
  .folder .f-meta { grid-column: 1; grid-row: auto; justify-self: start; flex-direction: row; gap: 12px; margin-top: 10px; text-align: left; }
}

/* ---------- Piece page ---------- */
.file-head { margin: 34px 0 8px; position: relative; }
.file-head .crumbs { margin-bottom: 22px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.file-head .crumbs a { font-family: var(--f-type); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; }
.file-head h1 {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(1.9rem, 5.4vw, 3.6rem);
  line-height: 1.04; margin: 8px 0 14px; text-wrap: balance;
}
.file-head .stamps { position: relative; display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0 8px; }
.file-head .meta-row {
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  font-family: var(--f-type); font-size: 0.74rem; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--ink-faint);
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 9px 2px; margin-top: 18px;
}

/* sticky action bar */
.actionbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
  padding: 8px 0;
  margin-top: 10px;
}
.actionbar .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.abtn {
  font-family: var(--f-type); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--paper-high); color: var(--ink-soft);
  border: 1px solid var(--rule-strong); border-radius: 4px;
  padding: 7px 12px 5px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
}
.abtn:hover { color: var(--stamp); border-color: var(--stamp); }
.abtn.on { background: var(--stamp); border-color: var(--stamp); color: #FBF7EB; }
.abtn .glyph { font-size: 0.85rem; line-height: 1; }
.spacer { flex: 1; }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; background: var(--stamp); width: 0%; }

/* view toggle: folder tabs */
.viewtoggle { display: inline-flex; }
.viewtoggle button {
  font-family: var(--f-type); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid var(--rule-strong); background: var(--paper-high); color: var(--ink-faint);
  padding: 7px 14px 5px; cursor: pointer;
}
.viewtoggle button:first-child { border-radius: 6px 0 0 6px; border-right: none; }
.viewtoggle button:last-child { border-radius: 0 6px 6px 0; }
.viewtoggle button.on { background: var(--ink); color: var(--paper-high); border-color: var(--ink); }
:root[data-theme='dark'] .viewtoggle button.on { background: var(--ink); color: var(--paper); }

/* section labels */
.seclabel {
  display: flex; align-items: center; gap: 14px;
  margin: 44px 0 20px;
}
.seclabel span { font-family: var(--f-type); font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--stamp); white-space: nowrap; }
.seclabel::after { content: ''; height: 1px; background: var(--rule-strong); flex: 1; }

/* commentary prose */
.commentary { max-width: 68ch; margin: 0 auto; font-size: 1.13rem; line-height: 1.75; }
.commentary > p:first-of-type::first-letter {
  font-family: var(--f-display);
  font-size: 3.4em; line-height: 0.8;
  float: left; padding: 8px 10px 0 0;
  color: var(--stamp);
}
.commentary strong { font-weight: 700; }
.commentary .note { color: var(--ballpoint); font-style: italic; }

/* letter view (typed) */
.letterwrap { margin: 8px 0 30px; }
.letter {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 2px 0 var(--shadow), 0 16px 40px -24px var(--shadow-deep);
  padding: clamp(22px, 5vw, 64px);
  max-width: 780px; margin: 0 auto;
  font-family: var(--f-mono);
  font-size: 0.97rem; line-height: 1.72;
}
.letter p { margin: 0 0 1.1em; }
/* letter headings are h2-h4 (page h1 is the piece title) */
.letter h2 {
  font-family: var(--f-headline); font-weight: 400;
  font-size: clamp(1.5rem, 4.4vw, 2.5rem);
  line-height: 1.12; text-align: center;
  margin: 0.4em 0 0.7em; letter-spacing: 0.01em;
}
.letter h3 {
  font-family: var(--f-headline); font-weight: 400;
  font-size: clamp(1.15rem, 3vw, 1.6rem); line-height: 1.2;
  text-align: center; margin: 1.4em 0 0.7em;
}
.letter h4 { font-family: var(--f-mono); font-weight: 700; font-size: 1.02rem; text-align: center; margin: 1.4em 0 0.6em; }
.letter ul { padding-left: 1.4em; margin: 0 0 1.2em; }
.letter li { margin: 0 0 0.7em; }
.letter u { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.letter .note { color: var(--ballpoint); font-style: italic; }
.letter .eyebrow { text-align: center; font-style: italic; }
.pagemark {
  display: flex; align-items: center; gap: 12px;
  margin: 2.2em 0;
  font-family: var(--f-type); font-size: 0.66rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-faint);
}
.pagemark::before, .pagemark::after { content: ''; height: 1px; background: var(--rule); flex: 1; }
.pagemark a { color: var(--ink-faint); text-decoration: none; border-bottom: 1px dashed var(--rule-strong); }
.pagemark a:hover { color: var(--stamp); }

/* scan view */
.scans { display: none; flex-direction: column; gap: 26px; max-width: 780px; margin: 0 auto; }
.scans.on { display: flex; }
.letterwrap.scanmode .letter { display: none; }
.scanpage { margin: 0; }
.scanpage img {
  width: 100%; display: block;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: 0 2px 0 var(--shadow), 0 18px 44px -26px var(--shadow-deep);
}
:root[data-theme='dark'] .scanpage img { filter: brightness(0.94); }
.scanpage figcaption {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  font-family: var(--f-type); font-size: 0.66rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint);
  padding: 8px 2px 0;
}
.scanpage figcaption .swap { cursor: pointer; background: none; border: none; font: inherit; color: var(--ink-faint); letter-spacing: inherit; text-transform: inherit; border-bottom: 1px dashed var(--rule-strong); padding: 0; }
.scanpage figcaption .swap:hover { color: var(--stamp); }
.scanpage .prov { color: var(--ink-faint); }
.scanpage .prov.restored { color: var(--stamp); }

/* prev / next */
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 54px 0 30px; }
.pn a {
  text-decoration: none; color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: 8px;
  background: var(--manila);
  padding: 16px 18px;
}
.pn a:hover { border-color: var(--stamp); }
.pn .dir { font-family: var(--f-type); font-size: 0.64rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint); display: block; margin-bottom: 6px; }
.pn .t { font-family: var(--f-display); font-size: 1.05rem; line-height: 1.2; }
.pn a.next { text-align: right; }
@media (max-width: 600px) { .pn { grid-template-columns: 1fr; } }

/* ---------- Static prose pages (intro/about) ---------- */
.prose { max-width: 68ch; font-size: 1.1rem; line-height: 1.75; margin: 26px auto 60px; }
.prose h2 { font-family: var(--f-display); font-weight: 400; font-size: 1.6rem; margin: 1.8em 0 0.6em; }
.prose .note { color: var(--ballpoint); font-style: italic; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--stamp); font-style: italic; color: var(--ink-soft); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper-high);
  font-family: var(--f-type); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 12px 20px 10px; border-radius: 4px;
  box-shadow: 0 14px 34px var(--shadow-deep);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Lightbox ---------- */
dialog.lightbox {
  border: none; border-radius: 6px; padding: 0;
  background: var(--paper-high);
  max-width: min(96vw, 1100px); width: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
dialog.lightbox::backdrop { background: rgba(12, 9, 5, 0.72); backdrop-filter: blur(3px); }
dialog.lightbox img { display: block; max-width: 100%; max-height: 86vh; width: auto; margin: 0 auto; }
dialog.lightbox .lb-bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-top: 1px solid var(--rule); }
dialog.lightbox .lb-bar span { font-family: var(--f-type); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
dialog.lightbox .lb-bar button { margin-left: auto; }

/* ---------- Flagged row (home) ---------- */
.flagged { margin: 26px 0 0; display: none; }
.flagged.has { display: block; }
.flagged .tw { display: block; margin-bottom: 10px; }

/* ---------- Footer ---------- */
footer.site {
  margin-top: 90px;
  border-top: 1px solid var(--rule-strong);
  padding: 30px 0 60px;
  font-family: var(--f-type); font-size: 0.72rem; letter-spacing: 0.1em;
  color: var(--ink-faint); text-transform: uppercase;
}
footer.site .cols { display: flex; flex-wrap: wrap; gap: 14px 40px; align-items: baseline; }
footer.site a { color: var(--ink-soft); }
footer.site a:hover { color: var(--stamp); }

/* ---------- Hot List popup ---------- */
.popup-backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(14, 10, 6, 0.55);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.popup-backdrop.open { opacity: 1; pointer-events: auto; }
.popup {
  position: relative;
  background: var(--manila);
  border: 1px solid var(--rule-strong);
  border-radius: 4px 12px 12px 12px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  max-width: 460px; width: 100%;
  padding: 30px 30px 24px;
  transform: rotate(-0.8deg) translateY(14px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.popup-backdrop.open .popup { transform: rotate(-0.8deg); }
.popup::before { /* folder tab */
  content: 'HOT LIST';
  position: absolute; top: -15px; left: 14px;
  font-family: var(--f-type); font-size: 0.62rem; letter-spacing: 0.22em;
  color: var(--ink-soft);
  background: var(--manila-deep);
  border: 1px solid var(--rule); border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 2px 16px 0; height: 14px; line-height: 13px;
}
.popup-x {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; line-height: 1; color: var(--ink-faint);
  padding: 6px;
}
.popup-x:hover { color: var(--stamp); }
.popup .popup-eyebrow { display: block; color: var(--stamp); margin-bottom: 8px; }
.popup h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.7rem; margin: 0 0 10px; line-height: 1.1; }
.popup p { margin: 0 0 18px; color: var(--ink-soft); font-size: 1rem; line-height: 1.55; }
.popup form { display: flex; gap: 10px; }
.popup input[type='email'] {
  flex: 1; min-width: 0;
  font-family: var(--f-mono); font-size: 0.95rem;
  color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule-strong); border-bottom: 3px solid var(--ink);
  border-radius: 5px 5px 2px 2px;
  padding: 11px 12px 9px;
}
.popup input[type='email']:focus { outline: none; border-bottom-color: var(--stamp); }
.popup button[type='submit'] {
  font-family: var(--f-type); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--stamp); color: #FBF7EB;
  border: none; border-radius: 5px;
  padding: 11px 20px 9px; cursor: pointer; white-space: nowrap;
}
.popup button[type='submit']:hover { background: var(--stamp-deep); }
.popup button[type='submit']:disabled { opacity: 0.6; cursor: wait; }
.popup .popup-fine { display: block; margin-top: 12px; font-size: 0.62rem; color: var(--ink-faint); }
.popup .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.popup .popup-done { text-align: center; padding: 18px 0 10px; }
.popup .popup-done .stamp { --rot: -5deg; font-size: 1rem; }
.popup .popup-done p { margin-top: 18px; }
@media (max-width: 520px) { .popup form { flex-direction: column; } .popup button[type='submit'] { padding: 13px; } }

/* ---------- Load-in ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 0.5s ease both; }
.rise-1 { animation-delay: 0.05s; } .rise-2 { animation-delay: 0.12s; } .rise-3 { animation-delay: 0.2s; }
