/* ————————————————————————————————————————————————————————————————
   Emmaus — Night Journal design system
   Ground: near-black. Two semantic inks: slate = structure, ochre = sources.
   Type: Bricolage Grotesque (display) · Source Serif 4 (reading) · IBM Plex Mono (machinery).
   ———————————————————————————————————————————————————————————————— */

:root {
  color-scheme: dark;
  --ground: #0a0a0a;
  --ink-text: #f2efe9;
  --ink-muted: #a39e93;
  --ink-faint: #6e6a61;
  --hairline: #232323;
  --slate: #7e93a8;          /* structure, navigation, the machinery */
  --slate-dim: #46586a;
  --ochre: #c89b5a;          /* sources, receipts, the evidence */
  --ochre-dim: #55452c;
  --paper: #14100e;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--ground);
  color: var(--ink-text);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.72;
  font-weight: 350;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--ochre-dim); color: var(--ink-text); }

:focus-visible { outline: 2px solid var(--slate); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ————— structure ————— */
.shell { max-width: 640px; margin: 0 auto; padding: 0 22px; }
.shell-wide { max-width: 960px; margin: 0 auto; padding: 0 22px; }

/* top bar */
.topbar { border-bottom: 1px solid var(--hairline); }
.topbar-inner {
  max-width: 960px; margin: 0 auto; padding: 18px 22px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
}
.wordmark {
  font-family: var(--display); font-weight: 600; font-size: 17px;
  letter-spacing: 0.01em; text-decoration: none;
}
.topbar-note { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-faint); }
.topbar-note a { text-decoration: none; }
.topbar-note a:hover { color: var(--ink-text); }

/* mono eyebrow with rule */
.eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--slate);
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

/* label */
.lbl {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ————— glosses (slate = structure) ————— */
.gloss { border-left: 2px solid var(--slate); padding: 4px 0 4px 18px; }
.gloss .lbl { color: var(--slate); }
.gloss p { margin-top: 6px; font-size: 14.5px; line-height: 1.6; color: var(--ink-muted); }
.gloss a { color: var(--ink-text); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: var(--slate-dim); }
.gloss a:hover { text-decoration-color: var(--slate); }

/* ————— receipts (ochre = sources) ————— */
.receipt { border-left: 2px solid var(--ochre); padding: 4px 0 4px 18px; }
.receipt .lbl { color: var(--ochre); }
.receipt p { margin-top: 6px; font-style: italic; font-size: 16.5px; color: #e4dccc; }
.receipt .cite {
  margin-top: 10px; font-family: var(--mono); font-size: 12px;
  font-style: normal; color: var(--ink-muted);
}
.receipt .cite a { color: var(--ochre); text-decoration: none;
  border-bottom: 1px solid var(--ochre-dim); }
.receipt .cite a:hover { border-color: var(--ochre); }

/* ————— reading column ————— */
.title {
  font-family: var(--display); font-size: clamp(33px, 7vw, 46px);
  line-height: 1.06; font-weight: 500; letter-spacing: -0.02em;
}
.prose { font-size: 17px; }
.prose p + p { margin-top: 1.1em; }
.prose a { text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--slate-dim); }
.prose a:hover { text-decoration-color: var(--slate); }
.prose em { font-style: italic; }
.prose .inline-src { text-decoration-color: var(--ochre-dim); }
.prose .inline-src:hover { text-decoration-color: var(--ochre); }

/* section heading inside prose */
.subhead {
  margin: 2em 0 0.6em; font-family: var(--display); font-weight: 500;
  font-size: 21px; letter-spacing: -0.01em;
}

/* ————— duotone plates ————— */
/* Ochre lives ONLY on .plate-ink (the image field); the caption sits on the
   page ground, flush left, or it drowns in the ink. */
.plate-ink { background: var(--ochre); }
.plate-ink.slate { background: var(--slate); }
.plate-ink img { filter: grayscale(1) contrast(1.08); mix-blend-mode: multiply; width: 100%; }
.plate-caption { padding-top: 10px; }
.plate-caption .lbl { color: var(--slate); }
.plate-caption .sub { margin-top: 4px; font-style: italic; font-size: 13.5px; color: var(--ink-muted); }

/* ————— shelf (go deeper) ————— */
.shelf { border-top: 1px solid var(--hairline); }
.shelf-item { padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.shelf-item .what { font-size: 15.5px; }
.shelf-item .what a { text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--ochre-dim); }
.shelf-item .what a:hover { text-decoration-color: var(--ochre); }
.shelf-item .who { margin-top: 2px; font-family: var(--mono); font-size: 11.5px;
  color: var(--ink-faint); letter-spacing: 0.04em; }

/* ————— the tutor bar (margin, not destination) ————— */
.ask-bar {
  position: sticky; bottom: 0; background: rgba(10,10,10,0.94);
  border-top: 1px solid var(--hairline);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ask-bar-inner {
  max-width: 640px; margin: 0 auto;
  padding: 13px 22px calc(13px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.ask-bar em { font-style: normal; font-family: var(--display);
  font-weight: 500; font-size: 15px; }
.ask-bar .lbl { color: var(--slate); }
.ask-bar button {
  all: unset; cursor: pointer; font-family: var(--mono); font-size: 11.5px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate);
  border: 1px solid var(--hairline); padding: 8px 14px;
}
.ask-bar button:hover { border-color: var(--slate-dim); color: var(--ink-text); }
.ask-panel { display: none; border-top: 1px solid var(--hairline); }
.ask-panel.open { display: block; }
.ask-panel-inner { max-width: 640px; margin: 0 auto; padding: 18px 22px 22px; }
.ask-panel p { font-size: 14.5px; color: var(--ink-muted); }
.ask-panel .lbl { color: var(--slate); }

/* ————— endings ————— */
.rest { text-align: center; font-style: italic; font-size: 14.5px; color: #8d887d; }

.footer { border-top: 1px solid var(--hairline); }
.footer-inner {
  max-width: 960px; margin: 0 auto; padding: 26px 22px 34px;
  display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between;
  align-items: baseline;
}
.footer .legend { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--ink-faint); }
.footer .legend b { font-weight: 400; }
.footer .legend .s { color: var(--slate); }
.footer .legend .o { color: var(--ochre); }

/* ————— landing: the three doors ————— */
.door {
  display: block; text-decoration: none; border: 1px solid var(--hairline);
  padding: 20px 22px; transition: border-color 120ms ease;
}
.door + .door { margin-top: 12px; }
.door:hover { border-color: var(--slate-dim); }
.door .lbl { color: var(--slate); }
.door h3 { margin-top: 6px; font-family: var(--display); font-weight: 500;
  font-size: 20px; letter-spacing: -0.01em; }
.door p { margin-top: 4px; font-size: 14.5px; color: var(--ink-muted); }
.door .state { margin-top: 8px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.door.waiting:hover { border-color: var(--hairline); cursor: default; }

/* hero */
.hero-name {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(52px, 13vw, 108px); line-height: 0.98; letter-spacing: -0.03em;
}
.hero-sub { margin-top: 14px; font-size: clamp(17px, 2.6vw, 20px); color: var(--ink-muted); }
.hero-verse { border-left: 2px solid var(--ochre); padding: 4px 0 4px 18px; }
.hero-verse p { font-style: italic; font-size: 16.5px; color: #e4dccc; }
.hero-verse .cite { margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--ink-muted); }

/* spacing utility (kept deliberate, not a framework) */
.mt-1 { margin-top: 14px; } .mt-2 { margin-top: 26px; } .mt-3 { margin-top: 40px; }
.mt-4 { margin-top: 64px; } .pb-4 { padding-bottom: 64px; } .pt-3 { padding-top: 40px; }
.pt-4 { padding-top: 64px; }

/* wordmark restructure: title links home; paidagogos links the LSJ entry */
.wordmark a { text-decoration: none; }
.wordmark .wm-sub { color: var(--ink-faint); font-weight: 400; }
.wordmark .pg { text-decoration: underline dotted; text-underline-offset: 3px;
  text-decoration-color: var(--slate-dim); }
.wordmark .pg:hover { text-decoration-color: var(--slate); }
