/* ── Shared Design Tokens ────────────────────────────────────── */
:root {
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --accent-blue: #3b82f6;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --border-light: #e5e7eb;
    --highlight-bg: #fef3c7;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Dark mode variables */
[data-theme="dark"] {
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-blue: #60a5fa;
    --bg-white: #0f172a;
    --bg-light: #1e293b;
    --border-light: #334155;
    --highlight-bg: #E84A2F;
    --shadow-color: rgba(0, 0, 0, 0.4);
}

/* Auto dark mode based on system preference (when no manual choice made) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --accent-blue: #60a5fa;
        --bg-white: #0f172a;
        --bg-light: #1e293b;
        --border-light: #334155;
        --highlight-bg: #E84A2F;
        --shadow-color: rgba(0, 0, 0, 0.4);
    }
}

/* ── Reset ───────────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background-color: var(--bg-white);
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 18px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Theme Toggle Button ─────────────────────────────────────── */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    background-color: var(--bg-light);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle .moon-icon {
    color: #1a1a2e;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(15deg);
}

/* Hide the inactive icon */
.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }

[data-theme="dark"] .theme-toggle .sun-icon { display: block; }
[data-theme="dark"] .theme-toggle .moon-icon { display: none; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .sun-icon { display: block; }
    :root:not([data-theme="light"]) .theme-toggle .moon-icon { display: none; }
}

/* ── Landing Page Layout ─────────────────────────────────────── */
.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 80px 24px 60px;
}

@media (max-width: 600px) {
    .container {
        padding: 60px 20px 40px;
    }
}

/* Header */
header {
    text-align: center;
    margin-bottom: 56px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--text-primary);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--text-primary);
}

header p {
    font-size: 16px;
    color: var(--text-secondary);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    margin-top: 8px;
}

/* Hero Image */
.hero-img {
    display: block;
    width: 60%;
    max-width: 360px;
    height: auto;
    margin: 24px auto 0;
    border-radius: 10px;
    box-shadow: none;
    border: 1px solid transparent;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .hero-img {
    box-shadow: 0 4px 12px var(--shadow-color);
    border-color: var(--border-light);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .hero-img {
        box-shadow: 0 4px 12px var(--shadow-color);
        border-color: var(--border-light);
    }
}

@media (max-width: 600px) {
    .hero-img {
        width: 80%;
    }
}

/* ── Topic Card Grid ─────────────────────────────────────────── */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 20px;
    list-style: none;
    padding: 0;
}

@media (max-width: 560px) {
    .topic-grid {
        grid-template-columns: 1fr;
    }
}

/* Individual card */
.topic-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.topic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--shadow-color);
    border-color: var(--border-light);
}

.topic-card:active {
    transform: translateY(-1px);
}

/* Number badge */
.topic-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #E84A2F;
    color: #ffffff;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
}

/* Topic name */
.topic-name {
    font-size: 1.15rem;
    font-weight: 400;
}

/* ── Footer ──────────────────────────────────────────────────── */
footer {
    margin-top: 80px;
    padding-top: 32px;
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    font-family: 'Helvetica Neue', Arial, sans-serif;
}
