/* 2FBooks — site theme on top of Bootstrap 5.3
   Layout idea: dark, cover-led pages; the logo red is the only accent, used for signals and calls to action. */
:root {
  --void: #0e1013;      /* page background */
  --hull: #161a1f;      /* panels, cards */
  --seam: #2a3038;      /* borders, rules */
  --bone: #ece6dc;      /* primary text */
  --ash: #9ba2ab;       /* secondary text */
  --signal: #ef3f46;    /* 2FBooks red (from the logo SVG) */
  --signal-deep: #c22f36;
  --signal-fill: #cf2f37;     /* button/strip fill: white text 5.1:1 */
  --signal-fill-hover: #b0262d; /* white text 6.6:1 */
  --signal-bright: #ff6b70;   /* red text over background art */
  --kraft: #cdb08a;     /* Tunguska "file folder" accent, used once */

  /* Brand fonts from the 2FBooks card files: EB Garamond, Barlow, Barlow Condensed */
  --font-display: "EB Garamond", Garamond, Georgia, serif;
  --font-body: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-label: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-mono: var(--font-label);

  color-scheme: dark;

  /* Bootstrap variable overrides */
  --bs-body-bg: var(--void);
  --bs-body-color: var(--bone);
  --bs-body-font-family: var(--font-body);
  --bs-body-font-size: 1.0625rem;
  --bs-body-line-height: 1.6;
  --bs-border-color: var(--seam);
  --bs-link-color: var(--bone);
  --bs-link-hover-color: var(--signal);
  --bs-link-color-rgb: 236, 230, 220;
  --bs-link-hover-color-rgb: 226, 67, 75;
  --bs-secondary-color: var(--ash);
  --bs-emphasis-color: var(--bone);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { background: var(--void); color: var(--bone); }

h1, h2, h3, .display-face {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--bone);
}
.text-ash { color: var(--ash) !important; }
.text-signal { color: var(--signal) !important; }
.mono { font-family: var(--font-mono); font-size: 0.95rem; font-weight: 500; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; }
.measure { max-width: 62ch; }

.eyebrow {
  font-family: var(--font-label);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
}

a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  box-shadow: none;
}

/* ---------- Buttons ---------- */
.btn { font-family: var(--font-label); font-weight: 600; font-size: 1.05rem; border-radius: 2px; padding: 0.6rem 1.25rem; letter-spacing: 0.06em; text-transform: uppercase; }
.btn-signal { --bs-btn-bg: var(--signal-fill); --bs-btn-border-color: var(--signal-fill); --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--signal-fill-hover); --bs-btn-hover-border-color: var(--signal-fill-hover); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--signal-fill-hover); --bs-btn-active-border-color: var(--signal-fill-hover); }
.btn-ghost { --bs-btn-color: var(--bone); --bs-btn-border-color: var(--seam); --bs-btn-bg: transparent;
  --bs-btn-hover-bg: var(--hull); --bs-btn-hover-border-color: var(--bone); --bs-btn-hover-color: var(--bone);
  --bs-btn-active-bg: var(--hull); --bs-btn-active-border-color: var(--bone); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.95rem; }

/* ---------- Header ---------- */
.site-header { background: rgba(14, 16, 19, 0.92); border-bottom: 1px solid var(--seam); backdrop-filter: blur(8px); }
.site-header .nav-link { color: var(--bone); font-family: var(--font-label); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.06em; text-transform: uppercase; padding-inline: 0.85rem !important; }
.site-header .nav-link:hover { color: var(--signal); }
.navbar-toggler { border-color: var(--seam); }
.navbar-toggler-icon { filter: invert(1); }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--bone); }
.brand img { height: 46px; width: auto; display: block; }

/* ---------- Snap scrolling ----------
   Each .snap section fills the screen below the sticky header.
   Desktop snaps firmly (mandatory); phones and tablets snap gently (proximity) so tall sections never trap the reader. */
:root { --header-h: 72px; }
html { scroll-snap-type: y proximity; scroll-padding-top: var(--header-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-snap-type: none; } }
.snap { scroll-snap-align: start; min-height: calc(100svh - var(--header-h)); display: flex; flex-direction: column; justify-content: center; }
.site-footer { scroll-snap-align: end; }

/* Dot navigator */
.dot-nav { position: fixed; right: clamp(0.75rem, 2vw, 1.75rem); top: 50%; transform: translateY(-50%); z-index: 1020;
  display: none; flex-direction: column; gap: 0.9rem; }
@media (min-width: 992px) { .dot-nav { display: flex; } }
.dot-nav a { position: relative; display: block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--ash); background: transparent; transition: background 0.2s, border-color 0.2s, transform 0.2s; }
.dot-nav a:hover, .dot-nav a:focus-visible { border-color: var(--bone); transform: scale(1.2); }
.dot-nav a[aria-current="true"] { background: var(--signal); border-color: var(--signal); }
.dot-nav a::after { /* label pill */
  content: attr(data-label); position: absolute; right: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-family: var(--font-label); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--bone); background: var(--hull); border: 1px solid var(--seam); padding: 0.2rem 0.55rem; border-radius: 2px;
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.dot-nav a:hover::after, .dot-nav a:focus-visible::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .dot-nav a, .dot-nav a::after { transition: none; } }
.site-header .nav-link[aria-current="true"] { color: var(--signal); }

/* ---------- Hero ---------- */
.hero { padding: clamp(2rem, 5vh, 3.5rem) 0 0; position: relative; justify-content: flex-start; }
.hero h1 { font-size: clamp(2.3rem, min(4.6vw, 7vh), 4.1rem); line-height: 1.05; font-weight: 500; }
.hero .lede { font-size: 1.2rem; color: var(--ash); }
.hero-banner { position: relative; flex: 1 1 auto; min-height: 240px; margin-top: clamp(1.25rem, 3vh, 2.5rem); }
.hero-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.hero-banner::after { /* fade the skyline into the page */
  content: ""; position: absolute; inset: auto 0 0 0; height: 30%;
  background: linear-gradient(180deg, transparent, var(--void)); pointer-events: none;
}

/* ---------- Next-up strip ---------- */
.next-up { background: var(--signal-fill); color: #fff; }
.next-up a { color: #fff; font-weight: 700; text-underline-offset: 3px; }
.next-up a:hover { color: #fff; opacity: 0.85; }

/* ---------- Sections ---------- */
.section { padding: clamp(2.5rem, 6vh, 4.5rem) 0; }
.hero.snap { padding-bottom: 0; }
.section + .section { border-top: 1px solid var(--seam); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 2.25rem; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin: 0; }

/* ---------- Covers (real image with a styled stand-in underneath) ---------- */
.cover { position: relative; aspect-ratio: 2 / 3; border-radius: 2px; overflow: hidden; background: var(--hull); }
.cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.cover-standin { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  padding: 10% 9%; font-family: var(--font-display); color: #f4efe6; }
.cover-standin .t { font-size: clamp(1rem, 1.9vw, 1.45rem); line-height: 1.05; font-weight: 700; }
.cover-standin .s { font-family: var(--font-body); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; margin-top: 0.4rem; }
.cover-standin .a { font-size: clamp(0.85rem, 1.4vw, 1.05rem); text-align: right; }
.standin-genesis { background:
  radial-gradient(circle at 25% 20%, #c62a32 0 10%, transparent 11%),
  radial-gradient(circle at 70% 12%, #9e1d25 0 7%, transparent 8%),
  radial-gradient(circle at 82% 38%, #c62a32 0 5%, transparent 6%),
  linear-gradient(180deg, #5b0f14 0%, #1d0b0d 45%, #0c0c0d 100%); }
.standin-oaths { background:
  radial-gradient(circle at 18% 14%, #c62a32 0 8%, transparent 9%),
  radial-gradient(circle at 78% 22%, #a51f28 0 9%, transparent 10%),
  linear-gradient(180deg, #4c1015 0%, #23262c 48%, #2f3a48 70%, #121417 100%); }
.standin-tunguska { background: repeating-linear-gradient(-35deg, #b99a72 0 14px, #c3a57e 14px 28px); color: #1d1a16; }
.standin-tunguska .stamp { align-self: center; transform: rotate(-18deg); border: 2px solid #a8282c; color: #a8282c;
  font-family: var(--font-body); font-weight: 800; letter-spacing: 0.12em; font-size: 0.75rem; padding: 0.15rem 0.5rem; }
.standin-gathering { background: linear-gradient(180deg, #1c2128 0%, #0f1216 100%); outline: 1px dashed var(--seam); outline-offset: -8px; }

/* ---------- Book cards ---------- */
.book-card { height: 100%; display: flex; flex-direction: column; gap: 0.75rem; }
@media (min-width: 992px) { .book-card .cover { width: min(100%, calc(46vh * 2 / 3)); } }
.book-card .cover { transition: transform 0.25s ease; }
.book-card:hover .cover { transform: translateY(-4px); }
@media (prefers-reduced-motion: reduce) { .book-card .cover { transition: none; } .book-card:hover .cover { transform: none; } }
.book-card h3 { font-size: 1.35rem; margin: 0; }
.book-meta { color: var(--ash); font-size: 0.9rem; }
.book-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-block; font-family: var(--font-label); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 0.22rem 0.55rem; border-radius: 2px; border: 1px solid var(--seam); color: var(--ash); }
.chip-signal { border-color: var(--signal); color: var(--signal); }
.chip-solid { background: var(--signal-fill); border-color: var(--signal-fill); color: #fff; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* ---------- Background art panels ----------
   Licensed art from the 2F-LLC Dropbox, darkened with a gradient so text stays readable. */
.bg-art { position: relative; isolation: isolate; background-color: var(--void); background-size: cover; background-repeat: no-repeat; }
.bg-art::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--shade); }
.bg-series   { background-image: url("../img/bg/series-pathogen.jpg"); background-position: 70% 40%;
  --shade: linear-gradient(90deg, rgba(14,16,19,0.82) 0%, rgba(14,16,19,0.88) 55%, rgba(14,16,19,0.9) 100%); }
.bg-tunguska { background-image: url("../img/bg/tunguska-sky.jpg"); background-position: 50% 35%;
  --shade: linear-gradient(180deg, rgba(14,16,19,0.35) 0%, rgba(14,16,19,0.6) 60%, rgba(14,16,19,0.85) 100%); }
.bg-author   { background-image: url("../img/bg/author-comet.jpg"); background-position: 50% 20%;
  --shade: linear-gradient(90deg, rgba(14,16,19,0.62) 0%, rgba(14,16,19,0.86) 40%, rgba(14,16,19,0.9) 100%); }
.bg-signup   { background-image: url("../img/bg/signup-survivor.jpg"); background-position: 30% 50%;
  --shade: linear-gradient(270deg, rgba(14,16,19,0.9) 0%, rgba(14,16,19,0.86) 55%, rgba(14,16,19,0.25) 100%); }
@media (max-width: 991.98px) { .bg-signup { --shade: rgba(14,16,19,0.88); } }
.bg-art .text-ash, .bg-art .book-meta { color: #b9bfc6 !important; }
.bg-art .eyebrow, .bg-art .reading-order .num { color: var(--signal-bright); }
.bg-art .reading-order p { color: #b9bfc6; }

/* ---------- Series ---------- */
.reading-order { list-style: none; padding: 0; margin: 0; counter-reset: book; display: grid; gap: 0; }
.reading-order li { display: grid; grid-template-columns: 3.25rem 1fr; gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--seam); }
.reading-order li:first-child { border-top: 1px solid var(--seam); }
.reading-order .num { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; color: var(--signal); }
.reading-order h3 { font-size: 1.3rem; margin: 0 0 0.25rem; }
.reading-order p { margin: 0; color: var(--ash); font-size: 0.97rem; }

/* ---------- Tunguska file ---------- */
.case-file { background: var(--hull); border: 1px solid var(--seam); border-left: 6px solid var(--kraft); padding: clamp(1.5rem, 4vw, 2.75rem); position: relative; }
.case-file .date { font-family: var(--font-display); font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 1; color: var(--kraft); }
.case-file .stamp { position: absolute; top: 1.25rem; right: 1.25rem; transform: rotate(8deg); border: 2px solid var(--signal);
  color: var(--signal); font-weight: 800; letter-spacing: 0.14em; font-size: 0.75rem; padding: 0.2rem 0.6rem; }

/* ---------- Author ---------- */
.author-photo { width: 100%; max-width: 320px; aspect-ratio: 4 / 5; position: relative; background: var(--hull); border: 1px solid var(--seam); overflow: hidden; }
.author-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.author-photo .monogram { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 4.5rem; color: var(--seam); }
.link-list { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding: 0; list-style: none; }
.link-list a { font-weight: 600; text-underline-offset: 4px; }

/* ---------- Signup ---------- */
.signup { border-top: 1px solid var(--seam); border-bottom: 1px solid var(--seam); }
.signup .form-control { background: var(--void); border: 1px solid var(--seam); color: var(--bone); border-radius: 2px; padding: 0.7rem 0.9rem; }
.signup .form-control::placeholder { color: #8a9099; }
.signup .form-control:focus { border-color: var(--signal); box-shadow: none; background: var(--void); color: var(--bone); }
.form-note { font-size: 0.9rem; color: var(--ash); min-height: 1.4em; }

/* ---------- Footer ---------- */
.site-footer { padding: 3rem 0 2.5rem; color: var(--ash); font-size: 0.92rem; }
.site-footer a { color: var(--ash); text-decoration: none; }
.site-footer a:hover { color: var(--bone); }
.site-footer .tagline { color: var(--bone); font-family: var(--font-display); font-size: 1.25rem; }
.site-footer .brand img { height: 56px; }

/* ---------- Accessibility ---------- */
/* Visible focus on elements where Bootstrap swaps the outline for a faint ring */
.site-header .nav-link:focus-visible,
.navbar-toggler:focus-visible,
.signup .form-control:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  box-shadow: none;
}
.navbar-toggler:focus { box-shadow: none; }
.signup .form-control:focus-visible { outline-offset: 2px; }

/* Skip link */
.skip-link { position: fixed; top: 0.5rem; left: 0.5rem; z-index: 1100; background: var(--signal-fill); color: #fff;
  font-family: var(--font-label); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.5rem 1rem; border-radius: 2px; text-decoration: none; }
.skip-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; color: #fff; }
main:focus { outline: none; }

/* Very short viewports (e.g. 400% zoom): let the header scroll away so it can't cover focused content */
@media (max-height: 500px) {
  .site-header.sticky-top { position: static; }
  html { scroll-padding-top: 0; scroll-snap-type: none; }
}

/* ---------- Legal / info pages ---------- */
.legal-page { padding: clamp(2.5rem, 7vh, 5rem) 0; }
.legal { max-width: 72ch; }
.legal h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); margin-bottom: 1rem; }
.legal h2 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); margin: 2.25rem 0 0.75rem; }
.legal .lede { font-size: 1.2rem; color: var(--ash); }
.legal a { text-decoration: underline; text-underline-offset: 3px; }

/* Links inside footer sentences need an underline so they don't rely on color alone */
.site-footer p a { text-decoration: underline; text-underline-offset: 3px; }
