/* ═══════════════════════════════════════════════════════════
   Les Nuits du Sahel — Design System
   Sibling to La Taxe Canicule — same bones, different skin.
   Night palette: deep blue-black + teal accent.
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Outfit:wght@300;400;500;600&family=DM+Mono:wght@300;400&display=swap');

:root {
    /* Night palette */
    --bg:            #0B0E14;
    --bg-card:       #10141C;
    --bg-card-hover: #151A24;
    --border:        #1C2230;
    --border-light:  #252D3D;

    /* Text — generous contrast */
    --text:          #D6D2CC;
    --text-bright:   #EBE8E4;
    --text-dim:      #7D7873;
    --text-faint:    #4A4744;

    /* Accent — teal/cyan for night identity */
    --accent:        #4AADAA;
    --accent-glow:   rgba(74, 173, 170, 0.08);
    --accent-strong: #5CC4C0;

    /* Danger — for worst-month highlights */
    --red:           #CB4B3A;
    --red-glow:      rgba(203, 75, 58, 0.08);

    /* Fonts — Cormorant stays (family link), body changes */
    --font-display:  'Cormorant Garamond', Georgia, serif;
    --font-body:     'Outfit', -apple-system, sans-serif;
    --font-mono:     'DM Mono', 'Courier New', monospace;

    /* Layout */
    --max-w:         760px;
    --pad:           clamp(1.5rem, 5vw, 4rem);
    --section-space: 9rem;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 300;
    line-height: 1.85;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

/* Grain — lighter than heat tax */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

::selection { background: var(--accent); color: var(--bg); }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-bright);
}

h1 { font-size: clamp(2.6rem, 6.5vw, 4.2rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.3rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.75rem; }

p { margin-bottom: 1.4rem; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}
a:hover { opacity: 0.8; }
a.amber { color: #D4893A; }
a.amber:hover { opacity: 0.8; }

strong { color: var(--text-bright); font-weight: 500; }

em, .dim { color: var(--text-dim); font-style: italic; }

.mono {
    font-family: var(--font-mono);
    font-size: 0.85em;
    letter-spacing: -0.01em;
}

/* ── Layout ───────────────────────────────────────────────── */
.wrap {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad);
}

.section {
    padding: var(--section-space) 0;
}

.section + .section {
    border-top: 1px solid var(--border);
}

/* ── Navigation ───────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 0.85rem var(--pad);
    background: rgba(11, 14, 20, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-bright);
}

.nav-links {
    display: flex;
    gap: 1.6rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--text-faint);
    text-transform: uppercase;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); opacity: 1; }

.nav-lang {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-faint);
    border: 1px solid var(--border);
    padding: 0.2rem 0.55rem;
    border-radius: 3px;
    transition: border-color 0.2s, color 0.2s;
}
.nav-lang:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }

/* Hamburger */
.nav-toggle {
    display: none;
    background: none; border: none; cursor: pointer; padding: 0.5rem;
}
.nav-toggle span {
    display: block; width: 22px; height: 2px;
    background: var(--text-bright); margin: 5px 0;
    transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 5rem;
    position: relative;
}

/* Soft radial glow — teal instead of amber */
.hero::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 1.5rem;
}

.hero h1 { margin-bottom: 1.75rem; position: relative; z-index: 1; }

.hero-sub {
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1.9;
    color: var(--text-dim);
    max-width: 540px;
    margin-bottom: 3rem;
}

/* Big hero number */
.hero-stat {
    position: relative; z-index: 1;
    margin: 3rem 0;
}

.hero-stat .num {
    font-family: var(--font-display);
    font-size: clamp(5rem, 14vw, 9rem);
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    letter-spacing: -0.03em;
}

.hero-stat .suffix {
    font-family: var(--font-mono);
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--text-faint);
    margin-left: 0.4rem;
}

.hero-stat .caption {
    display: block;
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-dim);
    margin-top: 0.75rem;
    line-height: 1.7;
}

/* ── Stat Row ─────────────────────────────────────────────── */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1.25rem;
    margin: 3rem 0;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1.4rem 1.5rem;
    transition: border-color 0.3s, background 0.3s;
}
.stat-card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.stat-card .val {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.stat-card .desc {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-faint);
    margin-top: 0.5rem;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── Section Headers ──────────────────────────────────────── */
.section-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-faint);
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
}

.section-lead {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text);
    margin-bottom: 2rem;
    max-width: 620px;
    line-height: 1.9;
}

/* ── Chart Images ─────────────────────────────────────────── */
.chart-wrap {
    margin: 2.5rem 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1.25rem;
}

.chart-wrap img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 3px;
}

.chart-caption {
    font-family: var(--font-mono);
    font-size: 0.73rem;
    color: var(--text-faint);
    margin-top: 0.75rem;
    line-height: 1.65;
}

/* ── Pullquote ────────────────────────────────────────────── */
.pullquote {
    text-align: center;
    padding: 4rem 0;
    margin: 2rem 0;
}

.pullquote blockquote {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3vw, 1.65rem);
    font-style: italic;
    color: var(--text-bright);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.55;
}

.pullquote .translation {
    font-size: 0.92rem;
    font-style: italic;
    color: var(--text-faint);
    margin-top: 1rem;
}

/* ── Callout ──────────────────────────────────────────────── */
.callout {
    border-left: 3px solid var(--accent);
    padding: 1.25rem 1.5rem;
    margin: 2.5rem 0;
    background: var(--accent-glow);
    border-radius: 0 5px 5px 0;
}

.callout p {
    color: var(--text-bright);
    margin-bottom: 0.75rem;
    font-size: 1.02rem;
    line-height: 1.8;
}
.callout p:last-child { margin-bottom: 0; }

/* ── Assumption & Formula Blocks ──────────────────────────── */
.assumption {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1.4rem 1.5rem;
    margin: 2rem 0;
}

.assumption .tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.formula {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.9;
    color: var(--text-dim);
    overflow-x: auto;
    white-space: pre;
}

/* ── Source List ───────────────────────────────────────────── */
.source-list { list-style: none; }

.source-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.source-badge {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 0.2rem;
}
.source-badge.open   { color: #5CB77A; border: 1px solid rgba(92,183,122,0.3); }
.source-badge.declared { color: var(--accent); border: 1px solid rgba(74,173,170,0.3); }
.source-badge.official { color: #5B9BD5; border: 1px solid rgba(91,155,213,0.3); }

.source-name { font-weight: 500; color: var(--text-bright); font-size: 0.95rem; }
.source-desc { font-size: 0.83rem; color: var(--text-faint); margin-top: 0.2rem; line-height: 1.6; }

/* ── Companion Link ───────────────────────────────────────── */
.companion {
    display: block;
    padding: 3rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 5px;
    margin: 3rem 0;
    transition: border-color 0.3s;
    text-align: center;
}
.companion:hover { border-color: var(--border-light); opacity: 1; }

.companion-icon {
    font-size: 2rem;
    margin-bottom: 1.25rem;
    display: block;
}

.companion-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-bottom: 0.4rem;
}
.companion-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.companion-desc {
    font-size: 0.92rem;
    font-weight: 300;
    color: var(--text-dim);
    margin-top: 0.3rem;
    line-height: 1.75;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}
.companion-link {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 1.25rem;
    color: var(--accent);
}

/* Amber variant for La Taxe Canicule */
.companion.amber { border-color: rgba(212, 137, 58, 0.2); }
.companion.amber:hover { border-color: rgba(212, 137, 58, 0.4); }
.companion.amber .companion-title { color: #D4893A; }
.companion.amber .companion-link { color: #D4893A; }

/* ── Footer ───────────────────────────────────────────────── */
.footer {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.footer-links a {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.footer-links a:hover { color: var(--accent); opacity: 1; }

.footer-credit {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-faint);
    line-height: 1.9;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-up { opacity: 0; animation: fadeUp 0.6s ease forwards; }
.d1 { animation-delay: 0.1s; }
.d2 { animation-delay: 0.2s; }
.d3 { animation-delay: 0.3s; }
.d4 { animation-delay: 0.4s; }
.d5 { animation-delay: 0.5s; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    :root { --section-space: 6rem; }
    body { font-size: 16px; }

    .nav-links { display: none; }
    .nav-toggle { display: block; }

    .nav-links.open {
        display: flex; flex-direction: column;
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        padding: 1.25rem var(--pad);
        gap: 1.1rem;
    }

    .stat-row { grid-template-columns: 1fr 1fr; }
    .hero-stat .num { font-size: clamp(4rem, 16vw, 7rem); }
}

@media (max-width: 420px) {
    .stat-row { grid-template-columns: 1fr; }
}
