/* ==========================================================================
   FEARLESS MANUAL: presale site
   Design system: "Case File", Siberian winter palette, medical/records motif
   ========================================================================== */

:root {
  /* Color: Siberian winter, single blood accent */
  --bg:        #0A0E15;
  --bg-panel:  #10151F;
  --bg-raised: #161C29;
  --ice:       #ECF1F6;
  --ice-dim:   #8D99AC;
  --ice-faint: #5B6577;
  --blood:     #C41E3A;
  --blood-dim: #7A1526;
  --line:      #232B3B;
  --line-soft: #1A2130;

  /* Type */
  --f-display: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --f-stamp:   'Special Elite', 'Courier New', monospace;
  --f-body:    'IBM Plex Sans', -apple-system, sans-serif;

  --container: 720px;
  --gutter: 24px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ice);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(196,30,58,0.06), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 20%, rgba(140,160,200,0.04), transparent 55%);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Typography scale ---------- */
h1, h2, h3 { font-family: var(--f-display); font-weight: 500; margin: 0; color: var(--ice); }
h1 { font-size: clamp(2.1rem, 7vw, 3.6rem); line-height: 1.08; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 5vw, 2.4rem); line-height: 1.15; }
h3 { font-size: clamp(1.15rem, 3.2vw, 1.4rem); }
p { margin: 0 0 1em; color: var(--ice-dim); }
strong { color: var(--ice); font-weight: 600; }
em { font-style: italic; color: var(--ice); }

.eyebrow {
  font-family: var(--f-stamp);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blood);
}

/* ---------- Layout rhythm ---------- */
section { padding: 88px 0; border-bottom: 1px solid var(--line-soft); position: relative; }
section:last-of-type { border-bottom: none; }
@media (max-width: 640px) { section { padding: 64px 0; } }

/* ==========================================================================
   NAV
   ========================================================================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,14,21,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; max-width: 960px; }
.nav-mark {
  font-family: var(--f-stamp);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ice);
  display: flex; align-items: center; gap: 8px;
}
.nav-mark .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blood); flex: none; }
.nav-cta {
  font-family: var(--f-stamp);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ice);
  border: 1px solid var(--ice-faint);
  padding: 8px 14px;
  text-decoration: none;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.nav-cta:hover { border-color: var(--blood); color: var(--blood); }

/* ==========================================================================
   HERO: case file cover
   ========================================================================== */
.hero { padding-top: 64px; padding-bottom: 72px; overflow: hidden; }
.file-frame {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-panel), var(--bg));
  padding: 28px 24px 32px;
  position: relative;
}
@media (min-width: 640px) { .file-frame { padding: 40px 48px 48px; } }

.file-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  font-family: var(--f-stamp);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ice-faint);
  margin-bottom: 28px;
  gap: 12px;
}
.file-header span { display: block; }

.stamp {
  font-family: var(--f-stamp);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--blood);
  border: 1.5px solid var(--blood);
  padding: 5px 10px;
  text-transform: uppercase;
  transform: rotate(-3deg);
  white-space: nowrap;
  opacity: 0.9;
}

.hero h1 { margin: 6px 0 20px; }
.hero h1 .accent { color: var(--blood); font-style: italic; }

.hero-sub { font-size: 1.05rem; max-width: 52ch; margin-bottom: 30px; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 30px; }

.btn {
  font-family: var(--f-stamp);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 26px;
  border: 1.5px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--blood); color: #0A0E15; border-color: var(--blood); }
.btn-primary:hover { background: #d92e4c; border-color: #d92e4c; }
.btn-ghost { background: transparent; color: var(--ice); border-color: var(--ice-faint); }
.btn-ghost:hover { border-color: var(--ice); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.hero-meta {
  display: flex; gap: 22px; flex-wrap: wrap;
  font-family: var(--f-stamp); font-size: 0.68rem; letter-spacing: 0.06em;
  color: var(--ice-faint); text-transform: uppercase;
  padding-top: 22px; border-top: 1px solid var(--line-soft);
}
.hero-meta b { color: var(--ice); font-weight: 400; }

/* ==========================================================================
   OPEN LOOP: the incident teaser
   ========================================================================== */
.incident .wrap { max-width: 640px; }
.incident blockquote {
  font-family: var(--f-display);
  font-style: italic;
  font-size: clamp(1.2rem, 3.6vw, 1.55rem);
  line-height: 1.55;
  color: var(--ice);
  margin: 26px 0;
}
.incident .redacted-line { position: relative; color: transparent; user-select: none; }
.incident .redacted-line::before {
  content: '';
  position: absolute; inset: 0.05em 0;
  background: var(--line);
}
.continue-note {
  font-family: var(--f-stamp);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--ice-faint);
  text-transform: uppercase;
  margin-top: 8px;
}

/* ==========================================================================
   THE LINE: closing excerpt, full reveal
   ========================================================================== */
.excerpt { background: var(--bg-panel); }
.excerpt-card {
  border: 1px solid var(--line);
  padding: 34px 26px;
  position: relative;
}
@media (min-width: 640px) { .excerpt-card { padding: 48px 56px; } }
.excerpt-card .eyebrow { margin-bottom: 20px; }
.excerpt-card p.line {
  font-family: var(--f-display);
  font-size: clamp(1.15rem, 3.4vw, 1.5rem);
  line-height: 1.7;
  color: var(--ice);
}
.excerpt-card .credit {
  margin-top: 22px;
  font-family: var(--f-stamp);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ice-faint);
}

/* ==========================================================================
   PITCH: what the book is
   ========================================================================== */
.pitch-grid { display: grid; gap: 28px; margin-top: 36px; }
@media (min-width: 640px) { .pitch-grid { grid-template-columns: repeat(3, 1fr); } }
.pitch-item { padding-top: 4px; }
.pitch-item h3 { margin-bottom: 8px; }
.pitch-item p { font-size: 0.92rem; margin: 0; }

/* ==========================================================================
   AUTHOR
   ========================================================================== */
.author-grid { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 640px) { .author-grid { flex-direction: row; align-items: center; gap: 40px; } }
.author-photo {
  width: 100%; max-width: 220px; aspect-ratio: 3/4;
  background: var(--bg-raised); border: 1px solid var(--line);
  flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-stamp); font-size: 0.62rem; color: var(--ice-faint); text-align: center; padding: 12px;
}
.author-copy p { font-size: 0.96rem; }

/* ==========================================================================
   PROOF / testimonials
   ========================================================================== */
.proof-grid { display: grid; gap: 18px; margin-top: 32px; }
@media (min-width: 640px) { .proof-grid { grid-template-columns: repeat(2, 1fr); } }
.proof-card { border: 1px solid var(--line); padding: 22px; background: var(--bg-panel); }
.proof-card p.quote { color: var(--ice); font-style: italic; font-family: var(--f-display); font-size: 1rem; margin-bottom: 12px; }
.proof-card .who { font-family: var(--f-stamp); font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ice-faint); }
.proof-note { margin-top: 14px; font-size: 0.78rem; color: var(--ice-faint); }

/* ==========================================================================
   TIERS / PRESALE
   ========================================================================== */
.countdown {
  display: flex; gap: 18px; margin: 28px 0 8px;
  font-family: var(--f-stamp);
}
.countdown div { text-align: center; }
.countdown .num { font-size: 1.5rem; color: var(--blood); display: block; }
.countdown .lab { font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ice-faint); }

.tiers { display: grid; gap: 20px; margin-top: 32px; }
@media (min-width: 720px) { .tiers { grid-template-columns: repeat(3, 1fr); } }

.tier {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  padding: 28px 24px;
  display: flex; flex-direction: column;
  position: relative;
}
.tier.featured { border-color: var(--blood); background: linear-gradient(180deg, rgba(196,30,58,0.08), var(--bg-panel) 40%); }
.tier-flag {
  position: absolute; top: -1px; right: -1px;
  background: var(--blood); color: #0A0E15;
  font-family: var(--f-stamp); font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 10px;
}
.tier .tier-name { font-family: var(--f-stamp); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ice-faint); margin-bottom: 10px; }
.tier .tier-price { font-family: var(--f-display); font-size: 2.1rem; color: var(--ice); margin-bottom: 4px; }
.tier .tier-was { font-size: 0.82rem; color: var(--ice-faint); text-decoration: line-through; margin-bottom: 16px; display: block; }
.tier ul { list-style: none; margin: 0 0 24px; padding: 0; flex: 1; }
.tier li { font-size: 0.88rem; color: var(--ice-dim); padding: 7px 0; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; }
.tier li:first-child { border-top: none; }
.tier li::before { content: '\2022'; color: var(--blood); flex: none; }
.tier .btn { width: 100%; justify-content: center; }
.tier-copies { margin-top: 12px; font-family: var(--f-stamp); font-size: 0.64rem; letter-spacing: 0.04em; color: var(--ice-faint); text-align: center; }

/* ==========================================================================
   EMAIL CAPTURE
   ========================================================================== */
.capture { background: var(--bg-panel); }
.capture-inner { max-width: 560px; }
.capture form { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
@media (min-width: 560px) { .capture form { flex-direction: row; } }

.field {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ice);
  font-family: var(--f-body);
  font-size: 16px; /* prevents iOS zoom */
  padding: 15px 16px;
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.field::placeholder { color: var(--ice-faint); }
.field:focus { border-color: var(--blood); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-note { font-size: 0.78rem; color: var(--ice-faint); margin-top: 12px; }
.form-status { font-family: var(--f-stamp); font-size: 0.72rem; letter-spacing: 0.04em; margin-top: 14px; min-height: 1em; }
.form-status.ok { color: #6FCF97; }
.form-status.err { color: var(--blood); }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq-list { margin-top: 28px; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; color: var(--ice);
  font-family: var(--f-body); font-weight: 600; font-size: 0.98rem;
  padding: 18px 0; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq-q .mark { font-family: var(--f-stamp); color: var(--blood); flex: none; transition: transform 0.25s var(--ease); }
.faq-item.open .faq-q .mark { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s var(--ease); }
.faq-a p { padding-bottom: 18px; font-size: 0.92rem; }
.faq-item.open .faq-a { max-height: 300px; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer { padding: 48px 0 64px; }
.footer-inner { display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 640px) { .footer-inner { flex-direction: row; justify-content: space-between; align-items: flex-end; } }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { font-family: var(--f-stamp); font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ice-faint); text-decoration: none; }
.footer-links a:hover { color: var(--ice); }
.footer-copy { font-size: 0.72rem; color: var(--ice-faint); }

/* ==========================================================================
   STICKY MOBILE CTA
   ========================================================================== */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(10,14,21,0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 12px var(--gutter);
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  transform: translateY(100%);
  transition: transform 0.3s var(--ease);
}
.sticky-cta.show { transform: translateY(0); }
.sticky-cta span { font-family: var(--f-stamp); font-size: 0.66rem; color: var(--ice-faint); text-transform: uppercase; }
.sticky-cta .btn { padding: 10px 18px; font-size: 0.66rem; }
@media (min-width: 720px) { .sticky-cta { display: none; } }

/* ==========================================================================
   COVER VOTE TEASER
   ========================================================================== */
.vote-teaser .wrap { max-width: 680px; }
.cover-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 30px 0 10px; }
@media (max-width: 560px) { .cover-grid { grid-template-columns: 1fr; } }
.cover-card { border: 1px solid var(--line); background: var(--bg-panel); padding: 14px; text-align: center; }
.cover-thumb {
  aspect-ratio: 2/3; background: var(--bg-raised); border: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--f-stamp); font-size: 0.62rem; color: var(--ice-faint);
  margin-bottom: 10px; padding: 10px;
}
.cover-label { font-family: var(--f-stamp); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ice-dim); margin: 0; }

/* ==========================================================================
   VOTE CASTING (thank-you.html and vote.html)
   ========================================================================== */
.vote-card { border: 1px solid var(--line); background: var(--bg-panel); padding: 26px 22px; margin-top: 32px; text-align: left; }
@media (min-width: 640px) { .vote-card { padding: 34px 40px; } }
.vote-weight { display: inline-block; font-family: var(--f-stamp); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blood); border: 1px solid var(--blood-dim); padding: 5px 10px; margin-bottom: 18px; }
.vote-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0; }
@media (max-width: 560px) { .vote-grid { grid-template-columns: 1fr; } }
.vote-option { border: 1px solid var(--line); background: var(--bg); padding: 12px; cursor: pointer; text-align: center; transition: border-color 0.2s var(--ease); }
.vote-option:hover { border-color: var(--ice-faint); }
.vote-option.selected { border-color: var(--blood); background: rgba(196,30,58,0.08); }
.vote-option .cover-thumb { margin-bottom: 8px; }
.vote-tally { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.vote-tally-row { margin-bottom: 14px; }
.vote-tally-label { display: flex; justify-content: space-between; font-family: var(--f-stamp); font-size: 0.66rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ice-dim); margin-bottom: 6px; }
.vote-tally-track { height: 6px; background: var(--line); }
.vote-tally-fill { height: 100%; background: var(--blood); transition: width 0.5s var(--ease); }
a:focus-visible, button:focus-visible, .field:focus-visible {
  outline: 2px solid var(--blood); outline-offset: 2px;
}

/* ==========================================================================
   SMALL-SCREEN HARDENING (320px to 380px devices: SE, older Android)
   ========================================================================== */
.file-header { flex-wrap: wrap; }
.faq-item.open .faq-a { max-height: 420px; }

@media (max-width: 380px) {
  :root { --gutter: 18px; }
  .nav .wrap { height: 54px; }
  .nav-mark { font-size: 0.66rem; gap: 6px; }
  .nav-cta { padding: 6px 10px; font-size: 0.6rem; }
  .file-frame { padding: 20px 16px 24px; }
  .countdown { gap: 10px; }
  .countdown .num { font-size: 1.25rem; }
  .tier { padding: 22px 18px; }
  .btn { padding: 13px 20px; }
}

/* Ensure every tap target clears the 44px minimum */
.btn, .buy-btn, .faq-q, .nav-cta { min-height: 44px; }
.field { min-height: 44px; }
