/* Fogbound's home and story pages (D45). Same palette and type tiers as the game (themes/waking.js, D39):
   ink, bone, one accent (verdigris), blood only for danger. Display for big titles only, body for reading, voice
   (typewriter) for the Ledger. When this file changes, bump ?v= in index.html and story/index.html. */
:root {
  --ink-0: #0a0d0f; --ink-1: #11171a; --ink-2: #1a2226; --line: #34423f; --line-hi: #8aa39c;
  --bone: #ece5d5; --bone-dim: #a8ada6; --bone-hi: #fff6e2;
  --accent: #5fbfa6; --accent-hi: #9fe0cc; --accent-ink: #0b1513; --accent-deep: #1f4a40;
  --font-display: 'IM Fell English SC', Georgia, serif;
  --font-body: 'Archivo', 'Segoe UI', system-ui, sans-serif;
  --font-voice: 'Courier Prime', 'Courier New', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .fog { animation: none !important; } }
body { margin: 0; background: var(--ink-0); color: var(--bone); font-family: var(--font-body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--accent-hi); text-underline-offset: 3px; }
a:hover { color: var(--bone-hi); }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; }

/* drifting fog behind everything */
.fog { position: fixed; inset: -20%; pointer-events: none; z-index: 0; opacity: .5;
  background: radial-gradient(ellipse 40% 25% at 30% 40%, #8aa39c22, transparent 70%), radial-gradient(ellipse 35% 20% at 70% 65%, #ece5d518, transparent 70%);
  animation: drift 60s ease-in-out infinite alternate; }
.fog.b { animation-duration: 90s; animation-direction: alternate-reverse; opacity: .35; }
@keyframes drift { from { transform: translate(-4%, -2%); } to { transform: translate(4%, 3%); } }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 0; background: radial-gradient(ellipse at center, transparent 50%, #000c 100%); }
main, footer, header.top { position: relative; z-index: 1; }

/* top bar: the three sections, always one click apart */
header.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; padding: 10px 20px;
  background: color-mix(in srgb, var(--ink-0) 88%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
header.top .home { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .08em; color: var(--bone); text-decoration: none; margin-right: auto; }
header.top nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: .92rem; }
header.top nav a { color: var(--bone-dim); text-decoration: none; }
header.top nav a:hover, header.top nav a[aria-current] { color: var(--bone); }
header.top nav a.cta { color: var(--accent-ink); background: var(--accent); padding: 2px 12px; border-radius: 99px; font-weight: 600; }

/* hero */
.hero { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 56px 20px 24px; }
.logo { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 7vw, 4.4rem); letter-spacing: .06em; line-height: 1; margin: 0;
  text-shadow: 0 0 30px #5fbfa640; }
.logo em { display: block; font-family: var(--font-body); font-style: normal; font-size: clamp(.95rem, 2.4vw, 1.2rem); letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-hi); margin-top: 14px; }
.lede { max-width: 640px; margin: 22px auto 0; font-size: 1.15rem; color: var(--bone); }
.trio { display: flex; justify-content: center; gap: clamp(6px, 2vw, 18px); margin: 0 auto 18px; }
.trio img { width: clamp(84px, 18vw, 140px); aspect-ratio: 2 / 3; object-fit: cover; filter: url(#spot); border-radius: 50% 50% 6px 6px / 30% 30% 6px 6px;
  box-shadow: 0 10px 30px #000a; }
.trio figure { margin: 0; } .trio figcaption { font-size: .78rem; color: var(--bone-dim); margin-top: 6px; }

/* the three doors (home page) */
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; max-width: 1040px; margin: 0 auto 60px; padding: 0 16px; }
.door { display: flex; flex-direction: column; text-decoration: none; color: var(--bone); background: var(--ink-1); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; transition: border-color .2s, transform .2s; }
.door:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--bone); }
.door .pic { height: 150px; background: var(--ink-2) center 20% / cover no-repeat; filter: url(#spot); }
.door .bn { font-family: var(--font-display); font-size: 1.7rem; padding: 14px 18px 0; letter-spacing: .04em; }
.door .tx { padding: 6px 18px 18px; color: var(--bone-dim); font-size: .98rem; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.door .go { color: var(--accent-hi); font-weight: 600; margin-top: auto; }
.door.prev .pic { filter: grayscale(1) contrast(1.1) brightness(.8); }

/* reading columns */
.col { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.wide { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
section { padding: 40px 0; }
.sec { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.9rem, 5vw, 2.6rem); letter-spacing: .04em; margin: 0 0 14px; line-height: 1.1; }
.ch { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 4vw, 2rem); margin: 0 0 6px; line-height: 1.15; }
.kicker { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-hi); margin: 0 0 4px; }
.prose p { margin: 0 0 1em; }
.chapter { border-top: 1px solid var(--line); }
.forgot { display: inline-block; font-size: .85rem; color: var(--bone); border: 1px solid var(--line-hi); border-radius: 99px; padding: 1px 12px; margin-bottom: 12px; }
.forgot b { color: var(--accent-hi); font-weight: 600; }

/* a Ledger page: the band's book, in the voice type */
.ledger { position: relative; margin: 22px 0; padding: 18px 22px 16px 26px; background: linear-gradient(#ece5d50a, #ece5d505), var(--ink-1);
  border: 1px solid var(--line); border-left: 4px solid var(--accent-deep); border-radius: 4px 10px 10px 4px; font-family: var(--font-voice); font-size: .98rem; line-height: 1.55; }
.ledger .where { display: block; font-size: .8rem; letter-spacing: .06em; color: var(--accent-hi); margin-bottom: 2px; }
.ledger .by { display: block; font-style: italic; color: var(--bone-dim); margin-bottom: 10px; font-size: .9rem; }
.ledger p { margin: 0 0 .8em; } .ledger p:last-child { margin-bottom: 0; }

/* a note pointing at the deckbuilder or the game */
.aside { font-size: .92rem; color: var(--bone-dim); border-left: 2px solid var(--line-hi); padding: 2px 0 2px 14px; margin: 18px 0; }
.aside b { color: var(--bone); font-weight: 600; }

/* allegiances */
.allies { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.ally { background: var(--ink-1); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.ally h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; margin: 0; }
.ally .want { color: var(--accent-hi); margin: 2px 0 10px; font-size: .95rem; }
.ally dl { margin: 0; font-size: .93rem; } .ally dt { color: var(--bone-dim); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; margin-top: 8px; }
.ally dd { margin: 0; }

/* the nine */
.class-row { margin: 34px 0 0; }
.class-row h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; margin: 0; }
.class-row .cl { color: var(--bone-dim); font-style: italic; margin: 2px 0 12px; max-width: 760px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.people:has(> .who:only-child) { grid-template-columns: minmax(0, 760px); }
.who { background: var(--ink-1); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; grid-template-columns: 84px 1fr; gap: 4px 14px; align-content: start; }
.who:target { border-color: var(--accent); box-shadow: 0 0 24px #5fbfa640; }
.who .por { grid-row: span 3; width: 84px; aspect-ratio: 2 / 3; object-fit: cover; filter: url(#spot); border-radius: 50% 50% 4px 4px / 28% 28% 4px 4px; }
.who h4 { margin: 0; font-size: 1.15rem; line-height: 1.25; }
.who .side { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-hi); }
.who .tie { font-size: .9rem; color: var(--bone-dim); }
.who .more { grid-column: 1 / -1; font-size: .93rem; margin-top: 8px; }
.who .more p { margin: 0 0 .5em; }
.who .more b { color: var(--bone-dim); font-weight: 600; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; margin-right: 4px; }
.who .ledger { font-size: .88rem; padding: 12px 14px 10px 16px; margin: 10px 0 4px; }
.who .links { grid-column: 1 / -1; font-size: .88rem; display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.lantern { color: var(--accent-hi); }

/* story -> rules */
table.rules { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.rules th, table.rules td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.rules th { color: var(--bone); font-weight: 600; width: 34%; }
table.rules td { color: var(--bone-dim); }

/* finale */
.finale { text-align: center; padding: 60px 20px 70px; border-top: 1px solid var(--line); }
.finale p { max-width: 600px; margin: 0 auto 1em; }
.btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.btn { display: inline-block; padding: 10px 22px; border-radius: 99px; border: 1px solid var(--line-hi); color: var(--bone); text-decoration: none; font-weight: 600; }
.btn:hover { border-color: var(--accent-hi); color: var(--bone-hi); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hi); color: var(--accent-ink); }

/* contents */
.toc { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; font-size: .92rem; margin: 26px auto 0; max-width: 760px; }
.toc a { color: var(--bone-dim); }

footer { text-align: center; color: var(--bone-dim); font-size: .82rem; padding: 30px 20px 40px; border-top: 1px solid var(--line); }
footer p { margin: .3em 0; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  header.top { padding: 8px 16px; gap: 10px; } header.top nav { gap: 12px; font-size: .85rem; }
  header.top .home { font-size: .92rem; white-space: nowrap; } header.top nav a { white-space: nowrap; }
  header.top nav { flex-wrap: nowrap; } header.top nav .wide-only { display: none; }
  .col, .wide { padding: 0 16px; }
  .who { grid-template-columns: 64px 1fr; } .who .por { width: 64px; }
  table.rules th { width: 40%; }
  .people { grid-template-columns: 1fr; }
}

/* the story as a short story (D50): one narrator, plain chapters, almost no links */
.know { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; max-width: 860px; margin: 26px auto 0; text-align: left; }
.know div { display: flex; gap: 12px; align-items: flex-start; background: var(--ink-1); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: .95rem; }
.know b { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-family: var(--font-display); font-size: 1.1rem; }
.cast { margin-top: 30px; } .cast a { text-decoration: none; color: var(--bone-dim); }
.cast figcaption b { color: var(--bone); font-weight: 600; display: block; font-size: .95rem; }
.cast-note { color: var(--bone-dim); font-size: .95rem; margin: 4px 0 0; }
.tale .col { max-width: 680px; }
.tale section { padding: 34px 0 10px; }
.tale .prose p { font-size: 1.1rem; line-height: 1.7; }
.tale .chapter { border-top: 0; }
.tale .chapter::before { content: '◆'; display: block; text-align: center; color: var(--line-hi); font-size: .8rem; margin-bottom: 26px; }
.tale .ch { margin-bottom: 10px; }
.tale .forgot { margin: 0 0 14px; }
.tale .key { border-left: 3px solid var(--accent); padding-left: 16px; color: var(--bone-hi); }
.tale .play { font-size: .95rem !important; color: var(--bone-dim); }
.tale .sign { font-family: var(--font-voice); color: var(--bone-dim); text-align: right; }
.tale #before p:first-of-type::first-letter { font-family: var(--font-display); float: left; font-size: 3.4em; line-height: .85; padding: 6px 8px 0 0; color: var(--accent-hi); }
.hero > div { min-width: 0; max-width: 100%; }
@media (max-width: 600px) { .know { grid-template-columns: 1fr; } .cast figcaption { font-size: .72rem; } }
