/* =====================================================================
   StixUngodlyLUS — Investigator's Field Manual
   Theme grounded in Lovecraft's Untold Stories' own menu: carved dark
   frames, gold trim, crimson banner buttons, oil-lantern amber light.
   Author: StixsworldHD (StixsmasterHD4k)
   ===================================================================== */

:root {
  --void: #060807;
  --abyss: #0a0d0b;
  --abyss-2: #0e1210;
  --panel: #16110c;
  --panel-2: #1e1610;
  --panel-3: #251b12;
  --ink: #0d0a07;

  --parchment: #dbcba6;
  --parchment-dim: #a3936f;
  --parchment-bright: #f2e6c6;

  --gold: #8a6c38;
  --gold-bright: #cda355;
  --gold-dim: #55431f;

  --lantern: #e8a63d;
  --lantern-bright: #ffd57e;

  --crimson: #a12b23;
  --crimson-bright: #c8402f;
  --crimson-deep: #5e130e;

  --eldritch: #63bd8a;
  --eldritch-dim: #2c5c42;

  --display: 'Pirata One', 'Georgia', serif;
  --body: 'Alegreya', 'Georgia', serif;
  --mono: 'Courier Prime', 'Courier New', monospace;

  --measure: 66rem;
  --radius: 3px;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.075rem;
  line-height: 1.7;
  color: var(--parchment);
  background:
    radial-gradient(120rem 40rem at 50% -12rem, rgba(232,166,61,.05), transparent 60%),
    radial-gradient(90rem 60rem at 50% 115%, rgba(10,30,20,.55), transparent 65%),
    linear-gradient(var(--abyss), var(--void) 85%);
  background-attachment: fixed;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--lantern); text-decoration-color: var(--gold-dim); text-underline-offset: 3px; }
a:hover { color: var(--lantern-bright); text-decoration-color: var(--gold-bright); }

::selection { background: var(--crimson-deep); color: var(--parchment-bright); }

:focus-visible {
  outline: 2px solid var(--lantern);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--crimson); color: var(--parchment-bright);
  padding: .6rem 1rem; z-index: 100; font-family: var(--mono);
}
.skip-link:focus { left: .5rem; top: .5rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- drifting fog (very subtle, honours reduced motion) ---------- */

.fog {
  position: fixed; inset: 0 0 auto 0; height: 42vh;
  pointer-events: none; z-index: 0; overflow: hidden;
  mask-image: linear-gradient(#000 30%, transparent);
  -webkit-mask-image: linear-gradient(#000 30%, transparent);
}
.fog i {
  position: absolute; top: -18vh; left: -30%;
  width: 160%; height: 60vh; display: block;
  background:
    radial-gradient(38rem 12rem at 22% 55%, rgba(120,140,125,.10), transparent 70%),
    radial-gradient(46rem 14rem at 62% 35%, rgba(100,120,110,.08), transparent 70%),
    radial-gradient(30rem 10rem at 86% 60%, rgba(120,140,125,.07), transparent 70%);
  filter: blur(14px);
  animation: fog-drift 90s linear infinite;
}
.fog i:nth-child(2) {
  animation-duration: 140s;
  animation-direction: reverse;
  opacity: .7;
}
@keyframes fog-drift {
  from { transform: translateX(-6%); }
  50%  { transform: translateX(6%); }
  to   { transform: translateX(-6%); }
}

/* ---------- masthead ---------- */

.masthead { position: relative; z-index: 1; padding: 2.2rem 1rem 0; }

.masthead-inner {
  max-width: var(--measure); margin: 0 auto;
  display: grid; grid-template-columns: 1fr minmax(0, 40rem) 1fr;
  align-items: center; gap: 1rem;
}

.lantern { position: relative; height: 7.5rem; justify-self: center; width: 3rem; }
.lantern::before {                 /* hanging frame */
  content: ""; position: absolute; left: 50%; top: 0;
  transform: translateX(-50%);
  width: 1.7rem; height: 3.4rem; margin-top: 1.1rem;
  border: 2px solid var(--gold-dim);
  border-radius: 3px 3px 6px 6px;
  background: linear-gradient(var(--panel-2), var(--panel));
  box-shadow: 0 -1.1rem 0 -0.68rem var(--gold-dim);   /* hook */
}
.lantern::after {                  /* flame + glow */
  content: ""; position: absolute; left: 50%; top: 2.1rem;
  transform: translateX(-50%);
  width: .55rem; height: 1.15rem; border-radius: 50% 50% 45% 45%;
  background: radial-gradient(circle at 50% 65%, var(--lantern-bright), var(--lantern) 55%, rgba(232,166,61,0) 75%);
  box-shadow:
    0 0 1.1rem .25rem rgba(232,166,61,.55),
    0 0 3.2rem 1.1rem rgba(232,166,61,.22),
    0 0 6.5rem 2.4rem rgba(232,166,61,.10);
  animation: flicker 4.6s ease-in-out infinite;
}
.lantern-right::after { animation-delay: -2.2s; }
@keyframes flicker {
  0%, 100% { opacity: .92; }
  22%      { opacity: 1; }
  47%      { opacity: .8; }
  71%      { opacity: .98; }
  84%      { opacity: .86; }
}

.masthead-plate {
  text-align: center;
  border: 1px solid var(--gold);
  outline: 1px solid var(--gold-dim);
  outline-offset: 4px;
  background:
    linear-gradient(rgba(232,166,61,.045), transparent 45%),
    linear-gradient(var(--panel-2), var(--panel));
  padding: 1.2rem 1.4rem 1.05rem;
  box-shadow: 0 0 0 6px rgba(6,8,7,.65), 0 14px 34px rgba(0,0,0,.55);
}

.masthead-eyebrow {
  margin: 0 0 .3rem;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--parchment-dim);
}
.masthead-title { margin: 0; line-height: 1; }
.masthead-title a {
  font-family: var(--display);
  font-size: clamp(2.5rem, 6vw, 3.6rem);
  color: var(--parchment-bright);
  text-decoration: none;
  text-shadow: 0 0 22px rgba(232,166,61,.30), 0 3px 0 rgba(0,0,0,.7);
}
.masthead-title a:hover { color: #fff; }
.masthead-lus { color: var(--crimson-bright); text-shadow: 0 0 20px rgba(200,64,47,.45), 0 3px 0 rgba(0,0,0,.7); }
.masthead-sub {
  margin: .45rem 0 0;
  font-family: var(--mono); font-size: .78rem;
  color: var(--parchment-dim); letter-spacing: .04em;
}

/* ---------- banner navigation (the game's menu buttons) ---------- */

.banners { max-width: var(--measure); margin: 1.5rem auto 0; }
.banners ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem .6rem;
}
.banner {
  display: inline-flex; align-items: baseline; gap: .45rem;
  font-family: var(--display); font-size: 1.06rem; letter-spacing: .035em;
  color: var(--parchment-bright); text-decoration: none;
  padding: .42rem 1.05rem .5rem;
  background: linear-gradient(#b23327, var(--crimson) 45%, #7e1d15);
  border: 1px solid var(--gold-bright);
  outline: 1px solid var(--gold-dim);
  outline-offset: 2px;
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,220,160,.28), inset 0 -6px 12px rgba(0,0,0,.38), 0 3px 8px rgba(0,0,0,.5);
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.banner-num {
  font-family: var(--mono); font-size: .68rem; font-weight: 700;
  color: var(--lantern-bright); letter-spacing: 0;
  transform: translateY(-1px);
}
.banner:hover {
  filter: brightness(1.14);
  transform: translateY(-1px);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,220,160,.32), inset 0 -6px 12px rgba(0,0,0,.34), 0 5px 14px rgba(0,0,0,.55), 0 0 14px rgba(232,166,61,.25);
}
.banner.is-active {
  background: linear-gradient(#d0492f, var(--crimson-bright) 45%, #8d251a);
  box-shadow: inset 0 1px 0 rgba(255,230,180,.4), inset 0 -6px 12px rgba(0,0,0,.3), 0 0 18px rgba(232,166,61,.35), 0 3px 10px rgba(0,0,0,.55);
}

/* ---------- page & prose ---------- */

.page {
  position: relative; z-index: 1;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.6rem 1rem 3.5rem;
}

.chapter-head { text-align: center; margin: 0 auto 2.4rem; max-width: 46rem; }
.eyebrow {
  margin: 0 0 .4rem;
  font-family: var(--mono); font-size: .74rem;
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--lantern);
}
.chapter-head h1 {
  margin: .1rem 0 .7rem;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08;
  color: var(--parchment-bright);
  text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 0 26px rgba(232,166,61,.14);
}
.lede { margin: 0; font-size: 1.16rem; color: var(--parchment); font-style: italic; }
.lede em, .lede strong { color: var(--parchment-bright); }

h2 {
  font-family: var(--display); font-weight: 400;
  font-size: 1.7rem; line-height: 1.15;
  color: var(--parchment-bright);
  margin: 3rem 0 .9rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--gold-dim);
  position: relative;
}
h2::after {
  content: ""; position: absolute; left: 0; bottom: -3px;
  width: 5.5rem; height: 1px; background: var(--gold-bright);
}
h3 { font-family: var(--body); font-weight: 700; font-size: 1.18rem; color: var(--parchment-bright); margin: 1.9rem 0 .6rem; }
p { margin: 0 0 1.05rem; }
ul, ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
li { margin-bottom: .45rem; }
li::marker { color: var(--gold-bright); }
strong { color: var(--parchment-bright); }
hr { border: 0; border-top: 1px solid var(--gold-dim); margin: 2.6rem 0; }

/* code, paths, keys */

code, kbd, pre { font-family: var(--mono); }
code.path, p code, li code, td code, figcaption code {
  background: var(--panel-2);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: .06rem .4rem;
  font-size: .88em;
  color: var(--lantern-bright);
  white-space: nowrap;
}
kbd {
  display: inline-block;
  background: linear-gradient(var(--panel-3), var(--panel));
  border: 1px solid var(--gold);
  border-bottom-width: 3px;
  border-radius: 4px;
  padding: .02rem .5rem .08rem;
  font-size: .84em; font-weight: 700;
  color: var(--parchment-bright);
  box-shadow: 0 1px 0 rgba(0,0,0,.6);
}
pre {
  background: linear-gradient(var(--panel), var(--ink));
  border: 1px solid var(--gold-dim);
  border-left: 3px solid var(--gold-bright);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  overflow-x: auto;
  font-size: .92rem; line-height: 1.55;
  color: var(--parchment-bright);
  box-shadow: inset 0 0 24px rgba(0,0,0,.5);
  margin: 0 0 1.2rem;
}
pre code { background: none; border: 0; padding: 0; white-space: pre; color: inherit; }
pre .c { color: var(--parchment-dim); }        /* comment lines in listings */
pre .hl { color: var(--lantern-bright); }      /* highlighted names */

/* ---------- seals & install steps ---------- */

.seal {
  width: 3rem; height: 3rem; flex: 0 0 3rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c33a2b, var(--crimson) 55%, var(--crimson-deep));
  border: 1px solid var(--gold-bright);
  outline: 1px solid var(--gold-dim);
  outline-offset: 3px;
  box-shadow: inset 0 2px 4px rgba(255,210,160,.3), inset 0 -4px 8px rgba(0,0,0,.5), 0 3px 10px rgba(0,0,0,.55);
}
.seal span {
  font-family: var(--display); font-size: 1.25rem;
  color: var(--parchment-bright);
  text-shadow: 0 1px 2px rgba(0,0,0,.85);
  transform: translateY(-1px);
}
.seal-lg { width: 3.9rem; height: 3.9rem; margin: 0 auto .9rem; }
.seal-lg span { font-size: 1.7rem; }

.step {
  display: grid; grid-template-columns: 3rem 1fr; gap: 1.15rem;
  margin: 0 0 .4rem; padding: 1.35rem 0 1.15rem;
  position: relative;
}
.step + .step { border-top: 1px dashed var(--gold-dim); }
.step::before {                     /* the rope between seals */
  content: ""; position: absolute; left: 1.45rem; top: 4.6rem; bottom: -.2rem;
  width: 2px; background: linear-gradient(var(--gold-dim), transparent);
}
.step:last-of-type::before { display: none; }
.step-body { min-width: 0; }
.step-title { margin: .35rem 0 .7rem; font-size: 1.24rem; }

/* ---------- callouts ---------- */

.callout {
  display: grid; gap: .15rem;
  margin: 1.4rem 0;
  padding: .95rem 1.15rem 1rem;
  background: linear-gradient(rgba(0,0,0,.22), rgba(0,0,0,.22)), var(--panel);
  border: 1px solid var(--gold-dim);
  border-left-width: 4px;
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.callout-title {
  margin: 0;
  font-family: var(--mono); font-size: .74rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
}
.callout-icon { margin-right: .55rem; }
.callout-body { font-size: 1rem; }
.callout-body p:last-child { margin-bottom: 0; }
.callout-note    { border-left-color: var(--lantern); }
.callout-note    .callout-title { color: var(--lantern); }
.callout-sanity  { border-left-color: var(--eldritch); background: linear-gradient(rgba(44,92,66,.12), rgba(44,92,66,.05)), var(--panel); }
.callout-sanity  .callout-title { color: var(--eldritch); }
.callout-warning { border-left-color: var(--crimson-bright); background: linear-gradient(rgba(161,43,35,.12), rgba(161,43,35,.04)), var(--panel); }
.callout-warning .callout-title { color: #e0705f; }

/* ---------- framed screenshots + lightbox trigger ---------- */

.shot { margin: 1.7rem 0 2rem; }
.shot-link {
  display: block; position: relative;
  border: 1px solid var(--gold);
  outline: 1px solid var(--gold-dim);
  outline-offset: 4px;
  background: var(--ink);
  padding: 6px;
  box-shadow: 0 0 0 6px rgba(6,8,7,.6), 0 16px 34px rgba(0,0,0,.55);
  cursor: zoom-in;
  transition: transform .14s ease, box-shadow .14s ease;
}
.shot-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 6px rgba(6,8,7,.6), 0 20px 40px rgba(0,0,0,.6), 0 0 22px rgba(232,166,61,.18);
}
.shot-zoom {
  position: absolute; right: 12px; bottom: 12px;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .06em;
  color: var(--parchment-bright);
  background: rgba(6,8,7,.82);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: .18rem .55rem;
  pointer-events: none;
}
.shot figcaption {
  margin-top: .7rem;
  font-size: .93rem; color: var(--parchment-dim);
  padding-left: .9rem;
  border-left: 2px solid var(--gold-dim);
}
.shot figcaption strong { color: var(--parchment); }

.shot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem 1.6rem; }
.shot-grid .shot { margin: .3rem 0; }

/* ---------- cards ---------- */

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin: 1.6rem 0; }
.card {
  border: 1px solid var(--gold);
  outline: 1px solid var(--gold-dim);
  outline-offset: 3px;
  background:
    linear-gradient(rgba(232,166,61,.04), transparent 40%),
    linear-gradient(var(--panel-2), var(--panel));
  padding: 1.25rem 1.3rem 1.2rem;
  box-shadow: 0 10px 26px rgba(0,0,0,.45);
  display: flex; flex-direction: column; gap: .1rem;
}
.card-kicker {
  margin: 0 0 .15rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--lantern);
}
.card h3, .card .card-h {
  margin: 0 0 .5rem;
  font-family: var(--display); font-weight: 400; font-size: 1.5rem;
  color: var(--parchment-bright);
}
.card p { font-size: .99rem; }
.card ul { font-size: .96rem; margin-bottom: .9rem; }
.card-facts {
  list-style: none; padding: 0; margin: 0 0 1rem;
  font-family: var(--mono); font-size: .8rem !important; color: var(--parchment-dim);
}
.card-facts li { margin-bottom: .2rem; }
.card-facts b { color: var(--parchment); font-weight: 700; }
.card-cta { margin-top: auto; }

/* red banner button reused as CTA */
.btn {
  display: inline-block;
  font-family: var(--display); font-size: 1.04rem; letter-spacing: .03em;
  color: var(--parchment-bright); text-decoration: none;
  padding: .42rem 1.2rem .5rem;
  background: linear-gradient(#b23327, var(--crimson) 45%, #7e1d15);
  border: 1px solid var(--gold-bright);
  outline: 1px solid var(--gold-dim); outline-offset: 2px;
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,220,160,.28), inset 0 -6px 12px rgba(0,0,0,.38), 0 3px 8px rgba(0,0,0,.5);
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
  transition: filter .12s ease, transform .12s ease;
}
.btn:hover { filter: brightness(1.15); transform: translateY(-1px); color: #fff; }
.btn-quiet {
  background: linear-gradient(var(--panel-3), var(--panel));
  color: var(--parchment);
}
.btn-quiet:hover { color: var(--parchment-bright); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; margin: 1.3rem 0 1.8rem; border: 1px solid var(--gold-dim); box-shadow: 0 8px 22px rgba(0,0,0,.4); }
table { border-collapse: collapse; width: 100%; background: var(--panel); font-size: .97rem; }
caption {
  caption-side: top; text-align: left;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--lantern); padding: .6rem .9rem .5rem;
  background: var(--panel-2); border-bottom: 1px solid var(--gold-dim);
}
th, td { padding: .55rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(138,108,56,.28); }
th {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--parchment-dim); background: rgba(0,0,0,.25);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(232,166,61,.05); }
td b, td strong { color: var(--parchment-bright); }

/* ---------- case files (details/summary) ---------- */

.case { margin: 0 0 .8rem; border: 1px solid var(--gold-dim); background: var(--panel); box-shadow: 0 5px 16px rgba(0,0,0,.35); }
.case summary {
  cursor: pointer; list-style: none;
  padding: .8rem 1.05rem;
  font-weight: 700; color: var(--parchment-bright);
  display: flex; gap: .7rem; align-items: baseline;
}
.case summary::-webkit-details-marker { display: none; }
.case summary::before {
  content: "\2020";   /* dagger */
  font-family: var(--display);
  color: var(--crimson-bright);
  transition: transform .15s ease;
}
.case[open] summary::before { transform: rotate(45deg); color: var(--lantern); }
.case[open] summary { border-bottom: 1px dashed var(--gold-dim); }
.case-body { padding: .9rem 1.05rem 1rem; font-size: 1rem; }
.case-body p:last-child, .case-body ul:last-child, .case-body ol:last-child, .case-body pre:last-child { margin-bottom: 0; }

/* ---------- downloads ---------- */

.dl-card {
  display: grid; grid-template-columns: 1fr auto; gap: .4rem 1.6rem;
  align-items: start;
  border: 1px solid var(--gold);
  outline: 1px solid var(--gold-dim); outline-offset: 3px;
  background: linear-gradient(rgba(232,166,61,.035), transparent 45%), linear-gradient(var(--panel-2), var(--panel));
  padding: 1.3rem 1.4rem;
  margin: 1.5rem 0;
  box-shadow: 0 10px 26px rgba(0,0,0,.45);
}
.dl-main h3 { margin: 0 0 .35rem; font-family: var(--display); font-weight: 400; font-size: 1.55rem; color: var(--parchment-bright); }
.dl-main .dl-blurb { font-size: .99rem; margin-bottom: .7rem; }
.dl-contents { font-size: .93rem; margin-bottom: .8rem; }
.dl-hash {
  font-family: var(--mono); font-size: .74rem; word-break: break-all;
  color: var(--parchment-dim);
  background: var(--ink); border: 1px solid var(--gold-dim); border-radius: var(--radius);
  padding: .45rem .6rem; margin: 0;
}
.dl-hash b { color: var(--eldritch); font-weight: 700; }
.dl-side { text-align: right; display: flex; flex-direction: column; gap: .55rem; align-items: flex-end; }
.dl-size { font-family: var(--mono); font-size: .78rem; color: var(--parchment-dim); }

/* ---------- pager ---------- */

.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-top: 3.2rem; padding-top: 1.4rem;
  border-top: 1px solid var(--gold-dim);
}
.pager-link {
  display: flex; flex-direction: column; gap: .15rem;
  text-decoration: none;
  border: 1px solid var(--gold-dim);
  background: var(--panel);
  padding: .8rem 1.05rem;
  transition: border-color .12s ease, background .12s ease;
}
.pager-link:hover { border-color: var(--gold-bright); background: var(--panel-2); }
.pager-next { text-align: right; align-items: flex-end; }
.pager-dir { font-family: var(--mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--lantern); }
.pager-title { font-family: var(--display); font-size: 1.2rem; color: var(--parchment-bright); }

/* ---------- colophon ---------- */

.colophon {
  position: relative; z-index: 1;
  border-top: 1px solid var(--gold-dim);
  background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.55)), var(--void);
  padding: 2.4rem 1rem 2.2rem;
  margin-top: 2rem;
}
.colophon-inner { max-width: var(--measure); margin: 0 auto; }
.colophon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.colophon-h {
  margin: 0 0 .6rem;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--lantern);
}
.colophon-list { list-style: none; margin: 0; padding: 0; font-size: .93rem; }
.colophon-list li { margin-bottom: .4rem; }
.colophon-rule { height: 1px; background: var(--gold-dim); margin: 1.7rem 0 1.2rem; }
.colophon-fine { font-size: .88rem; color: var(--parchment-dim); margin: 0 0 .45rem; }
.colophon-tiny { font-family: var(--mono); font-size: .74rem; font-style: italic; }

/* ---------- lightbox ---------- */

.lb {
  position: fixed; inset: 0; z-index: 60;
  display: none;
  background: rgba(4,6,5,.94);
}
.lb.is-open { display: block; }
.lb-stage {
  position: absolute; inset: 3.4rem 0 4.2rem;
  overflow: auto;
  display: grid; place-items: center;
  padding: .5rem;
  scrollbar-width: thin; scrollbar-color: var(--gold-dim) transparent;
}
.lb-img {
  border: 1px solid var(--gold);
  outline: 1px solid var(--gold-dim); outline-offset: 3px;
  background: var(--ink);
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
  cursor: zoom-in;
}
.lb.fit .lb-img { max-width: calc(100vw - 3rem); max-height: calc(100vh - 9rem); width: auto; height: auto; }
.lb.raw .lb-stage { place-items: start center; }
.lb.raw .lb-img { max-width: none; max-height: none; cursor: zoom-out; }

.lb-bar {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; align-items: center; gap: .8rem;
  padding: .65rem 1rem;
  background: linear-gradient(rgba(6,8,7,.95), rgba(6,8,7,.75));
  border-bottom: 1px solid var(--gold-dim);
}
.lb-counter { font-family: var(--mono); font-size: .78rem; color: var(--lantern); letter-spacing: .1em; }
.lb-title { font-family: var(--mono); font-size: .78rem; color: var(--parchment-dim); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lb-btn {
  font-family: var(--mono); font-size: .8rem; font-weight: 700;
  color: var(--parchment-bright);
  background: linear-gradient(var(--panel-3), var(--panel));
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: .3rem .75rem;
  cursor: pointer;
}
.lb-btn:hover { border-color: var(--gold-bright); color: #fff; background: var(--panel-3); }

.lb-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: .8rem 4.6rem .9rem;
  text-align: center;
  font-size: .93rem; color: var(--parchment);
  background: linear-gradient(rgba(6,8,7,.75), rgba(6,8,7,.96));
  border-top: 1px solid var(--gold-dim);
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 3rem; height: 3.6rem;
  font-size: 1.5rem; line-height: 1;
  display: grid; place-items: center;
  color: var(--parchment-bright);
  background: rgba(22,17,12,.85);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  cursor: pointer;
}
.lb-nav:hover { background: var(--panel-3); border-color: var(--gold-bright); }
.lb-prev { left: .8rem; }
.lb-next { right: .8rem; }
.lb-nav[hidden] { display: none; }
body.lb-lock { overflow: hidden; }

/* ---------- home hero extras ---------- */

.rite-path { list-style: none; counter-reset: rite; margin: 1.4rem 0 .4rem; padding: 0; display: grid; gap: .55rem; }
.rite-path li {
  counter-increment: rite;
  display: grid; grid-template-columns: 2.1rem 1fr; gap: .8rem; align-items: baseline;
  background: var(--panel);
  border: 1px solid var(--gold-dim);
  padding: .6rem .9rem;
}
.rite-path li::before {
  content: counter(rite, upper-roman);
  font-family: var(--display); font-size: 1.05rem; text-align: center;
  color: var(--lantern);
}
.rite-path a { font-weight: 700; }

.req-strip {
  display: flex; flex-wrap: wrap; gap: .5rem .55rem;
  list-style: none; margin: 1rem 0 0; padding: 0;
}
.req-strip li {
  font-family: var(--mono); font-size: .78rem;
  color: var(--parchment);
  background: var(--panel-2);
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  padding: .28rem .85rem;
  margin: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .masthead-inner { grid-template-columns: 1fr; }
  .lantern { display: none; }
  .cards, .shot-grid, .colophon-grid { grid-template-columns: 1fr; }
  .dl-card { grid-template-columns: 1fr; }
  .dl-side { text-align: left; flex-direction: row; flex-wrap: wrap; align-items: center; }
}

@media (max-width: 640px) {
  body { font-size: 1.02rem; }
  .page { padding-top: 2rem; }
  .step { grid-template-columns: 2.4rem 1fr; gap: .85rem; }
  .seal { width: 2.4rem; height: 2.4rem; flex-basis: 2.4rem; }
  .seal span { font-size: 1rem; }
  .step::before { left: 1.15rem; top: 3.8rem; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; align-items: flex-start; }
  .lb-cap { padding: .7rem 1rem .8rem; }
  .lb-nav { top: auto; bottom: 4.9rem; transform: none; }
  code.path, p code, li code, td code, figcaption code { white-space: normal; word-break: break-all; }
}

/* ---------- motion & print ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fog i, .lantern::after { animation: none; }
  * { transition: none !important; }
}

@media print {
  body { background: #fff; color: #111; font-size: 11pt; }
  .fog, .banners, .lantern, .pager, .colophon, .shot-zoom, .lb { display: none !important; }
  .masthead-plate, .card, .callout, .case, .dl-card, .shot-link { box-shadow: none; border-color: #999; outline: none; background: #fff; }
  a { color: #111; }
  .masthead-title a, .chapter-head h1, h2, h3 { color: #000; text-shadow: none; }
  code.path, p code, li code, td code, figcaption code, kbd, pre { background: #f2f2f2; color: #000; border-color: #bbb; }
}
