/* ============================================================
   STYLE.CSS — Eren Ege Volkan Projesi
   Modern Gradient Temalı, Mobil Uyumlu Matematik Tarihi Sitesi
   ============================================================ */

/* ========== CSS CUSTOM PROPERTIES ========== */
:root {
    /* Gradient Palette */
    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
    --gradient-hero: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-warm: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #172554 100%);
    --gradient-formula: linear-gradient(135deg, #4c1d95 0%, #1e3a5f 100%);
    --gradient-card: linear-gradient(145deg, rgba(124,58,237,0.08) 0%, rgba(59,130,246,0.08) 100%);

    /* Colors */
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-text: #1e293b;
    --color-text-light: #64748b;
    --color-text-inverse: #f1f5f9;
    --color-border: #e2e8f0;
    --color-purple: #7c3aed;
    --color-blue: #3b82f6;
    --color-teal: #14b8a6;

    /* Typography */
    --font-primary: 'Poppins', sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;

    /* Spacing */
    --section-padding: 5rem 0;
    --container-max: 1200px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --shadow-glow: 0 0 30px rgba(124,58,237,0.3);

    /* Transitions */
    --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
    --transition-smooth: 0.5s cubic-bezier(0.4,0,0.2,1);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition);
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ========== SECTION BASICS ========== */
.section {
    padding: var(--section-padding);
}

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-tag {
    display: inline-block;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

.section-header.light .section-tag {
    background: linear-gradient(135deg, #a78bfa, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
}

.section-header.light .section-title,
.section-header.light .section-desc {
    color: var(--color-text-inverse);
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--color-text-light);
    max-width: 650px;
    margin: 0 auto;
    font-weight: 400;
}

/* ========== HEADER / STICKY NAV ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: all var(--transition);
}

.header.scrolled {
    background: rgba(255,255,255,0.95);
    border-bottom-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-text);
    z-index: 1001;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    font-weight: 800;
    flex-shrink: 0;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.5rem 0.9rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-light);
    transition: all var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-purple);
    background: rgba(124,58,237,0.08);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--color-text);
    border-radius: 4px;
    transition: all var(--transition);
}

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

/* ========== HERO SECTION ========== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-hero);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(124,58,237,0.25) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 60%, rgba(59,130,246,0.2) 0%, transparent 60%);
}

.hero-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    50% { transform: translateY(-100px) scale(1.2); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    color: #c4b5fd;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    margin-top:6rem;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #cbd5e1;
    max-width: 650px;
    margin: 0 auto 2.5rem;
    font-weight: 300;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124,58,237,0.5);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.35);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-2px);
}

.hero-scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    color: #94a3b8;
    font-size: 0.8rem;
    letter-spacing: 1px;
    animation: bounceFade 2s ease-in-out infinite;
}

.scroll-mouse {
    width: 24px;
    height: 38px;
    border: 2px solid #94a3b8;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    padding-top: 6px;
}

.scroll-dot {
    width: 4px;
    height: 8px;
    background: #94a3b8;
    border-radius: 4px;
    animation: scrollDot 1.5s ease-in-out infinite;
}

@keyframes bounceFade {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-8px); }
}

@keyframes scrollDot {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(8px); opacity: 1; }
}

/* ========== CIVILIZATIONS ========== */
.civ-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.civ-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 2rem;
    border: 1px solid var(--color-border);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.civ-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.civ-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.civ-card:hover::before {
    opacity: 1;
}

.civ-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.civ-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.civ-card p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    line-height: 1.7;
}

/* ========== HORIZONTAL SCROLL CONTAINER ========== */
.scroll-container {
    position: relative;
    padding: 0 52px;
}

.scroll-track-inner {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    user-select: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scroll-track-inner::-webkit-scrollbar {
    display: none;
}

.scroll-track-inner:active {
    cursor: grabbing;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--color-purple);
    transition: all var(--transition);
}

.scroll-btn:hover {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-lg);
}

.scroll-btn.prev { left: 0; }
.scroll-btn.next { right: 0; }

/* ========== PERIODS ========== */
.periods {
    background: #f1f5f9;
}

.scroll-container .periods-grid,
.periods-grid {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    user-select: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scroll-container .periods-grid::-webkit-scrollbar,
.periods-grid::-webkit-scrollbar {
    display: none;
}

.period-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: all var(--transition-smooth);
    flex: 0 0 calc((100% - 3rem) / 3);
    min-width: 300px;
    scroll-snap-align: start;
}

.period-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.period-img {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.period-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.period-card:hover .period-img img {
    transform: scale(1.06);
}

.period-body {
    padding: 1.5rem;
}

.period-date {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-purple);
    background: rgba(124,58,237,0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    margin-bottom: 0.75rem;
}

.period-body h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--color-text);
}

.period-body p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    line-height: 1.7;
}

/* ========== GENIUSES ========== */
.scroll-container .geniuses-grid,
.geniuses-grid {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    user-select: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scroll-container .geniuses-grid::-webkit-scrollbar,
.geniuses-grid::-webkit-scrollbar {
    display: none;
}

.genius-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: all var(--transition-smooth);
    display: flex;
    flex-direction: column;
    flex: 0 0 calc((100% - 4rem) / 3);
    min-width: 300px;
    scroll-snap-align: start;
}

.genius-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(124,58,237,0.3);
}

.genius-img-wrapper {
    width: 100%;
    height: 260px;
    overflow: hidden;
    position: relative;
}

.genius-img-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, var(--color-surface), transparent);
}

.genius-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.genius-card:hover .genius-img-wrapper img {
    transform: scale(1.06);
}

.genius-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.genius-info h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.genius-era {
    font-size: 0.8rem;
    color: var(--color-purple);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.genius-info p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    line-height: 1.7;
    flex: 1;
    margin-bottom: 1rem;
}

.genius-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.genius-tags span {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    background: var(--gradient-card);
    color: var(--color-purple);
}

/* ========== FORMULAS ========== */
.formulas {
    background: var(--gradient-formula);
    position: relative;
}

.formulas::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.formulas .container {
    position: relative;
    z-index: 1;
}

.formulas-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.formula-card {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-smooth);
    color: var(--color-text-inverse);
}

.formula-card:hover {
    background: rgba(255,255,255,0.14);
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.25);
    box-shadow: var(--shadow-glow);
}

.formula-card.highlight {
    background: rgba(255,255,255,0.14);
    border-color: rgba(167,139,250,0.4);
    position: relative;
}

.formula-card.highlight::before {
    content: '🌟';
    position: absolute;
    top: -14px;
    right: -14px;
    font-size: 1.5rem;
}

.formula-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.formula-code {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 600;
    color: #a78bfa;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
    word-break: break-all;
}

.formula-card.highlight .formula-code {
    font-size: 1.5rem;
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251,191,36,0.4);
}

.formula-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.formula-card p {
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.6;
}

/* Fun Facts */
.fun-facts {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.fun-facts-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1.5rem;
    text-align: center;
}

.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.fact-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.fact-num {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    color: #a78bfa;
    flex-shrink: 0;
    margin-top: 2px;
}

.fact-item p {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ========== TIMELINE ========== */
.timeline-section {
    background: #f8fafc;
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--color-purple), var(--color-teal), var(--color-blue));
    border-radius: 3px;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    width: 100%;
    display: flex;
    justify-content: flex-start;
}

.timeline-item.right {
    justify-content: flex-end;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    background: var(--gradient-primary);
    border-radius: 50%;
    border: 4px solid #f8fafc;
    box-shadow: 0 0 0 4px rgba(124,58,237,0.2);
    z-index: 2;
    transition: all var(--transition);
}

.timeline-item:hover .timeline-dot {
    box-shadow: 0 0 0 8px rgba(124,58,237,0.3);
    transform: translateX(-50%) scale(1.3);
}

.timeline-content {
    width: 44%;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: all var(--transition-smooth);
}

.timeline-content:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.timeline-img {
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.timeline-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.timeline-content:hover .timeline-img img {
    transform: scale(1.05);
}

.timeline-content h4 {
    font-size: 1rem;
    font-weight: 700;
    padding: 1rem 1.25rem 0.25rem;
}

.timeline-content p {
    font-size: 0.88rem;
    color: var(--color-text-light);
    padding: 0.25rem 1.25rem 1.25rem;
    line-height: 1.6;
}

.timeline-date {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: var(--gradient-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    margin: 1rem 1.25rem 0;
}

/* ========== FUN / QUIZ SECTION ========== */
.fun-section {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.fun-subsection {
    margin-top: 3rem;
}

.fun-subsection:first-child {
    margin-top: 0;
}

.fun-subtitle {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    color: var(--color-text);
}

.quiz-desc {
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Puzzles */
.puzzles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.puzzle-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    border: 1px solid var(--color-border);
    transition: all var(--transition-smooth);
}

.puzzle-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(124,58,237,0.2);
}

.puzzle-card h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--color-purple);
}

.puzzle-question {
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.puzzle-card details {
    border-top: 1px solid var(--color-border);
    padding-top: 0.75rem;
}

.puzzle-card summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--color-purple);
    font-size: 0.9rem;
    transition: color var(--transition);
}

.puzzle-card summary:hover {
    color: var(--color-blue);
}

.puzzle-answer {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.6;
    padding: 0.75rem;
    background: rgba(124,58,237,0.05);
    border-radius: var(--radius-sm);
}

/* Quiz */
.quiz-wrapper {
    margin-top: 4rem;
}

.quiz-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.quiz-progress {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 6px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 6px;
    transition: width 0.4s ease;
    width: 0%;
}

.quiz-question-area h4 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--color-text);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.95rem;
    font-weight: 500;
    user-select: none;
}

.quiz-option:hover {
    border-color: var(--color-purple);
    background: rgba(124,58,237,0.04);
}

.quiz-option.selected {
    border-color: var(--color-purple);
    background: rgba(124,58,237,0.08);
    color: var(--color-purple);
}

.quiz-option.correct {
    border-color: #22c55e !important;
    background: rgba(34,197,94,0.1) !important;
    color: #16a34a !important;
}

.quiz-option.wrong {
    border-color: #ef4444 !important;
    background: rgba(239,68,68,0.08) !important;
    color: #dc2626 !important;
}

.quiz-option-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
}

.quiz-option.selected .quiz-option-radio {
    border-color: var(--color-purple);
    background: var(--color-purple);
}

.quiz-option.selected .quiz-option-radio::after {
    content: '';
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
}

.quiz-option.correct .quiz-option-radio {
    border-color: #22c55e;
    background: #22c55e;
}

.quiz-option.wrong .quiz-option-radio {
    border-color: #ef4444;
    background: #ef4444;
}

.quiz-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.quiz-counter {
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-weight: 500;
}

.btn-quiz {
    padding: 0.65rem 1.5rem;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    color: var(--color-text);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-quiz:hover:not(:disabled) {
    border-color: var(--color-purple);
    color: var(--color-purple);
}

.btn-quiz:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-quiz-next {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
}

.btn-quiz-next:hover:not(:disabled) {
    color: #fff;
    box-shadow: 0 4px 15px rgba(124,58,237,0.4);
    transform: translateY(-1px);
}

.quiz-result {
    text-align: center;
    padding: 2rem 0;
}

.quiz-result h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.quiz-result .score {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quiz-result .message {
    color: var(--color-text-light);
    margin-top: 0.5rem;
    font-size: 1rem;
}

.btn-retry {
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: all var(--transition);
}

.btn-retry:hover {
    box-shadow: 0 4px 20px rgba(124,58,237,0.4);
    transform: translateY(-2px);
}

/* ========== FOOTER ========== */
.footer {
    background: var(--gradient-dark);
    color: var(--color-text-inverse);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2.5rem;
    padding: 4rem 1.5rem 3rem!important;
    max-width: var(--container-max);
    margin: 0 auto;
}

.footer-brand p {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.7;
    margin-top: 1rem;
    max-width: 320px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    flex-wrap: wrap;
}

.footer-logo .logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 800;
}

.footer-links h4,
.footer-math h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    font-size: 0.9rem;
    color: #94a3b8;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: #a78bfa;
}

.footer-formula {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 0.5rem;
}

.footer-formula-caption {
    font-size: 0.8rem;
    color: #64748b;
    font-style: italic;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.5rem 0;
    text-align: center;
}

.footer-bottom .container {
    padding: 0 1.5rem;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: #64748b;
}

/* ========== REVEAL ANIMATIONS ========== */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1),
                transform 0.7s cubic-bezier(0.4,0,0.2,1);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========== BACK TO TOP BUTTON ========== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: var(--shadow-md);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

/* ============================================================
   RESPONSIVE — MOBILE FIRST (base styles above are mobile)
   ============================================================ */

/* Tablet (768px+) */
@media (min-width: 768px) {
    .formulas-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small Desktop (1024px+) */
@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }

    .civ-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .formulas-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================
   MOBILE SPECIFIC (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 320px;
        height: 100vh;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 100px 2rem 2rem;
        transition: right var(--transition-smooth);
        box-shadow: -10px 0 30px rgba(0,0,0,0.15);
        z-index: 1000;
    }

    .nav.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .nav-link {
        display: block;
        padding: 0.85rem 1.25rem;
        font-size: 1rem;
        border-radius: var(--radius-sm);
    }

    /* Timeline mobile */
    .timeline-line {
        left: 24px;
    }

    .timeline-item,
    .timeline-item.right {
        justify-content: flex-start;
        padding-left: 56px;
    }

    .timeline-dot {
        left: 24px;
    }

    .timeline-content {
        width: 100%;
    }

    .hero-title {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }

    .section {
        padding: 3.5rem 0;
    }

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

    .scroll-container {
        padding: 0 40px;
    }

    .scroll-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .scroll-container .periods-grid,
    .scroll-container .geniuses-grid {
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .scroll-container .periods-grid::-webkit-scrollbar,
    .scroll-container .geniuses-grid::-webkit-scrollbar {
        display: none;
    }

    .periods-grid,
    .geniuses-grid {
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .periods-grid::-webkit-scrollbar,
    .geniuses-grid::-webkit-scrollbar {
        display: none;
    }

    .period-card,
    .genius-card {
        flex: 0 0 82vw;
    }

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

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

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

    .fun-facts {
        padding: 1.5rem;
    }

    .quiz-container {
        padding: 1.25rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-links ul {
        align-items: center;
    }

    .back-to-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .scroll-container {
        padding: 0 32px;
    }
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 280px;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .quiz-actions {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .quiz-actions > div {
        display: flex;
        gap: 0.5rem;
        justify-content: center;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

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