/* Crusadercore — the landing page. 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;
  --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.07rem, 0.98rem + 0.35vw, 1.25rem)/1.6 var(--serif);
  font-feature-settings: "liga", "dlig";
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
img.px { image-rendering: pixelated; width: 100%; }
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));
  transition: background .3s;
}
.bar-mark { display: flex; align-items: center; gap: .55rem; 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.4rem; margin-left: auto; font-family: var(--sc); font-size: 1rem; }
.bar-nav a { text-decoration: none; color: var(--vellum-dim); }
.bar-nav a:hover { color: var(--vellum); }
.bar-cta { font-family: var(--sc); font-size: 1rem; text-decoration: none; color: var(--vellum); border: 1px solid var(--gold); padding: .2rem .8rem .3rem; }
.bar-cta:hover { background: var(--gold); color: var(--ink); }
@media (max-width: 760px) {
  .bar-nav { display: none; }
  .bar-cta { margin-left: auto; }
}

/* ---------- 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-dim); cursor: not-allowed; }
.btn-ghost small { font-family: var(--serif); font-style: italic; font-size: .95rem; color: var(--vellum-faint); }

/* ---------- 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 { /* keeps the title legible over the bright sky without a soft glow */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgb(13 11 9 / 0) 30%, rgb(13 11 9 / .62) 55%, rgb(13 11 9 / .86) 100%);
}
.hero-text {
  align-self: center; justify-self: end;
  width: min(44rem, 58vw); padding: 6rem var(--gutter) 10rem 0; /* clear of the dither below */
  margin-right: clamp(0px, 4vw, 4rem);
  text-shadow: 0 2px 0 rgb(13 11 9 / .6);
}
.kicker { margin: 0 0 .6rem; font-style: italic; color: var(--vellum-dim); font-size: 1.1rem; }
h1 {
  margin: 0; font: 400 clamp(2.9rem, 1.2rem + 4.6vw, 5.6rem)/.95 var(--sc); letter-spacing: .01em;
  color: var(--vellum);
}
.lede { margin: 1.1rem 0 2rem; font-size: clamp(1.3rem, 1.1rem + .8vw, 1.75rem); 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) 2rem;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.6rem;
  font-family: var(--sc); font-size: 1rem; color: var(--vellum-dim);
}
.hero-status::before { /* the scene dissolves into ink the way the game's shadows do: ordered dither, at art-pixel size */
  content: ""; position: absolute; inset: auto 0 100%; height: 144px;
  background: url(/img/dither-down.png) repeat-x bottom / 12px 144px; image-rendering: pixelated;
}
.hero-status li + li::before { content: "✠" / ""; color: var(--rubric-hi); margin-right: 1.6rem; font-size: .8em; }
@media (max-width: 900px) {
  /* phone and tablet: the scene above, the words below it on ink */
  .hero { min-height: 0; }
  .hero-art { inset: 0 0 auto; height: 64svh; }
  .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(64svh - .5rem) var(--gutter) 1rem; text-shadow: none; }
  .hero-status::before { display: none; }
  .hero-status { justify-content: flex-start; gap: .2rem 1rem; padding-top: 1rem; }
  .hero-status li + li::before { margin-right: 1rem; }
}

/* ---------- sections ---------- */
.sect { padding: clamp(4rem, 3rem + 5vw, 8rem) var(--gutter); }
.sect-tight { padding-top: 2rem; }
.col { max-width: var(--col); margin: 0 auto; }
.sect-no { margin: 0; font: 400 1rem/1 var(--sc); color: var(--rubric-hi); letter-spacing: .2em; }
h2 { margin: .4rem 0 1.6rem; font: 400 clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem)/1.05 var(--sc); }
h3 { margin: 0 0 .5rem; font: 400 1.5rem/1.15 var(--sc); }
p { margin: 0 0 1.1rem; }
.muted { color: var(--vellum-dim); }
.big { font-size: clamp(1.25rem, 1.1rem + .7vw, 1.6rem); line-height: 1.45; }

/* the rubricated initial: a red capital three lines deep, as in the Book */
.initial::first-letter {
  float: left; font: 400 4.6em/.8 var(--sc); color: var(--rubric-hi);
  margin: .08em .1em 0 -.02em; padding-top: .04em;
}

.clauses { list-style: none; counter-reset: c; margin: 2rem 0 2.2rem; padding: 0; border-top: 1px solid var(--rule); }
.clauses li {
  counter-increment: c; display: grid; grid-template-columns: 3.2rem 1fr; align-items: baseline;
  padding: 1rem 0; border-bottom: 1px solid var(--rule);
  font-size: clamp(1.4rem, 1.15rem + 1vw, 2rem); line-height: 1.2;
}
.clauses li::before { content: counter(c, lower-roman) "."; font: italic 1.2rem var(--serif); color: var(--rubric-hi); }
.coda { margin-top: 2rem; font-size: 1.35rem; font-style: italic; }

/* ---------- plates (screenshots) ---------- */
.plate { margin: 0 auto; max-width: var(--wide); padding: 0 var(--gutter); }
.plate-wide { max-width: 100rem; }
.plate img { border: 1px solid var(--rule); }
figcaption { margin-top: .7rem; color: var(--vellum-dim); font-style: italic; font-size: 1rem; }
.cap-place { font-style: normal; font-family: var(--sc); color: var(--vellum); margin-right: .3rem; }

/* ---------- chapters ---------- */
.chapters { list-style: none; margin: 3rem auto 0; padding: 0; max-width: var(--wide); display: grid; grid-template-columns: minmax(0, 1fr); gap: 3.5rem; }
.ch { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(1.5rem, 3vw, 3rem); align-items: center; }
.ch:nth-child(even) .ch-art { order: 2; }
.ch-art { border: 1px solid var(--rule); }
.ch-meta { display: flex; gap: 1rem; justify-content: space-between; margin-bottom: .5rem; border-bottom: 1px solid var(--rule); padding-bottom: .4rem; font: 400 1rem var(--sc); color: var(--vellum-dim); }
.ch-no { color: var(--rubric-hi); letter-spacing: .1em; }
.ch h3 { font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem); }
.ride { margin: 1.2rem 0 0; padding-left: 1rem; border-left: 2px solid var(--gold); color: var(--vellum-dim); font-style: italic; }
.ride span { font-style: normal; font-family: var(--sc); color: var(--gold); margin-right: .25rem; }

@media (max-width: 960px) {
  .chapters { gap: 2.5rem; }
  .ch { grid-template-columns: minmax(0, 1fr); }
  .ch:nth-child(even) .ch-art { order: 0; }
}

/* ---------- the entry ---------- */
.entry { padding: clamp(3.5rem, 3rem + 4vw, 7rem) var(--gutter); background: var(--ink-2); border-block: 1px solid var(--rule); }
.entry-date { font: 400 1rem var(--sc); color: var(--rubric-hi); letter-spacing: .08em; margin-bottom: 1.2rem; }
.entry blockquote { margin: 0; font-size: clamp(1.2rem, 1.05rem + .6vw, 1.5rem); line-height: 1.55; }
.entry blockquote p::first-letter { font-family: var(--sc); color: var(--rubric-hi); font-size: 1.5em; line-height: 0; }
.entry-by { margin: 1.4rem 0 0; color: var(--vellum-dim); font-style: italic; }
.entry-by::before { content: "— "; }

/* ---------- arms ---------- */
.arms { max-width: var(--wide); margin: 3rem auto 3.5rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(2rem, 4vw, 4rem); }
.arm { padding: 1.4rem 0; border-top: 1px solid var(--rule); }
.arm p { color: var(--vellum-dim); margin: 0; }
.arm-wide { grid-column: 1 / -1; }
.graces { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; }
.graces dt { font-family: var(--sc); color: var(--gold); }
.graces dd { margin: 0; color: var(--vellum-dim); }
.prayers { font-family: var(--sc); font-size: 1.3rem; color: var(--vellum) !important; line-height: 1.7; }
.prayers i { color: var(--rubric-hi); font-style: normal; margin: 0 .35rem; }
.pair { max-width: var(--wide); margin: 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 2rem); }
.pair .plate { padding: 0; margin: 0; }
@media (max-width: 760px) {
  .arms, .pair { grid-template-columns: minmax(0, 1fr); }
  .graces { grid-template-columns: minmax(0, 1fr); gap: 0 0; }
  .graces dd { margin-bottom: .7rem; }
}

/* ---------- the roll of brothers ---------- */
.roll { list-style: none; counter-reset: b; max-width: var(--wide); margin: 3rem auto 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.roll li { counter-increment: b; position: relative; padding: 1.1rem 1.2rem 1.2rem 3rem; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: grid; gap: .15rem; }
.roll li::before { content: counter(b, upper-roman); position: absolute; left: 1rem; top: 1.25rem; font: 400 .85rem var(--sc); color: var(--rubric-hi); }
.roll b { font: 400 1.3rem/1.2 var(--sc); }
.roll i { color: var(--gold); font-size: .95rem; }
.roll span { color: var(--vellum-dim); font-size: 1rem; line-height: 1.4; }

/* ---------- fields gallery ---------- */
.fields { list-style: none; max-width: var(--wide); margin: 3rem auto 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.8rem, 1.5vw, 1.5rem); }
.fields button { all: unset; display: block; cursor: zoom-in; border: 1px solid var(--rule); }
.fields button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.fields button:hover { border-color: var(--gold); }
.fields span { display: block; margin-top: .5rem; font-style: italic; font-size: 1rem; color: var(--vellum-dim); }
@media (max-width: 960px) { .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .fields { grid-template-columns: minmax(0, 1fr); } }

.lightbox { padding: 0; border: 1px solid var(--rule); background: var(--ink); color: var(--vellum); max-width: min(96vw, 1600px); width: 96vw; }
.lightbox::backdrop { background: rgb(5 4 3 / .9); }
.lightbox p { margin: .6rem 1rem .8rem; font-style: italic; color: var(--vellum-dim); }
.lb-close { all: unset; position: absolute; top: .3rem; right: .7rem; font-size: 2rem; line-height: 1; cursor: pointer; color: var(--vellum); text-shadow: 0 1px 0 #000; }
.lb-close:focus-visible { outline: 2px solid var(--gold); }

/* ---------- letters ---------- */
.letters { position: relative; isolation: isolate; padding: clamp(5rem, 4rem + 6vw, 10rem) var(--gutter); display: grid; place-items: center; overflow: hidden; }
.letters-art { position: absolute; inset: 0; z-index: -2; height: 100%; object-fit: cover; opacity: .55; }
.letters::before { content: ""; position: absolute; inset: 0 0 auto; height: 144px; z-index: -1; background: url(/img/dither-down.png) repeat-x top / 12px 144px; image-rendering: pixelated; transform: scaleY(-1); }
.letters::after { content: ""; position: absolute; inset: auto 0 0; height: 144px; z-index: -1; background: url(/img/dither-down.png) repeat-x bottom / 12px 144px; image-rendering: pixelated; }
.letters-card { width: min(36rem, 100%); background: rgb(13 11 9 / .92); border: 1px solid var(--gold); padding: clamp(1.6rem, 4vw, 2.8rem); box-shadow: 8px 8px 0 rgb(0 0 0 / .5); }
.letters-card h2 { margin-bottom: 1.2rem; }
.addr { margin: 1.6rem 0 0; font: 400 clamp(1.15rem, 1rem + 1vw, 1.5rem) var(--serif); overflow-wrap: anywhere; }
.addr a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: .2em; }
.addr a:hover { color: var(--vellum); }

/* ---------- footer ---------- */
.foot { padding: 4rem var(--gutter) max(3rem, env(safe-area-inset-bottom)); text-align: center; border-top: 1px solid var(--rule); }
.seal { width: 120px; height: 120px; margin: 0 auto 1.2rem; 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.8rem var(--serif); margin: 0 0 1.5rem; }
.foot-small { font-size: .9rem; color: var(--vellum-faint); margin: 0; }
