:root {
    /* Dark theme (default) */
    --bg-primary: #0a0a0b;
    --bg-secondary: #141419;
    --bg-tertiary: #1a1a22;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --accent-secondary: #c084fc;
    --highlight: #fbbf24;
    --code-bg: #1e1e28;
    --border: #2a2a35;
    --gradient-start: #8b5cf6;
    --gradient-end: #ec4899;
}

[data-theme="light"] {
    --bg-primary: #fafafa;
    --bg-secondary: #f0f0f5;
    --bg-tertiary: #e8e8f0;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a60;
    --accent: #7c3aed;
    --accent-glow: rgba(124, 58, 237, 0.2);
    --accent-secondary: #9333ea;
    --highlight: #d97706;
    --code-bg: #e2e2ea;
    --border: #d0d0e0;
    --gradient-start: #7c3aed;
    --gradient-end: #db2777;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 18px;
    position: relative;
    overflow-x: hidden;
}

/* Film grain effect */
.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    z-index: 1000;
    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%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    right: 0;
    padding: 1.5rem 2rem;
    z-index: 100;
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--accent);
}

.theme-toggle .moon {
    display: none;
}

[data-theme="light"] .theme-toggle .sun {
    display: none;
}

[data-theme="light"] .theme-toggle .moon {
    display: inline;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero */
.hero {
    text-align: center;
    padding: 6rem 2rem 4rem;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

h1 {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    position: relative;
    animation: fadeInUp 0.8s ease-out;
}

/* Glitch effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    -webkit-background-clip: text;
    background-clip: text;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--gradient-end);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--gradient-start);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(51px, 9999px, 28px, 0); }
    20% { clip: rect(70px, 9999px, 63px, 0); }
    40% { clip: rect(26px, 9999px, 97px, 0); }
    60% { clip: rect(29px, 9999px, 10px, 0); }
    80% { clip: rect(33px, 9999px, 55px, 0); }
    100% { clip: rect(84px, 9999px, 94px, 0); }
}

.subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--text-secondary);
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

/* Table of Contents */
.toc {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin: 3rem 0;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.toc h2 {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.toc ul {
    list-style: none;
}

.toc li {
    margin: 0.5rem 0;
}

.toc a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
    font-size: 0.95rem;
}

.toc a:hover {
    color: var(--accent);
    transform: translateX(5px);
}

/* Sections */
section {
    margin: 4rem 0;
    animation: fadeInUp 0.6s ease-out backwards;
}

section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.2s; }
section:nth-child(3) { animation-delay: 0.3s; }

h2 {
    font-family: 'Archivo Black', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-secondary) 100%);
    border-radius: 2px;
}

h3 {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent-secondary);
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

strong {
    color: var(--text-primary);
    font-weight: 700;
}

.highlight {
    color: var(--highlight);
    font-weight: 600;
}

/* Points/Features */
.point {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    transition: all 0.3s ease;
}

.point:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Code blocks */
.code-block {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    overflow-x: auto;
}

pre {
    margin: 0;
}

code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.comment {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Inline code */
p code, li code {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent-secondary);
}

/* Feature list */
.feature-list {
    list-style: none;
    margin: 2rem 0;
}

.feature-list li {
    padding: 0.8rem 0;
    padding-left: 2rem;
    position: relative;
    color: var(--text-secondary);
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

.stat .number {
    display: block;
    font-family: 'Archivo Black', sans-serif;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Use cases */
.use-cases {
    list-style: none;
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}

.use-cases li {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.use-cases li:hover {
    border-color: var(--accent);
    transform: translateX(10px);
    background: var(--bg-tertiary);
}

/* Conclusion */
.conclusion {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 2px solid var(--accent);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    margin-top: 3rem;
}

.conclusion p {
    color: var(--text-primary);
}

.final-cta {
    font-size: clamp(2rem, 6vw, 3.5rem);
    margin: 2rem 0;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.final-cta::after {
    display: none;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.footer p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--accent-secondary);
}

.php-love {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.footer-note {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Selection */
::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    .container {
        padding: 1rem;
    }
    
    .hero {
        padding: 4rem 1rem 2rem;
    }
    
    .point, .toc, .code-block {
        padding: 1.5rem;
    }
    
    .conclusion {
        padding: 2rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .glitch::before,
    .glitch::after {
        display: none;
    }
}

