/* Forbidden Realms
   The page is the road east: it starts hearth-warm and ends Veil-purple.
   One family (Cormorant), one bold idea, hairlines only where they separate real things. */

:root {
  --soot: #1a1410;
  --ash: #121317;
  --veil-dark: #150f22;
  --bone: #d9d2c2;
  --bone-dim: #9d968a;
  --bone-bright: #f1ebe0;
  --gold: #b8964f;
  --gold-bright: #dcbb6c;
  --veil: #7a4fb5;
  --veil-bright: #a98be0;
  --vellum: #e9dfc9;
  --ink: #2b2118;
  --ink-dim: #6b5a48;
  --rule: rgba(217, 210, 194, 0.16);

  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --caps: "Cormorant SC", "Cormorant Garamond", Garamond, serif;

  --measure: 62ch;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --ease: cubic-bezier(0.3, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--bone);
  background: linear-gradient(180deg, var(--soot) 0%, var(--ash) 42%, var(--veil-dark) 100%);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--gold-bright); text-decoration: none; text-underline-offset: 0.18em; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1em; max-width: var(--measure); }
h1, h2, h3 { font-weight: 400; line-height: 1.1; color: var(--bone-bright); margin: 0 0 0.5em; letter-spacing: -0.005em; }
h2 { font-size: clamp(2rem, 4.2vw, 3.05rem); font-weight: 300; max-width: 22ch; text-wrap: balance; }
h3 { font-size: 1.75rem; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 4px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--gold); color: var(--ink); padding: 0.4rem 0.9rem; }
.skip:focus { top: 1rem; }

/* Buttons */
.button {
  display: inline-block;
  font-family: var(--caps);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--gold);
  border: 0;
  padding: 0.7rem 1.6rem 0.75rem;
  transition: background 0.2s;
}
.button:hover { background: var(--gold-bright); text-decoration: none; }

/* Top bar */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem var(--gutter);
  transition: background 0.3s, box-shadow 0.3s;
}
.top.is-scrolled { background: rgba(26, 20, 16, 0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--rule); }
.top__home { display: flex; align-items: center; gap: 0.6rem; font-family: var(--caps); font-weight: 600; font-size: 1.15rem; color: var(--bone-bright); letter-spacing: 0.02em; }
.top__home:hover { text-decoration: none; }
.top__home img { width: 30px; }
.top__nav { display: flex; align-items: center; gap: 1.6rem; font-family: var(--caps); font-weight: 500; font-size: 1.05rem; letter-spacing: 0.02em; }
.top__nav a { color: var(--bone); }
.top__nav a:hover { color: var(--bone-bright); }
.top__nav .top__cta { border: 1px solid var(--gold); padding: 0.3rem 0.9rem 0.35rem; color: var(--gold-bright); }
.top__nav .top__cta:hover { background: rgba(184, 150, 79, 0.14); text-decoration: none; }
.top__toggle { display: none; width: 44px; height: 44px; background: none; border: 0; padding: 0; position: relative; }
.top__toggle span { position: absolute; left: 10px; right: 10px; height: 1px; background: var(--bone-bright); transition: transform 0.25s, top 0.25s; }
.top__toggle span:first-child { top: 18px; }
.top__toggle span:last-child { top: 26px; }
.top__toggle[aria-expanded="true"] span:first-child { top: 22px; transform: rotate(45deg); }
.top__toggle[aria-expanded="true"] span:last-child { top: 22px; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .top__toggle { display: block; }
  .top__nav {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; justify-content: center; gap: 1.5rem;
    background: rgba(26, 20, 16, 0.97);
    font-size: 1.6rem;
    opacity: 0; pointer-events: none; transition: opacity 0.25s;
  }
  .top__nav.is-open { opacity: 1; pointer-events: auto; }
  .top.is-open { background: transparent; box-shadow: none; }
}

/* Hero: the mark, one line, one drawn hairline */
.hero {
  position: relative; min-height: min(100svh, 1000px);
  display: grid; place-items: center; text-align: center;
  padding: 7rem var(--gutter) 5rem; overflow: hidden;
}
.hero__bg, .hero__bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 55% at 50% 42%, rgba(26,20,16,0.1), rgba(26,20,16,0.82) 78%),
    linear-gradient(180deg, rgba(26,20,16,0.75), rgba(26,20,16,0.15) 30%, rgba(26,20,16,0.4) 75%, var(--soot) 100%);
}
.hero__body { position: relative; display: flex; flex-direction: column; align-items: center; }
.hero__mark { width: min(520px, 80vw); filter: drop-shadow(0 16px 40px rgba(0,0,0,0.75)); animation: settle 1.4s var(--ease) both; }
.hero__line {
  font-size: clamp(1.6rem, 3.6vw, 2.6rem); font-weight: 300; line-height: 1.2;
  color: var(--bone-bright); max-width: none; margin: 1.2rem 0 0.9rem;
  animation: settle 1.4s 0.3s var(--ease) both;
}
.hero__note {
  display: block; width: min(420px, 60vw); height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--veil-bright));
  transform: scaleX(0); transform-origin: left;
  animation: heldNote 2.2s 0.9s var(--ease) both;
}
.hero__about { font-size: 1.2rem; color: var(--bone); max-width: 36em; margin: 1.4rem 0 1.8rem; animation: settle 1.4s 1.1s var(--ease) both; text-shadow: 0 1px 10px rgba(0,0,0,0.7); }
.hero .button { animation: settle 1.4s 1.3s var(--ease) both; }
@keyframes settle { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes heldNote { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Manuscript sections: margin note + measured column */
.ms {
  display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: 2rem var(--gutter);
  padding: clamp(4rem, 8vw, 7rem) var(--gutter);
  max-width: 1280px; margin: 0 auto;
}
.ms__margin { padding-top: 0.9rem; }
.ms__margin p { font-style: italic; font-size: 1.05rem; color: var(--bone-dim); max-width: 22ch; border-top: 1px solid var(--rule); padding-top: 0.9rem; }
.ms__text { max-width: var(--measure); }
.ms__text .first { font-size: 1.45rem; line-height: 1.4; color: var(--bone-bright); }
@media (max-width: 900px) {
  .ms { grid-template-columns: 1fr; gap: 1rem; }
  .ms__margin p { border-top: 0; padding-top: 0; }
}

/* A recovered fragment: vellum, ink, a torn edge */
.fragment {
  margin: 2.5rem 0 2.5rem -0.5rem; padding: 1.8rem 2rem 1.6rem;
  max-width: calc(var(--measure) - 4ch);
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,0.35), transparent 50%),
    radial-gradient(ellipse at 90% 100%, rgba(120, 90, 50, 0.18), transparent 55%),
    var(--vellum);
  color: var(--ink);
  clip-path: polygon(0 3%, 3% 0, 22% 1.5%, 48% 0, 75% 2%, 97% 0, 100% 6%, 99% 40%, 100% 72%, 98% 100%, 70% 98.5%, 45% 100%, 20% 98%, 2% 100%, 0 80%, 1% 45%);
  transform: rotate(-0.6deg);
  box-shadow: 0 18px 40px -18px rgba(0,0,0,0.9);
}
.fragment blockquote { margin: 0; }
.fragment blockquote p { font-size: 1.55rem; line-height: 1.3; font-style: italic; font-weight: 500; color: var(--ink); margin: 0 0 0.8em; max-width: none; }
.fragment figcaption { font-size: 1rem; color: var(--ink-dim); }

/* The road: seven stops, west to east. Buttons sit on the line; one panel opens beneath it. */
.road-section { padding: clamp(4rem, 8vw, 7rem) var(--gutter); max-width: 1280px; margin: 0 auto; }
.road-section__head p { font-size: 1.3rem; color: var(--bone); }
.road { list-style: none; margin: 3rem 0 0; padding: 0; position: relative; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: auto auto; }
.road::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0.55rem; height: 1px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold) 45%, var(--veil) 100%);
}
.road__stop { display: contents; }
.road__stop button {
  position: relative; grid-row: 1; display: block; background: none; border: 0;
  padding: 1.4rem 0.6rem 0 0; text-align: left;
  font-size: 1.2rem; line-height: 1.15; color: var(--bone-dim); transition: color 0.2s;
}
.road__stop button::before {
  content: ""; position: absolute; left: 0; top: 0; width: 12px; height: 12px;
  border-radius: 50%; background: var(--soot); border: 1px solid var(--gold);
  transition: background 0.2s, box-shadow 0.2s;
}
.road__stop--veil button::before { border-color: var(--veil-bright); }
.road__stop button:hover, .road__stop.is-active button { color: var(--bone-bright); }
.road__stop.is-active button::before { background: var(--gold-bright); box-shadow: 0 0 14px rgba(220,187,108,0.55); }
.road__stop--veil.is-active button::before { background: var(--veil-bright); box-shadow: 0 0 14px rgba(169,139,224,0.6); }
.road__text { grid-row: 2; grid-column: 1 / -1; padding-top: 1.6rem; }
.road__text p { font-size: 1.3rem; color: var(--bone-bright); max-width: var(--measure); }
.road__text[hidden] { display: none; }

@media (max-width: 900px) {
  .road { grid-template-columns: 1fr; grid-template-rows: none; padding-left: 1.4rem; }
  .road::before { left: 5px; right: auto; top: 0.5rem; bottom: 0.5rem; width: 1px; height: auto; background: linear-gradient(180deg, var(--gold) 0%, var(--gold) 45%, var(--veil) 100%); }
  .road__stop { display: block; padding: 0 0 1.4rem; }
  .road__stop button { grid-row: auto; padding: 0; }
  .road__stop button::before { left: -1.4rem; top: 0.45rem; }
  .road__text { grid-row: auto; grid-column: auto; padding-top: 0.6rem; }
  .road__text p { font-size: 1.15rem; color: var(--bone); }
}
.road-section__foot { margin-top: 3.5rem; font-size: 1.15rem; color: var(--bone-dim); max-width: var(--measure); }

/* No JS: show every stop's text */
html:not(.js) .road__text[hidden] { display: block; }

/* Classes: four columns, hairlines between */
.classes { padding: clamp(4rem, 8vw, 7rem) var(--gutter); max-width: 1280px; margin: 0 auto; }
.classes__head p { font-size: 1.3rem; }
.classes__grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 3rem; border-top: 1px solid var(--rule); }
.classes__grid article { position: relative; overflow: hidden; padding: 1.6rem 1.6rem 1.6rem 0; border-right: 1px solid var(--rule); margin-right: 1.6rem; min-height: 30rem; }
.classes__grid article > :not(.classes__loop) { position: relative; z-index: 1; }
/* The class idle loop, faint and desaturated so it reads as presence behind the text, not an
   illustration. Sources with a real alpha channel composite normally; a loop rendered on black
   gets .classes__loop--onblack, which screen-blends the black away against the page (the
   column must NOT isolate its own stacking context or the blend has nothing to blend with). */
.classes__loop {
  position: absolute; z-index: 0; right: -6%; bottom: -4%; width: 78%; height: 88%;
  object-fit: contain; object-position: right bottom;
  opacity: 0.26; filter: saturate(0.45) contrast(1.05);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  pointer-events: none;
}
.classes__loop--onblack { mix-blend-mode: screen; }
/* Reduced motion: drop the video and show the loop's own transparent poster frame instead, so
   these users still get the character art rather than an empty column. The poster PNGs carry a
   real alpha channel, so no blend mode is needed (the old background-blend-mode: screen was for
   the on-black era). Kept in sync with the poster= attributes in index.html. */
@media (prefers-reduced-motion: reduce) {
  .classes__loop { display: none; }
  .classes__grid article {
    background-repeat: no-repeat; background-position: right bottom; background-size: auto 88%;
    opacity: 1;
  }
  .classes__grid article::before {
    content: ""; position: absolute; right: -6%; bottom: -4%; width: 78%; height: 88%; z-index: 0;
    background-repeat: no-repeat; background-position: right bottom; background-size: contain;
    opacity: 0.26; filter: saturate(0.45) contrast(1.05);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
    pointer-events: none;
  }
  .classes__grid article:nth-child(1)::before { background-image: url("../video/sentinel.png"); }
  .classes__grid article:nth-child(2)::before { background-image: url("../video/hexblade.png"); }
  .classes__grid article:nth-child(3)::before { background-image: url("../video/ironsworn.png"); }
  .classes__grid article:nth-child(4)::before { background-image: url("../video/sage.png"); }
}
.classes__grid article:last-child { border-right: 0; margin-right: 0; }
.classes__grid h3 { margin-bottom: 0.2em; }
.classes__style { font-style: italic; color: var(--gold-bright); font-size: 1.1rem; }
.classes__grid p { font-size: 1.1rem; }
.classes__kit { color: var(--bone-dim); }
@media (max-width: 1000px) {
  .classes__grid { grid-template-columns: repeat(2, 1fr); }
  .classes__grid article:nth-child(2) { border-right: 0; margin-right: 0; }
  .classes__grid article:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 560px) {
  .classes__grid { grid-template-columns: 1fr; }
  .classes__grid article { border-right: 0; margin-right: 0; padding-right: 0; }
  .classes__grid article + article { border-top: 1px solid var(--rule); }
}

/* Gallery: two large, three small */
.gallery {
  display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(120px, auto); gap: 0.5rem;
  padding: 2rem var(--gutter); max-width: 1400px; margin: 0 auto;
}
.gallery__item { position: relative; overflow: hidden; background: var(--ash); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; }
.gallery__item--a { grid-column: 1 / 5; grid-row: 1 / 3; }
.gallery__item--b { grid-column: 5 / 7; grid-row: 1; }
.gallery__item--c { grid-column: 5 / 7; grid-row: 2; }
.gallery__item--d { grid-column: 1 / 4; grid-row: 3; }
.gallery__item--e { grid-column: 4 / 7; grid-row: 3; }
.gallery__item:focus-visible { outline-offset: -3px; }
.gallery__note { grid-column: 1 / -1; font-style: italic; color: var(--bone-dim); font-size: 1.05rem; margin: 0.6rem 0 0; }
@media (max-width: 720px) {
  .gallery { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .gallery__item { grid-column: auto !important; grid-row: auto !important; aspect-ratio: 16 / 9; }
}

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(12, 9, 14, 0.94); display: grid; grid-template-columns: auto 1fr auto; align-items: center; padding: 1rem; opacity: 0; transition: opacity 0.2s; }
.lightbox[hidden] { display: none; }
.lightbox.is-visible { opacity: 1; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.6rem; min-width: 0; }
.lightbox__img { max-width: 100%; max-height: 84vh; object-fit: contain; }
.lightbox__cap { font-style: italic; color: var(--bone-dim); font-size: 1.05rem; }
.lightbox__close, .lightbox__prev, .lightbox__next { background: none; border: 0; color: var(--bone-bright); font-size: 2.4rem; line-height: 1; width: 48px; height: 48px; }
.lightbox__close { position: absolute; top: 1rem; right: 1rem; }
@media (max-width: 640px) {
  .lightbox { grid-template-columns: 1fr; }
  .lightbox__prev, .lightbox__next { position: absolute; bottom: 1rem; }
  .lightbox__prev { left: 1rem; }
  .lightbox__next { right: 1rem; }
}

/* Progress log: a real sequence, so dated entries */
.log { margin: 2rem 0 0; max-width: var(--measure); }
.log dt { font-style: italic; color: var(--gold-bright); }
.log dd { margin: 0.2rem 0 1.4rem; padding-left: 1.4rem; border-left: 1px solid var(--rule); }

/* Follow */
.follow { text-align: center; padding: clamp(4rem, 8vw, 7rem) var(--gutter) clamp(5rem, 9vw, 8rem); }
.follow__mark { width: 72px; margin: 0 auto 1.4rem; opacity: 0.9; }
.follow h2 { margin-inline: auto; }
.follow p { margin-inline: auto; }
.follow__form { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.6rem; }
.follow__form input {
  width: min(360px, 100%); padding: 0.7rem 1rem 0.75rem; font: inherit; font-size: 1.2rem;
  color: var(--bone-bright); background: rgba(0,0,0,0.3); border: 1px solid var(--rule);
}
.follow__form input:focus { outline: none; border-color: var(--gold); }
.follow__form input::placeholder { color: var(--bone-dim); }
.follow__msg { flex-basis: 100%; margin: 0.8rem 0 0; min-height: 1.5em; font-style: italic; color: var(--gold-bright); }
.follow__msg.is-error { color: #e08a8a; }

/* Footer */
.foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; padding: 2rem var(--gutter) 2.5rem; border-top: 1px solid var(--rule); font-size: 0.95rem; color: var(--bone-dim); }
.foot p { margin: 0; max-width: 70ch; }
.foot nav { display: flex; gap: 1.4rem; font-family: var(--caps); font-size: 1.05rem; }
@media (max-width: 720px) { .foot { flex-direction: column; align-items: flex-start; } }

/* Press page */
.page { padding: 7rem var(--gutter) 3rem; max-width: 1280px; margin: 0 auto; }
.page h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 300; }
.page h2 { font-size: 1.9rem; margin-top: 2.5rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1.5rem; max-width: var(--measure); }
.facts dt { font-style: italic; color: var(--bone-dim); }
.facts dd { margin: 0; }
.downloads { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-top: 1rem; }
.downloads figure { margin: 0; }
.downloads img { background: var(--ash); margin-bottom: 0.5rem; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; }
.downloads figcaption { font-size: 1.05rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__mark, .hero__line, .hero__about, .hero .button { animation: none; }
  .hero__note { animation: none; transform: none; }
}
