/* ============================================
   SECOOLIO'S WEB - Next Level Stylesheet
   Apple-inspired + premium animations
   ============================================ */

/* --- Skip Link (Accessibility) --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    z-index: 100000;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.3s ease;
}
.skip-link:focus {
    top: 0;
}

/* --- Legal Page Styles --- */
.legal-content {
    max-width: 740px;
    margin: 0 auto;
    line-height: 1.8;
}
.legal-content h2 {
    font-size: 1.4rem;
    margin: 2rem 0 0.75rem;
    color: var(--text);
    font-weight: 700;
}
.legal-content h3 {
    font-size: 1.15rem;
    margin: 1.5rem 0 0.5rem;
    color: var(--text);
    font-weight: 600;
}
.legal-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.legal-content a {
    color: var(--primary);
    text-decoration: none;
}
.legal-content a:hover {
    text-decoration: underline;
}

/* --- Footer Links (legal) --- */
.footer-links {
    display: flex;
    gap: 1.5rem;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--text);
}

/* --- CSS Variables / Theme --- */
:root {
    --primary: #2997ff;
    --primary-dark: #0071e3;
    --accent: #bf5af2;
    --accent-alt: #5e5ce6;
    --bg-dark: #000000;
    --bg-darker: #000000;
    --bg-section: #0a0a0a;
    --bg-section-alt: #111111;
    --bg-card: rgba(28, 28, 30, 0.8);
    --text: #f5f5f7;
    --text-muted: #a1a1a6;
    --text-secondary: #b0b0b5;
    --white: #f5f5f7;
    --border: rgba(255, 255, 255, 0.08);
    --transition: 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-spring: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --nav-bg: rgba(0, 0, 0, 0.72);
    --nav-bg-scroll: rgba(0, 0, 0, 0.88);
    --sidebar-bg: rgba(0, 0, 0, 0.92);
    --radius: 20px;
    --radius-sm: 12px;
    --radius-full: 980px;
    --glow-primary: rgba(41, 151, 255, 0.15);
    --glow-accent: rgba(191, 90, 242, 0.15);
    --yt-red: #ff0000;
}

/* --- Light Theme --- */
[data-theme="light"] {
    --primary: #0071e3;
    --primary-dark: #0077ed;
    --accent: #bf5af2;
    --accent-alt: #5e5ce6;
    --bg-dark: #ffffff;
    --bg-darker: #fbfbfd;
    --bg-section: #f5f5f7;
    --bg-section-alt: #eeeeef;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text: #1d1d1f;
    --text-muted: #515154;
    --text-secondary: #6e6e73;
    --white: #1d1d1f;
    --border: rgba(0, 0, 0, 0.08);
    --nav-bg: rgba(255, 255, 255, 0.72);
    --nav-bg-scroll: rgba(255, 255, 255, 0.88);
    --sidebar-bg: rgba(255, 255, 255, 0.95);
    --glow-primary: rgba(0, 113, 227, 0.08);
    --glow-accent: rgba(191, 90, 242, 0.08);
}

[data-theme="light"] .hero-title {
    background: linear-gradient(135deg, #1d1d1f 0%, #0071e3 25%, #5e5ce6 50%, #0071e3 75%, #1d1d1f 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 8s ease-in-out infinite;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
    transition: background 0.6s ease, color 0.6s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* --- Particle Canvas --- */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
    transition: opacity 0.6s ease;
}

[data-theme="light"] #particleCanvas {
    opacity: 0.12;
}

/* ============================================
   SCROLL REVEAL SYSTEM (Apple-style)
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays for child elements */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* ============================================
   NAVBAR (Apple-style frosted glass, 48px tall)
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 48px;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    transition: all var(--transition), transform 0.35s ease;
}

.navbar.scrolled {
    background: var(--nav-bg-scroll);
}

.navbar.nav-hidden {
    transform: translateY(-100%);
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Hamburger Button */
.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    z-index: 1001;
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .hamburger:hover {
    background: rgba(0, 0, 0, 0.05);
}

.hamburger .bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Language Toggle Button --- */
.lang-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all var(--transition);
}

.lang-toggle:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.lang-flag {
    pointer-events: none;
}

[data-theme="light"] .lang-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* --- Theme Toggle Button --- */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-muted);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.theme-toggle:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-toggle .icon-sun {
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}
.theme-toggle .icon-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

[data-theme="light"] .theme-toggle .icon-sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}
[data-theme="light"] .theme-toggle .icon-moon {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

[data-theme="light"] .theme-toggle {
    color: #f59e0b;
}

/* Social Buttons in Navbar */
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    transition: all var(--transition);
    color: var(--text-muted);
    background: transparent;
    border: none;
}

.social-btn svg {
    width: 18px;
    height: 18px;
}

.social-btn:hover {
    color: var(--text);
}

.youtube-btn { color: #ff3b30; }
.github-btn { color: #8957e5; }
.instagram-btn { color: #E1306C; }
.forum-btn { color: #2997ff; }
.youtube-btn:hover { color: #ff0000; filter: drop-shadow(0 0 8px rgba(255, 59, 48, 0.6)); }
.github-btn:hover { color: #a371f7; filter: drop-shadow(0 0 8px rgba(137, 87, 229, 0.6)); }
.instagram-btn:hover { color: #fd1d1d; filter: drop-shadow(0 0 8px rgba(225, 48, 108, 0.6)); }
.forum-btn:hover { color: #64d2ff; filter: drop-shadow(0 0 8px rgba(41, 151, 255, 0.6)); }

/* --- Easter Egg --- */
.easter-egg {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.55rem;
    color: rgba(134, 134, 139, 0.2);
    cursor: pointer;
    letter-spacing: 3px;
    transition: all 0.5s ease;
    user-select: none;
}

.easter-egg:hover {
    color: var(--accent);
    letter-spacing: 5px;
}

/* ============================================
   SIDEBAR (clean frosted panel)
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: -340px;
    width: 320px;
    height: 100vh;
    background: var(--sidebar-bg);
    backdrop-filter: saturate(180%) blur(40px);
    -webkit-backdrop-filter: saturate(180%) blur(40px);
    z-index: 2000;
    transition: left 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    min-height: 48px;
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.close-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-links {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.sidebar-links li {
    opacity: 0;
    transform: translateX(-15px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar.open .sidebar-links li {
    opacity: 1;
    transform: translateX(0);
}

.sidebar.open .sidebar-links li:nth-child(1) { transition-delay: 0.05s; }
.sidebar.open .sidebar-links li:nth-child(2) { transition-delay: 0.1s; }
.sidebar.open .sidebar-links li:nth-child(3) { transition-delay: 0.15s; }
.sidebar.open .sidebar-links li:nth-child(4) { transition-delay: 0.2s; }

.sidebar-links a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
}

.sidebar-links a:hover,
.sidebar-links a.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border-left-color: var(--primary);
}

[data-theme="light"] .sidebar-links a:hover,
[data-theme="light"] .sidebar-links a.active {
    background: rgba(0, 0, 0, 0.03);
}

.link-icon {
    font-size: 1.1rem;
}

/* Submenu Accordion */
.has-submenu > .submenu-toggle {
    justify-content: flex-start;
    position: relative;
}

.submenu-toggle .arrow {
    margin-left: auto;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
    color: var(--text-muted);
    line-height: 1;
}

.has-submenu.open > .submenu-toggle .arrow {
    transform: rotate(90deg);
    color: var(--primary);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    margin-left: 0.25rem;
}

.has-submenu.open > .submenu {
    max-height: 800px;
}

.submenu li {
    opacity: 1 !important;
    transform: none !important;
}

.submenu a {
    padding: 0.5rem 1.5rem 0.5rem 2.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-left: 1px solid rgba(255, 255, 255, 0.04);
}

.submenu a:hover {
    color: var(--primary);
}

/* Nested submenu deeper indentation */
.submenu .submenu a {
    padding-left: 3.2rem;
    font-size: 0.85rem;
}

.submenu .submenu .submenu a {
    padding-left: 3.8rem;
    font-size: 0.82rem;
}

[data-theme="light"] .submenu a {
    border-left-color: rgba(0, 0, 0, 0.04);
}

.submenu a .link-icon {
    font-size: 0.95rem;
}

.sidebar-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.sidebar-footer p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   HERO SECTION (Apple: huge text, clean space)
   ============================================ */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    overflow: hidden;
}

/* Subtle gradient glow behind hero */
.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(41, 151, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: heroGlow 8s ease-in-out infinite alternate;
}

[data-theme="light"] .hero::before {
    background: radial-gradient(circle, rgba(0, 113, 227, 0.04) 0%, transparent 70%);
}

@keyframes heroGlow {
    0% { transform: translateX(-50%) scale(1); opacity: 1; }
    100% { transform: translateX(-50%) scale(1.2); opacity: 0.6; }
}

/* --- Hero Floating Orbs --- */
.hero-orbs {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: orbFloat 20s ease-in-out infinite;
}

.hero-orb-1 {
    width: 500px;
    height: 500px;
    background: var(--glow-primary);
    top: -10%;
    right: -10%;
    animation-delay: 0s;
    animation-duration: 18s;
}

.hero-orb-2 {
    width: 400px;
    height: 400px;
    background: var(--glow-accent);
    bottom: -10%;
    left: -10%;
    animation-delay: -5s;
    animation-duration: 22s;
}

.hero-orb-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--glow-primary), var(--glow-accent));
    top: 40%;
    left: 50%;
    animation-delay: -10s;
    animation-duration: 25s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 30px) scale(1.05); }
}

.hero-content {
    animation: heroReveal 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

@keyframes heroReveal {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.97);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Title - huge, clean, animated gradient */
.glitch-wrapper {
    position: relative;
    display: inline-block;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(3.2rem, 10vw, 7rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.04em;
    position: relative;
    line-height: 1.05;
    padding: 0.1em 0;
}

.hero-title.gradient-text {
    background: linear-gradient(
        135deg,
        var(--text) 0%,
        var(--primary) 25%,
        var(--accent) 50%,
        var(--primary) 75%,
        var(--text) 100%
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Subtle glitch - rare, minimal */
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: var(--font-heading);
    font-size: clamp(3.2rem, 10vw, 7rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    background: transparent;
    -webkit-text-fill-color: initial;
}

.glitch::before {
    color: var(--primary);
    z-index: -1;
    animation: glitch1 10s infinite;
    clip-path: inset(50% 0 50% 0);
    opacity: 0;
}

.glitch::after {
    color: var(--accent);
    z-index: -2;
    animation: glitch2 10s infinite;
    clip-path: inset(50% 0 50% 0);
    opacity: 0;
}

@keyframes glitch1 {
    0%, 95%, 100% { clip-path: inset(50% 0 50% 0); transform: translate(0); opacity: 0; }
    96% { clip-path: inset(15% 0 60% 0); transform: translate(-2px, 1px); opacity: 0.5; }
    97% { clip-path: inset(60% 0 10% 0); transform: translate(2px, -1px); opacity: 0.5; }
    98% { clip-path: inset(50% 0 50% 0); transform: translate(0); opacity: 0; }
}

@keyframes glitch2 {
    0%, 96%, 100% { clip-path: inset(50% 0 50% 0); transform: translate(0); opacity: 0; }
    97% { clip-path: inset(40% 0 20% 0); transform: translate(2px, -1px); opacity: 0.5; }
    98% { clip-path: inset(20% 0 50% 0); transform: translate(-2px, 1px); opacity: 0.5; }
    99% { clip-path: inset(50% 0 50% 0); transform: translate(0); opacity: 0; }
}

/* Subtitle with Typewriter */
.hero-subtitle {
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 1.25rem;
    min-height: 2rem;
    line-height: 1.5;
}

.cursor {
    color: var(--primary);
    animation: blink 1s step-end infinite;
    font-weight: 200;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* CTA Buttons */
.hero-cta {
    margin-top: 2.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: ctaReveal 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
    opacity: 0;
}

@keyframes ctaReveal {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero Search Trigger Bar */
.hero-search-trigger {
    margin-top: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: 0.92rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: ctaReveal 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
    opacity: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    user-select: none;
    max-width: 340px;
    width: 100%;
}

.hero-search-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hero-search-trigger:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.hero-search-trigger svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.hero-search-trigger span {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-search-trigger kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-family: var(--font-body);
    flex-shrink: 0;
    line-height: 1.4;
}

[data-theme="light"] .hero-search-trigger {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .hero-search-trigger:hover {
    background: rgba(0, 0, 0, 0.07);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .hero-search-trigger kbd {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    text-decoration: none;
    position: relative;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    overflow: hidden;
}

/* Apple-style shine overlay */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
    pointer-events: none;
    border-radius: var(--radius-full) var(--radius-full) 0 0;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.04);
    box-shadow: 0 4px 20px rgba(41, 151, 255, 0.3);
}

/* Glow button effect */
.btn-glow {
    position: relative;
}

.btn-glow::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--primary));
    background-size: 200% 200%;
    z-index: -1;
    opacity: 0;
    filter: blur(12px);
    transition: opacity 0.4s ease;
    animation: gradientShift 4s ease-in-out infinite;
}

.btn-glow:hover::after {
    opacity: 0.6;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    position: relative;
}

.btn-outline:hover {
    color: var(--primary-dark);
}

.btn-outline::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.btn-outline:hover::after {
    width: 55%;
}

.btn-forum-hero {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    background: rgba(41, 151, 255, 0.1);
    border: 1px solid rgba(41, 151, 255, 0.3);
    border-radius: 50px;
    color: var(--primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}
.btn-forum-hero:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(41, 151, 255, 0.3);
}
.btn-forum-hero svg {
    transition: transform 0.3s ease;
}
.btn-forum-hero:hover svg {
    transform: scale(1.1);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: floatUp 3s ease-in-out infinite;
    opacity: 0.35;
}

.scroll-indicator p {
    font-size: 0.68rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 500;
}

.mouse {
    width: 22px;
    height: 36px;
    border: 2px solid var(--text-muted);
    border-radius: 11px;
    display: flex;
    justify-content: center;
    padding-top: 7px;
}

.wheel {
    width: 3px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 2px;
    animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollWheel {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(8px); }
}

@keyframes floatUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ============================================
   FEATURES SECTION (Apple card grid + 3D tilt)
   ============================================ */
.features {
    position: relative;
    z-index: 1;
    padding: 8rem 2rem;
    background: var(--bg-section);
}

.container {
    max-width: 1080px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text);
    letter-spacing: -0.03em;
    font-weight: 700;
    line-height: 1.1;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Remove the old underline bar */
.section-title::after {
    display: none;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 4rem;
}

/* Feature card with 3D tilt support */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Scroll reveal */
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
    will-change: transform;
}

.feature-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 3D tilt card overrides - transform handled by JS */
.tilt-card {
    transform-style: preserve-3d;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

.tilt-card.visible {
    opacity: 1;
}

/* Shine overlay for tilt effect */
.card-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.feature-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .feature-card {
    background: var(--bg-card);
}

[data-theme="light"] .feature-card:hover {
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.06);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateZ(30px);
}

.feature-card:hover .feature-icon {
    transform: translateZ(30px) scale(1.12);
}

.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 0.6rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transform: translateZ(20px);
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
    transform: translateZ(15px);
}

/* ============================================
   STATS / COUNTER SECTION
   ============================================ */
.stats-section {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
    background: var(--bg-section);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1080px;
    margin: 0 auto;
}

.stat-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    /* reveal */
    opacity: 0;
    transform: translateY(30px);
}

.stat-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .stat-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    fill: var(--primary);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

/* Live badge for YouTube */
.stat-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    background: rgba(255, 0, 0, 0.08);
    border: 1px solid rgba(255, 0, 0, 0.15);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--yt-red);
    letter-spacing: 1.5px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-live-badge.active {
    opacity: 1;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--yt-red);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* ============================================
   TECH STACK MARQUEE
   ============================================ */
.marquee-section {
    position: relative;
    z-index: 1;
    padding: 1.5rem 0;
    overflow: hidden;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.marquee-track {
    display: flex;
    width: fit-content;
    animation: marqueeScroll 40s linear infinite;
}

.marquee-content {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

.marquee-item {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0 1rem;
    transition: color 0.3s ease;
}

.marquee-dot {
    color: var(--primary);
    font-size: 0.5rem;
    opacity: 0.5;
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-section:hover .marquee-track {
    animation-play-state: paused;
}

/* ============================================
   YOUTUBE SHOWCASE SECTION
   ============================================ */
.yt-showcase {
    position: relative;
    z-index: 1;
    padding: 8rem 2rem;
    background: var(--bg-section-alt);
}

.yt-showcase-content {
    margin-top: 3rem;
}

.yt-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.yt-card:hover {
    border-color: rgba(255, 0, 0, 0.2);
    box-shadow: 0 30px 80px rgba(255, 0, 0, 0.06);
}

[data-theme="light"] .yt-card:hover {
    box-shadow: 0 30px 80px rgba(255, 0, 0, 0.03);
}

.yt-card-visual {
    position: relative;
    background: linear-gradient(135deg, #1a0000 0%, #0a0000 50%, #1a0005 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    overflow: hidden;
}

.yt-card-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 0, 0, 0.08) 0%, transparent 70%);
    z-index: 0;
}

.yt-play-btn {
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    filter: drop-shadow(0 4px 20px rgba(255, 0, 0, 0.3));
}

.yt-play-btn:hover {
    transform: scale(1.15);
}

.yt-channel-art {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    z-index: 1;
}

.yt-channel-name {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.yt-card-info {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.yt-card-info h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text);
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.yt-card-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.yt-card-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.yt-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.yt-stat svg {
    color: #30d158;
}

.btn-yt {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    background: var(--yt-red);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    align-self: flex-start;
    text-decoration: none;
}

.btn-yt svg {
    width: 18px;
    height: 18px;
}

.btn-yt:hover {
    background: #cc0000;
    transform: scale(1.04);
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.3);
}

/* ============================================
   FOOTER (clean, minimal)
   ============================================ */
.footer {
    position: relative;
    z-index: 1;
    background: var(--bg-dark);
    border-top: 1px solid var(--border);
    padding: 2rem 2rem 1.5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-brand h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.footer-socials {
    display: flex;
    gap: 0.25rem;
}

.footer-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    transition: all var(--transition);
}

.footer-socials a:hover {
    color: var(--text);
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }

    .sidebar {
        width: 85vw;
        max-width: 320px;
    }

    .hero-title {
        font-size: clamp(2.4rem, 12vw, 4rem);
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-search-trigger {
        max-width: 280px;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-card {
        padding: 1.75rem 1rem;
    }

    .features {
        padding: 5rem 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .yt-card {
        grid-template-columns: 1fr;
    }

    .yt-card-visual {
        min-height: 200px;
    }

    .yt-card-info {
        padding: 1.5rem;
    }

    .yt-showcase {
        padding: 5rem 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .stat-number {
        font-size: 1.7rem;
    }
}

/* ============================================
   SUBPAGE STYLES
   ============================================ */
.page-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 7rem 2rem 5rem;
}

.page-content .container {
    max-width: 820px;
}

.page-header {
    text-align: center;
    margin-bottom: 4rem;
}

.page-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--text);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
    line-height: 1.05;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}

.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.25rem;
    margin-bottom: 1.25rem;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* scroll reveal */
    opacity: 0;
    transform: translateY(30px);
}

.content-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.content-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .content-card:hover {
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.05);
}

.content-card h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 0.65rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.content-card p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 0.75rem;
    font-size: 0.98rem;
}

.content-card p:last-child {
    margin-bottom: 0;
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 500;
    background: rgba(41, 151, 255, 0.08);
    color: var(--primary);
    border: 1px solid rgba(41, 151, 255, 0.12);
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(41, 151, 255, 0.15);
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1rem;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.12);
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea {
    background: rgba(0, 0, 0, 0.02);
}

.form-group textarea {
    min-height: 130px;
    resize: vertical;
}

.form-submit {
    align-self: flex-start;
}

/* ============================================
   AI CHATBOT WIDGET
   ============================================ */
.chatbot-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 3000;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(41, 151, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    color: #fff;
}

.chatbot-toggle svg {
    width: 22px;
    height: 22px;
}

.chatbot-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(41, 151, 255, 0.4);
}

.chatbot-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary);
    animation: chatPulse 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes chatPulse {
    0%, 100% { transform: scale(1); opacity: 0.25; }
    50% { transform: scale(1.3); opacity: 0; }
}

.chatbot-window {
    position: fixed;
    bottom: 5rem;
    right: 1.5rem;
    z-index: 3001;
    width: 380px;
    max-height: 500px;
    background: var(--sidebar-bg);
    backdrop-filter: saturate(180%) blur(40px);
    -webkit-backdrop-filter: saturate(180%) blur(40px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
    transform: scale(0.9) translateY(16px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.chatbot-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.chatbot-avatar {
    font-size: 1.3rem;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(41, 151, 255, 0.1);
    border-radius: var(--radius-full);
}

.chatbot-name {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    color: var(--text);
    font-weight: 600;
    display: block;
}

.chatbot-status {
    font-size: 0.68rem;
    color: #30d158;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.chatbot-status::before {
    content: '';
    width: 5px;
    height: 5px;
    background: #30d158;
    border-radius: 50%;
    display: inline-block;
    animation: statusBlink 2s infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chatbot-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    transition: var(--transition);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

[data-theme="light"] .chatbot-close:hover {
    background: rgba(0, 0, 0, 0.04);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 340px;
    min-height: 240px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.chatbot-messages::-webkit-scrollbar {
    width: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.chat-msg {
    display: flex;
    animation: msgIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg.bot {
    justify-content: flex-start;
}

.chat-msg.user {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 85%;
    padding: 0.65rem 0.95rem;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-msg.bot .chat-bubble {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

[data-theme="light"] .chat-msg.bot .chat-bubble {
    background: rgba(0, 0, 0, 0.04);
}

.chat-msg.user .chat-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.65rem 0.95rem;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
    opacity: 0.4;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { opacity: 0.4; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.chatbot-input-area {
    display: flex;
    gap: 0.4rem;
    padding: 0.65rem 0.85rem;
    border-top: 1px solid var(--border);
}

#chatbotInput {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.55rem 0.9rem;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.86rem;
    outline: none;
    transition: var(--transition);
}

#chatbotInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.1);
}

[data-theme="light"] #chatbotInput {
    background: rgba(0, 0, 0, 0.02);
}

#chatbotInput::placeholder {
    color: var(--text-muted);
}

.chatbot-send-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--primary);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.chatbot-send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.06);
}

@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 1.5rem);
        right: 0.75rem;
        bottom: 4.5rem;
        max-height: 70vh;
    }

    .chatbot-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }
}

/* ============================================
   TUTORIAL PAGE STYLES
   ============================================ */

/* Tutorial badge */
.tutorial-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: var(--radius-full);
    background: rgba(41, 151, 255, 0.1);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    border: 1px solid rgba(41, 151, 255, 0.15);
}

/* Step header with number */
.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
}

.step-header h2 {
    margin-bottom: 0;
}

/* Code blocks */
.code-block {
    margin: 1rem 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .code-block {
    background: rgba(0, 0, 0, 0.04);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .code-header {
    background: rgba(0, 0, 0, 0.03);
}

.code-lang {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.code-copy {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
    color: var(--text-muted);
}

.code-copy:hover {
    background: rgba(255, 255, 255, 0.08);
}

.code-block pre {
    padding: 1rem;
    overflow-x: auto;
    margin: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.code-block code {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.88rem;
    line-height: 1.7;
    color: #e2e8f0;
    white-space: pre;
}

[data-theme="light"] .code-block code {
    color: #1d1d1f;
}

/* Callout boxes */
.tip-card, .warning-card, .info-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.tip-card {
    border-left: 3px solid #30d158;
}

.warning-card {
    border-left: 3px solid #ff9f0a;
}

.info-card {
    border-left: 3px solid var(--primary);
}

.tip-icon, .warning-icon, .info-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.tip-card h3, .warning-card h3, .info-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.3rem;
}

/* Config file highlight */
.config-path {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: rgba(41, 151, 255, 0.08);
    color: var(--primary);
    border-radius: 6px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    border: 1px solid rgba(41, 151, 255, 0.12);
}

/* Language visibility classes */
[hidden] { display: none !important; }

/* Coming soon placeholder */
.coming-soon {
    text-align: center;
    padding: 4rem 2rem;
}

.coming-soon-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

.coming-soon h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.coming-soon p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Tutorial page responsive */
@media (max-width: 768px) {
    .step-header {
        gap: 0.75rem;
    }

    .step-number {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .code-block code {
        font-size: 0.78rem;
    }
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 90;
}

.scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.scroll-top:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(41, 151, 255, 0.3);
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: var(--accent);
}

.breadcrumbs .separator {
    color: var(--text-muted);
    opacity: 0.5;
    font-size: 0.75rem;
}

.breadcrumbs .current {
    color: var(--text);
    font-weight: 500;
}

/* ============================================
   COPY FEEDBACK
   ============================================ */
.code-copy {
    position: relative;
}

.code-copy.copied::after {
    content: '✓ Kopiert!';
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    white-space: nowrap;
    pointer-events: none;
    animation: copyFade 1.5s ease forwards;
}

@keyframes copyFade {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
}

/* ============================================
   SEARCH MODAL
   ============================================ */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.search-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.search-modal {
    width: 100%;
    max-width: 600px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transform: translateY(-20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-overlay.active .search-modal {
    transform: translateY(0) scale(1);
}

.search-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.search-header input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 1.05rem;
    font-family: var(--font-body);
}

.search-header input::placeholder {
    color: var(--text-muted);
}

.search-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text);
}

.search-results {
    max-height: 50vh;
    overflow-y: auto;
    padding: 0.5rem;
}

.search-results:empty::before {
    content: '';
}

.search-result-item {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.2s ease;
}

.search-result-item:hover, .search-result-item.active {
    background: rgba(255, 255, 255, 0.06);
}

.search-result-title {
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.search-result-path {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.search-no-results {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-hint {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.search-hint kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: var(--font-body);
}

[data-theme="light"] .search-overlay {
    background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .search-result-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

@media (max-width: 768px) {
    .search-modal {
        margin: 0 1rem;
    }
    .scroll-top {
        bottom: 1.5rem;
        left: 1.5rem;
        width: 42px;
        height: 42px;
    }
}

/* ============================================
   DAILY VERSE
   ============================================ */
.verse-section {
    padding: 6rem 0;
    background: var(--bg-section);
    position: relative;
    overflow: hidden;
}

.verse-card {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    padding: 3rem 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
}

.verse-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
}

.verse-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.verse-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.verse-text {
    font-family: var(--font-body);
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text);
    font-style: italic;
    margin: 0 0 1.25rem;
    padding: 0;
    border: none;
    min-height: 3rem;
}

.verse-text .verse-loading {
    color: var(--text-muted);
    font-style: normal;
    animation: versePulse 1.5s ease-in-out infinite;
}

@keyframes versePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.verse-ref {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    font-style: normal;
    margin-bottom: 1.25rem;
}

.verse-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.verse-link:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    .verse-card {
        padding: 2rem 1.5rem;
    }
    .verse-text {
        font-size: 1.05rem;
    }
}

/* ============================================
   READING PROGRESS BAR (tutorial pages)
   ============================================ */
.reading-progress {
    position: fixed;
    top: 48px;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    z-index: 999;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ============================================
   PREFERS-REDUCED-MOTION (Accessibility)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal, .reveal-scale {
        opacity: 1 !important;
        transform: none !important;
    }

    .hero-orb {
        display: none !important;
    }

    #particleCanvas {
        display: none !important;
    }

    .marquee-content {
        animation: none !important;
    }

    .chatbot-pulse {
        display: none !important;
    }

    .typewriter .cursor {
        animation: none !important;
    }
}

/* ============================================
   PRINT STYLESHEET
   ============================================ */
@media print {
    /* Hide non-content elements */
    .navbar,
    .sidebar,
    .sidebar-overlay,
    #particleCanvas,
    .chatbot-toggle,
    .chatbot-window,
    .scroll-top,
    .search-overlay,
    .hero-orbs,
    .scroll-indicator,
    .skip-link,
    .reading-progress,
    .marquee-section,
    .manifesto-quote,
    .hero-cta,
    .hero-search-trigger,
    .footer-socials,
    #scrollTopBtn {
        display: none !important;
    }

    /* Reset backgrounds and colors */
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
    }

    .page-content {
        padding-top: 0 !important;
    }

    .hero {
        min-height: auto !important;
        padding: 1rem 0 !important;
    }

    .hero-title {
        background: none !important;
        -webkit-text-fill-color: #000 !important;
        font-size: 2rem !important;
    }

    /* Code blocks print-friendly */
    pre, code {
        background: #f4f4f4 !important;
        color: #000 !important;
        border: 1px solid #ddd !important;
        white-space: pre-wrap !important;
        word-break: break-word !important;
        font-size: 10pt !important;
    }

    .code-block {
        background: #f4f4f4 !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }

    .code-header {
        background: #e8e8e8 !important;
        color: #000 !important;
    }

    .code-copy {
        display: none !important;
    }

    /* Links show URL */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    /* Page break control */
    h1, h2, h3 {
        break-after: avoid;
        color: #000 !important;
    }

    .step-card, .feature-card, .content-card {
        break-inside: avoid;
        background: #fff !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }

    /* Footer minimal */
    .footer {
        background: none !important;
        border-top: 1px solid #ddd !important;
        padding: 1rem 0 !important;
    }

    .footer-brand h3,
    .footer-bottom p {
        color: #000 !important;
    }
}

/* ============================================
   FOCUS TRAP OVERLAY (for open dialogs)
   ============================================ */
.focus-trap-active {
    overflow: hidden;
}

/* ============================================
   MANIFESTO QUOTE (tilted rebellious cite)
   ============================================ */
.manifesto-quote {
    position: relative;
    z-index: 1;
    max-width: 520px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
    text-align: center;
    transform: rotate(-2.5deg);
    user-select: none;
    cursor: default;
}

.manifesto-quote blockquote {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    border: none;
    padding: 0;
    margin: 0;
}

.manifesto-quote .mq-line {
    display: block;
}

.manifesto-quote .mq-bold {
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.25rem;
}

.manifesto-quote cite {
    display: block;
    margin-top: 0.75rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-muted);
    opacity: 0.5;
    letter-spacing: 0.04em;
}

.manifesto-quote:hover blockquote {
    color: var(--text-secondary);
}

.manifesto-quote:hover .mq-bold {
    filter: brightness(1.15);
}

.manifesto-quote:hover cite {
    opacity: 0.7;
}

@media (max-width: 640px) {
    .manifesto-quote {
        max-width: 300px;
        padding: 2rem 1rem 3rem;
        transform: rotate(-3deg);
    }
    .manifesto-quote blockquote {
        font-size: 1rem;
    }
    .manifesto-quote .mq-bold {
        font-size: 1.1rem;
    }
}

/* Smaller variant for sub-pages */
.manifesto-sm {
    max-width: 420px;
    padding: 2rem 1.5rem 2.5rem;
    transform: rotate(-2deg);
}

.manifesto-sm blockquote {
    font-size: 0.95rem;
    line-height: 1.7;
}

.manifesto-sm .mq-bold {
    font-size: 1.05rem;
}

.manifesto-sm cite {
    font-size: 0.7rem;
}

@media (max-width: 640px) {
    .manifesto-sm {
        max-width: 260px;
        padding: 1.5rem 1rem 2rem;
    }
    .manifesto-sm blockquote {
        font-size: 0.85rem;
    }
    .manifesto-sm .mq-bold {
        font-size: 0.95rem;
    }
}

