/* ==========================================================================
   Relics Mod — relicsmod.com
   Design seed: S13 Adventure Codex Light
   Palette: petrol teal + saffron + mist ivory (light theme only)
   ========================================================================== */

/* Fonts: Poppins is defined in fonts.css (embedded, works offline). */

/* ---------- Tokens ---------- */
:root {
  /* Palette sampled from the supplied Relics icon:
     violet night sky (primary), ruby gem (supporting), gold frame (accent). */
  --violet: #6B028F;
  --violet-deep: #47017C;
  --violet-tint: #EEE3F5;
  --orchid: #8E5AA8;
  --ruby: #C61F25;
  --ruby-tint: #FBE4E4;
  --gold: #FBB02E;
  --gold-light: #FDCE3F;
  --gold-deep: #8F5200;
  --gold-tint: #FFF4D6;
  --gold-line: #F6DB9A;
  --paper: #FBF9FD;
  --mist: #F3EEF8;
  --white: #FFFFFF;
  --ink: #1F0B3A;
  --ink-soft: #564A69;
  --line: #E3D6EC;
  --font: "Poppins", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1180px;
  --wrap-narrow: 860px;
  --r-sm: 6px;
  --r-md: 14px;
  --r-lg: 26px;
  --header-h: 72px;
  --shadow-soft: 0 10px 30px -18px rgba(107, 2, 143, .35);
  --shadow-lift: 0 18px 40px -22px rgba(71, 1, 124, .45);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.7; color: var(--ink); background: var(--paper); overflow-x: hidden; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--violet); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--violet-deep); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.7rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.45rem); letter-spacing: -.02em; }
h3 { font-size: 1.22rem; }
p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.2em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: 12px; clip-path: inset(50%); z-index: 200; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none; }
.skip-link:focus { clip-path: none; color: #fff; }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 40px, var(--wrap-narrow)); margin-inline: auto; }
.section { padding: clamp(64px, 9vw, 112px) 0; position: relative; }
.section--mist { background: var(--mist); }
.section--white { background: var(--white); }
.lead { font-size: 1.15rem; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head p { color: var(--ink-soft); }
.section-head--right { margin-left: auto; text-align: right; }
.chapter-tag { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 500; color: var(--violet); margin-bottom: 10px; }
.chapter-tag::before { content: ""; width: 22px; height: 2px; background: var(--gold); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; font: 700 .98rem/1 var(--font); padding: 15px 24px; border-radius: var(--r-sm); text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease, color .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn--marker { background: var(--gold); color: var(--ink); padding-right: 34px; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); }
.btn--marker:hover { background: var(--gold-light); color: var(--ink); }
.btn--violet { background: var(--violet); color: #fff; }
.btn--violet:hover { background: var(--violet-deep); color: #fff; box-shadow: var(--shadow-lift); }
.btn--ghost { border-color: var(--violet); color: var(--violet); background: transparent; }
.btn--ghost:hover { background: var(--violet-tint); color: var(--violet-deep); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* Grid children may shrink below their content width (prevents overflow). */
.hero-grid > *, .codex > *, .compat-layout > *, .fieldnotes > *, .procedure-layout > *, .basecamp-grid > *, .release > *, .chapters > *, .article-layout > *, .split-page > *, .legal-layout > *, .journal-feature > * { min-width: 0; }

/* ---------- Header ---------- */
#site-header { position: sticky; top: 0; z-index: 100; min-height: var(--header-h); }
.site-header { background: rgba(251, 249, 253, .94); border-bottom: 1px solid transparent; transition: border-color .25s ease, box-shadow .25s ease; backdrop-filter: saturate(1.2) blur(6px); }
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: 0 6px 20px -16px rgba(71, 1, 124, .5); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 42px; height: 42px; border-radius: 8px; box-shadow: 0 4px 12px -6px rgba(71, 1, 124, .6); }
.brand-name { font-weight: 700; font-size: 1.12rem; line-height: 1.1; }
.brand-sub { display: block; font-weight: 400; font-size: .74rem; color: var(--ink-soft); }
.primary-nav { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nav-list a { position: relative; display: block; padding: 8px 10px; font-size: .92rem; font-weight: 500; color: var(--ink-soft); text-decoration: none; border-radius: var(--r-sm); transition: color .2s ease; }
.nav-list a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 3px; border-bottom: 2px dashed var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav-list a:hover { color: var(--violet); }
.nav-list a.is-active, .nav-list a[aria-current="page"] { color: var(--violet-deep); }
.nav-list a.is-active::after, .nav-list a[aria-current="page"]::after { transform: scaleX(1); }
.nav-toggle { display: none; margin-left: auto; width: 46px; height: 46px; border: 1px solid var(--line); background: var(--white); border-radius: var(--r-sm); cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px auto; transition: transform .25s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero: expedition board ---------- */
.hero { padding: clamp(40px, 6vw, 80px) 0 0; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero-copy h1 { max-width: 11ch; }
.hero-copy .lead { max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 22px; }
.hero-notes { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .9rem; color: var(--ink-soft); }
.hero-notes li { display: flex; align-items: center; gap: 8px; }
.hero-notes li::before { content: ""; width: 8px; height: 8px; background: var(--orchid); transform: rotate(45deg); }
.hero-visual { position: relative; }
.hero-visual figure { margin: 0; }
.hero-visual img { border-radius: var(--r-lg); animation: drift 9s ease-in-out infinite; }
.map-marker { position: absolute; display: flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px 7px 8px; font-size: .82rem; font-weight: 500; box-shadow: var(--shadow-soft); }
.map-marker b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--violet); color: #fff; font-size: .7rem; }
.map-marker--a { top: 8%; left: -6%; }
.map-marker--b { top: 46%; right: -5%; }
.map-marker--c { bottom: 12%; left: 6%; }
.terrain { margin-top: clamp(30px, 5vw, 60px); height: 70px; background:
  radial-gradient(120% 140px at 20% 140%, var(--mist) 60%, transparent 61%),
  radial-gradient(90% 120px at 85% 150%, var(--violet-tint) 60%, transparent 61%); }
@keyframes drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- About: codex entry ---------- */
.codex { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: clamp(30px, 6vw, 80px); align-items: start; }
.codex-text .entry-no { font-size: .9rem; color: var(--gold-deep); font-weight: 500; }
.codex-text .big { font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.6; color: var(--ink); font-weight: 400; }
.codex-text .big strong { font-weight: 700; color: var(--violet-deep); }
.codex-side { border-left: 2px dashed var(--line); padding-left: 28px; }
.codex-side img { border-radius: var(--r-md); margin-bottom: 20px; }
.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 112px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 500; }

/* ---------- Features: discovery route ---------- */
.route { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); gap: 28px 24px; }
.route::before { content: ""; position: absolute; top: 20px; bottom: 20px; left: 50%; border-left: 3px dotted var(--orchid); opacity: .55; }
.waypoint { align-self: start; position: relative; background: var(--white); border: 1px solid var(--line); padding: 26px 28px; border-radius: var(--r-md); }
.waypoint::after { content: ""; display: none; position: absolute; top: 30px; width: 14px; height: 14px; background: var(--gold); transform: rotate(45deg); }
.waypoint h3 { display: flex; align-items: center; gap: 12px; }
.waypoint p:last-child { margin-bottom: 0; color: var(--ink-soft); }
.waypoint .wp-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--violet-tint); display: grid; place-items: center; }
.waypoint .wp-icon svg { width: 22px; height: 22px; stroke: var(--violet); }
.wp-1 { grid-column: 1 / 7; } .wp-1::after { right: -38px; }
.wp-2 { grid-column: 8 / 13; margin-top: 60px; border-radius: var(--r-lg) var(--r-sm) var(--r-lg) var(--r-sm); } .wp-2::after { left: -38px; }
.wp-3 { grid-column: 2 / 7; background: var(--gold-tint); border-color: var(--gold-line); } .wp-3::after { right: -38px; }
.wp-4 { grid-column: 7 / 13; display: grid; grid-template-columns: 120px 1fr; gap: 22px; align-items: center; } .wp-4::after { left: -9px; }
.wp-4 .wp-figure { background: var(--mist); border-radius: var(--r-md); aspect-ratio: 1; display: grid; place-items: center; }
.wp-5 { grid-column: 1 / 8; border-style: dashed; background: transparent; } .wp-5::after { right: -26px; display: none; }
.wp-6 { grid-column: 9 / 13; margin-top: 30px; } .wp-6::after { left: -50px; }

/* ---------- How it works: checkpoints ---------- */
.checkpoints { list-style: none; margin: 0; padding: 0; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.checkpoints::before { content: ""; position: absolute; left: 4%; right: 4%; top: 46px; height: 60px; border-top: 3px dashed var(--gold); border-radius: 50% 50% 0 0 / 100% 100% 0 0; opacity: .6; }
.checkpoint { position: relative; padding-top: 4px; }
.checkpoint:nth-child(even) { margin-top: 48px; }
.cp-badge { position: relative; width: 84px; height: 84px; display: grid; place-items: center; margin-bottom: 18px; background: var(--white); border: 2px solid var(--violet); color: var(--violet-deep); font-weight: 700; font-size: 1.5rem; }
.checkpoint:nth-child(1) .cp-badge { border-radius: 50%; }
.checkpoint:nth-child(2) .cp-badge { border-radius: var(--r-md); transform: rotate(45deg); }
.checkpoint:nth-child(2) .cp-badge span { transform: rotate(-45deg); }
.checkpoint:nth-child(3) .cp-badge { border-radius: 50% 50% 50% 4px; background: var(--violet-tint); }
.checkpoint:nth-child(4) .cp-badge { border-radius: 50%; background: var(--gold); border-color: var(--gold); color: var(--ink); }
.checkpoint h3 { font-size: 1.12rem; }
.checkpoint p { color: var(--ink-soft); font-size: .95rem; }

/* ---------- Use cases: casebook (typography only) ---------- */
.casebook { border-top: 2px solid var(--ink); }
.case-row { display: grid; grid-template-columns: 70px minmax(0, .9fr) minmax(0, 1.4fr); gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.case-row .case-sym { font-size: 1.6rem; color: var(--ruby); line-height: 1; }
.case-row h3 { font-size: clamp(1.3rem, 2.4vw, 1.8rem); margin: 0; }
.case-row p { margin: 0; color: var(--ink-soft); }

/* ---------- Compatibility: matrix ---------- */
.compat-layout { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(28px, 5vw, 60px); align-items: start; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); }
.matrix { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 560px; }
.matrix th, .matrix td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.matrix thead th { background: var(--violet-tint); font-weight: 700; color: var(--violet-deep); }
.matrix tbody tr:last-child td, .matrix tbody tr:last-child th { border-bottom: 0; }
.matrix tbody th { font-weight: 700; white-space: nowrap; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 500; margin: 2px 4px 2px 0; background: var(--mist); color: var(--violet-deep); }
.tag--warn { background: var(--gold-tint); color: var(--gold-deep); }
.tag--no { background: var(--ruby-tint); color: #8E1A22; }
.small-note { font-size: .86rem; color: var(--ink-soft); margin-top: 14px; }

/* ---------- Guides preview: field notes ---------- */
.fieldnotes { display: grid; grid-template-columns: 1.25fr 1fr; gap: 34px; }
.expedition { display: block; text-decoration: none; color: inherit; }
.expedition img { border-radius: var(--r-lg); border: 1px solid var(--line); }
.expedition h3 { font-size: 1.5rem; margin-top: 20px; }
.expedition:hover h3 { color: var(--violet); }
.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.note-list a { display: grid; grid-template-columns: 110px 1fr; gap: 18px; align-items: center; padding: 12px; border-radius: var(--r-md); text-decoration: none; color: var(--ink); transition: background-color .2s ease; }
.note-list a:hover { background: var(--white); }
.note-list img { border-radius: var(--r-sm); aspect-ratio: 16/10; object-fit: cover; }
.note-list strong { display: block; line-height: 1.35; }
.note-list span { font-size: .86rem; color: var(--ink-soft); }
.see-all { margin-top: 26px; }

/* ---------- Installation: procedure ---------- */
.procedure-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(30px, 6vw, 70px); }
.procedure { list-style: none; margin: 0; padding: 0; counter-reset: proc; }
.procedure li { counter-increment: proc; position: relative; padding: 0 0 30px 64px; }
.procedure li::before { content: counter(proc); position: absolute; left: 0; top: 0; width: 42px; height: 42px; border-radius: var(--r-sm); background: var(--violet); color: #fff; display: grid; place-items: center; font-weight: 700; }
.procedure li::after { content: ""; position: absolute; left: 20px; top: 48px; bottom: 6px; border-left: 2px dashed var(--line); }
.procedure li:last-child::after { display: none; }
.procedure h3 { margin-bottom: .3em; font-size: 1.1rem; }
.procedure p { color: var(--ink-soft); margin: 0; }
.pack-list { align-self: start; background: var(--white); border: 1px solid var(--line); border-top: 5px solid var(--gold); border-radius: var(--r-sm) var(--r-sm) var(--r-md) var(--r-md); padding: 26px 28px; }
.pack-list ul { list-style: none; padding: 0; margin: 0; }
.pack-list li { padding: 9px 0 9px 32px; position: relative; border-bottom: 1px dashed var(--line); }
.pack-list li::before { content: ""; position: absolute; left: 0; top: 13px; width: 18px; height: 18px; border: 2px solid var(--violet); border-radius: 4px; }
.pack-list li::after { content: ""; position: absolute; left: 6px; top: 16px; width: 6px; height: 10px; border: solid var(--violet); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* ---------- Download: base camp (full-width) ---------- */
.basecamp { background: var(--gold-tint); border-block: 1px solid var(--gold-line); }
.basecamp-grid { display: grid; grid-template-columns: 380px 1fr; gap: clamp(30px, 6vw, 72px); align-items: center; }
.basecamp-grid img { border-radius: var(--r-lg); }
.basecamp h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
.dl-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 26px; }
.dl-meta .tag { background: var(--white); }
.dl-note { margin-top: 22px; font-size: .9rem; color: #5A4320; max-width: 62ch; padding-left: 16px; border-left: 3px solid var(--gold); }

/* ---------- Release info: metadata block ---------- */
.release { display: grid; grid-template-columns: 300px 1fr; gap: clamp(28px, 6vw, 70px); }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--white); }
.meta-grid div { padding: 22px 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.meta-grid div:nth-child(2n) { border-right: 0; }
.meta-grid div:nth-last-child(-n+2) { border-bottom: 0; }
.meta-grid dt { font-size: .84rem; color: var(--ink-soft); margin-bottom: 4px; }
.meta-grid dd { margin: 0; font-weight: 500; }

/* ---------- Pros & cons: ledger ---------- */
.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 2px solid var(--ink); }
.ledger > div { padding: 30px 34px 10px 0; }
.ledger > div + div { padding: 30px 0 10px 34px; border-left: 1px solid var(--line); }
.ledger h3 { font-size: 1.35rem; }
.ledger ul { list-style: none; margin: 0; padding: 0; }
.ledger li { padding: 12px 0 12px 36px; position: relative; border-bottom: 1px dashed var(--line); }
.ledger li::before { position: absolute; left: 0; top: 11px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; line-height: 1; }
.ledger .pros li::before { content: "+"; background: var(--violet-tint); color: var(--violet-deep); }
.ledger .cons li::before { content: "\2013"; background: var(--ruby-tint); color: var(--ruby); }

/* ---------- Troubleshooting: diagnostic rows ---------- */
.diag { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); }
.diag-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 28px; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.diag-row:last-child { border-bottom: 0; }
.diag-row:nth-child(odd) { background: var(--paper); }
.diag-row h3 { font-size: 1.02rem; margin: 0; display: flex; gap: 10px; }
.diag-row h3::before { content: ""; flex: none; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--ruby); }
.diag-row p { margin: 0; color: var(--ink-soft); }

/* ---------- Safety notice ---------- */
.notice { display: grid; grid-template-columns: 64px 1fr; gap: 24px; padding: 32px 36px; border: 2px solid var(--violet); border-radius: var(--r-lg) var(--r-sm); background: var(--white); }
.notice-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--violet-tint); display: grid; place-items: center; }
.notice-icon svg { width: 32px; height: 32px; stroke: var(--violet); }
.notice p:last-child { margin-bottom: 0; }

/* ---------- FAQ: codex chapters ---------- */
.chapters { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.chapter { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); }
.chapter-head { display: flex; align-items: center; gap: 14px; padding: 22px 26px; border-bottom: 2px solid var(--violet); }
.chapter-head .roman { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--gold); display: grid; place-items: center; font-weight: 700; color: var(--gold-deep); }
.chapter-head h3 { margin: 0; }
.faq-item { border-bottom: 1px dashed var(--line); }
.faq-item:last-child { border-bottom: 0; }
.faq-q { margin: 0; font-size: 1rem; }
.faq-btn { width: 100%; display: grid; grid-template-columns: 46px 1fr 24px; gap: 8px; align-items: start; text-align: left; background: none; border: 0; padding: 16px 22px; font: 500 .97rem/1.5 var(--font); color: var(--ink); cursor: pointer; transition: background-color .2s ease; }
.faq-btn:hover { background: var(--mist); }
.faq-idx { font-size: .8rem; color: var(--orchid); font-weight: 700; padding-top: 2px; }
.faq-mark { width: 20px; height: 20px; margin-top: 2px; position: relative; }
.faq-mark::before, .faq-mark::after { content: ""; position: absolute; left: 3px; right: 3px; top: 9px; height: 2px; background: var(--violet); transition: transform .25s ease; }
.faq-mark::after { transform: rotate(90deg); }
.faq-btn[aria-expanded="true"] { background: var(--violet-tint); }
.faq-btn[aria-expanded="true"] .faq-mark::after { transform: rotate(0); }
.faq-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.faq-panel.is-open { grid-template-rows: 1fr; }
.faq-panel > div { overflow: hidden; }
.faq-panel p { margin: 0; padding: 4px 26px 20px 76px; color: var(--ink-soft); }

/* ---------- Footer ---------- */
#site-footer { display: block; }
.site-footer { background: var(--mist); border-top: 1px solid var(--line); position: relative; overflow: hidden; padding-top: 64px; }
.footer-lines { position: absolute; inset: 0 0 auto 0; height: 120px; pointer-events: none; opacity: .5; }
.footer-top { position: relative; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.footer-statement { font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 500; line-height: 1.45; max-width: 30ch; margin-top: 18px; }
.footer-col h2 { font-size: .95rem; color: var(--violet-deep); margin-bottom: 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 6px 0; }
.site-footer a { text-decoration: none; color: var(--ink-soft); }
.site-footer a:hover { color: var(--violet); text-decoration: underline; }
.footer-email { font-size: .92rem; color: var(--ink-soft); margin-top: 14px; }
.footer-legal { border-top: 1px solid var(--line); padding: 18px 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .88rem; }
.legal-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.copyright { margin: 0; color: var(--ink-soft); }
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); color: var(--violet); cursor: pointer; box-shadow: var(--shadow-soft); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s ease, transform .25s ease; display: grid; place-items: center; }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; }

/* ---------- Scroll reveal (only on selected elements) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Inner page hero ---------- */
.page-hero { padding: clamp(48px, 7vw, 88px) 0 clamp(36px, 5vw, 56px); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--mist), var(--paper)); }
.breadcrumbs { font-size: .86rem; margin-bottom: 16px; color: var(--ink-soft); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--orchid); }
.breadcrumbs a { color: var(--ink-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--violet); }
.page-hero h1 { font-size: clamp(2rem, 4vw, 3rem); max-width: 22ch; }
.page-hero .lead { max-width: 60ch; margin: 0; }

/* ---------- Blog listing: adventure journal ---------- */
.journal-feature { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(26px, 5vw, 56px); align-items: center; text-decoration: none; color: inherit; padding-bottom: 50px; margin-bottom: 50px; border-bottom: 2px solid var(--ink); }
.journal-feature img { border-radius: var(--r-lg); border: 1px solid var(--line); }
.journal-feature h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.journal-feature:hover h2 { color: var(--violet); }
.read-on { font-weight: 700; color: var(--violet); }
.journal-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 34px 28px; }
.note-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 12px; }
.note-card img { border-radius: var(--r-md); border: 1px solid var(--line); object-fit: cover; width: 100%; }
.note-card h3 { margin: 0; font-size: 1.12rem; }
.note-card p { margin: 0; color: var(--ink-soft); font-size: .93rem; }
.note-card:hover h3 { color: var(--violet); }
.note-card .topic { font-size: .8rem; font-weight: 500; color: var(--gold-deep); }
.note-card--wide { grid-column: span 3; }
.note-card--wide img { aspect-ratio: 16/8; }
.note-card--tall { grid-column: span 2; }
.note-card--tall img { aspect-ratio: 4/3.4; }
.note-card--row { grid-column: span 3; display: grid; grid-template-columns: 150px 1fr; align-items: start; gap: 18px; }
.note-card--row img { aspect-ratio: 1; }
.note-card--full { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; padding-top: 34px; border-top: 1px dashed var(--line); }
.note-card--full img { aspect-ratio: 16/7; }

/* ---------- Article ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(30px, 5vw, 64px); padding: 48px 0 90px; }
.article-figure { margin: 0 0 34px; }
.article-figure img { border-radius: var(--r-lg); border: 1px solid var(--line); width: 100%; }
.prose { font-size: 1.04rem; max-width: 72ch; }
.prose h2 { font-size: clamp(1.45rem, 2.4vw, 1.8rem); margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; }
.prose li { margin: .4em 0; }
.prose .callout { background: var(--mist); border-left: 4px solid var(--violet); padding: 18px 22px; border-radius: 0 var(--r-md) var(--r-md) 0; margin: 1.6em 0; }
.prose .callout p:last-child { margin: 0; }
.prose table { border-collapse: collapse; width: 100%; min-width: 480px; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.prose th { background: var(--violet-tint); }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .88rem; color: var(--ink-soft); margin-top: 18px; }
.related { margin-top: 56px; padding-top: 30px; border-top: 2px solid var(--ink); }
.related ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.related a { text-decoration: none; color: var(--ink); font-weight: 500; display: grid; gap: 10px; }
.related img { border-radius: var(--r-md); border: 1px solid var(--line); }
.related a:hover { color: var(--violet); }
.sidebar { display: flex; flex-direction: column; gap: 22px; }
.sidebar-sticky { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 22px; }
.side-box { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); padding: 20px 22px; }
.side-box h2 { font-size: 1rem; margin-bottom: 10px; color: var(--violet-deep); }
.side-box ol, .side-box ul { margin: 0; padding-left: 1.1em; font-size: .92rem; }
.side-box li { margin: 6px 0; }
.side-box a { text-decoration: none; }
.side-box a:hover { text-decoration: underline; }
.side-box--accent { background: var(--gold-tint); border-color: var(--gold-line); }
.side-box--accent p { font-size: .92rem; }

/* ---------- Supporting pages ---------- */
.split-page { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(30px, 6vw, 70px); padding: 60px 0 90px; align-items: start; }
.split-page img { border-radius: var(--r-lg); }
.legal-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(28px, 5vw, 60px); padding: 56px 0 90px; }
.legal-index { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; font-size: .92rem; border-left: 2px dashed var(--line); padding-left: 18px; }
.legal-index ol { padding-left: 1.1em; margin: 0; }
.legal-index li { margin: 6px 0; }
.legal-index a { text-decoration: none; color: var(--ink-soft); }
.legal-index a:hover { color: var(--violet); }
.contact-panel { max-width: 760px; margin: 60px auto 90px; padding: clamp(28px, 5vw, 48px); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); }
.email-plain { display: inline-block; font-size: clamp(1.15rem, 3vw, 1.5rem); font-weight: 700; color: var(--violet-deep); padding: 12px 18px; background: var(--mist); border: 1px dashed var(--orchid); border-radius: var(--r-sm); word-break: break-all; }
.reason-list { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 10px; }
.reason-list li { padding: 12px 16px; border-left: 3px solid var(--gold); background: var(--paper); }
.disclaimer-stack { padding: 56px 0 90px; }
.disclaimer-stack section { border-top: 1px solid var(--line); padding: 30px 0; display: grid; grid-template-columns: 260px 1fr; gap: 28px; }
.disclaimer-stack h2 { font-size: 1.25rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav-list a { padding: 8px 7px; font-size: .87rem; }
  .map-marker--a { left: 0; } .map-marker--b { right: 0; }
}
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .primary-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 20px 22px; margin: 0; box-shadow: 0 16px 30px -24px rgba(71, 1, 124, .6); visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s; }
  .primary-nav.is-open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .nav-list { flex-direction: column; }
  .nav-list a { padding: 12px 6px; font-size: 1rem; border-bottom: 1px dashed var(--line); border-radius: 0; }
  .nav-list a::after { display: none; }
  .nav-list a.is-active, .nav-list a[aria-current="page"] { color: var(--violet); font-weight: 700; }
  .primary-nav .btn { justify-content: center; clip-path: none; padding-right: 24px; }
  .header-inner { position: relative; }
  .hero-grid, .codex, .compat-layout, .fieldnotes, .procedure-layout, .basecamp-grid, .release, .chapters, .journal-feature, .article-layout, .split-page, .legal-layout { grid-template-columns: 1fr; }
  .hero-copy h1 { max-width: 16ch; }
  .codex-side { border-left: 0; border-top: 2px dashed var(--line); padding: 26px 0 0; display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
  .route::before { left: 18px; }
  .route { grid-template-columns: 1fr; padding-left: 44px; }
  .waypoint { grid-column: 1 / -1 !important; margin-top: 0 !important; }
  .waypoint::after { left: -33px !important; right: auto !important; display: block !important; }
  .checkpoints { grid-template-columns: 1fr 1fr; gap: 30px; }
  .checkpoints::before { display: none; }
  .checkpoint:nth-child(even) { margin-top: 0; }
  .basecamp-grid img { max-width: 320px; }
  .sidebar-sticky, .legal-index { position: static; }
  .legal-index { border-left: 0; border-top: 2px dashed var(--line); padding: 16px 0 0; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .note-card--wide, .note-card--row { grid-column: span 6; }
  .note-card--full { grid-template-columns: 1fr; gap: 12px; }
  .note-card--tall { grid-column: span 3; }
  .disclaimer-stack section { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 640px) {
  body { font-size: .97rem; }
  .map-marker { position: static; display: inline-flex; margin: 10px 6px 0 0; box-shadow: none; }
  .codex-side { grid-template-columns: 1fr; }
  .wp-4 { grid-template-columns: 1fr; }
  .wp-4 .wp-figure { max-width: 120px; }
  .checkpoints { grid-template-columns: 1fr; }
  .case-row { grid-template-columns: 40px 1fr; }
  .case-row p { grid-column: 2; }
  .section-head--right { text-align: left; margin-left: 0; }
  .ledger { grid-template-columns: 1fr; }
  .ledger > div, .ledger > div + div { padding: 24px 0 6px; border-left: 0; }
  .ledger > div + div { border-top: 1px solid var(--line); }
  .diag-row { grid-template-columns: 1fr; gap: 8px; }
  .meta-grid { grid-template-columns: 1fr; }
  .meta-grid div { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .meta-grid div:last-child { border-bottom: 0 !important; }
  .notice { grid-template-columns: 1fr; padding: 26px 22px; }
  .faq-btn { grid-template-columns: 38px 1fr 22px; padding: 14px 16px; }
  .faq-panel p { padding: 2px 18px 18px 18px; }
  .note-list a { grid-template-columns: 84px 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .note-card--tall, .note-card--row { grid-column: span 6; }
  .note-card--row { grid-template-columns: 110px 1fr; }
  .related ul { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .btn--marker { clip-path: none; padding-right: 24px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .hero-visual img { animation: none; }
}
