@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --prime-blue: #0578FF;
    --black: #000000;
    --white: #FFFFFF;
    --off-white: #F5F3EF;
    --bg-dark: #0a0c0e;
    --bg-card: rgba(22, 25, 28, 0.7);
    --bg-card-solid: #16191c;
    --text-primary: #f0f2f5;
    --text-secondary: #8a8f98;
    --card-border: rgba(255, 255, 255, 0.06);
    --card-glow: rgba(5, 120, 255, 0.15);

    /* Secondary Colors */
    --color-gold: #FFD700;
    --color-seafoam: #00FF6C;
    --color-neon-blue: #0000FF;
    --color-canary: #FFEF00;
    --color-acid: #D8FF00;
    --color-sky: #71D9FF;
    --color-shade-pink: #FF60A7;
    --color-green-neon: #B5FF07;
    --color-powder-blue: #B0E0E6;
    --color-mantis: #BAE6B0;
    --color-egg-nog: #FAE29B;
    --color-thistle: #D8BFD7;
    --color-butter: #FFF9C7;
    --color-sorbet: #F4BAEA;
    --color-tangerine: #FD6C23;
    --color-palm-leaf: #AEA435;

    --nav-width: 240px;
    --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== SCROLL PROGRESS BAR ========== */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--prime-blue), #71D9FF, var(--prime-blue));
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    z-index: 10000;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== SIDEBAR NAVIGATION ========== */
.sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--nav-width);
    height: 100vh;
    background: rgba(10, 12, 14, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--card-border);
    z-index: 1000;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.5s var(--transition-smooth);
}

.nav-brand {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 1rem;
}

.nav-brand h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--prime-blue);
    margin: 0;
}

.nav-brand span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.nav-links li { margin: 0; }

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.3s var(--transition-smooth);
    position: relative;
    border-left: 2px solid transparent;
}

.nav-links a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(5, 120, 255, 0.1), transparent);
    transition: width 0.3s var(--transition-smooth);
}

.nav-links a:hover {
    color: var(--text-primary);
    border-left-color: rgba(5, 120, 255, 0.3);
}

.nav-links a:hover::before { width: 100%; }

.nav-links a.active {
    color: var(--prime-blue);
    border-left-color: var(--prime-blue);
    font-weight: 600;
}

.nav-links a.active::before { width: 100%; }

.nav-num {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(5, 120, 255, 0.4);
    min-width: 1.5rem;
    letter-spacing: 0.05em;
}

.nav-links a.active .nav-num { color: var(--prime-blue); }

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1100;
    background: rgba(10, 12, 14, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.6rem;
    cursor: pointer;
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    transition: all 0.3s var(--transition-smooth);
}

.nav-toggle:hover { border-color: var(--prime-blue); }

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    margin: 4px auto;
    border-radius: 1px;
    transition: all 0.3s var(--transition-smooth);
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

/* ========== MAIN CONTENT WRAPPER ========== */
.main-content {
    margin-left: var(--nav-width);
    transition: margin-left 0.5s var(--transition-smooth);
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4 {
    font-weight: 700;
    margin-bottom: 0.5em;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    font-weight: 800;
    position: relative;
    display: inline-block;
}

a {
    color: var(--prime-blue);
    text-decoration: none;
    transition: color 0.2s, opacity 0.2s;
}

a:hover {
    color: #4da3ff;
}

/* ========== UTILITIES ========== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 2.5rem;
}

.section {
    margin-bottom: 5rem;
    position: relative;
}

/* Section number watermark */
.section-number {
    position: absolute;
    top: -1.5rem;
    right: 0;
    font-size: 8rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.02);
    line-height: 1;
    pointer-events: none;
    user-select: none;
    letter-spacing: -0.05em;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--card-border), rgba(5, 120, 255, 0.15), var(--card-border), transparent);
    margin: 3rem 0;
    border: none;
}

.text-prime-blue {
    color: var(--prime-blue);
}

.grid {
    display: grid;
    gap: 1.25rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* ========== COMPONENTS ========== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.75rem;
    transition: all 0.4s var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(5, 120, 255, 0), rgba(5, 120, 255, 0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    transition: background 0.4s var(--transition-smooth);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(5, 120, 255, 0.08), 0 0 0 1px rgba(5, 120, 255, 0.1);
}

.card:hover::before {
    background: linear-gradient(135deg, rgba(5, 120, 255, 0.3), rgba(113, 217, 255, 0.1));
}

/* Glassmorphism card variant */
.card-glass {
    background: rgba(22, 25, 28, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn {
    display: inline-block;
    background: var(--prime-blue);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    margin-top: 1rem;
    transition: all 0.3s var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn:hover {
    background: #0066d9;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(5, 120, 255, 0.3);
}

.btn:hover::after { opacity: 1; }

.btn-outline {
    background: transparent;
    border: 1.5px solid rgba(5, 120, 255, 0.4);
    color: var(--prime-blue);
}

.btn-outline:hover {
    background: var(--prime-blue);
    color: white;
    border-color: var(--prime-blue);
}

/* ========== HERO SECTION ========== */
.hero {
    text-align: center;
    padding: 10rem 2rem 8rem;
    position: relative;
    overflow: hidden;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(5, 120, 255, 0.12) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 30%, rgba(113, 217, 255, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 80%, rgba(255, 96, 167, 0.04) 0%, transparent 40%);
    animation: heroShift 8s ease-in-out infinite alternate;
}

@keyframes heroShift {
    0% { transform: scale(1) translate(0, 0); opacity: 1; }
    50% { transform: scale(1.1) translate(-2%, 1%); opacity: 0.8; }
    100% { transform: scale(1.05) translate(1%, -1%); opacity: 1; }
}

/* Floating orbs */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.15;
    animation: float 10s ease-in-out infinite;
}

.hero-orb:nth-child(1) {
    width: 300px; height: 300px;
    background: var(--prime-blue);
    top: 10%; left: 15%;
    animation-delay: 0s;
    animation-duration: 12s;
}

.hero-orb:nth-child(2) {
    width: 200px; height: 200px;
    background: var(--color-sky);
    bottom: 20%; right: 20%;
    animation-delay: -3s;
    animation-duration: 10s;
}

.hero-orb:nth-child(3) {
    width: 150px; height: 150px;
    background: var(--color-shade-pink);
    top: 60%; left: 60%;
    animation-delay: -5s;
    animation-duration: 14s;
}

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

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 12rem;
    background: linear-gradient(to bottom, transparent, var(--bg-dark));
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #fff 0%, #b0b3b8 40%, var(--prime-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transform: translateY(30px);
    animation: heroEnter 1s var(--transition-smooth) 0.2s forwards;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    animation: heroEnter 1s var(--transition-smooth) 0.5s forwards;
}

.hero .btn {
    opacity: 0;
    transform: translateY(20px);
    animation: heroEnter 1s var(--transition-smooth) 0.8s forwards;
}

@keyframes heroEnter {
    to { opacity: 1; transform: translateY(0); }
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    animation: heroEnter 1s var(--transition-smooth) 1.2s forwards;
}

.scroll-indicator span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
}

.scroll-indicator .scroll-arrow {
    width: 20px;
    height: 30px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    position: relative;
}

.scroll-indicator .scroll-arrow::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 6px;
    background: var(--prime-blue);
    border-radius: 2px;
    animation: scrollDot 2s ease-in-out infinite;
}

@keyframes scrollDot {
    0%, 100% { top: 6px; opacity: 1; }
    50% { top: 14px; opacity: 0.3; }
}

/* ========== COLOR SWATCHES ========== */
.swatch {
    height: 110px;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s var(--transition-smooth);
    overflow: hidden;
}

.swatch:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.swatch:active {
    transform: scale(0.98);
}

/* Ripple effect on swatch click */
.swatch-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

.swatch-info h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
}

.swatch-info code {
    font-size: 0.75rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    opacity: 0.75;
}

/* ========== SCROLL REVEAL ANIMATIONS ========== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--transition-smooth), transform 0.8s var(--transition-smooth);
}

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

/* Staggered children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.6s var(--transition-smooth), transform 0.6s var(--transition-smooth);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 80ms; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 160ms; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 240ms; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 320ms; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 400ms; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 480ms; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 560ms; }

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ========== CHECKLIST ========== */
.checklist label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    transition: all 0.3s var(--transition-smooth);
    font-size: 0.9rem;
}

.checklist label:hover {
    background: rgba(255, 255, 255, 0.03);
}

.checklist input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--card-border);
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s var(--transition-smooth);
    flex-shrink: 0;
}

.checklist input[type="checkbox"]:checked {
    background: var(--prime-blue);
    border-color: var(--prime-blue);
}

.checklist input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.checklist input[type="checkbox"]:checked + span {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* ========== CODE BLOCK ========== */
.code-block {
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #a5d6ff;
    border-left: 3px solid var(--prime-blue);
}

/* ========== TOAST NOTIFICATION ========== */
#toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card-solid);
    border: 1px solid var(--prime-blue);
    color: var(--text-primary);
    text-align: center;
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    z-index: 10001;
    box-shadow: 0 8px 32px rgba(5, 120, 255, 0.2);
    transition: bottom 0.4s var(--transition-smooth), opacity 0.4s var(--transition-smooth);
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#toast.show {
    bottom: 2rem;
    opacity: 1;
}

.toast-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--prime-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

/* ========== BACK TO TOP BUTTON ========== */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card-solid);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    z-index: 999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s var(--transition-smooth);
    pointer-events: none;
    backdrop-filter: blur(10px);
}

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

#back-to-top:hover {
    border-color: var(--prime-blue);
    box-shadow: 0 4px 16px rgba(5, 120, 255, 0.15);
    transform: translateY(-2px);
}

/* ========== IMAGES ========== */
.section img {
    border-radius: 10px;
    border: 1px solid var(--card-border);
    transition: transform 0.3s var(--transition-smooth);
}

/* ========== LISTS ========== */
.section ul {
    padding-left: 0;
}

.section li {
    padding: 0.35rem 0;
    line-height: 1.6;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .sidebar-nav {
        transform: translateX(-100%);
        width: 260px;
    }

    .sidebar-nav.open {
        transform: translateX(0);
    }

    .nav-toggle { display: block; }

    .main-content {
        margin-left: 0;
    }

    .hero {
        padding: 7rem 1.5rem 5rem;
        min-height: 70vh;
    }

    .container { padding: 1.5rem; }

    h2 { font-size: 1.6rem; }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .section-number {
        font-size: 5rem;
    }

    .checklist {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .swatch { height: 80px; }
}