/* --- TEEMAMUUTTUJAT --- */
:root {
    --brand: #14695c; /* Sovelluksen vihreä teemaväri */
    --brand-hover: #0d4a40;
    --bg-main: #ffffff;
    --bg-sec: #e8f1ee;
    --bg-glass: rgba(244, 247, 246, 0.85);
    --text-main: #1f2d2a;
    --text-muted: #4a5854; /* 7.46:1 valkoisella — WCAG AAA */
    --border: #e1e8e6;
    --danger-bg: #FFF0F0;
    --danger-text: #D00000;
    --danger-border: #FFB3B3;
    --shadow: 0 10px 30px rgba(20, 105, 92, 0.08);
    --font-family: 'Manrope', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --radius: 20px;
    --on-brand: #ffffff;
    color-scheme: light;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg-main: #0d1412;
    --bg-sec: #14201d;
    --bg-glass: rgba(13, 20, 18, 0.85);
    --text-main: #e6efec;
    --text-muted: #a4bdb7; /* Parannettu kontrasti WCAG AAA -tasolle */
    --border: #25332f;
    --brand: #4db6a4;
    --brand-hover: #6fcaba;
    --on-brand: #08201c;
    --danger-bg: rgba(208, 0, 0, 0.15);
    --danger-text: #ff6b6b;
    --danger-border: #7f1d1d;
    --shadow: 0 10px 30px rgba(0,0,0,0.5);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;
}

[id] {
    scroll-margin-top: 5.5rem;
}

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

body.theme-transitioning {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.menu-open {
    overflow: hidden;
}

h1, h2, h3, h4, .logo { font-family: var(--font-display); font-weight: 600; }
/* Pitkä suomen yhdyssana saa katketa vain, jos se ei mahdu riville lainkaan:
   Linux-Chromium (CI) renderöi tekstin muutaman pikselin leveämmäksi, ja
   "hiilihydraatteja" ylitti laatikkonsa 320 px:ssä 5 px. */
h1, h2, h3, h4, p, li, summary { overflow-wrap: break-word; }

a { text-decoration: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* --- SKIP-LINK (saavutettavuus) --- */
.skip-link {
    position: absolute; top: -100px; left: 1rem;
    background: var(--text-main); color: var(--bg-main);
    padding: 0.6rem 1rem; border-radius: 8px;
    font-weight: 600; z-index: 100;
    transition: top 0.15s;
}
.skip-link:focus { top: 0.5rem; outline: 2px solid var(--brand); outline-offset: 2px; }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* --- MDR BANNERI --- */
.mdr-banner {
    background-color: var(--danger-bg);
    color: var(--danger-text);
    text-align: center;
    padding: 8px 24px;
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 1px solid var(--danger-border);
}

/* --- NAVIGOINTI --- */
nav {
    position: sticky;
    top: 0; width: 100%;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 1rem 0;
}

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

.logo { font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 0.6rem; letter-spacing: -0.02em;}
.logo-icon { width: 32px; height: 32px; border-radius: 8px; display: block; }

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { font-size: 0.95rem; font-weight: 500; color: var(--text-muted); transition: color 0.2s; }
.nav-links a:hover { color: var(--text-main); }
.nav-links a.lang-link { border: 1px solid var(--border); border-radius: 999px; padding: 0.3rem 0.7rem; font-weight: 600; letter-spacing: 0.03em; }
.nav-links a.lang-link:hover { border-color: var(--brand); color: var(--brand); }
/* Kielilinkki on kirjoitettu auki ("English"), jolloin 2rem:n välit rivittivät
   FI-navigaation 901 px:n leveydellä. Kapealla työpöydällä välit tiiviimmiksi. */
@media (max-width: 1100px) { .nav-links { gap: 1.25rem; } }

.theme-toggle {
    background: none; border: none; color: var(--text-main); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px; padding: 10px;
    border-radius: 50%; transition: background 0.2s;
}
.theme-toggle:hover { background: var(--bg-sec); }
#sun-icon { display: none; }
#moon-icon { display: block; }
[data-theme="dark"] #sun-icon { display: block; }
[data-theme="dark"] #moon-icon { display: none; }

/* Mobiilinavigaation hampurilainen */
.nav-burger {
    display: none; background: none; border: none; cursor: pointer;
    min-width: 44px; min-height: 44px; padding: 10px;
    align-items: center; justify-content: center;
    color: var(--text-main); border-radius: 8px;
}
.nav-burger:hover { background: var(--bg-sec); }

.btn-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: -0.25rem; margin-bottom: 1rem; }
/* Vihjetekstin linkki oli täsmälleen leipätekstin värinen ja alleviivaamaton
   (mitattu 1.14:1) — ei erottunut linkiksi millään visuaalisella keinolla. */
.btn-hint a { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 0.15em; }
.btn-hint a:hover { color: var(--brand-hover); }

/* --- HERO --- */
/* Vain pystytäyte: padding-oikotie kumosi .containerin 2rem:n sivureunukset, ja
   teksti oli kiinni ruudun reunassa alle 1264 px:n leveydellä. */
.hero { padding-top: 3.5rem; padding-bottom: 3rem; display: flex; align-items: center; gap: 4rem; }
.hero-text { flex: 1; }

.hero h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 1.25rem; }
.hero p { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 1.8rem; max-width: 550px; }

.stores { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
    padding: 0.8rem 1.5rem; border-radius: 30px; font-weight: 600; font-size: 1rem;
    font-family: inherit; line-height: 1;
    background: var(--text-main); color: var(--bg-main);
    border: none; cursor: pointer;
    transition: opacity 0.2s, background-color 0.2s;
}
.btn-outline { background: var(--bg-main); color: var(--text-main); border: 1px solid var(--border); }
.btn:not(:disabled):hover { opacity: 0.9; }
.btn svg { width: 22px; height: 22px; fill: currentColor; }
/* Viivakuvake (fill="none") pysyy ääriviivana: yllä oleva sääntö täytti selainversio-
   painikkeen ikkunakuvakkeen umpinaiseksi neliöksi. */
.btn svg[fill="none"] { fill: none; }

/* Uusi tyyli pääpainikkeelle */
.btn-primary { background: var(--brand); color: var(--on-brand); border: none; }
.btn-primary:hover { background: var(--brand-hover); opacity: 1; }

/* Hero-screenshot fan */
.hero-visual { flex: 1; display: flex; justify-content: center; align-items: center; min-width: 0; }
.phone-fan {
    position: relative; width: 320px; height: 620px;
}
.phone {
    position: absolute; top: 0; left: 50%;
    width: 280px; aspect-ratio: 585 / 1266;
    border: 10px solid #1d1d1f; border-radius: 36px;
    background: #1d1d1f; overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.16);
    transform-origin: bottom center;
}
[data-theme="dark"] .phone { border-color: #38383a; background: #38383a; }
.phone picture, .phone img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone-1 { transform: translateX(-50%) translateX(-105px) rotate(-6deg); z-index: 1; }
.phone-2 { transform: translateX(-50%) translateY(-8px) rotate(0deg); z-index: 3; }
.phone-3 { transform: translateX(-50%) translateX(105px) rotate(6deg); z-index: 1; }

/* --- MITEN SE TOIMII / HOW IT WORKS --- */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.step-card {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s;
}
.step-card:hover {
    border-color: var(--brand);
}
.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--on-brand);
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.step-card h3 {
    font-size: 1.3rem;
    letter-spacing: -0.01em;
    margin: 0;
}
.step-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}
.step-visual {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-sec);
    aspect-ratio: 585 / 380;
    display: flex;
    align-items: flex-start;
}
.step-visual picture, .step-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* --crop-y valitsee mikä kohta lähdekuvasta näkyy: 0 % = ylin reuna.
       Näkyvä ikkuna on aina 380 lähdepikseliä näytön leveydestä riippumatta,
       koska laatikon aspect-ratio on kiinteä 585/380. */
    object-position: 50% var(--crop-y, 0%);
    display: block;
}
/* Rajauskohdat on mitattu sovelluksen 1.69.6 kuvista (tools/app-screens.mjs).
   Ikkunan yläreuna on --crop-y × 886 lähdepikseliä (1266 − 380), ja jokainen
   ikkuna alkaa ja päättyy rivien väliin katkaisematta tekstiä tai kenttää:
   - syöttö 53,5 % = rivit 474–854: ajankohta, sokeriarvo ja hiilihydraattien otsikko
   - laskelma 40,2 % = rivit 356–736: vaiheet 1–3
   - asetukset 10,4 % = rivit 92–472: Laskenta-ryhmän neljä riviä
   EN-etusivun kuvat ovat englanninkielisestä käyttöliittymästä (screen-*-en).
   Laskelma ja asetukset ovat niissä samoilla riveillä, joten arvot ovat yhteiset.
   Syöttönäkymässä "Clear inputs" mahtuu otsikon riville, ja kentät ovat 56 riviä
   ylempänä:
   - syöttö (EN) 47,2 % = rivit 418–798: sama sisältö kuin suomenkielisessä ikkunassa
   Tarkista arvot kummankin kielen kuvista aina, kun kuvat otetaan uudelleen. */
.step-visual--crop-inputs { --crop-y: 53.5%; }
.step-visual--crop-inputs:lang(en) { --crop-y: 47.2%; }
.step-visual--crop-result { --crop-y: 40.2%; }
.step-visual--crop-settings { --crop-y: 10.4%; }

/* --- BENTO GRID (Ominaisuudet) --- */
.section { padding-block: 3.5rem; } /* sivureunukset tulevat .containerista, ks. .hero */
.section-header { text-align: center; margin-bottom: 2.25rem; }
/* min(): pitkät sanat ("Lääketieteellinen") eivät mahtuneet 320 px:n näytölle. */
.section-header h2 { font-size: min(2.1rem, 9.5vw); margin-bottom: 0.75rem; letter-spacing: -0.03em; }
.section-header p { color: var(--text-muted); font-size: 1.08rem; max-width: 620px; margin: 0 auto; }

.bento { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.bento-item { background: var(--bg-main); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; transition: border-color 0.2s; }
.bento-item:hover { border-color: var(--text-muted); }
.bento-icon { width: 44px; height: 44px; background: var(--bg-sec); color: var(--brand); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; font-size: 24px;}
.bento-item h3 { font-size: 1.15rem; margin-bottom: 0.6rem; letter-spacing: -0.01em;}
.bento-item p { color: var(--text-muted); font-size: 0.95rem; }

/* --- SYVÄSUKELLUS (Algoritmi & Turvallisuus) --- */
.deep-dive { background: var(--bg-sec); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: center; margin-bottom: 3.5rem; }
.feature-row:last-child { margin-bottom: 0; }
@media (min-width: 901px) {
    .feature-row--reverse .ft-text { order: 2; }
    .feature-row--reverse .ft-visual { order: 1; }
}

.ft-text h3 { font-size: 1.75rem; margin-bottom: 1rem; letter-spacing: -0.02em; line-height: 1.2;}
.ft-text p { color: var(--text-muted); margin-bottom: 1rem; font-size: 1rem; }
.ft-list { list-style: none; margin-top: 1.25rem; }
.ft-list li { margin-bottom: 0.85rem; display: flex; align-items: flex-start; gap: 0.85rem; color: var(--text-main);}
.ft-list li svg { width: 22px; height: 22px; color: var(--brand); flex-shrink: 0; margin-top: 2px;}

.ft-visual { background: var(--bg-main); border: 1px solid var(--border); border-radius: 24px; padding: 2.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; min-height: 340px;}
.ft-visual h4 { margin-bottom: 1.5rem; color: var(--text-main); font-size: 1.1rem; }
.ft-visual > svg { width: 100%; height: auto; max-width: 380px; }
.ft-visual--hypo { background: var(--danger-bg); border-color: var(--danger-border); }
/* Yksittäinen sovelluskuva puhelinkehyksessä tekstin rinnalla. Oma luokka eikä
   .phone: viuhkan puhelimet ovat absoluuttisesti aseteltuja ja kutistuvat
   viuhkan omissa mediakyselyissä. */
.ft-phone {
    justify-self: center;
    /* Prosenttileveys ja kiinteä yläraja, ei toisin päin: kiinteä 280 px:n leveys
       venytti ruudukon sarakkeen 320 px:n näytöllä 24 px sivureunuksen yli. */
    width: 100%; max-width: 280px; aspect-ratio: 585 / 1266;
    border: 10px solid #1d1d1f; border-radius: 36px;
    background: #1d1d1f; overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.16);
}
[data-theme="dark"] .ft-phone { border-color: #38383a; background: #38383a; }
.ft-phone picture, .ft-phone img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hypo-card {
    background: var(--bg-main);
    padding: 2.25rem;
    border-radius: 20px;
    border: 2px solid var(--danger-text);
    text-align: center;
    width: 100%;
    max-width: 320px;
}
.hypo-card__icon {
    stroke: var(--danger-text);
    margin-bottom: 1rem;
}
/* Kappale, ei otsikko: kortti on esimerkki sovelluksen näkymästä, eikä sen
   teksti kuulu ruudunlukijan otsikkolistaan. Otsikkotyyli annetaan tässä. */
.hypo-card__title {
    font-family: var(--font-display); font-weight: 600;
    color: var(--danger-text);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}
.hypo-card__dose {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -0.03em;
}
.hypo-card__desc {
    color: var(--danger-text);
    font-size: 0.95rem;
    margin-top: 1rem;
    font-weight: 500;
}

/* --- TIETOSUOJA JA KÄYTTÖOIKEUS --- */
.trust-section {
    background: var(--bg-sec);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 3.5rem 0;
}
.trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
.trust-pill {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem;
    text-align: center;
}
.trust-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-sec);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}
.trust-pill h3 {
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
}
.trust-pill p {
    font-size: 0.9rem;
    color: var(--text-muted);
}



/* --- FAQ ACCORDION --- */
.faq-grid {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.faq-item {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.faq-item:hover, .faq-item[open] {
    border-color: var(--brand);
}
.faq-item summary {
    padding: 1.2rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    font-family: var(--font-display);
}
.faq-item summary::-webkit-details-marker { display: none; }
/* .faq-item leikkaa overflow: hiddenilla kaiken reunansa yli menevän, joten
   yleinen outline-offset: 2px jäi kokonaan näkymättömiin (mitattu 0 muuttunutta
   pikseliä). Rengas piirretään siksi sisäpuolelle. */
.faq-item summary:focus-visible { outline-offset: -3px; border-radius: 13px; }
.faq-chevron {
    width: 20px;
    height: 20px;
    transition: transform 0.25s ease;
    color: var(--brand);
    flex-shrink: 0;
    margin-left: 1rem;
}
.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
}
.faq-content {
    padding: 0 1.5rem 1.35rem;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.65;
}
.faq-content p {
    margin-bottom: 0.75rem;
}
.faq-content p:last-child {
    margin-bottom: 0;
}

/* --- MDR FOOTER --- */
footer { padding: 3.5rem 0 2.5rem; text-align: center; }
.mdr-box { background: var(--danger-bg); border: 1px solid var(--danger-border); border-radius: 16px; padding: 1.75rem; text-align: left; margin-bottom: 2.5rem; max-width: 900px; margin-left: auto; margin-right: auto;}
.mdr-box h3 { color: var(--danger-text); display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.85rem; font-size: 1.05rem; }
.mdr-box p { color: var(--text-main); font-size: 0.92rem; margin-bottom: 0.7rem; }
.footer-links { display: flex; gap: 1.5rem; justify-content: center; margin-bottom: 1.5rem; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; transition: color 0.2s; display: inline-flex; align-items: center; min-height: 44px; padding: 0.25rem 0.5rem; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; color: var(--text-muted); font-size: 0.9rem; display: flex; justify-content: space-between; align-items: center;}
.footer-bottom a { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 0.15em; display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.25rem; }
.footer-bottom a:hover { color: var(--brand-hover); }
.footer-bottom .footer-links { margin-bottom: 0; }
.footer-bottom .footer-links a { color: var(--text-muted); font-weight: 400; text-decoration: none; padding: 0.25rem 0.5rem; }

/* --- RESPONSIVISUUS --- */
@media (max-width: 900px) {
    .hero { flex-direction: column; text-align: center; gap: 3rem; }
    .feature-row { grid-template-columns: 1fr; gap: 3rem; }
    /* minmax(0, …): 1fr ei kutistu sisällön minimileveyttä kapeammaksi, ja kortit
       ylittivät 320 px:n näytön (EN, +6 px). */
    .steps-grid, .trust-grid { grid-template-columns: minmax(0, 1fr); }
    .hero-text { display: flex; flex-direction: column; align-items: center; }
    .stores { justify-content: center; }
    .ft-list li { text-align: left; }
    .hero h1 { font-size: 2.8rem; }
    .phone-fan { width: 320px; height: 500px; margin: 0 auto; }
    .phone { width: 200px; border-width: 8px; border-radius: 30px; }
    .phone-1 { transform: translateX(-50%) translateX(-70px) rotate(-6deg); }
    .phone-3 { transform: translateX(-50%) translateX(70px) rotate(6deg); }
    .phone-fan:hover .phone-1 { transform: translateX(-50%) translateX(-80px) rotate(-7deg); }
    .phone-fan:hover .phone-3 { transform: translateX(-50%) translateX(80px) rotate(7deg); }

    .nav-burger { display: inline-flex; }
    .nav-links {
        position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--bg-glass); backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        padding: 0.5rem 2rem 1rem;
        transform: translateY(-10px); opacity: 0; pointer-events: none;
        visibility: hidden;
        transition: transform 0.2s, opacity 0.2s, visibility 0.2s;
    }
    .nav-links a { padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
    .nav-links a:last-of-type { border-bottom: none; }
    .nav-links .theme-toggle { align-self: flex-end; margin-top: 0.5rem; }
    nav.open .nav-links { transform: translateY(0); opacity: 1; pointer-events: auto; visibility: visible; }

    .nav-links--static {
        position: static; opacity: 1; visibility: visible; pointer-events: auto;
        flex-direction: row; gap: 1.25rem; background: none; backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: none; padding: 0; transform: none;
    }
    .nav-links--static a { padding: 0; border-bottom: none; }

}
/* Puhelinviuhka mahtuu ruutuun: työpöytäviuhka on 666 px leveä ja ylitti ruudun
   oikean reunan 901–1263 px:ssä (enintään 124 px), mobiiliviuhka (429 px) alle
   430 px:n näytöt molemmin puolin. Mitattu: ei ylitystä 320–1400 px. */
@media (min-width: 901px) and (max-width: 1279px) {
    .phone-fan { width: 320px; height: 500px; }
    .phone { width: 200px; border-width: 8px; border-radius: 30px; }
    .phone-1 { transform: translateX(-50%) translateX(-70px) rotate(-6deg); }
    .phone-3 { transform: translateX(-50%) translateX(70px) rotate(6deg); }
    .phone-fan:hover .phone-1 { transform: translateX(-50%) translateX(-80px) rotate(-7deg); }
    .phone-fan:hover .phone-3 { transform: translateX(-50%) translateX(80px) rotate(7deg); }
}
@media (max-width: 440px) { .phone-fan { zoom: 0.72; } }
@media (max-width: 600px) {
    .footer-bottom { flex-direction: column; gap: 1rem; }
    .footer-links { flex-wrap: wrap; justify-content: center; }
    /* Pinoaa napit siististi allekkain mobiilissa */
    .stores { flex-direction: column; width: 100%; max-width: 280px; margin: 0 auto 2rem; }
    /* Sisäkkäiset 3rem- ja 2,5rem-täytteet jättivät esimerkkikortin tekstille
       74–144 px, ja "Ota hiilihydraatteja" ylitti kortin 320–390 px:ssä. */
    .ft-visual, .hypo-card { padding: 1.5rem; }
}
@media (max-width: 400px) {
    /* Sisäkkäiset täytteet jättivät pisimmille sanoille liian vähän tilaa. */
    .ft-visual, .hypo-card { padding: 1rem; }
    .mdr-box { padding: 1.25rem; }
}

/* --- ANIMAATIOT --- */
/* Piilotus koskee vain html.reveal-tilaa, jonka landing.js asettaa luotuaan
   IntersectionObserverin. Ennen tätä koko sivu (myös h1 ja CTA) jäi
   näkymättömiin, jos landing.js ei latautunut tai kaatui (mitattu 21/21). */
.reveal .fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal .fade-in.visible { opacity: 1; transform: translateY(0); }
.reveal .fade-in:focus-within { opacity: 1; transform: none; transition: none; }

/* Animaatiot pois liikkeenrajoituksen kanssa */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    /* Sisältö näkyviin ehdoitta: liikkeenrajoituskäyttäjä ei saa jäädä
       IntersectionObserverin paljastuksen varaan. */
    .reveal .fade-in { opacity: 1; transform: none; }
    *, *::before, *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* --- 404 NOT FOUND --- */
.not-found {
    min-height: 65vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 1.5rem;
}
.not-found-code {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 700;
    color: var(--brand);
    line-height: 1;
    margin-bottom: 1rem;
}
.not-found-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}
.not-found-desc {
    color: var(--text-muted);
    max-width: 520px;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}
.not-found-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}


/* --- TULOSTUS --- */
/* Fade-in paljastuu vain vieritettäessä, joten tuloste ja PDF jäivät lähes
   tyhjiksi (mitattu 19/21 osiota näkymättömiä) ja alatunnisteen
   MDR-vastuuvapauslauseke puuttui kokonaan. Pidä lohko tiedoston lopussa:
   myöhempi .fade-in-sääntö kumoaisi sen. */
@media print {
    .fade-in { opacity: 1 !important; transform: none !important; }
    /* UKK:n vastaukset tulosteeseen myös suljetuista kysymyksistä. Selaimet,
       jotka eivät tunne ::details-contentia, tulostavat vain kysymykset. */
    .faq-item::details-content { content-visibility: visible; height: auto; }
    .faq-chevron { display: none; }
}
