/* DarkOS – Main CSS */
@import url('https://fonts.googleapis.com/css2?family=Oxanium:wght@400;600;700;800&family=DM+Mono:wght@300;400;500&display=swap');

/* ── Variables: Pre-light ──────────────────────────────── */
html.pre-light body {
  --bg: #f0f2f7;
  --surface: #ffffff;
  --surface2: #f7f9fc;
  --border: rgba(0,0,0,0.08);
  --text: #0d0f1a;
  --text-dim: #6b7280;
  --accent: #5b3de8;
  --accent2: #0ea5a0;
  --accent3: #e84040;
  --glow: rgba(91,61,232,0.15);
  --shadow: 0 4px 24px rgba(0,0,0,0.07);
  --shadow-lg: 0 12px 48px rgba(91,61,232,0.12);
  --nav-bg: rgba(240,242,247,0.88);
}

/* ── Variables: Dark ──────────────────────────────── */
body {
  --bg:        #080c14;
  --surface:   #111827;
  --surface2:  #1a2236;
  --border:    rgba(255,255,255,0.07);
  --text:      #e8ecf4;
  --text-dim:  #6b7a99;
  --accent:    #7f5af0;
  --accent2:   #2cb67d;
  --accent3:   #ff4757;
  --glow:      rgba(127,90,240,0.25);
  --shadow:    0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 48px rgba(127,90,240,0.2);
  --font-head: 'Oxanium', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --nav-bg:    rgba(8,12,20,0.85);
}

/* ── Animated orb system ───────────────────────────────────────
   Orbs live as real DOM elements (.orb) so they can animate
   independently. body::after handles the fixed grid.         */

/* Keyframes — each orb drifts on its own path */
@keyframes orb1 { 0%,100%{transform:translate(0,0) scale(1)}   33%{transform:translate(4vw,3vh) scale(1.08)}  66%{transform:translate(-3vw,5vh) scale(0.95)} }
@keyframes orb2 { 0%,100%{transform:translate(0,0) scale(1)}   40%{transform:translate(-5vw,-4vh) scale(1.1)} 70%{transform:translate(3vw,2vh) scale(0.92)} }
@keyframes orb3 { 0%,100%{transform:translate(0,0) scale(1)}   30%{transform:translate(3vw,-5vh) scale(0.94)} 65%{transform:translate(-4vw,3vh) scale(1.07)} }
@keyframes orb4 { 0%,100%{transform:translate(0,0) scale(1)}   45%{transform:translate(-3vw,4vh) scale(1.12)} 75%{transform:translate(5vw,-2vh) scale(0.96)} }
@keyframes orb5 { 0%,100%{transform:translate(0,0) scale(1)}   35%{transform:translate(4vw,4vh) scale(0.93)}  68%{transform:translate(-2vw,-3vh) scale(1.06)} }

.orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
  z-index: 0;
  will-change: transform;
}
.orb-1 {
  width: 55vw; height: 55vh;
  top: -10vh; left: 10vw;
  background: radial-gradient(ellipse at center, rgba(127,90,240,0.22) 0%, transparent 70%);
  animation: orb1 18s ease-in-out infinite;
}
.orb-2 {
  width: 45vw; height: 50vh;
  top: 30vh; right: -5vw;
  background: radial-gradient(ellipse at center, rgba(127,90,240,0.12) 0%, transparent 70%);
  animation: orb2 22s ease-in-out infinite;
}
.orb-3 {
  width: 40vw; height: 45vh;
  top: 45vh; left: -8vw;
  background: radial-gradient(ellipse at center, rgba(44,182,125,0.11) 0%, transparent 70%);
  animation: orb3 26s ease-in-out infinite;
}
.orb-4 {
  width: 50vw; height: 45vh;
  bottom: -5vh; right: 5vw;
  background: radial-gradient(ellipse at center, rgba(127,90,240,0.13) 0%, transparent 70%);
  animation: orb4 20s ease-in-out infinite;
}
.orb-5 {
  width: 30vw; height: 30vh;
  bottom: 15vh; left: 30vw;
  background: radial-gradient(ellipse at center, rgba(255,71,87,0.07) 0%, transparent 70%);
  animation: orb5 24s ease-in-out infinite;
}

/* Light mode orb colors */
body.light .orb-1 { background: radial-gradient(ellipse at center, rgba(91,61,232,0.22)  0%, transparent 70%); }
body.light .orb-2 { background: radial-gradient(ellipse at center, rgba(180,80,255,0.14) 0%, transparent 70%); }
body.light .orb-3 { background: radial-gradient(ellipse at center, rgba(14,165,160,0.13) 0%, transparent 70%); }
body.light .orb-4 { background: radial-gradient(ellipse at center, rgba(91,61,232,0.15)  0%, transparent 70%); }
body.light .orb-5 { background: radial-gradient(ellipse at center, rgba(14,165,160,0.09) 0%, transparent 70%); }

/* Fixed grid on top of orbs */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(127,90,240,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127,90,240,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 140% 100% at 50% 25%, black 15%, transparent 75%);
  opacity: 0.8;
}
body.light::after {
  background:
    linear-gradient(rgba(91,61,232,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91,61,232,0.07) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ── Variables: Light ───────────────────────────────────────── */
body.light {
  --bg:        #eeeaff;
  --surface:   #f5f2ff;
  --surface2:  #ede8ff;
  --surface3:  #e2dcf8;
  --border:    rgba(91,61,232,0.14);
  --text:      #0d0a1f;
  --text-dim:  #5a527a;
  --accent:    #5b3de8;
  --accent2:   #0ea5a0;
  --accent3:   #e84040;
  --glow:      rgba(91,61,232,0.22);
  --shadow:    0 4px 24px rgba(91,61,232,0.1);
  --shadow-lg: 0 12px 48px rgba(91,61,232,0.18);
  --nav-bg:    rgba(238,234,255,0.9);
}

/* Light mode base bg color (orbs animated via .orb classes above) */
body.light { background: #eeeaff; }
body.light .hero::before { background: none; }
body.light .stats-section::before,
body.light .stats-section::after { display: none; }
body.light .twitch-section::before { display: none; }

/* Cards + strips */
body.light .stat-card {
  background: rgba(245,242,255,0.85);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 20px rgba(91,61,232,0.1), inset 0 1px 0 rgba(255,255,255,0.7);
}
body.light .hero-stats-strip {
  background: rgba(245,242,255,0.8);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(91,61,232,0.12), inset 0 1px 0 rgba(255,255,255,0.8);
}
body.light .twitch-card {
  background: rgba(245,242,255,0.85);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(145,70,255,0.12), inset 0 1px 0 rgba(255,255,255,0.7);
}
body.light .nav {
  background: rgba(238,234,255,0.88);
  border-bottom-color: rgba(91,61,232,0.15);
}
/* Accent badge etc pick up purple tint naturally via --surface */

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-head);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.25s, color 0.25s;
}
a { color: inherit; text-decoration: none; }

/* ── Noise ──────────────────────────────────────────────────── */
.noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Nav ────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center;
  padding: 0 2.5rem; height: 64px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.25s, border-color 0.25s;
}
.nav-brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 1.15rem; font-weight: 800; color: var(--text);
  transition: color 0.25s;
}
.nav-logo {
  width: 32px; height: 32px; object-fit: contain; border-radius: 50%;
  filter: drop-shadow(0 0 8px var(--glow));
}
.nav-links {
  display: flex; align-items: center; gap: 0.5rem; margin-left: auto;
}
.nav-links a {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-dim);
  padding: 0.4rem 0.8rem; border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--accent); background: rgba(127,90,240,0.08); }
.btn-nav {
  padding: 0.4rem 1.1rem !important; background: var(--accent) !important;
  color: #fff !important; border-radius: 8px !important;
  font-weight: 700 !important; font-size: 0.75rem !important;
  letter-spacing: 0.08em !important; box-shadow: 0 2px 12px var(--glow);
  transition: background 0.2s !important;
}
.nav-right { display: flex; align-items: center; gap: 0.5rem; margin-left: 0.75rem; }
.lang-toggle, .theme-toggle {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 0.3rem 0.65rem; border-radius: 6px;
  cursor: pointer; font-family: var(--font-head); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; transition: border-color 0.2s, background 0.25s, color 0.25s;
}
.theme-toggle { font-size: 1rem; padding: 0.3rem 0.55rem; }
.lang-toggle:hover, .theme-toggle:hover { border-color: var(--accent); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  position: relative; min-height: 100vh; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8rem 2rem 5rem; text-align: center; overflow: hidden;
}
/* hero::before removed — body::before handles global bg */
.hero-grid { display: none; } /* grid now handled by fixed body::after */
.hero-content {
  position: relative; z-index: 1; max-width: 720px; width: 100%;
  display: flex; flex-direction: column; align-items: center;
}
.hero-logo {
  width: 184px; height: 184px; object-fit: contain;
  margin-bottom: 2rem; border-radius: 50%;
  filter: drop-shadow(0 8px 32px rgba(127,90,240,0.3));
  animation: float 5s ease-in-out infinite;
}
body.light .hero-logo { mix-blend-mode: multiply; filter: drop-shadow(0 8px 32px rgba(91,61,232,0.2)); }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }

.hero-badge {
  display: inline-flex; align-items: center;
  padding: 0.3rem 1rem; background: var(--surface);
  border: 1px solid rgba(127,90,240,0.25); border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent);
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 1.2rem;
  box-shadow: 0 2px 12px var(--glow); transition: background 0.25s;
}
.hero-title {
  font-size: clamp(3.5rem, 10vw, 7rem); font-weight: 800;
  line-height: 0.95; letter-spacing: -0.02em; color: var(--text);
  margin-bottom: 1.2rem; transition: color 0.25s;
}
.hero-sub {
  font-size: 1.05rem; color: var(--text-dim); font-weight: 400;
  line-height: 1.6; max-width: 480px; margin-bottom: 2.5rem; transition: color 0.25s;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 2rem; background: var(--accent); color: #fff;
  border-radius: 10px; font-family: var(--font-head); font-weight: 700;
  font-size: 0.9rem; box-shadow: 0 4px 20px var(--glow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px var(--glow); }

/* ── Stats strip ────────────────────────────────────────────── */
.hero-stats-strip {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; justify-content: center;
  margin-top: 4rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  width: 100%; max-width: 760px;
  transition: background 0.25s, border-color 0.25s;
}
.stat-chip {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.2rem 1.6rem; flex: 1; min-width: 100px;
  border-right: 1px solid var(--border);
  transition: background 0.2s, border-color 0.25s;
}
.stat-chip:last-child { border-right: none; }
.stat-chip:hover {
  background: rgba(127,90,240,0.06);
  box-shadow: inset 0 0 20px rgba(127,90,240,0.06);
}
.stat-num { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 500; color: var(--accent); }
.stat-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); margin-top: 0.2rem; transition: color 0.25s; }

/* ── Stats section ──────────────────────────────────────────── */
.stats-section {
  padding: 7rem 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* stats bg removed — body::before/after handles entire page bg */
.stats-section::before, .stats-section::after { display: none; }

.section-header { position: relative; z-index: 1; margin-bottom: 3rem; }
.section-header h2 {
  font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800;
  letter-spacing: -0.02em; color: var(--text); margin-bottom: 0.5rem; transition: color 0.25s;
}
.stat-live-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent2); letter-spacing: 0.1em;
}
.stat-live-badge::before { content: '●'; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.stats-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem; max-width: 960px; margin: 0 auto;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s, background 0.25s, border-color 0.25s;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px var(--glow), 0 0 0 1px rgba(127,90,240,0.2);
  border-color: rgba(127,90,240,0.25);
}
.stat-big { font-family: var(--font-mono); font-size: 2.5rem; font-weight: 500; color: var(--accent); letter-spacing: -0.03em; margin-bottom: 0.4rem; }
.stat-name { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); transition: color 0.25s; }

/* ── Twitch ─────────────────────────────────────────────────── */
.twitch-section {
  padding: 5rem 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}
.twitch-section::before { display: none; }
.twitch-section .section-header { position: relative; z-index: 1; }

/* Card wrapper */
.tc-wrap {
  max-width: 480px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(145,70,255,0.2);
  box-shadow: 0 8px 40px rgba(145,70,255,0.12);
  transition: transform .3s, box-shadow .3s;
  position: relative; z-index: 1;
}
.tc-wrap:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(145,70,255,0.22);
}

/* Thumbnail */
.tc-thumb {
  position: relative;
  width: 100%; height: 200px;
  overflow: hidden;
  background: #0e0618;
  cursor: pointer;
}
.tc-thumb-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 30% 40%, rgba(145,70,255,0.35) 0%, transparent 65%),
    radial-gradient(ellipse 60% 60% at 80% 70%, rgba(40,10,80,0.8) 0%, transparent 70%),
    linear-gradient(135deg, #0e0618 0%, #1a0a2e 50%, #0a1628 100%);
  transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.tc-thumb:hover .tc-thumb-bg { transform: scale(1.04); }

/* subtle scanline noise */
.tc-thumb-noise {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0.04;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.5) 0px, rgba(255,255,255,0.5) 1px, transparent 1px, transparent 3px);
}

/* LIVE badge */
.tc-live-badge {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  background: #e91916; color: #fff;
  font-family: var(--font-head); font-size: 0.65rem; font-weight: 800;
  letter-spacing: 0.12em; padding: 4px 10px; border-radius: 5px;
  box-shadow: 0 2px 12px rgba(233,25,22,0.5);
}
.tc-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff; display: inline-block;
  animation: pulse 1.2s ease-in-out infinite;
}

/* Viewer count */
.tc-viewers {
  position: absolute; bottom: 10px; left: 12px; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(0,0,0,0.65); color: #fff; backdrop-filter: blur(4px);
  font-family: var(--font-mono); font-size: 0.68rem;
  padding: 3px 8px; border-radius: 5px;
}

/* Play icon center */
.tc-play {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
}
.tc-play svg {
  opacity: 0.25;
  filter: drop-shadow(0 0 12px rgba(145,70,255,0.8));
  transition: opacity .25s, transform .25s;
  transform: scale(1);
}
.tc-thumb:hover .tc-play svg { opacity: 0.55; transform: scale(1.15); }

/* Info row */
.tc-info {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.4rem;
}

/* Avatar */
.tc-avatar-wrap { position: relative; flex-shrink: 0; width: 46px; height: 46px; }
.tc-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: #9146ff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(145,70,255,0.4);
  position: relative; z-index: 1;
}
.tc-avatar-ring {
  position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid rgba(145,70,255,0.5);
  transition: border-color .3s, box-shadow .3s;
}
/* Ring pulses when live */
.tc-wrap.live .tc-avatar-ring {
  border-color: #e91916;
  box-shadow: 0 0 0 3px rgba(233,25,22,0.2);
  animation: liveRing 2s ease-in-out infinite;
}
@keyframes liveRing {
  0%,100% { box-shadow: 0 0 0 3px rgba(233,25,22,0.2); }
  50%      { box-shadow: 0 0 0 6px rgba(233,25,22,0.0); }
}

.tc-meta { flex: 1; text-align: left; }
.tc-name {
  font-size: 1rem; font-weight: 800; color: var(--text);
  margin-bottom: .2rem; transition: color .25s;
}
.tc-sub {
  display: flex; align-items: center; gap: .7rem;
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-dim);
}
.tc-followers { display: flex; align-items: center; gap: 4px; }
.tc-status-txt { color: var(--text-dim); }
.tc-wrap.live .tc-status-txt { color: #e91916; font-weight: 700; }

/* Follow button */
.tc-follow-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.2rem;
  background: #9146ff;
  color: #fff; border-radius: 8px;
  font-family: var(--font-head); font-weight: 700; font-size: .8rem;
  text-decoration: none; flex-shrink: 0;
  box-shadow: 0 3px 14px rgba(145,70,255,0.4);
  transition: background .2s, transform .2s, box-shadow .2s;
}
.tc-follow-btn:hover {
  background: #a855f7;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(145,70,255,0.55);
}
.tc-follow-btn:active { transform: scale(0.97); }

/* Light mode adjustments */
body.light .tc-wrap {
  background: rgba(245,242,255,0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 40px rgba(91,61,232,0.13), inset 0 1px 0 rgba(255,255,255,0.8);
}
body.light .tc-wrap:hover { box-shadow: 0 20px 60px rgba(91,61,232,0.2), inset 0 1px 0 rgba(255,255,255,0.8); }

/* Legacy compat (twitch.js might set these) */
.twitch-offline { color: var(--text-dim); font-size: 0.78rem; font-family: var(--font-mono); }
.twitch-live { display:none; }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 3rem 2.5rem; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 1.5rem;
  transition: background 0.25s, border-color 0.25s;
  position: relative; z-index: 1;
}
.footer-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1rem; color: var(--text); transition: color 0.25s; }
.footer-logo { width: 28px; height: 28px; object-fit: contain; border-radius: 50%; filter: drop-shadow(0 0 6px var(--glow)); }
body.light .footer-logo { mix-blend-mode: multiply; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { font-size: 0.8rem; font-weight: 600; color: var(--text-dim); transition: color 0.2s; letter-spacing: 0.06em; text-transform: uppercase; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: 0.72rem; color: var(--text-dim); font-family: var(--font-mono); transition: color 0.25s; }
