/* Crusadercore — ink, vellum, rubric red, and the gold of the outline. */

:root {
  color-scheme: dark;
  --ink: #0d0b09;
  --ink-2: #16120e;
  --ink-3: #221b15;
  --rule: #3a2f25;
  --vellum: #e9dfc8;
  --vellum-dim: #b5a88e;
  --vellum-faint: #7d7262;
  --rubric: #b8301f;
  --rubric-hi: #d2442f;
  --gold: #d6a84a;
  --gold-hi: #f6d98a;
  --serif: 'IM Fell English', 'Iowan Old Style', Georgia, serif;
  --sc: 'IM Fell English SC', 'IM Fell English', Georgia, serif;
  --col: 40rem;
  --wide: 76rem;
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--ink);
  color: var(--vellum);
  font: 400 clamp(1.03rem, 0.96rem + 0.3vw, 1.18rem)/1.55 var(--serif);
  font-feature-settings: "liga", "dlig";
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--rubric); color: var(--vellum); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.7rem var(--gutter);
  padding-top: max(0.7rem, env(safe-area-inset-top));
  background: linear-gradient(var(--ink) 0%, rgb(13 11 9 / 0.86) 70%, rgb(13 11 9 / 0));
}
.bar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--ink); box-shadow: 0 1px 0 var(--rule);
  opacity: 0; transition: opacity .25s;
}
.bar.solid::before { opacity: 1; }
.bar-mark { display: flex; align-items: center; gap: .55rem; min-height: 44px; text-decoration: none; font-family: var(--sc); font-size: 1.15rem; letter-spacing: .04em; }
.bar-mark svg { width: 18px; height: 18px; fill: var(--rubric-hi); }
.bar-nav { display: flex; gap: 1.5rem; margin-left: auto; font-family: var(--sc); font-size: 1rem; }
.bar-nav a { text-decoration: none; color: var(--vellum-dim); white-space: nowrap; }
.bar-nav a:hover { color: var(--vellum); }
.bar-cta {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.3rem .1rem;
  font-family: var(--sc); font-size: 1.1rem; letter-spacing: .03em; text-decoration: none; color: var(--vellum);
  background: var(--rubric); border: 1px solid var(--rubric); box-shadow: inset 0 -3px 0 rgb(0 0 0 / .25);
}
.bar-cta:hover { background: var(--rubric-hi); border-color: var(--rubric-hi); }
@media (max-width: 640px) {
  .bar-nav { display: none; }
  .bar-cta { margin-left: auto; }
}
@media (max-width: 760px) {
  .bar { padding-block: .45rem; padding-top: max(.45rem, env(safe-area-inset-top)); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: baseline; gap: .35rem;
  font: 400 1.15rem/1 var(--sc); letter-spacing: .03em;
  padding: .8rem 1.4rem .9rem; border: 1px solid transparent;
  text-decoration: none; cursor: pointer; color: var(--vellum);
}
.btn-red { background: var(--rubric); border-color: var(--rubric); box-shadow: inset 0 -3px 0 rgb(0 0 0 / .25); }
.btn-red:hover { background: var(--rubric-hi); border-color: var(--rubric-hi); }
.btn-ghost { border-color: var(--vellum-faint); color: var(--vellum); }
.btn-ghost:hover { border-color: var(--vellum); }
.btn-play { min-width: 10rem; justify-content: center; font-size: 1.3rem; }
@media (max-width: 560px) { .actions .btn-play { min-width: 0; flex: 1 0 auto; } }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; overflow: hidden; isolation: isolate; }
.hero-art { position: absolute; inset: 0; z-index: -2; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgb(13 11 9 / 0) 28%, rgb(13 11 9 / .68) 54%, rgb(13 11 9 / .9) 100%);
}
.hero-text {
  align-self: center; justify-self: end;
  width: min(44rem, 58vw); padding: 6rem var(--gutter) 9.5rem 0;
  margin-right: clamp(0px, 4vw, 4rem);
  text-shadow: 0 2px 0 rgb(13 11 9 / .65);
}
.kicker { margin: 0 0 .55rem; font-style: italic; color: var(--vellum-dim); font-size: 1.08rem; }
h1 {
  margin: 0; font: 400 clamp(2.9rem, 1.2rem + 4.6vw, 5.5rem)/.95 var(--sc); letter-spacing: .01em;
  color: var(--vellum);
}
.lede { margin: 1rem 0 1.8rem; font-size: clamp(1.25rem, 1.08rem + .75vw, 1.7rem); line-height: 1.35; max-width: 26ch; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.hero-status {
  position: relative; background: var(--ink);
  list-style: none; margin: 0; padding: .4rem var(--gutter) 1.75rem;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.5rem;
  font-family: var(--sc); font-size: 1rem; color: var(--vellum-dim);
}
.hero-status::before {
  content: ""; position: absolute; inset: auto 0 100%; height: 96px;
  background: url(/img/dither-down.png) repeat-x bottom / 8px 96px; image-rendering: pixelated;
}
.hero-status li + li::before {
  content: ""; display: inline-block; width: .7em; height: .7em; margin-right: 1.5rem; vertical-align: -.02em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7 0h6l-1.6 7.4L20 7v6l-8.6-.4L13 20H7l1.6-7.4L0 13V7l8.6.4z' fill='%23d2442f'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (max-width: 900px) {
  .hero { min-height: 0; }
  .hero-art { inset: 0 0 auto; height: 54svh; }
  .hero-art img { object-position: 30% 50%; }
  .hero-art::after {
    content: ""; position: absolute; inset: auto 0 0; height: 96px;
    background: url(/img/dither-down.png) repeat-x bottom / 8px 96px; image-rendering: pixelated;
  }
  .hero::before { display: none; }
  .hero-text { align-self: end; justify-self: stretch; width: auto; margin: 0; padding: calc(54svh - .6rem) var(--gutter) 1rem; text-shadow: none; }
  .hero-status::before { display: none; }
  .hero-status { justify-content: flex-start; gap: .2rem 1rem; padding-top: .75rem; padding-bottom: 1.25rem; }
  .hero-status li + li::before { margin-right: 1rem; }
}
@media (max-width: 560px) {
  .hero-status .wide-only { display: none; }
}

/* ---------- shared section & 404 support ---------- */
.sect { padding: clamp(3rem, 2.2rem + 3vw, 5.25rem) var(--gutter); }
.intro-sect { padding-top: clamp(2.4rem, 1.8rem + 2.2vw, 4rem); }
.sect-band { background: var(--ink-2); border-block: 1px solid var(--rule); }
.wrap { max-width: var(--wide); margin: 0 auto; }
.col { max-width: var(--col); margin: 0 auto; } /* used by 404.html */
.sect-head { margin-bottom: clamp(1.6rem, 1.2rem + 1.5vw, 2.5rem); }
.sect-no { margin: 0; font: 400 .98rem/1 var(--sc); color: var(--rubric-hi); letter-spacing: .2em; }
h2 { margin: .35rem 0 0; font: 400 clamp(2rem, 1.5rem + 2vw, 3rem)/1.05 var(--sc); }
.sect-sub { margin: .55rem 0 0; color: var(--vellum-dim); font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); }
h3 { margin: 0 0 .4rem; font: 400 1.4rem/1.15 var(--sc); }
p { margin: 0 0 1rem; }
.muted { color: var(--vellum-dim); }

/* ---------- clickable screenshots ---------- */
.shot {
  all: unset; display: block; width: 100%; cursor: zoom-in;
  border: 1px solid var(--rule); background: var(--ink-2);
  transition: border-color .18s;
}
.shot:hover { border-color: var(--gold); }
.shot:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* ---------- I · THE OATH ---------- */
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: clamp(1.8rem, 3.5vw, 4rem); align-items: center; }
.intro-copy h2 { margin-bottom: 1.2rem; }
.clauses { list-style: none; counter-reset: c; margin: 0 0 1.4rem; padding: 0; border-top: 1px solid var(--rule); }
.clauses li {
  counter-increment: c; display: grid; grid-template-columns: 2.5rem 1fr; align-items: baseline;
  padding: .65rem 0; border-bottom: 1px solid var(--rule);
  font-size: clamp(1.25rem, 1.05rem + .75vw, 1.55rem); line-height: 1.2;
}
.clauses li::before { content: counter(c, lower-roman) "."; font: italic 1.05rem var(--serif); color: var(--rubric-hi); }
.intro-copy p { color: var(--vellum-dim); }
.intro-copy .coda { margin: .2rem 0 0; font-style: italic; color: var(--vellum); font-size: 1.15rem; }
.plate { margin: 0; }
figcaption, .cap { margin: .55rem 0 0; color: var(--vellum-dim); font-style: italic; font-size: .96rem; line-height: 1.4; }
.cap-place { font-style: normal; font-family: var(--sc); color: var(--vellum); margin-right: .25rem; }
@media (max-width: 960px) {
  .intro { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- II · THE CHRONICLE ---------- */
.chapters { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.4rem, 2.5vw, 2.2rem); }
.ch { display: flex; flex-direction: column; }
.ch-meta { display: flex; gap: .75rem; justify-content: space-between; margin: .85rem 0 .45rem; padding-bottom: .35rem; border-bottom: 1px solid var(--rule); font: 400 .95rem var(--sc); color: var(--vellum-dim); }
.ch-no { color: var(--rubric-hi); letter-spacing: .08em; }
.ch h3 { font-size: clamp(1.35rem, 1.15rem + .6vw, 1.65rem); margin-bottom: .45rem; }
.ch p:last-child { margin-bottom: 0; color: var(--vellum-dim); }
.chron-more { margin: 1.8rem 0 0; padding-top: 1.1rem; border-top: 1px solid var(--rule); color: var(--vellum-dim); font-style: italic; font-size: .98rem; }
@media (max-width: 900px) {
  .chapters { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
}

/* ---------- III · ARMS & ORDER ---------- */
.pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem clamp(1.2rem, 2.5vw, 2.4rem); }
.pillar { padding-top: 1rem; border-top: 1px solid var(--rule); }
.pillar p { margin: 0; color: var(--vellum-dim); }
.hud-bar {
  margin-top: clamp(1.8rem, 1.4rem + 1.5vw, 2.6rem);
  padding-top: 1.4rem; border-top: 1px solid var(--rule);
  display: grid; gap: 1.1rem;
}
.hud-group { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); align-items: baseline; gap: .5rem 1.2rem; }
.hud-label { font: 400 .98rem/1 var(--sc); color: var(--vellum-faint); letter-spacing: .08em; }
.graces { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1.25rem; }
.grace { font-family: var(--sc); font-size: 1.1rem; color: var(--gold-hi); text-shadow: 0 0 8px rgb(246 210 122 / .55); }
.grace.furor { color: #f08a5a; text-shadow: 0 0 8px rgb(232 90 40 / .55); }
.grace-note { color: var(--vellum-dim); font-style: italic; font-size: .98rem; }
.prayers { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.prayers li {
  font: 400 1.05rem/1 var(--sc); padding: .42rem .72rem .5rem;
  border: 1px solid rgb(246 217 138 / .45); background: rgb(233 223 200 / .04);
}
.prayers li.live { color: #f6e2a8; border-color: var(--gold-hi); box-shadow: 0 0 8px rgb(246 210 122 / .45); }
@media (max-width: 960px) {
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .pillars { grid-template-columns: minmax(0, 1fr); }
  .hud-group { grid-template-columns: minmax(0, 1fr); gap: .45rem; }
  .prayers { gap: .4rem; }
  .prayers li { font-size: .98rem; }
}

/* ---------- IV · THE FIELDS ---------- */
.fields { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem clamp(.9rem, 1.6vw, 1.5rem); }
@media (max-width: 960px) { .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .fields {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%;
    margin-inline: calc(-1 * var(--gutter)); padding: 0 var(--gutter) .4rem; scroll-padding-inline: var(--gutter);
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .fields::-webkit-scrollbar { display: none; }
  .fields li { scroll-snap-align: start; }
}
.take { margin: clamp(2.2rem, 1.8rem + 2vw, 3.25rem) auto 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .7rem 1.4rem; }
.take p { margin: 0; color: var(--vellum-dim); font-style: italic; }

/* ---------- lightbox ---------- */
.lightbox { padding: 0; border: 1px solid var(--rule); background: var(--ink); color: var(--vellum); max-width: min(95vw, 1280px); width: 95vw; }
.lightbox::backdrop { background: rgb(5 4 3 / .92); }
.lightbox img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.lb-close { all: unset; position: absolute; top: .35rem; right: .45rem; width: 44px; height: 44px; display: grid; place-items: center; font-size: 2rem; line-height: 1; cursor: pointer; color: var(--vellum); background: rgb(13 11 9 / .55); text-shadow: 0 1px 0 #000; }
.lb-close:hover { color: var(--gold); }
.lb-close:focus-visible { outline: 2px solid var(--gold); }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem 1rem; border-top: 1px solid var(--rule); }
.lb-bar p { margin: 0; font-style: italic; color: var(--vellum-dim); }
.lb-nav { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.lb-nav button {
  all: unset; width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--rule); cursor: pointer; font-size: 1.4rem; line-height: 1; color: var(--vellum);
}
.lb-nav button:hover { border-color: var(--gold); color: var(--gold); }
.lb-nav button:focus-visible { outline: 2px solid var(--gold); }
.lb-nav span { font-family: var(--sc); font-size: .92rem; color: var(--vellum-faint); min-width: 3.5rem; text-align: center; }

/* ---------- footer ---------- */
.foot { padding: clamp(2.8rem, 2.2rem + 2vw, 4rem) var(--gutter) max(2.5rem, env(safe-area-inset-bottom)); text-align: center; border-top: 1px solid var(--rule); background: var(--ink); }
.seal { width: 100px; height: 100px; margin: 0 auto 1rem; color: var(--vellum-faint); display: block; }
.seal text { font: 400 15.5px var(--sc); letter-spacing: 2.6px; fill: var(--vellum-dim); }
.seal-cross { fill: var(--rubric-hi); }
.motto { font: italic 1.65rem var(--serif); margin: 0 0 1.2rem; }
.foot-early { font-style: italic; color: var(--vellum-dim); margin: 0 0 .35rem; }
.foot-margin { font-family: var(--sc); font-size: .85rem; color: var(--rubric-hi); margin: 0 0 1rem; transform: rotate(-1.5deg); }
.foot-letters { margin: 0 0 1.2rem; color: var(--vellum-dim); font-size: 1rem; }
.foot-letters a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: .2em; }
.foot-letters a:hover { color: var(--vellum); }
.foot-small { font-size: .88rem; color: var(--vellum-faint); margin: 0; }

/* ---------- early-access stamp ---------- */
.stamp {
  display: inline-block; margin: 0 0 1rem; padding: .35rem .8rem .45rem;
  font-family: var(--sc); font-size: 1.1rem; font-weight: 700; line-height: 1.15; letter-spacing: .08em; text-transform: uppercase;
  color: var(--rubric-hi); border: 2px solid currentColor; border-radius: 3px;
  transform: rotate(-4deg); text-shadow: none; background: none;
  filter: drop-shadow(0 1px 6px rgb(13 11 9 / .85));
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='7'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='1 1 1 1 .35 1 1 1 1 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23n)'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='7'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='1 1 1 1 .35 1 1 1 1 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23n)'/%3E%3C/svg%3E");
}
