/* The Undertaker’s Diary — ink-navy night, aged paper, iron-gall ink, mourning lilac and mulberry wax.
   Tokens first; then the journal components (.j-*) that only build-journal.mjs emits. */
:root {
  --bg: #0e1220;
  --bg-rgb: 14, 18, 32;
  --bg-2: #141a2c;
  --panel: #1a2136;
  --panel-2: #222a42;
  --footer-bg: #0a0d18;
  --line: rgba(216, 203, 239, 0.14);
  --text: #f0e8d8;
  --muted: #bdb6cc;
  --dim: #8c88a0;
  --red: #8c1d40;
  --red-deep: #6e1531;
  --ochre: #b7a3d9;
  --ochre-soft: #d8cbef;
  --gum: #b49a5e;
  --paper: #efe4cc;
  --paper-ink: #1e2742;
  --display: "Playfair Display SC", Georgia, "Times New Roman", serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --body: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 6px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}
h1, h2, h3, h4 { font-weight: 700; letter-spacing: 0.01em; line-height: 1.1; }
h1 { font-size: clamp(2.1rem, 4.8vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
.btn { font: 700 1.02rem/1 var(--display); letter-spacing: 0.06em; padding: 14px 24px; }
.btn.sm { font-size: .9rem; }
.btn.ghost { border-color: rgba(216, 203, 239, 0.5); }
.brand img { height: 44px; }
.footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
.site-footer .production img { width: 200px; height: auto; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.qa h3, .qa h2 { font-family: var(--display); }

/* ---------- home hero ---------- */
.j-hero { min-height: min(86vh, 780px); }
.j-hero .hero-media img { filter: blur(3px) brightness(.42) saturate(.85); transform: scale(1.03); }
.j-hero .wrap { padding-block: 110px 56px; }
.j-hero .hero-logo { width: min(620px, 86%); margin-bottom: 0; }
.j-hero .presents { margin: 6px 0 28px; }
.j-hero .presents img { width: 240px; opacity: 1; }
.j-hero h1 { font-size: clamp(1.35rem, 2.8vw, 2.1rem); letter-spacing: 0.04em; max-width: 820px; margin-inline: auto; }
.j-band .bg img { opacity: .34; filter: saturate(.8); }

/* ---------- the diary page (paper) ---------- */
.j-page {
  position: relative; color: var(--paper-ink);
  background: var(--paper) url("../img/aged-paper.webp") center / cover no-repeat;
  border-radius: 4px 10px 10px 4px; padding: clamp(26px, 5vw, 56px) clamp(22px, 5vw, 60px) clamp(40px, 6vw, 70px);
  box-shadow: 0 30px 60px rgba(0,0,0,.45), inset 14px 0 18px -14px rgba(60, 40, 20, .45);
}
.j-page p { font: 500 1.5rem/1.75rem var(--hand); margin: 0 0 1.75rem; }
.j-page h2 { color: var(--paper-ink); font-size: clamp(1.6rem, 3vw, 2.2rem); }
.j-page a { color: var(--red); }
.j-page .j-dateline { font: 600 1.75rem/1.75rem var(--hand); color: var(--red); text-align: right; }
.j-page .j-sign { font: 600 2rem/1.75rem var(--hand); text-align: right; margin-right: 110px; }
.j-page .j-seal { position: absolute; right: clamp(10px, 3vw, 30px); bottom: clamp(8px, 2vw, 22px); width: 110px; height: auto; transform: rotate(-12deg); filter: drop-shadow(0 6px 8px rgba(0,0,0,.3)); }
.j-kicker { display: block; font: 600 1.4rem/1 var(--hand); color: var(--red); margin-bottom: 10px; }
.j-hand { font: 500 1.4rem/1.45 var(--hand); color: var(--ochre-soft); }

.j-split { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.j-entry { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
@media (max-width: 900px) { .j-split, .j-entry { grid-template-columns: 1fr; } }

/* ---------- archive ---------- */
.j-archive { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.j-archive li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.j-archive a { display: grid; gap: 4px; text-decoration: none; color: var(--text); }
.j-archive time { font: 600 1.2rem/1 var(--hand); color: var(--ochre); }
.j-archive strong { font: 700 1.25rem/1.25 var(--display); }
.j-archive a:hover strong { color: var(--ochre-soft); }
.j-archive span { display: block; color: var(--muted); font-size: .95rem; margin-top: 4px; }
.j-years { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.j-years a { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; text-decoration: none; font-weight: 700; }
.j-year { margin-bottom: 36px; scroll-margin-top: 90px; }

/* ---------- out-of-character fact boxes ---------- */
.j-box { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--ochre); border-radius: var(--radius); padding: clamp(18px, 3vw, 26px); position: sticky; top: 90px; }
@media (max-width: 900px) { .j-box { position: static; } }
.j-box h2 { font-size: 1.6rem; }
.j-facts { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.j-box .j-facts { background: var(--panel-2); }
.j-facts h3 { margin-bottom: 10px; }
.j-facts dl, .j-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: .93rem; }
.j-facts dt, .j-dl dt { color: var(--dim); font-weight: 700; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; padding-top: 3px; }
.j-facts dd, .j-dl dd { margin: 0; color: var(--text); }
@media (max-width: 480px) { .j-facts dl, .j-dl { grid-template-columns: 1fr; gap: 2px; } .j-facts dd, .j-dl dd { margin-bottom: 8px; } }
.j-tag { display: inline-block; font: 700 .7rem/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--gum); border: 1px solid var(--gum); border-radius: 999px; padding: 5px 9px; vertical-align: middle; }
.j-book { font-size: .9rem; color: var(--muted); margin-top: -6px; }
.j-pager { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 36px; font-weight: 700; }
.j-pager a { text-decoration: none; }

/* ---------- cameos & alter egos ---------- */
.j-cameos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
@media (max-width: 900px) { .j-cameos { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .j-cameos { grid-template-columns: repeat(2, 1fr); } }
.j-cameo { display: grid; justify-items: center; text-align: center; gap: 4px; text-decoration: none; color: var(--text); }
.j-cameo img { width: 100%; max-width: 200px; height: auto; transition: transform .2s ease; }
.j-cameo:hover img { transform: translateY(-4px) rotate(-1deg); }
.j-cameo strong { font: 700 1.05rem/1.2 var(--display); }
.j-cameo span { color: var(--muted); font-size: .85rem; }
.j-ego { display: grid; grid-template-columns: 220px 1fr; gap: clamp(20px, 4vw, 48px); padding-block: 40px; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.j-ego:first-child { padding-top: 0; }
.j-ego > img { width: 100%; height: auto; }
.j-ego h3 { font-size: 1.1rem; margin-top: 20px; color: var(--ochre); }
.j-motto { font: italic 600 1.15rem/1.4 Georgia, serif; color: var(--ochre-soft); }
@media (max-width: 680px) { .j-ego { grid-template-columns: 1fr; } .j-ego > img { max-width: 180px; } }
.j-objects { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
.j-objects img { width: 100%; height: auto; }
.j-objects > div { grid-column: 1 / -1; }
.j-shovel { width: min(420px, 90%); height: auto; margin: 10px 0 20px; transform: rotate(-6deg); }

/* ---------- rooms table ---------- */
.j-table td a { color: var(--ochre-soft); }
.j-table td.num, .j-table th:nth-child(3), .j-table th:nth-child(5), .j-table th:nth-child(6), .j-table th:nth-child(7) { text-align: right; }

/* Scheduled diary entries ship hidden and are revealed by date (see build-journal.mjs). */
[hidden] { display: none !important; }
