/* ==============================================
   IGHI'S HOME RADIO — V2 DESIGN SYSTEM
   Shared styles across all pages
   ============================================== */

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

:root {
    /* Deep space palette */
    --bg-0: #08090e;
    --bg-1: #0d0f16;
    --bg-2: #13151f;
    --bg-3: rgba(22, 25, 38, 0.9);
    --bg-glass: rgba(255,255,255,0.03);
    --bg-glass-hover: rgba(255,255,255,0.06);
    --bg-glass-active: rgba(255,255,255,0.09);

    /* Teal-Emerald accent */
    --accent: #2dd4bf;
    --accent-dim: #0f766e;
    --accent-glow: rgba(45, 212, 191, 0.15);
    --accent-glow-strong: rgba(45, 212, 191, 0.3);
    --accent-subtle: rgba(45, 212, 191, 0.06);

    /* Warm accent (sparingly) */
    --warm: #f59e0b;

    /* Semantic */
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Text hierarchy */
    --text-0: #f1f3f8;
    --text-1: #b0b5c9;
    --text-2: #626880;
    --text-3: #3d4259;

    /* Borders */
    --border: rgba(255,255,255,0.05);
    --border-hover: rgba(255,255,255,0.1);
    --border-accent: rgba(45, 212, 191, 0.15);

    /* Radius */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-pill: 100px;

    /* Typography */
    --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration: 0.25s;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
    --shadow-lg: 0 12px 48px rgba(0,0,0,0.6);
    --shadow-glow: 0 0 40px var(--accent-glow);

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-0);
    color: var(--text-0);
    line-height: 1.6;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 2px; }

/* Skip link */
.skip-link {
    position: absolute; top: -100%; left: var(--space-4);
    padding: var(--space-2) var(--space-4);
    background: var(--accent); color: #000;
    border-radius: var(--radius-sm); font-weight: 600;
    z-index: 9999; text-decoration: none;
}
.skip-link:focus { top: var(--space-2); }

/* ===== BACKGROUNDS ===== */
.scene-bg {
    position: fixed; inset: -60%; width: 220%; height: 220%;
    background-size: cover; background-position: center;
    filter: blur(120px) brightness(0.25) saturate(2);
    opacity: 0.6; z-index: -2;
    transition: background-image 2s ease;
    animation: scene-float 50s ease-in-out infinite alternate;
}
@keyframes scene-float {
    0% { transform: scale(1) translate(0, 0); }
    33% { transform: scale(1.05) translate(-1%, 1%); }
    66% { transform: scale(1.02) translate(1%, -0.5%); }
    100% { transform: scale(1.07) translate(-0.5%, 0.5%); }
}
.scene-overlay {
    position: fixed; inset: 0; z-index: -1;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, transparent 0%, var(--bg-0) 100%),
        linear-gradient(180deg, rgba(8,9,14,0.2) 0%, rgba(8,9,14,0.95) 100%);
}
/* Grain texture */
.scene-overlay::after {
    content: ''; position: fixed; inset: 0; z-index: -1;
    opacity: 0.015;
    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");
}

/* ===== HEADER ===== */
.header {
    position: sticky; top: 0; z-index: 100;
    height: 68px;
    background: rgba(8, 9, 14, 0.85);
    backdrop-filter: blur(30px) saturate(1.3);
    -webkit-backdrop-filter: blur(30px) saturate(1.3);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 clamp(16px, 5vw, 48px);
}
.header-inner {
    width: 100%; max-width: 1200px;
    margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-6);
}

/* Logo */
.logo-link {
    display: flex; align-items: center; gap: var(--space-3);
    text-decoration: none; flex-shrink: 0;
}
.logo-mark {
    position: relative;
    width: 40px; height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(45,212,191,0.2), 0 2px 12px var(--accent-glow);
    transition: all var(--duration) var(--ease);
}
.logo-mark:hover {
    box-shadow: 0 0 0 1px rgba(45,212,191,0.3), 0 4px 20px var(--accent-glow-strong);
    transform: scale(1.04);
}
.logo-mark svg { width: 22px; height: 22px; }
.logo-wordmark {
    font-family: var(--font-display);
    font-size: 17px; font-weight: 700;
    color: var(--text-0); letter-spacing: -0.02em; line-height: 1;
}
.logo-wordmark .logo-accent { color: var(--accent); }
.logo-sub {
    font-size: 10px; font-weight: 500;
    color: var(--text-2); letter-spacing: 0.12em;
    text-transform: uppercase; margin-top: 1px;
}

/* Nav */
.nav { display: flex; align-items: center; gap: 2px; }
.nav-item {
    padding: var(--space-2) var(--space-4);
    color: var(--text-1); text-decoration: none;
    font-size: 14px; font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease);
    position: relative;
}
.nav-item:hover { color: var(--text-0); background: var(--bg-glass-hover); }
.nav-item.active { color: var(--accent); }
.nav-item.active::after {
    content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
    width: 16px; height: 2px; border-radius: 1px; background: var(--accent);
}

/* Header right */
.header-right { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

/* Status pill */
.status-pill {
    display: flex; align-items: center; gap: 7px;
    padding: 6px 14px 6px 10px;
    background: var(--accent-subtle);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-pill);
    font-size: 11px; font-weight: 600;
    color: var(--accent);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.status-dot-wrap {
    position: relative; width: 8px; height: 8px;
}
.status-dot-wrap::before {
    content: ''; position: absolute; inset: 0;
    border-radius: 50%; background: var(--accent);
    animation: dot-ping 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.status-dot-wrap::after {
    content: ''; position: absolute; inset: 1px;
    border-radius: 50%; background: var(--accent);
}
@keyframes dot-ping {
    0% { transform: scale(1); opacity: 0.8; }
    75%, 100% { transform: scale(2.2); opacity: 0; }
}

/* Lang toggle */
.lang-toggle {
    display: flex; background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill); padding: 3px;
}
.lang-btn {
    padding: 4px 11px; border: none; background: transparent;
    color: var(--text-3); font-size: 11px; font-weight: 600;
    cursor: pointer; border-radius: var(--radius-pill);
    transition: all 0.2s ease; font-family: var(--font-body);
}
.lang-btn:hover { color: var(--text-1); }
.lang-btn.active { background: var(--accent); color: #000; }

/* ===== FOOTER ===== */
.footer {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: var(--space-2) var(--space-4);
    padding: 14px clamp(16px, 5vw, 48px);
    font-size: 11px; color: var(--text-3);
    border-top: 1px solid var(--border);
}
.footer a { color: var(--text-3); text-decoration: none; transition: color 0.2s; }
.footer a:hover { color: var(--accent); }
.footer-dot { opacity: 0.3; }

/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: 24px; right: 24px;
    padding: 12px 20px;
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-0); font-size: 13px;
    box-shadow: var(--shadow-lg);
    transform: translateX(calc(100% + 40px));
    transition: transform 0.4s var(--ease-out);
    z-index: 999;
}
.toast.show { transform: translateX(0); }
.toast.error { border-color: var(--error); }
.toast.success { border-color: var(--success); }

/* ===== UTILITY ===== */
.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;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
    .nav { display: none; }
    .header { height: 56px; }
}

@media (max-width: 480px) {
    .logo-wordmark { font-size: 14px; }
    .logo-sub { display: none; }
    .logo-mark { width: 34px; height: 34px; border-radius: 10px; }
    .logo-mark svg { width: 18px; height: 18px; }
    .status-pill { padding: 4px 10px 4px 8px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
