/* ─── Root Variables ───────────────────────────────────────────────────────── */
:root {
    --primary-color:    #000000;
    --secondary-color:  #ffffff;
    --accent-color:     #000000;
    --accent-dark:      #ffffff;
    --text-primary:     #000000;
    --text-secondary:   #505050;
    --bg-primary:       #ffffff;
    --bg-secondary:     #f5f5f5;
    --border-color:     #e5e5e5;

    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --reading-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --transition:   all 0.3s var(--reading-ease);
}

body.dark-mode {
    --primary-color:    #ffffff;
    --secondary-color:  #000000;
    --accent-color:     #ffffff;
    --bg-primary:       #0a0a0a;
    --bg-secondary:     #1a1a1a;
    --text-primary:     #ffffff;
    --text-secondary:   #999999;
    --border-color:     #2a2a2a;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    padding: 2rem;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
}

p { 
    line-height: 1.6; 
    color: var(--text-secondary); 
}

/* ─── Header Section ───────────────────────────────────────────────────────── */
.sections-header {
    max-width: 1000px;
    margin: 0 auto 4rem;
    position: relative;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    border-radius: 30px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 1.5rem;
    font-family: var(--font-body);
}

.back-btn:hover {
    background: var(--border-color);
    transform: translateX(-4px);
}

.back-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sections-header h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
}

/* ─── Sections Grid ────────────────────────────────────────────────────────── */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 2rem;
    border: 1.5px solid var(--border-color);
    border-radius: 24px;
    background: var(--bg-primary);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.section-box:hover {
    border-color: var(--accent-color);
    box-shadow: 0 12px 40px rgba(81, 81, 81, 0.15);
    transform: translateY(-8px);
}

body.dark-mode .section-box:hover {
    box-shadow: 0 12px 40px rgba(123, 123, 123, 0.2);
}

/* ─── Section Icon ─────────────────────────────────────────────────────────── */
.section-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 30px;
    background: var(--bg-secondary);
    transition: var(--transition);
}

.section-box:hover .section-icon {
    background: var(--accent-color);
}

.section-box:hover .section-icon svg {
    color: var(--secondary-color);
}

.section-icon svg {
    width: 32px;
    height: 32px;
    color: var(--accent-color);
    transition: var(--transition);
}

/* ─── Section Content ──────────────────────────────────────────────────────── */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0;
}

.section-box:hover .section-title {
    color: var(--accent-color);
}

.section-description {
    display: none;
}

/* ─── Theme Toggle ─────────────────────────────────────────────────────────── */
.floating-theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--secondary-color);
    border: 1px solid var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

body.dark-mode .floating-theme-toggle {
    box-shadow: 0 4px 16px rgba(255,255,255,0.1);
}

.floating-theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

body.dark-mode .floating-theme-toggle:hover {
    box-shadow: 0 8px 24px rgba(255,255,255,0.12);
}

.floating-theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    body {
        padding: 2rem 1.5rem;
    }

    .sections-header {
        margin-bottom: 3rem;
    }

    .sections-header h1 {
        font-size: clamp(2rem, 5vw, 2.75rem);
        margin-bottom: 0.75rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .sections-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 1.5rem;
    }

    .section-box {
        padding: 2rem 1.5rem;
        gap: 1rem;
    }

    .section-icon {
        width: 56px;
        height: 56px;
    }

    .section-icon svg {
        width: 28px;
        height: 28px;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .floating-theme-toggle {
        width: 44px;
        height: 44px;
        top: 1.5rem;
        right: 1.5rem;
    }

    .floating-theme-toggle svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1.5rem 1rem;
    }

    .sections-header {
        margin-bottom: 2.5rem;
    }

    .sections-header h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .back-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

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

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

    .section-box {
        padding: 1.5rem 1.25rem;
        gap: 0.75rem;
        border-radius: 12px;
    }

    .section-box:hover {
        transform: translateY(-4px);
    }

    .section-icon {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }

    .section-icon svg {
        width: 24px;
        height: 24px;
    }

    .section-title {
        font-size: 0.95rem;
    }

    .floating-theme-toggle {
        width: 40px;
        height: 40px;
        top: 1rem;
        right: 1rem;
    }

    .floating-theme-toggle svg {
        width: 18px;
        height: 18px;
    }
}