:root {
    --color-bg: #f5f4ed;
    --color-text-primary: #111111;
    --color-text-secondary: #111111;
    --color-text-tertiary: #555550;
    --teal-light: #C8E6DF;
    --teal-mid: #6CB2A4;
    --teal-base: #549280;
    --teal-dark: #245248;
    --terra-light: #D4BAF0;
    --terra-mid: #805BB5;
    --terra-dark: #4A2B7A;
    --font-mono: 'Satoshi', sans-serif;
    --font-serif: 'Erode', serif;
}

body {
    margin: 0;
    font-family: var(--font-serif);
    background: var(--color-bg);
    color: var(--color-text-primary);
}

h1, h2, h3 { font-family: var(--font-mono); font-weight: 600; }

.bridge-q { font-family: var(--font-mono); font-weight: 500; }

.narration .kicker,
.narration .meta,
#w-kicker,
#w-year,
#cause-source,
.waffleLegend { font-family: var(--font-mono); font-weight: 400; font-size: 13px; }

#petal-labels text { font-family: 'Satoshi', sans-serif; }

.step-intro p,
.step-tgf p,
.narration .line,
#w-line1, #w-line2,
#cause-body { font-family: var(--font-serif); font-size: 19px; line-height: 1.65; }

.bridge-kicker { font-family: var(--font-serif); font-style: italic; }

#convergence-text p:first-child { font-family: var(--font-mono); font-weight: 600; }

.step {
    min-height: 100vh;
    max-width: 680px;
    margin: 0 auto;
    padding: 20vh 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.step-title {
    min-height: 300vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 40vh;
    position: relative;
    z-index: 1;
}

.step-title h1 {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 500;
    line-height: 1.1;
}

.step-intro p {
    font-size: 20px;
    line-height: 1.7;
    margin: 0 0 18px 0;
}

.step-tgf {
    position: relative;
    z-index: 1;
}

.step-tgf p {
    font-size: 18px;
    line-height: 1.45;
    margin: 0 0 18px 0;
}

.step-tgf .simple {
    margin-top: 24px;
    font-size: 18px;
}

.bridge {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    position: relative;
    z-index: 10;
    opacity: 1;
}

.bridge-inner {
    max-width: 900px;
    text-align: center;
}

.bridge-kicker {
    opacity: .7;
    margin: 0 0 10px 0;
    font-size: 20px;
    text-decoration: underline;
    text-decoration-color: #6CB2A4;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.bridge-q {
    margin: 0;
    font-size: clamp(34px, 5vw, 56px);
    font-weight: 500;
    line-height: 1.1;
}

#waffle-bridge .bridge-q {
    font-size: clamp(20px, 2.2vw, 28px);
    line-height: 1.35;
}

.scrolly {
    position: relative;
    width: 100%;
}



#scrolly-tgf {
    min-height: 260vh;
    overflow: visible !important;
    position: relative;
    z-index: 1;
}

#scrolly-waffle {
    min-height: 360vh;
    overflow: visible;
}

.sticky {
    position: relative;
    height: 100vh;
    width: 100%;
}


#scrolly-waffle .sticky {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.twoCol {
    width: min(1200px, 92vw);
    margin: 0 auto;
    height: 100%;
    position: relative;
}

#scrolly-tgf .viz {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(900px, 70vw);
    max-height: 78vh;
}

#scrolly-tgf .sticky {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}


#scrolly-tgf .viz svg {
    max-height: 78vh;
    width: 100%;
    height: auto;
    display: block;
}

#scrolly-waffle .viz {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, 45vw);
    text-align: center;
}

.viz svg {
    width: 100%;
    height: auto;
    display: block;
}

.narration {
    position: absolute;
    top: 50%;
    right: min(5vw, 60px);
    transform: translateY(-50%);
    width: min(420px, 28vw);
}

.narration .kicker {
    font-size: 14px;
    opacity: .75;
    margin: 0 0 12px 0;
    letter-spacing: .02em;
}

.narration .line {
    font-size: 20px;
    line-height: 1.35;
    margin: 0 0 12px 0;
}

.narration .meta {
    margin-top: 10px;
    font-size: 14px;
    opacity: .65;
}

.waffleStack {
    position: relative;
    width: 420px;
    height: 420px;
    flex-shrink: 0;
}

.waffle {
    position: absolute;
    top: 0;
    left: 0;
    width: 420px;
    height: 420px;
    object-fit: contain;
    opacity: 0;
}

.waffleLegend {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 14px;
    font-size: 14px;
    opacity: .75;
}

.waffleLegend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

.waffleLegend .c0 {
    background: var(--terra-mid);
}

.waffleLegend .c1 {
    background: #D9CBBA;
}

.waffleLegend .c2 {
    background: var(--teal-mid);
}

@media (max-width:700px) {
    /* TGF: pinned, centrado vertical y horizontal */
    #scrolly-tgf .sticky {
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding-top: 0 !important;
    }

    #scrolly-tgf .viz {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        width: min(86vw, 620px) !important;
        max-height: 52vh !important;
        margin: 0 auto;
        flex-shrink: 0;
    }

    .tgf-card { display: none !important; }

    /* Anotación móvil TGF: posición absoluta para no desplazar el gráfico */
    #tgf-mobile-annot {
        display: block !important;
        position: absolute !important;
        bottom: 6vh;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 90vw !important;
        max-width: 560px !important;
        margin: 0 !important;
    }

    /* Ocultar etiquetas del abanico en SVG (se muestran en #cause-title) */
    #petal-labels { display: none; }

    /* Waffle: pinned, vertical stack */
    #scrolly-waffle .viz {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: min(900px, 92vw);
        margin: 0 auto;
    }

    #scrolly-waffle .twoCol > div:first-child {
        flex-direction: column !important;
        left: 0 !important;
        gap: 16px !important;
        align-items: center !important;
        width: 100%;
        box-sizing: border-box;
    }

    .waffleStack {
        width: min(82vw, 320px) !important;
        height: min(82vw, 320px) !important;
    }

    .waffle {
        width: min(82vw, 320px) !important;
        height: min(82vw, 320px) !important;
    }

    #waffle-annotations {
        flex-direction: row !important;
        gap: 10px !important;
        width: min(82vw, 320px);
    }

    #box-children, #box-elderly {
        width: calc(50% - 5px) !important;
        min-width: 0 !important;
        max-width: none !important;
        box-sizing: border-box !important;
    }

    .narration {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin: 18px auto 10vh auto;
    }
}

/* ── Sección 3: flor de pétalos ── */
#scrolly-causes {
    position: relative;
    width: 100%;
}

#scrolly-causes .sticky {
    height: 100vh;
    width: 100%;
    background: #f5f4ed;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

/* Zona superior: contiene el SVG */
.flor-top {
    height: 45vh;
    width: 100%;
    position: relative;
    flex-shrink: 0;
    overflow: visible;
    z-index: 3;
}

#flower-svg {
    display: block;
}

/* Zona inferior: texto de la causa activa */
.flor-bottom {
    height: 55%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 24px;
    text-align: center;
    position: relative;
    z-index: 3;
}

.petal-label {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 14px 0;
    line-height: 1.2;
    /* opacity: 0; — GSAP controlará la entrada */
}

.petal-data {
    font-size: 18px;
    opacity: 0.75;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.45;
    /* opacity: 0; — GSAP controlará la entrada */
}

/* ── Cadena de consecuencias móvil — integrada en #scrolly-causes ── */
#scm-track {
    position: absolute;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    will-change: transform;
    z-index: 4;
}

.scm-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.scm-dot {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #805BB5;
    flex-shrink: 0;
    opacity: 0;
}

.scm-line {
    width: 3px;
    background: #805BB5;
    transform-origin: top center;
    flex-shrink: 0;
    transform: scaleY(0);
    will-change: transform;
}

#scm-content {
    position: absolute;
    left: 0;
    right: 0;
    padding: 0 28px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
}

#scm-title {
    font-family: 'Satoshi', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #f5f4ed;
    margin: 0 0 12px 0;
    line-height: 1.25;
}

#scm-sub {
    font-family: 'Erode', serif;
    font-size: 19px;
    font-style: italic;
    color: #f5f4ed;
    opacity: 0.8;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

#scm-img {
    max-height: 26vh;
    max-width: min(80vw, 300px);
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.85;
    display: block;
    margin: 0 auto;
}

@media (max-width: 700px) {
    #cause-title { display: block !important; }
    .flor-top { height: 38vh; }
    .flor-bottom { padding: 0 16px; }
    #cause-text { margin-top: 1vh !important; }
}

/* ── Sección 4: cierre ── */
#cierre {
    background: var(--color-bg);
    padding: 20vh 24px 20vh;
}

.cierre-inner {
    max-width: 680px;
    margin: 0 auto;
}

.cierre-cuerpo {
    font-family: var(--font-serif);
    font-size: 20px;
    line-height: 1.7;
    color: var(--color-text-primary);
    margin: 0 0 24px 0;
}

.cierre-cuerpo:last-child {
    margin-bottom: 0;
}

/* ── Sección 5: fuentes ── */
#fuentes {
    background: var(--color-bg);
    padding: 0 24px 14vh;
}

.fuentes-hr {
    width: 200px;
    border: none;
    border-top: 1.5px solid var(--color-text-primary);
    opacity: 0.25;
    margin: 0 auto 8vh;
}

.fuentes-inner {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.fuentes-titulo {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-text-primary);
    opacity: 0.45;
    margin: 0 0 10px 0;
}

.fuentes-lista {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fuentes-lista li {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-text-primary);
    opacity: 0.65;
}

.fuentes-lista a {
    color: inherit;
    opacity: 0.7;
    text-decoration: underline;
    text-decoration-color: currentColor;
    text-underline-offset: 2px;
}

.fuentes-lista a:hover {
    opacity: 1;
}

/* ── Énfasis tipográfico ── */
.hl-orange { background: #D4BAF0; padding: 0 2px; border-radius: 2px; }
.hl-teal   { background: #C8E6DF; padding: 0 2px; border-radius: 2px; }
.ul-orange { text-decoration: underline; text-decoration-color: #805BB5; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ul-teal   { text-decoration: underline; text-decoration-color: #6CB2A4; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ── TGF mobile annotation (hidden on desktop) ── */
#tgf-mobile-annot { display: none; }

/* ── Tamaños de texto móvil ── */
@media (max-width: 700px) {
    .step { padding: 15vh 20px; }
    /* Título: centrado vertical y horizontal en la primera pantalla */
    .step.step-title {
        min-height: 100vh !important;
        padding: 0 20px !important;
        justify-content: center !important;
        align-items: center !important;
    }
    .step-intro p { font-size: 19px !important; line-height: 1.65 !important; }
    .step-tgf p { font-size: 18px !important; line-height: 1.55 !important; }
    .step-tgf .simple { font-size: 18px !important; }
    .bridge-q { font-size: clamp(24px, 6.5vw, 40px) !important; }
    .cierre-cuerpo { font-size: 18px; line-height: 1.65; }
    /* Cigüeñas más pequeñas */
    .stork { max-width: min(40vw, 200px) !important; }
    #cause-title {
        font-size: 20px !important;
        font-weight: 700 !important;
        margin-bottom: 10px !important;
    }
    #cause-body, #cause-body2 {
        font-size: 18px !important;
        line-height: 1.6 !important;
    }
    #cause-source, #cause-source2 { font-size: 13px !important; }
    #waffle-title { font-size: clamp(14px, 4vw, 20px) !important; }
    #bc-count, #be-count { font-size: 20px !important; }
    #bc-text, #be-text { font-size: 14px !important; line-height: 1.4 !important; }
    #bc-year, #be-year { font-size: 10px !important; }
    #box-children > div, #box-elderly > div { padding: 10px 12px !important; }
}

