/* =============================================================================
   BEAR WARRIORS UNITED — THE LEGAL FRONTLINE
   Aesthetic: Brutalist-Editorial, courtroom authority, purple on abyssal black
   Fonts: Bebas Neue (display) + Source Serif 4 (body) + Bricolage Grotesque (CTA)
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Source+Serif+4:opsz,wght@8..60,300;8..60,400;8..60,600&family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,700;12..96,800&display=swap');

/* --- Design Tokens --- */
:root {
  /* Abyssal base — deep brutalist blacks */
  --bg:             #080808;
  --surface:        #1A1A1D;
  --elevated:       #2A2A2E;
  --surface-mid:    #222225;
  --surface-deep:   #111113;
  --charcoal:       #161618;
  --slab:           #1e1e21;

  /* Purple ink palette — legal authority accent */
  --accent:         #B197FC;
  --accent-dim:     #7c68b5;
  --accent-bright:  #c9b3ff;
  --accent-deep:    #5a4a8a;
  --accent-ink:     rgba(177,151,252,0.18);
  --accent-wash:    rgba(177,151,252,0.07);
  --accent-rule:    rgba(177,151,252,0.28);

  /* Gavel white — text tones */
  --text:           #F5F5F7;
  --text-muted:     #A1A1A6;
  --text-dim:       rgba(245,245,247,0.45);
  --text-ghost:     rgba(245,245,247,0.25);

  /* Transparency layers */
  --mist:           rgba(245,245,247,0.05);
  --mist-mid:       rgba(245,245,247,0.10);
  --mist-strong:    rgba(245,245,247,0.16);
  --shadow:         rgba(0,0,0,0.55);
  --shadow-deep:    rgba(0,0,0,0.82);

  /* Layout */
  --sidebar-w:      320px;
  --header-h:       60px;
  --footer-h:       44px;
  --music-h:        80px;

  /* Typography */
  --font-display:   'Bebas Neue', sans-serif;
  --font-body:      'Source Serif 4', serif;
  --font-accent:    'Bricolage Grotesque', sans-serif;

  /* Easing */
  --ease-spring:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:       cubic-bezier(0.0, 0, 0.2, 1);
  --ease-bounce:    cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Global Lucide icon size */
svg[xmlns] { width: 16px; height: 16px; }

html {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) var(--bg);
}
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Noise grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* Vignette edges */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 110% 60% at 50% 50%, transparent 58%, rgba(0,0,0,0.4) 100%);
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); }

/* --- Progress Bar (reading tracker) --- */
.progress-bar-top {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 500;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent), var(--accent-bright));
  transition: width 0.15s linear;
  box-shadow: 0 0 8px rgba(177,151,252,0.6);
}

/* --- Tab Bar --- */
#tab-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(8,8,8,0.98);
  border-bottom: 1px solid var(--accent-rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.7);
}

#tab-bar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

#tab-bar .brand img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

/* Logo badge — purple seal */
#tab-bar .brand .logo-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: linear-gradient(160deg, var(--accent), var(--accent-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  color: var(--bg);
  flex-shrink: 0;
  letter-spacing: 0.05em;
  box-shadow:
    0 0 0 1px var(--accent-rule),
    0 0 16px rgba(177,151,252,0.35);
}

#tab-bar .event-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Tab pills — brutalist index tabs */
#tab-bar .tab-buttons {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.03);
  padding: 4px;
  border-radius: 0;
  border: 1px solid var(--accent-rule);
}

.tab-btn {
  padding: 7px 18px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.22s var(--ease-out);
  white-space: nowrap;
  text-transform: uppercase;
}

.tab-btn.active {
  background: linear-gradient(160deg, var(--accent), var(--accent-dim));
  color: var(--bg);
  box-shadow: 0 2px 12px rgba(177,151,252,0.4);
}

.tab-btn:hover:not(.active) {
  background: var(--mist-mid);
  color: var(--text);
}

/* Live clock */
#tab-bar .live-clock {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.06em;
  min-width: 90px;
  text-align: right;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
