/* ============================================================
   shared.css — slim brand layer for all non-landing pages
   Imports v2 tokens, provides themed nav + footer + typography +
   buttons + cards. NOT the heavy landing stack (no boot, no
   scroll-scrub, no magnetic cursor, no flashlight) — keeps perf
   tight while matching the brand.
   ============================================================ */

/* NOTE: tokens.css is loaded via <link> in each themed page — we don't
   @import it here because @import is unreliable on some mobile engines
   when combined with cache-bust query strings on the parent file.
   Every themed page loads BOTH tokens.css AND shared.css in that order. */

/* Safety fallback — if tokens.css didn't load for any reason, provide a
   minimal palette so the page still renders (not black-screen). */
:root {
  --bg-base:          var(--bg-base, #0f0c09);
  --bg-elevated:      var(--bg-elevated, #1a1612);
  --accent-primary:   var(--accent-primary, #d4a94a);
  --accent-secondary: var(--accent-secondary, #8b1a1a);
  --accent-dim:       var(--accent-dim, rgba(212, 169, 74, 0.18));
  --text-highlight:   var(--text-highlight, #f4d89a);
  --text-body:        var(--text-body, #d8cfc2);
  --text-muted:       var(--text-muted, #8a8073);
  --text-inverse:     var(--text-inverse, #0f0c09);
  --tape-yellow:      var(--tape-yellow, #f5c518);
  --tape-black:       var(--tape-black, #1a1a1a);
  --font-serif:       var(--font-serif, "Fraunces", Georgia, serif);
  --font-display:     var(--font-display, "Fraunces", Georgia, serif);
  --font-sans:        var(--font-sans, "Inter", system-ui, sans-serif);
  --font-mono:        var(--font-mono, "Courier Prime", monospace);
  --radius-lg:        var(--radius-lg, 14px);
  --glow-amber:       var(--glow-amber, 0 0 32px rgba(212,169,74,0.35));
  --ease-out:         var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
}

/* Themed pages: hide the old urgency-bar — our crime-tape is the new
   top indicator. Prevents overlap + black-block layout collision. */
.urgency-bar { display: none !important; }

/* Offset body for the fixed crime-tape so first content isn't hidden */
body { padding-top: 28px; }

/* ───── Legacy style.css .hero override for themed pages ──────────────
   The legacy .hero rule (min-height: 90vh + overflow: hidden + absolute
   ::before overlay) was designed for the original landing hero that
   filled the viewport. On themed pages paired with our shared-nav +
   fixed crime-tape, that 90vh + overflow:hidden produced a pitch-black
   render on mobile because the content column became invisible behind
   the radial-gradient pseudo and the viewport ran out of room.
   Neutralise legacy .hero on themed pages only (landing doesn't load
   this stylesheet, so it keeps its full-screen hero). */
.hero {
  min-height: auto !important;
  overflow: visible !important;
}
.hero::before { display: none !important; }

/* ---------- Page base ---------- */
html {
  scroll-behavior: smooth;
}
body {
  background: var(--bg-base);
  color: var(--text-body);
  font-family: var(--font-sans);
  min-height: 100vh;
}

/* Heading defaults — Fraunces display everywhere */
h1, h2, h3, h4 {
  font-family: var(--font-display, var(--font-serif));
  color: var(--text-highlight);
  font-variation-settings: "opsz" 96, "SOFT" 100, "wght" 700, "WONK" 1;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 0 0 0.6rem; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); margin: 0 0 0.5rem; }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); margin: 0 0 0.4rem; font-variation-settings: "opsz" 48, "SOFT" 100, "wght" 600, "WONK" 0; }

p { line-height: 1.7; color: var(--text-body); }

a { color: var(--accent-primary); transition: color 180ms var(--ease-out); }
a:hover { color: var(--text-highlight); }

::selection { background: var(--accent-secondary); color: var(--text-highlight); }

/* ---------- Thin top crime tape (visual echo of landing) ---------- */
.shared-tape {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 28px;
  background: repeating-linear-gradient(
    90deg,
    var(--tape-yellow) 0 70px,
    var(--tape-black) 70px 74px,
    var(--tape-yellow) 74px 140px
  );
  z-index: 90;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  overflow: hidden;
}
.shared-tape__text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  color: var(--tape-black);
  letter-spacing: 0.2em;
  white-space: nowrap;
  animation: shared-tape-slide 20s linear infinite;
}
.shared-tape__text span { padding: 0 2.5rem; }
@keyframes shared-tape-slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Shared nav (slim, sticky BELOW the fixed tape) ---------- */
.shared-nav {
  position: sticky;
  top: 28px; /* matches .shared-tape height */
  z-index: 80;
  -webkit-backdrop-filter: blur(14px) saturate(1.05); /* iOS Safari prefix */
  padding: 14px 0;
  background: rgba(15, 12, 9, 0.82);
  backdrop-filter: blur(14px) saturate(1.05);
  border-bottom: 1px solid rgba(212,169,74,0.12);
}
.shared-nav__inner {
  max-width: min(1200px, 92vw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.shared-nav__brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
.shared-nav__brand-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48, "SOFT" 100, "wght" 700, "WONK" 1;
  font-size: 18px;
  color: var(--text-highlight);
  line-height: 1;
  letter-spacing: -0.01em;
}
.shared-nav__brand-title em { color: var(--accent-primary); font-style: normal; }
.shared-nav__links {
  display: flex;
  gap: 14px;
  align-items: center;
}
.shared-nav__link {
  color: var(--text-body);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 8px 4px;
  position: relative;
  transition: color 180ms;
}
.shared-nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 4px;
  width: 100%; height: 1px;
  background: var(--accent-primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 260ms var(--ease-out);
}
.shared-nav__link:hover { color: var(--text-highlight); }
.shared-nav__link:hover::after { transform: scaleX(1); transform-origin: left; }
.shared-nav__cta {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  background: var(--accent-primary);
  color: var(--text-inverse);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 180ms, transform 180ms;
}
.shared-nav__cta:hover {
  background: var(--text-highlight);
  transform: translateY(-1px);
  color: var(--text-inverse);
}
@media (max-width: 760px) {
  .shared-nav { padding: 12px 0 10px; }
  .shared-nav__inner {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    text-align: center;
  }
  .shared-nav__brand {
    align-items: center;
    justify-content: center;
  }
  .shared-nav__brand-title { font-size: 17px; }
  .shared-nav__links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, auto) 1fr;
    gap: 6px 12px;
    justify-content: center;
    align-items: center;
  }
  .shared-nav__link {
    padding: 6px 4px;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-align: center;
  }
  .shared-nav__link--always,
  .shared-nav__cta {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
  }
}

@media (max-width: 440px) {
  /* Tighter still on small phones — Start CTA drops to a second row */
  .shared-nav__links {
    grid-template-columns: repeat(3, auto);
    gap: 10px 14px;
  }
  .shared-nav__link--always,
  .shared-nav__cta {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    margin-top: 4px;
  }
}

/* ---------- Shared hero (title + sub + CTA pattern) ---------- */
.shared-hero {
  padding: clamp(3rem, 8vw, 5rem) 0 clamp(2rem, 5vw, 3rem);
  max-width: min(1200px, 92vw);
  margin: 0 auto;
  padding-inline: 24px;
}
.shared-hero__stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--accent-primary);
  padding: 6px 12px;
  border: 1px dashed var(--accent-dim);
  transform: rotate(-1.2deg);
  margin-bottom: 20px;
  text-transform: uppercase;
}
.shared-hero__title {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 0.98;
  max-width: 22ch;
  color: var(--text-highlight);
  margin-bottom: 18px;
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 700, "WONK" 1;
}
.shared-hero__title em {
  font-style: italic;
  color: var(--accent-primary);
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 700, "WONK" 1;
}
.shared-hero__sub {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-body);
  max-width: 52ch;
  line-height: 1.65;
  margin-bottom: 24px;
}

/* ---------- Shared buttons ---------- */
.shared-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 180ms var(--ease-out), background 180ms, box-shadow 180ms;
}
.shared-btn--primary {
  background: var(--accent-primary);
  color: var(--text-inverse);
  box-shadow: var(--glow-amber);
}
.shared-btn--primary:hover {
  transform: translateY(-2px);
  background: var(--text-highlight);
  color: var(--text-inverse);
}
.shared-btn--ghost {
  color: var(--text-highlight);
  border-color: var(--accent-dim);
  background: transparent;
}
.shared-btn--ghost:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.shared-btn--lg { padding: 18px 34px; font-size: 15px; }
.shared-btn--block { display: flex; width: 100%; }

/* ---------- Shared sections + cards ---------- */
.shared-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  max-width: min(1200px, 92vw);
  margin: 0 auto;
  padding-inline: 24px;
}
.shared-card {
  background: var(--bg-elevated);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  transition: transform 240ms var(--ease-out), border-color 240ms;
}
.shared-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
}

/* ---------- Shared footer ---------- */
.shared-footer {
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(1.5rem, 3vw, 2.5rem);
  border-top: 1px solid var(--accent-dim);
  max-width: min(1200px, 92vw);
  margin: clamp(3rem, 6vw, 5rem) auto 0;
  padding-inline: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-align: center;
  line-height: 1.85;
}
.shared-footer__brand {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48, "SOFT" 100, "wght" 700, "WONK" 1;
  font-size: 16px;
  letter-spacing: 0;
  color: var(--text-highlight);
  text-transform: none;
  margin-bottom: 10px;
  display: inline-block;
}
.shared-footer__brand em { color: var(--accent-primary); font-style: normal; }
.shared-footer a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 8px;
  transition: color 180ms;
}
.shared-footer a:hover { color: var(--accent-primary); }
.shared-footer__links { margin-top: 14px; }
.shared-footer__tiny {
  margin-top: 20px;
  font-size: 10px;
  color: #5f564c;
  letter-spacing: 0.12em;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .shared-tape__text { animation: none; }
  html { scroll-behavior: auto; }
}
