@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   learns.tv — Frontend CSS (always dark gold cinematic theme)
   Light mode is for admin/dashboard only.
   ============================================================ */

/* Global Typography */
body {
    font-family: 'DM Sans', system-ui, sans-serif;
    scroll-behavior: smooth;
    overflow-x: hidden;
    background: #07070a;
    color: #f1f5f9;
}

h1, h2, h3, h4, h5, h6, .font-display {
    font-family: 'Inter', 'Outfit', sans-serif;
}

/* Design Tokens — always the cinematic dark gold palette */
:root {
    --bg-mesh: radial-gradient(circle at 15% 50%, rgba(212, 168, 83, 0.05) 0%, transparent 50%),
               radial-gradient(circle at 85% 30%, rgba(212, 168, 83, 0.05) 0%, transparent 50%);
    --card-bg: rgba(10, 14, 26, 0.85);
    --border-light: rgba(255, 255, 255, 0.08);
    --card-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 8px 32px rgba(0, 0, 0, 0.4);
    --metric-card-bg: linear-gradient(145deg, rgba(26, 31, 46, 0.7) 0%, rgba(10, 14, 26, 0.7) 100%);
    --chat-bg: rgba(10, 14, 26, 0.92);
    --chat-border: rgba(255, 255, 255, 0.08);
    --code-bg: #050508;
}

/* ── Background Mesh ── */
@keyframes mesh-float {
    0%   { transform: scale(1.1) translate(0, 0) rotate(0deg); }
    33%  { transform: scale(1.2) translate(1%, -1%) rotate(1deg); }
    66%  { transform: scale(1.2) translate(-1%, 1%) rotate(-1deg); }
    100% { transform: scale(1.1) translate(0, 0) rotate(0deg); }
}

.bg-mesh {
    position: fixed;
    top: -10vh;
    left: -10vw;
    width: 120vw;
    height: 120vh;
    z-index: -2;
    background: var(--bg-mesh);
    pointer-events: none;
    animation: mesh-float 25s infinite ease-in-out;
}

/* ── Mouse Glow ── */
#mouse-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 168, 83, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.6s ease;
}

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

/* ── Glass Panel Cards ── */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-light);
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.glass-panel:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(212, 168, 83, 0.1);
    border-color: rgba(212, 168, 83, 0.15);
}

/* ── Typography Gradients ── */
.text-gradient {
    background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-primary {
    background: linear-gradient(135deg, #D4A853 0%, #F0D878 50%, #D4A853 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-gold {
    background: linear-gradient(135deg, #D4A853 0%, #F0D878 50%, #D4A853 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-blue {
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 50%, #1D4ED8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Cinematic Heading ── */
.cinematic-heading {
    letter-spacing: -0.02em;
    text-shadow: 0 2px 40px rgba(0, 0, 0, 0.5);
}

/* ── Glass Nav — transparent → dark glass on scroll ── */
.glass-nav {
    background: rgba(5, 5, 8, 0.85) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.5);
}

/* Navbar slide-in animation */
@keyframes navSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
#navbar {
    animation: navSlideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Nav link gold underline */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #D4A853, #F0D878);
    transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }

/* ── Glow / Shadow Utilities ── */
.shadow-glow    { box-shadow: 0 0 40px rgba(212, 168, 83, 0.15); }
.shadow-glow-lg { box-shadow: 0 0 60px rgba(212, 168, 83, 0.25); }
.hover\:shadow-glow:hover    { box-shadow: 0 0 40px rgba(212, 168, 83, 0.15); }
.hover\:shadow-glow-lg:hover { box-shadow: 0 0 60px rgba(212, 168, 83, 0.25); }

.glow-gold { box-shadow: 0 0 40px rgba(212, 168, 83, 0.3), 0 0 80px rgba(212, 168, 83, 0.1); }

/* ── Scroll-reveal Animations ── */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.scroll-reveal.visible { opacity: 1; transform: translateY(0); }

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.scroll-reveal-left.visible { opacity: 1; transform: translateX(0); }

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.scroll-reveal-right.visible { opacity: 1; transform: translateX(0); }

.scroll-reveal-delay-1 { transition-delay: 0.1s; }
.scroll-reveal-delay-2 { transition-delay: 0.2s; }
.scroll-reveal-delay-3 { transition-delay: 0.3s; }
.scroll-reveal-delay-4 { transition-delay: 0.4s; }
.scroll-reveal-delay-5 { transition-delay: 0.5s; }

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

/* ── Metric Card ── */
.metric-card {
    background: var(--metric-card-bg);
    border: 1px solid var(--border-light);
    transition: all 0.4s ease;
}
.metric-card:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 168, 83, 0.3);
    box-shadow: 0 10px 30px -10px rgba(212, 168, 83, 0.15);
}

/* ── AI Chatbot ── */
#chat-widget {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(120%) scale(0.95);
    opacity: 0;
    pointer-events: none;
    border: 1px solid var(--chat-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    background: var(--chat-bg);
    backdrop-filter: blur(20px);
}
#chat-widget.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* ── AI Markdown Styling ── */
.ai-markdown strong { font-weight: 600; color: #D4A853; }
.ai-markdown ul { list-style-type: none; padding-left: 0.5rem; }
.ai-markdown li { position: relative; padding-left: 1.5rem; margin-bottom: 0.5rem; color: #cbd5e1; }
.ai-markdown li::before { content: "→"; position: absolute; left: 0; color: #D4A853; }

/* ── Loading Dots ── */
.loading-dots::after {
    content: '.';
    animation: dots 1.5s steps(5, end) infinite;
}
@keyframes dots {
    0%, 20%  { color: transparent; text-shadow: .25em 0 0 transparent, .5em 0 0 transparent; }
    40%       { color: inherit;     text-shadow: .25em 0 0 transparent, .5em 0 0 transparent; }
    60%       { text-shadow: .25em 0 0 inherit,  .5em 0 0 transparent; }
    80%, 100% { text-shadow: .25em 0 0 inherit,  .5em 0 0 inherit; }
}

/* ── Float Animation (hero particles) ── */
@keyframes float {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}
.animate-float { animation: float 6s ease-in-out infinite; }

/* ── Fade In Up ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up { animation: fadeInUp 0.8s ease-out forwards; }

/* ── Cinematic hero overlay ── */
.cinematic-overlay {
    background: linear-gradient(
        to bottom,
        rgba(5, 5, 8, 0.3) 0%,
        rgba(5, 5, 8, 0.1) 30%,
        rgba(5, 5, 8, 0.4) 60%,
        rgba(5, 5, 8, 0.95) 100%
    );
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #07070a; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }
