/* ─────────────────────────────────────────────────────────────────────────────
   Lottolyysi — Stylesheet
   Design system: Cormorant Garamond + Raleway, dark palette
   Matches portfolio aesthetic (ranno.tech)
───────────────────────────────────────────────────────────────────────────── */

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

/* ─── Design Tokens ───────────────────────────────────────────────────────── */
:root {
    --black:      #0b0907;
    --slate:      #181210;
    --charcoal:   #261e18;
    --mist:       #6b6058;
    --bone:       #c9c0af;
    --ivory:      #ede5d8;
    --gold:       #c49a14;
    --gold-light: #ddb84e;
    --gold-dim:   #7a5c08;

    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans:  'Raleway', system-ui, Arial, sans-serif;

    --pad-x:       clamp(24px, 7vw, 120px);
    --section-pad: clamp(72px, 10vw, 120px);
}

/* ─── Base ────────────────────────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--black);
    color: var(--bone);
    font-family: var(--font-sans);
    font-weight: 300;
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── Film Grain ──────────────────────────────────────────────────────────── */
.film-grain {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
}
.film-grain svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ─── Navigation ──────────────────────────────────────────────────────────── */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--pad-x);
    height: 64px;
    background: transparent;
    transition: background 0.4s ease, border-color 0.4s ease;
    border-bottom: 1px solid transparent;
}
nav.scrolled {
    background: rgba(11, 9, 7, 0.97);
    border-bottom-color: rgba(201, 192, 175, 0.07);
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 400;
    color: var(--bone);
    text-decoration: none;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.nav-logo span { color: var(--gold); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 28px;
}
.nav-links a {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mist);
    text-decoration: none;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--bone); }

/* Language switcher */
.lang-switcher {
    display: flex;
    gap: 4px;
}
.lang-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--mist);
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.14em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 2px;
    transition: color 0.2s, border-color 0.2s;
}
.lang-btn:hover { color: var(--bone); }
.lang-btn.active {
    color: var(--gold);
    border-color: rgba(196, 154, 20, 0.35);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 1px;
    background: var(--bone);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ─── Hero ────────────────────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px var(--pad-x) 48px;
    background: var(--black);
    text-align: center;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 560px;
    gap: 0;
}

.hero-eyebrow {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 14px;
    display: block;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(52px, 10vw, 88px);
    font-weight: 300;
    line-height: 1.0;
    color: var(--ivory);
    letter-spacing: -0.02em;
    margin-bottom: 18px;
}
.hero-title em {
    font-style: italic;
    font-weight: 300;
    color: var(--gold-light);
}

.hero-subtitle {
    font-size: clamp(14px, 2vw, 16px);
    font-weight: 300;
    color: var(--mist);
    line-height: 1.7;
    letter-spacing: 0.03em;
    margin-bottom: 36px;
    max-width: 420px;
}

/* Stat cards 2x2 grid */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    width: 100%;
    margin-bottom: 36px;
}

.stat-card {
    background: var(--slate);
    border: 1px solid var(--charcoal);
    padding: 22px 20px 18px;
    text-align: left;
    transition: border-color 0.2s;
}
.stat-card:hover { border-color: rgba(196, 154, 20, 0.2); }

.stat-val {
    display: block;
    font-family: var(--font-serif);
    font-size: clamp(22px, 4vw, 34px);
    font-weight: 300;
    color: var(--ivory);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 7px;
}

.stat-label {
    display: block;
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--mist);
    line-height: 1.5;
}

/* Hero CTA */
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--mist);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    transition: color 0.3s;
}
.hero-cta:hover { color: var(--bone); }

.cta-line {
    display: block;
    width: 32px;
    height: 1px;
    background: var(--gold);
    transition: width 0.3s ease;
    flex-shrink: 0;
}
.hero-cta:hover .cta-line { width: 50px; }

/* ─── Shared Section Elements ─────────────────────────────────────────────── */
.section-label {
    display: block;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 20px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(38px, 5.5vw, 64px);
    font-weight: 300;
    line-height: 1.1;
    color: var(--ivory);
    letter-spacing: -0.01em;
    margin-bottom: 48px;
}

.section-divider {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}
.divider-mark {
    display: block;
    width: 48px;
    height: 1px;
    background: rgba(201, 192, 175, 0.14);
}

/* ─── Findings Section ────────────────────────────────────────────────────── */
.findings-section {
    padding: var(--section-pad) var(--pad-x);
}

.findings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.finding-card {
    background: var(--slate);
    border-left: 3px solid var(--gold-dim);
    padding: 32px 28px 28px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.finding-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.finding-num {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 12px;
    display: block;
}

.finding-title {
    font-family: var(--font-serif);
    font-size: clamp(19px, 2.2vw, 24px);
    font-weight: 300;
    color: var(--ivory);
    line-height: 1.25;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.finding-body {
    font-size: 14px;
    font-weight: 300;
    color: var(--mist);
    line-height: 1.85;
}

/* ─── Methodology / Accordion ─────────────────────────────────────────────── */
.methodology-section {
    padding: var(--section-pad) var(--pad-x);
}

.methodology-intro {
    max-width: 660px;
    font-size: 16px;
    font-weight: 300;
    color: var(--mist);
    line-height: 1.85;
    margin-bottom: 52px;
}

.accordion {
    max-width: 780px;
    border-top: 1px solid rgba(201, 192, 175, 0.1);
}

.accordion-item {
    border-bottom: 1px solid rgba(201, 192, 175, 0.1);
}

.accordion-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--bone);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-align: left;
    gap: 16px;
    transition: color 0.2s;
}
.accordion-trigger:hover { color: var(--ivory); }
.accordion-trigger:hover .accordion-icon { color: var(--gold); }

.accordion-icon {
    font-size: 22px;
    font-weight: 200;
    color: var(--mist);
    transition: transform 0.35s ease, color 0.2s;
    flex-shrink: 0;
    line-height: 1;
}
.accordion-item.open .accordion-icon {
    transform: rotate(45deg);
    color: var(--gold);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s ease, padding-bottom 0.45s ease;
    padding-bottom: 0;
}
.accordion-item.open .accordion-body {
    max-height: 600px;
    padding-bottom: 24px;
}

.accordion-body p {
    font-size: 14px;
    font-weight: 300;
    color: var(--mist);
    line-height: 1.85;
    margin-bottom: 6px;
}
.accordion-body p:last-child { margin-bottom: 0; }
.accordion-body strong {
    color: var(--bone);
    font-weight: 400;
}

/* ─── About Section ───────────────────────────────────────────────────────── */
.about-section {
    padding: var(--section-pad) var(--pad-x);
}

.about-body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 60px;
    align-items: start;
    max-width: 860px;
}

.about-text p {
    font-size: 16px;
    font-weight: 300;
    color: var(--mist);
    line-height: 1.9;
    margin-bottom: 22px;
}
.about-text p:last-child { margin-bottom: 0; }

.about-links {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-top: 4px;
}

.about-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mist);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}
.about-link::before {
    content: '';
    display: block;
    width: 22px;
    height: 1px;
    background: var(--gold);
    flex-shrink: 0;
}
.about-link:hover { color: var(--bone); }

/* ─── Footer ──────────────────────────────────────────────────────────────── */
footer {
    padding: 40px var(--pad-x);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(201, 192, 175, 0.08);
}

.footer-copy {
    font-size: 12px;
    font-weight: 300;
    color: var(--mist);
    letter-spacing: 0.05em;
}

.footer-links {
    display: flex;
    list-style: none;
    gap: 28px;
}
.footer-links a {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--mist);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--bone); }

/* ─── Scroll Reveal ───────────────────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in-view {
    opacity: 1;
    transform: none;
}

/* ─── Data page shared styles ────────────────────────────────────────────── */
.data-section {
    padding: var(--section-pad) var(--pad-x);
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin-top: 8px;
}

.chart-card {
    background: var(--slate);
    padding: 28px 24px;
}

.chart-card-title {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--bone);
    margin-bottom: 6px;
}

.chart-card-sub {
    font-size: 12px;
    font-weight: 300;
    color: var(--mist);
    margin-bottom: 20px;
    letter-spacing: 0.03em;
}

.chart-container {
    position: relative;
    height: 220px;
}

.chart-container--tall {
    height: 260px;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 8px;
    max-width: 840px;
}

.download-item {
    background: var(--slate);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: background 0.2s;
}
.download-item:hover { background: var(--charcoal); }

.download-meta { flex: 1; }

.download-name {
    font-size: 13px;
    font-weight: 400;
    color: var(--bone);
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.download-desc {
    font-size: 12px;
    font-weight: 300;
    color: var(--mist);
    line-height: 1.5;
}

.download-link {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
    flex-shrink: 0;
}
.download-link:hover { color: var(--gold-light); }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .chart-grid { grid-template-columns: 1fr; }
    .download-grid { grid-template-columns: 1fr; }
    .findings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .about-body { grid-template-columns: 1fr; gap: 36px; }
    .about-links { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 640px) {
    .hamburger { display: flex; }
    .lang-switcher { display: none; }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(11, 9, 7, 0.98);
        flex-direction: column;
        padding: 12px 0 20px;
        gap: 0;
        border-bottom: 1px solid rgba(201, 192, 175, 0.08);
    }
    .nav-links.open { display: flex; }
    .nav-links a {
        display: block;
        padding: 14px var(--pad-x);
    }

    .hero-stats { grid-template-columns: 1fr; }
    .hero-title { font-size: clamp(44px, 12vw, 72px); }

    footer {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    .footer-links { justify-content: center; }
}
