/* ═══════════════════════════════════════════════
   TEFO 11 — BAGAY SERYE
   Shared Design System
   ═══════════════════════════════════════════════ */

/* ── Theme tokens ── */
:root {
  --font-display: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;

  /* Dark theme (default) */
  --bg-primary: #060a14;
  --bg-secondary: #0b1022;
  --bg-card: rgba(255,255,255,.04);
  --bg-card-hover: rgba(255,255,255,.07);
  --bg-nav: rgba(6,10,20,.72);
  --border: rgba(255,255,255,.08);
  --border-hover: rgba(255,255,255,.16);
  --text-primary: rgba(255,255,255,.94);
  --text-secondary: rgba(255,255,255,.64);
  --text-muted: rgba(255,255,255,.42);
  --accent-cyan: #6EE7FF;
  --accent-purple: #7C5CFF;
  --accent-cyan-muted: rgba(110,231,255,.16);
  --accent-purple-muted: rgba(124,92,255,.12);
  --glow-cyan: rgba(110,231,255,.25);
  --glow-purple: rgba(124,92,255,.20);
  --shadow-heavy: 0 32px 80px rgba(0,0,0,.6);
  --shadow-medium: 0 16px 48px rgba(0,0,0,.4);
  --shadow-light: 0 8px 24px rgba(0,0,0,.25);
  --overlay: rgba(0,0,0,.55);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 999px;
  --max-w: 1200px;
  --max-w-narrow: 880px;

  --transition-fast: .18s cubic-bezier(.4,0,.2,1);
  --transition-base: .3s cubic-bezier(.4,0,.2,1);
  --transition-slow: .6s cubic-bezier(.4,0,.2,1);
}

/* ── Light theme ── */
html.light {
  --bg-primary: #f4f2ed;
  --bg-secondary: #eae7e0;
  --bg-card: rgba(0,0,0,.03);
  --bg-card-hover: rgba(0,0,0,.06);
  --bg-nav: rgba(244,242,237,.82);
  --border: rgba(0,0,0,.08);
  --border-hover: rgba(0,0,0,.16);
  --text-primary: #111111;
  --text-secondary: rgba(17,17,17,.62);
  --text-muted: rgba(17,17,17,.38);
  --accent-cyan: #0e9ab5;
  --accent-purple: #6344d9;
  --accent-cyan-muted: rgba(14,154,181,.12);
  --accent-purple-muted: rgba(99,68,217,.08);
  --glow-cyan: rgba(14,154,181,.15);
  --glow-purple: rgba(99,68,217,.12);
  --shadow-heavy: 0 4px 16px rgba(0,0,0,.06);
  --shadow-medium: 0 2px 8px rgba(0,0,0,.04);
  --shadow-light: 0 1px 4px rgba(0,0,0,.03);
  --overlay: rgba(255,255,255,.65);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient background glow — dark only */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 1100px 700px at 15% 5%, var(--glow-cyan), transparent 60%),
    radial-gradient(ellipse 900px 600px at 85% 80%, var(--glow-purple), transparent 60%);
  opacity: 1;
}

html.light body::before {
  opacity: 0;
}

html.light .site-header.scrolled,
html.light .site-header.solid {
  box-shadow: 0 1px 0 var(--border);
}

html.light .glass-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* ── Typography ── */
.t-display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.0;
}

.t-heading {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.t-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ══════════════════════════════
   HEADER / NAV
   ══════════════════════════════ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background var(--transition-base), border-color var(--transition-base), backdrop-filter var(--transition-base);
}

.site-header.scrolled {
  background: var(--bg-nav);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

/* On inner pages, always solid */
.site-header.solid {
  background: var(--bg-nav);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  gap: 16px;
}

/* Brand / Logo */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
}

.nav-logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  background: linear-gradient(135deg, rgba(110,231,255,.20), rgba(124,92,255,.16));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 14px 46px rgba(0,0,0,.35);
  color: var(--text-primary);
  transition: transform var(--transition-fast);
}

.nav-logo:hover { transform: scale(1.05); }

.nav-brand-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: .5px;
}

.nav-brand-sub {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: .2px;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 9px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .01em;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border);
}

.nav-link.highlight {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan-muted);
  background: var(--accent-cyan-muted);
}

.nav-link.highlight:hover {
  background: rgba(110,231,255,.24);
}

/* Theme toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  transition: all var(--transition-fast);
  font-size: 18px;
  line-height: 1;
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html.light .theme-toggle .icon-sun { display: block; }
html.light .theme-toggle .icon-moon { display: none; }

/* Burger */
.nav-burger {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  z-index: 2;
}

.nav-burger span {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
  display: block;
  transition: all var(--transition-fast);
}

/* Mobile menu */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.mobile-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(340px, 88vw);
  z-index: 120;
  transform: translateX(105%);
  transition: transform var(--transition-base);
  padding: 20px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.mobile-drawer.open { transform: translateX(0); }

.mobile-drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.mobile-close {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 18px;
  display: grid;
  place-items: center;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.mobile-nav a {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  transition: all var(--transition-fast);
}

.mobile-nav a:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

@media (max-width: 768px) {
  .nav-burger { display: flex; }
  .nav-links { display: none; }
}

/* ══════════════════════════════
   MAIN LAYOUT
   ══════════════════════════════ */
.page-wrap {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 100px 24px 60px;
}

.page-wrap.narrow {
  max-width: var(--max-w-narrow);
}

/* ══════════════════════════════
   CARDS / GLASS
   ══════════════════════════════ */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 36px);
  box-shadow: var(--shadow-medium);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.glass-card:hover {
  border-color: var(--border-hover);
}

.glass-card.interactive:hover {
  transform: translateY(-3px);
}

/* ══════════════════════════════
   BUTTONS
   ══════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-light);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan-muted), var(--accent-purple-muted));
  border-color: rgba(110,231,255,.18);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(110,231,255,.28), rgba(124,92,255,.22));
}

.btn-spotify {
  background: linear-gradient(135deg, #1DB954, #1ed760);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(29,185,84,.3);
}

.btn-youtube {
  background: linear-gradient(135deg, #ff0000, #cc0000);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(255,0,0,.25);
}

/* ══════════════════════════════
   FOOTER
   ══════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 48px;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.social-icons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.social-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: grid;
  place-items: center;
  transition: all var(--transition-fast);
}

.social-icon:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-light);
}

.social-icon img {
  width: 20px;
  height: 20px;
}

/* In light mode, invert the icon SVGs */
html.light .social-icon img {
  filter: brightness(0);
}

/* ══════════════════════════════
   SCROLL REVEAL
   ══════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s cubic-bezier(.4,0,.2,1), transform .7s cubic-bezier(.4,0,.2,1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: .1s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: .2s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: .3s; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: .4s; }

/* ══════════════════════════════
   SECTION DIVIDER
   ══════════════════════════════ */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 48px 0;
}

/* ══════════════════════════════
   PAGE HERO (inner pages)
   ══════════════════════════════ */
.page-hero {
  padding: 32px 0 0;
}

.page-hero .t-label {
  margin-bottom: 12px;
}

.page-hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  margin-bottom: 12px;
}

.page-hero .page-subtitle {
  color: var(--text-secondary);
  font-size: 17px;
  max-width: 55ch;
}

/* ══════════════════════════════
   QUICK FACTS MODAL
   ══════════════════════════════ */
.qf-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}

.qf-overlay.open { display: block; }

.qf-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

.qf-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(680px, calc(100vw - 40px));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-heavy);
  padding: 24px;
}

.qf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.qf-header h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
}

.qf-close {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 18px;
  display: grid;
  place-items: center;
}

.qf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.qf-item {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
}

.qf-item strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}

.qf-item span {
  display: block;
  color: var(--text-secondary);
  font-size: 14px;
}

@media (max-width: 520px) {
  .qf-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════
   COOKIE BANNER
   ══════════════════════════════ */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 190;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-card {
  width: min(900px, 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-heavy);
  color: var(--text-primary);
  padding: 18px;
  pointer-events: auto;
}

.cookie-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.cookie-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
}

.cookie-x {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
}

.cookie-text {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.55;
}

.cookie-text-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.cookie-text-links a {
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 13px;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 12px;
}

.cookie-btn {
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  background: var(--bg-card);
  transition: all var(--transition-fast);
}

.cookie-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.cookie-btn.primary {
  background: linear-gradient(135deg, var(--accent-cyan-muted), var(--accent-purple-muted));
  border-color: rgba(110,231,255,.18);
}

.cookie-prefs {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.cookie-pref {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.cookie-pref b { font-size: 14px; }
.cookie-pref .muted { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

.pill-on {
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--accent-cyan-muted);
  background: var(--accent-cyan-muted);
  color: var(--accent-cyan);
}

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: var(--transition-fast);
  border-radius: var(--radius-full);
}
.toggle-slider::before {
  position: absolute; content: "";
  height: 20px; width: 20px;
  left: 2px; top: 2px;
  background: var(--text-secondary);
  transition: var(--transition-fast);
  border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-cyan-muted);
  border-color: rgba(110,231,255,.25);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: var(--accent-cyan);
}

@media (max-width: 520px) {
  .cookie-actions { justify-content: stretch; }
  .cookie-btn { flex: 1; text-align: center; }
}

/* ══════════════════════════════
   LEGAL PAGES (privacy/terms/cookies)
   ══════════════════════════════ */
.legal-card h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -.02em;
  margin-bottom: 8px;
}

.legal-card .effective-date {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 14px;
}

.legal-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 28px 0 10px;
}

.legal-card p,
.legal-card li {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

.legal-card ul {
  padding-left: 20px;
  margin: 8px 0;
}

.legal-card a {
  color: var(--accent-cyan);
}

.legal-card a:hover {
  text-decoration: underline;
}

.legal-note {
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent-cyan-muted), var(--accent-purple-muted));
  color: var(--text-primary);
  font-size: 14px;
}

/* ══════════════════════════════
   UTILITIES
   ══════════════════════════════ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
