/* Heretical Reformation — site stylesheet.
   Tokens, type scale and components come from Claude Concept A (Editorial);
   contrast floors from the brief addendum. One file, no build step. */

/* ---------- Fonts (self-hosted, OFL; see fonts/LICENSES.md) ---------- */
@font-face { font-family: "Gelasio"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/gelasio-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Gelasio"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/gelasio-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Gelasio"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/gelasio-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Gelasio"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/gelasio-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/source-sans-3-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --navy: #0D0F1A;        /* ground */
  --navy-deep: #0A0C16;   /* banded sections */
  --panel: #0F1221;       /* cards, panels */
  --copper: #C87941;      /* rules, at reduced alpha */
  --copper-text: #C9A27E; /* mono labels; contrast floor per addendum */
  --amber: #E8A030;       /* actions, wordmark */
  --amber-hover: #F0B24A;
  --cyan: #00D4D4;        /* focus ring, sigil centre */
  --rose: #D4748A;        /* gradient wordmark only */
  --text: #F5F2EA;
  --text-body: #D9D5CB;
  --text-2: #A9A6B8;      /* secondary; 8.4:1 on navy */
  --rule: rgba(200, 121, 65, .25);
  --rule-strong: rgba(200, 121, 65, .4);
  --serif: "Gelasio", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
  --measure: 620px;
  --wrap: 1180px;
  --gutter: 40px;
  --radius: 4px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--navy);
  color: var(--text);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--amber); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
.visually-hidden { position: absolute; 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: 16px; top: -100px; z-index: 100; padding: 10px 14px; background: var(--amber); color: var(--navy); border-radius: var(--radius); font-weight: 600; }
.skip:focus { top: 16px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Type helpers ---------- */
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; }
.label { color: var(--copper-text); }
.serif { font-family: var(--serif); }
.lede { font-family: var(--serif); font-size: 22px; line-height: 1.45; color: var(--text-body); max-width: var(--measure); text-wrap: pretty; }
.body { font-size: 18px; line-height: 1.6; color: var(--text-body); max-width: var(--measure); text-wrap: pretty; }
.body + .body { margin-top: 1em; }
.muted { color: var(--text-2); }
.h1 { font-size: 76px; line-height: 1.02; text-wrap: balance; }
.h2 { font-size: 44px; line-height: 1.1; text-wrap: balance; }
.h3 { font-size: 20px; line-height: 1.3; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding-top: 72px; padding-bottom: 72px; border-top: 1px solid var(--rule); }
.band { background: var(--navy-deep); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px; }
.col-label { grid-column: 1 / span 2; }
.col-main { grid-column: 3 / span 6; display: flex; flex-direction: column; gap: 24px; }
.col-main.wide { grid-column: 3 / span 7; }
.col-aside { grid-column: 9 / span 4; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack-s { display: flex; flex-direction: column; gap: 12px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding-top: 8px; }

/* ---------- Header / nav ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 20px; padding-bottom: 20px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 14px; letter-spacing: .2em; text-transform: uppercase; color: var(--amber); }
.nav { display: flex; gap: 8px 28px; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--text); text-decoration: none; font-family: var(--serif); font-size: 17px; display: inline-flex; align-items: center; min-height: 44px; }
.nav a:hover { color: var(--amber); }
.nav a[aria-current="page"] { color: var(--amber); }
.nav .btn { font-family: var(--sans); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--radius);
  font-family: var(--sans); font-weight: 600; font-size: 16px; line-height: 1.2;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
}
.btn-p { background: var(--amber); color: var(--navy); }
.btn-p:hover { background: var(--amber-hover); color: var(--navy); }
.btn-s { background: transparent; color: var(--text); border-color: rgba(200, 121, 65, .7); }
.btn-s:hover { border-color: var(--amber); color: var(--text); }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 17px; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 15px; }
.status {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-body);
}

.inline-actions { display: flex; gap: 6px 14px; flex-wrap: wrap; justify-content: center; font-size: 15px; }
.inline-actions a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Hero ---------- */
.hero { padding-top: 88px; padding-bottom: 72px; }
.hero .grid12 { align-items: end; }
.hero-text { grid-column: 1 / span 8; display: flex; flex-direction: column; gap: 28px; }
.routes { grid-column: 9 / span 4; display: flex; flex-direction: column; border-top: 1px solid var(--rule-strong); }
.route {
  display: flex; gap: 16px; padding: 18px 0; min-height: 48px; align-items: baseline;
  border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--text);
}
.route:hover .route-title { color: var(--amber); }
.route-n { color: var(--copper-text); width: 28px; flex-shrink: 0; }
.route-title { font-family: var(--serif); font-size: 19px; display: block; }
.route-sub { font-size: 14px; color: var(--text-2); display: block; margin-top: 2px; }

/* ---------- Figures / cards ---------- */
.card { width: 100%; height: auto; border-radius: var(--radius); box-shadow: 0 18px 40px rgba(0, 0, 0, .55); }
.card-hero { box-shadow: 0 30px 70px rgba(0, 0, 0, .65); }
figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
figcaption { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 28px 24px; }
.gallery figcaption { display: flex; justify-content: space-between; gap: 4px 12px; align-items: baseline; flex-wrap: wrap; }
.gallery figcaption .mono { white-space: nowrap; }
.gallery .title { font-family: var(--serif); font-size: 17px; color: var(--text); }

/* ---------- Panels ---------- */
.panel { padding: 28px; border: 1px solid rgba(200, 121, 65, .35); border-radius: var(--radius); background: var(--panel); display: flex; flex-direction: column; gap: 14px; }
.panel-title { font-family: var(--serif); font-size: 22px; line-height: 1.25; }
.aside-cyan { border-color: rgba(0, 212, 212, .35); }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; font-size: 16px; line-height: 1.5; }
.facts dt { color: var(--copper-text); padding-top: 4px; }
.facts dd { margin: 0; }
.tags { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tag { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; padding: 8px 12px; border: 1px solid rgba(200, 121, 65, .45); border-radius: var(--radius); color: var(--text-body); white-space: nowrap; }

/* ---------- Deck page ---------- */
.deck-hero { padding-top: 56px; padding-bottom: 72px; display: grid; grid-template-columns: 420px 1fr; gap: 56px; align-items: center; }
.deck-hero .facts { border-top: 1px solid rgba(200, 121, 65, .3); padding-top: 20px; max-width: 560px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.deck-hero .facts > div { display: flex; flex-direction: column; gap: 4px; }
.deck-hero .facts dd { font-size: 17px; }
.gallery-head { align-items: end; }
.gallery-head .right { grid-column: 10 / span 3; text-align: right; }
.gallery-head .mid { grid-column: 3 / span 7; }

/* ---------- Guide page ---------- */
.guide-landing { padding-top: 48px; padding-bottom: 96px; }
.guide-grid { display: grid; grid-template-columns: 200px 1fr 200px; gap: 48px; align-items: center; }
.guide-side { transform: rotate(-6deg); box-shadow: 0 24px 50px rgba(0, 0, 0, .6); }
.guide-side.r { transform: rotate(6deg); }
.guide-centre { display: flex; flex-direction: column; gap: 26px; align-items: center; text-align: center; padding: 16px 0; }
.guide-centre .h1 { font-size: 60px; line-height: 1.04; max-width: 640px; }
.guide-centre .lede { max-width: 560px; }
.guide-panel { width: 100%; max-width: 560px; padding: 32px 36px; align-items: center; gap: 16px; }
.guide-panel .btn { width: 100%; max-width: 320px; margin-top: 4px; }
.inside { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 24px; border-top: 1px solid var(--rule); padding-top: 40px; margin-top: 56px; }
.inside > div { display: flex; flex-direction: column; gap: 8px; }
.inside .sub { font-size: 15px; color: var(--text-2); line-height: 1.5; }
.next { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--rule); padding-top: 28px; margin-top: 40px; }
.next a { font-size: 16px; min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; }
.links { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding-top: 4px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding-top: 32px; padding-bottom: 32px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: center; justify-content: space-between; font-size: 14px; color: var(--text-2); }
.site-footer .brand-name { font-size: 13px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer nav a { color: var(--text-body); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.site-footer nav a:hover { color: var(--amber); }

/* ---------- 404 ---------- */
.notfound { padding-top: 96px; padding-bottom: 120px; display: flex; flex-direction: column; gap: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .deck-hero { grid-template-columns: 1fr 1fr; gap: 32px; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-side { display: none; }
}
@media (max-width: 760px) {
  :root { --gutter: 20px; }
  .h1, .guide-centre .h1 { font-size: 42px; line-height: 1.06; }
  .h2 { font-size: 32px; }
  .lede { font-size: 19px; }
  .body { font-size: 17px; }
  .hero { padding-top: 48px; padding-bottom: 40px; }
  .section { padding-top: 48px; padding-bottom: 48px; }
  .grid12, .about-grid, .deck-hero { grid-template-columns: 1fr; gap: 20px; }
  .hero-text, .routes, .col-label, .col-main, .col-main.wide, .col-aside, .gallery-head .mid, .gallery-head .right { grid-column: auto; }
  .gallery-head .right { text-align: left; }
  .routes { margin-top: 8px; }
  .site-header .wrap { padding-top: 14px; padding-bottom: 14px; }
  .nav { gap: 0 20px; width: 100%; }
  .nav a { font-size: 16px; }
  .nav .btn { display: none; } /* the route list below already carries the guide link */
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn, .actions .status { width: 100%; }
  .deck-hero .facts { grid-template-columns: 1fr; }
  .guide-panel { padding: 24px 20px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
  .gallery .title { font-size: 15px; }
  .mobile-single { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .gallery { grid-template-columns: 1fr; }
}
