/* ============================================================
   Vampires vs. Werewolves — Base Styles
   ============================================================ */

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
}

/* Page enter animation */
body { animation: pageEnter 0.3s ease-out; }
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-gothic);
  line-height: 1.3;
  color: var(--color-text);
  letter-spacing: 0.04em;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5, h6 { font-size: var(--text-base); }

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

a {
  color: var(--color-accent);
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-text); }

/* Lore / quote text */
blockquote, .lore-text {
  font-style: italic;
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-md);
  color: var(--color-text-muted);
  margin: var(--space-md) 0;
}

/* Text utilities */
.text-muted    { color: var(--color-text-muted); }
.text-gold     { color: var(--color-gold); }
.text-danger   { color: var(--color-danger); }
.text-success  { color: var(--color-success); }
.text-accent   { color: var(--color-accent); }
.text-center   { text-align: center; }
.text-sm       { font-size: var(--text-sm); }
.text-xs       { font-size: var(--text-xs); }
.text-lg       { font-size: var(--text-lg); }

/* Dividers */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-lg) 0;
}

.section-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
}
.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

/* Focus visible — distinct from :focus so mouse users don't see outlines */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-gold, #c9a96e);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 4px rgba(201, 169, 110, 0.2);
}
/* Vampire-side context */
.btn-vampire:focus-visible, [data-race="vampire"]:focus-visible {
  outline-color: var(--color-vampire, #8b0000);
  box-shadow: 0 0 0 4px rgba(139, 0, 0, 0.25);
}
/* Werewolf-side context */
.btn-werewolf:focus-visible, [data-race="werewolf"]:focus-visible {
  outline-color: var(--color-werewolf, #2d5a27);
  box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.25);
}

/* Custom scrollbar (Webkit) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) var(--color-bg);
}

/* Selection */
::selection {
  background: var(--color-accent);
  color: #fff;
}

/* Accessibility: contrast utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ── Race SVG icons ───────────────────────────────────────────── */
/* Usage: <img src="/static/img/icon-vampire.svg" class="race-icon race-icon--vampire" alt="Vampire"> */
.race-icon {
  display: inline-block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}
.race-icon--sm  { width: 20px; height: 20px; }
.race-icon--lg  { width: 48px; height: 48px; }
.race-icon--xl  { width: 80px; height: 80px; }

/* CSS-only race badge (no img needed) */
.race-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-family: var(--font-gothic);
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  border: 1px solid;
}
.race-badge--vampire {
  color: #ff6b6b;
  border-color: rgba(139,0,0,0.5);
  background: rgba(139,0,0,0.12);
}
.race-badge--werewolf {
  color: #93c5fd;
  border-color: rgba(59,130,246,0.4);
  background: rgba(59,130,246,0.1);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--color-text-faint);
}
.empty-state-icon {
  font-size: 48px;
  display: block;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}
.empty-state-text {
  font-size: var(--text-sm);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ─── Skip-to-content link (WCAG 2.1 Level A) ─────────────── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  padding: 0.6rem 1rem;
  background: var(--color-gold, #c8a84b);
  color: #000;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 10000;
  border-radius: 0 0 4px 0;
  text-decoration: none;
  transition: top 0.15s ease-out;
}
.skip-link:focus {
  top: 0;
  outline: 2px solid var(--color-text, #e8e0d5);
  outline-offset: 2px;
}

/* ── Lore typography polish (drop-cap + OpenType ligatures + old-style numerals) ── */
.lore-prose {
  font-feature-settings: "liga" 1, "clig" 1, "onum" 1, "kern" 1;
  font-variant-numeric: oldstyle-nums;
}
.lore-prose > p:first-of-type::first-letter {
  font-family: 'Cinzel', serif;
  font-size: 3.4em;
  float: left;
  line-height: 0.85;
  padding: 0.05em 0.12em 0 0;
  color: var(--color-gold, #c9a96e);
  font-weight: 700;
  text-shadow: 0 0 18px rgba(201, 169, 110, 0.25);
}
.lore-prose blockquote {
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  font-size: 1.1em;
  border-left: 3px solid var(--color-gold, #c9a96e);
  padding: 0.5rem 1rem;
  margin: 1.25rem 0;
  color: #d4c8a8;
  background: rgba(201, 169, 110, 0.04);
}

/* ── View Transitions API (Chrome/Edge) — smooth same-document navigations ── */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
  animation-timing-function: var(--ease-out-soft, cubic-bezier(0.25, 0.46, 0.45, 0.94));
}
::view-transition-old(root) {
  animation-name: vvw-fade-out;
}
::view-transition-new(root) {
  animation-name: vvw-fade-in;
}
@keyframes vvw-fade-out { to { opacity: 0; } }
@keyframes vvw-fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

/* ── Liquid CTA hover effect (SVG goo filter) — applied via .btn-liquid class ── */
.btn-liquid { position: relative; overflow: hidden; isolation: isolate; }
.btn-liquid::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%),
              rgba(201, 169, 110, 0.4) 0%,
              transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease-out;
  pointer-events: none;
  z-index: -1;
}
.btn-liquid:hover::before { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .btn-liquid::before { transition: none; }
}

/* ── Uniform hover timing across all interactive elements ── */
.pub-nav a, .footer-col a, .btn, button:not(.btn), .tool-card,
.cls-card, .vote-card, .discuss-item, .lore-card {
  transition: color var(--dur-base, 180ms) var(--ease-out-soft, ease-out),
              background var(--dur-base, 180ms) var(--ease-out-soft, ease-out),
              border-color var(--dur-base, 180ms) var(--ease-out-soft, ease-out),
              transform var(--dur-base, 180ms) var(--ease-out-soft, ease-out),
              box-shadow var(--dur-base, 180ms) var(--ease-out-soft, ease-out);
}

/* ── Auto-hide empty press wall / partner logo grid ── */
.press-wall:empty,
.partner-logos:empty,
.creators-wall:empty { display: none; }

/* ── Event-driven theme variants (set via body[data-event] from API or scheduler) ── */
body[data-event="blood-moon"] {
  --color-gold: #d63a3a;
  --grad-hero: radial-gradient(ellipse at top, rgba(204, 0, 0, 0.18) 0%, transparent 60%);
}
body[data-event="blood-moon"] .live-state-strip { background: linear-gradient(90deg, transparent, rgba(204, 0, 0, 0.08) 50%, transparent); }
body[data-event="blood-moon"] .pub-header { box-shadow: 0 0 24px rgba(204, 0, 0, 0.15); }

body[data-event="eclipse"] {
  --grad-hero: radial-gradient(ellipse at top, rgba(155, 89, 182, 0.18) 0%, transparent 60%);
}
body[data-event="eclipse"] .live-state-strip { background: linear-gradient(90deg, transparent, rgba(155, 89, 182, 0.08) 50%, transparent); }

body[data-event="full-moon"] {
  --grad-hero: radial-gradient(ellipse at top, rgba(74, 158, 255, 0.16) 0%, transparent 60%);
}
body[data-event="full-moon"] .live-state-strip { background: linear-gradient(90deg, transparent, rgba(74, 158, 255, 0.08) 50%, transparent); }

/* ── 3D card tilt — opt-in via .card-tilt class, desktop only ── */
@media (hover: hover) and (pointer: fine) {
  .card-tilt {
    transform-style: preserve-3d;
    transition: transform 200ms var(--ease-out-soft, ease-out);
    will-change: transform;
  }
  .card-tilt:hover {
    transform: perspective(800px) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg)) translateZ(2px);
  }
  @media (prefers-reduced-motion: reduce) {
    .card-tilt:hover { transform: none; }
  }
}

/* ============================================================
   Professional Public Header — site-wide override
   Refines .pub-header / .header-logo / .pub-nav site-wide
   without requiring per-page HTML changes.
   ============================================================ */
.pub-header {
  background: linear-gradient(180deg, rgba(8,8,12,0.96) 0%, rgba(10,10,15,0.88) 100%) !important;
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  box-shadow: 0 1px 0 0 rgba(200,168,75,0.06), 0 8px 24px -12px rgba(0,0,0,0.6);
  position: relative;
}
/* Subtle gold accent line under the header */
.pub-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(200,168,75,0) 10%,
    rgba(200,168,75,0.35) 50%,
    rgba(200,168,75,0) 90%,
    transparent 100%);
  pointer-events: none;
  opacity: 0.7;
}

/* Refined logo: better tracking, separator dot, subtle hover glow */
.header-logo {
  font-family: var(--font-gothic);
  font-weight: 700;
  letter-spacing: 0.14em !important;
  text-transform: uppercase;
  font-size: 0.95rem !important;
  color: var(--color-text) !important;
  position: relative;
  transition: color .2s ease, text-shadow .25s ease;
}
.header-logo:hover {
  color: var(--color-gold, #c8a84b) !important;
  text-shadow: 0 0 18px rgba(200,168,75,0.35);
}
.header-logo .icon {
  filter: drop-shadow(0 0 6px rgba(200,168,75,0.25));
  transition: filter .25s ease;
}
.header-logo:hover .icon {
  filter: drop-shadow(0 0 10px rgba(200,168,75,0.5));
}

/* Nav links: cleaner underline-on-hover instead of background bg-tint */
.pub-nav { gap: 2px !important; }
.pub-nav > a.hide-mobile {
  position: relative;
  font-size: 13px !important;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em !important;
  color: rgba(230,230,235,0.72) !important;
  padding: 8px 14px !important;
  background: transparent !important;
  border-radius: 4px;
  transition: color .18s ease;
}
.pub-nav > a.hide-mobile::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px;
  bottom: 4px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold, #c8a84b), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s var(--ease-out-soft, ease-out);
  opacity: 0.85;
}
.pub-nav > a.hide-mobile:hover {
  color: #fff !important;
  background: transparent !important;
}
.pub-nav > a.hide-mobile:hover::after { transform: scaleX(1); }
.pub-nav > a.hide-mobile[aria-current="page"] {
  color: #fff !important;
}
.pub-nav > a.hide-mobile[aria-current="page"]::after {
  transform: scaleX(1);
  opacity: 1;
}

/* Header CTAs: tighter, more refined */
.pub-nav .btn { margin-left: 6px !important; }
.pub-nav .btn-sm {
  padding: 7px 14px !important;
  font-size: 12.5px !important;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.pub-nav .btn-primary {
  box-shadow: 0 2px 12px -2px rgba(200,168,75,0.4);
}
.pub-nav .btn-primary:hover {
  box-shadow: 0 4px 18px -2px rgba(200,168,75,0.55);
  transform: translateY(-1px);
}

/* Mobile: hide secondary nav, keep logo + primary CTA */
@media (max-width: 768px) {
  .pub-header { padding: 0 var(--space-md, 1rem) !important; gap: var(--space-md, 1rem) !important; }
  .header-logo { font-size: 0.85rem !important; letter-spacing: 0.1em !important; }
  .pub-nav .btn-sm { padding: 6px 12px !important; font-size: 12px !important; }
}

