@import url('reset.css');
@import url('variables.css');

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout Utilities */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header / Navigation */
header {
    border-bottom: 1px solid var(--border);
    padding: var(--space-4) 0;
    position: sticky;
    top: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    z-index: 10;
}

nav ul {
    display: flex;
    gap: var(--space-6);
    align-items: center;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
    font-size: 0.9em;
}

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

/* Hero Section */
.hero {
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

/* CTA Button */
.cta-button {
    display: inline-block;
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 700;
    padding: 14px 32px;
    border-radius: 9999px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px var(--accent);
}

main {
    padding-bottom: var(--space-12);
}

section {
    padding: 60px 0;
    border-bottom: 1px solid var(--border);
}

section h2 {
    font-size: 2rem;
    margin-bottom: var(--space-6);
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

/* Footer */
footer {
    margin-top: 100px;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Utility: Badge */
.badge {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: var(--space-4);
}

.badge.phase {
    background: var(--accent-glow);
    color: var(--accent);
}

.badge.old {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.badge.new {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: 6px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Remove persistent focus outline when clicking with mouse */
button:focus:not(:focus-visible) {
    outline: none;
}

/* =============================================
   RESPONSIVE DESIGN & MOBILE ADJUSTMENTS
   ============================================= */

/* Tablet and below */
@media (max-width: 768px) {
    .hero {
        padding: 60px 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    section {
        padding: 40px 0;
    }

    section h2 {
        font-size: 1.5rem;
    }

    nav ul {
        gap: var(--space-3);
    }

    nav a {
        font-size: 0.8em;
    }

    .code-block,
    .code-preview {
        font-size: 0.75rem;
        padding: 12px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .cta-button {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    nav ul {
        justify-content: center;
    }
}

/* =============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================= */

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Skip to content link (accessibility) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: var(--bg-primary);
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Improve color contrast for inline code */
code {
    background: rgba(56, 189, 248, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--accent);
}