/* Mundo Químico — identidad alineada con la newsletter */
:root {
    --navy: #0b3d6e;
    --navy-deep: #082f54;
    --teal: #0d9488;
    --teal-dark: #0f766e;
    --bg: #f4f7fa;
    --bg-white: #ffffff;
    --text-main: #0f2744;
    --text-muted: #3d4f63;
    --border: #d1d9e0;
    --shadow-soft: 0 12px 40px rgba(11, 61, 110, 0.12);
    --font-display: "Source Serif 4", Georgia, serif;
    --font-body: "Outfit", system-ui, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    font-size: 18px;
}

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

a { text-decoration: none; color: inherit; transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 820px; }
.section-pad { padding: 96px 0; }
.hidden { display: none !important; }

/* --- NAV --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(8, 47, 84, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 0;
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.brand-mark {
    width: 46px;
    height: 46px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.brand-text {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.2px;
}

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

.nav-links a {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.05rem;
}

.nav-links a:hover { color: #fff; }

.btn-nav {
    background: var(--teal) !important;
    color: #fff !important;
    padding: 11px 22px;
    font-weight: 600 !important;
    font-size: 1.05rem !important;
}

.btn-nav:hover { background: var(--teal-dark) !important; }

.mobile-menu-icon {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
}

/* --- HERO --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 130px 0 110px;
    overflow: hidden;
    background:
        linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 48%, #0a4a6e 100%);
    color: #fff;
}

.hero-atmosphere {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 18% 22%, rgba(13, 148, 136, 0.28) 0%, transparent 42%),
        radial-gradient(circle at 82% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 35%),
        repeating-linear-gradient(
            -18deg,
            transparent,
            transparent 48px,
            rgba(255, 255, 255, 0.025) 48px,
            rgba(255, 255, 255, 0.025) 49px
        );
    animation: atmosphereDrift 18s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes atmosphereDrift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(-2%, 1.5%, 0) scale(1.04); }
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 920px;
    text-align: center;
    margin: 0 auto;
}

.hero-kicker {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #5eead4;
    margin-bottom: 28px;
    opacity: 0;
    animation: riseIn 0.8s ease 0.15s forwards;
}

.hero-brand {
    font-family: var(--font-display);
    font-size: clamp(3.4rem, 8vw, 5.6rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    opacity: 0;
    animation: riseIn 0.9s ease 0.28s forwards;
}

.hero-tagline {
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 3vw, 2.1rem);
    font-style: italic;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.96);
    margin-bottom: 26px;
    opacity: 0;
    animation: riseIn 0.9s ease 0.42s forwards;
}

.hero-lead {
    font-size: 1.28rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.88);
    max-width: 680px;
    margin: 0 auto 40px;
    opacity: 0;
    animation: riseIn 0.9s ease 0.55s forwards;
}

.cta-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: riseIn 0.9s ease 0.68s forwards;
}

@keyframes riseIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-edge {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--teal) 0%, var(--navy) 55%, var(--teal) 100%);
    background-size: 200% 100%;
    animation: edgeSweep 8s linear infinite;
}

@keyframes edgeSweep {
    from { background-position: 0% 0; }
    to { background-position: 200% 0; }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--teal);
    color: #fff;
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35);
}

.btn-primary:hover {
    background: var(--teal-dark);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

/* --- SECTIONS --- */
.title-wrap {
    text-align: center;
    margin-bottom: 56px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4vw, 3rem);
    font-weight: 600;
    color: var(--navy);
    line-height: 1.2;
    margin-bottom: 18px;
    letter-spacing: -0.02em;
}

.section-desc {
    font-size: 1.22rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

.section-about {
    background: var(--bg-white);
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.section-about .section-desc {
    margin-top: 8px;
}

.section-topics {
    background:
        radial-gradient(#c5d0db 1px, transparent 1px),
        var(--bg);
    background-size: 22px 22px;
}

.topic-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 860px;
    margin: 0 auto;
    border-top: 1px solid var(--border);
}

.topic-list li {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 22px;
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
    align-items: start;
}

.topic-num {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--teal);
    line-height: 1.2;
}

.topic-list h3 {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 8px;
}

.topic-list p {
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1.65;
}

/* --- SUBSCRIBE --- */
.section-subscribe {
    background: var(--navy-deep);
    color: #fff;
}

.section-subscribe .section-title { color: #fff; }
.section-subscribe .section-desc { color: rgba(255, 255, 255, 0.72); }

.subscribe-panel {
    text-align: center;
}

.subscribe-kicker {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #5eead4;
    margin-bottom: 18px;
}

.subscribe-panel .section-desc {
    margin-bottom: 28px;
    color: rgba(255, 255, 255, 0.88);
}

.subscribe-cta {
    margin: 8px auto 22px;
    max-width: 520px;
    padding: 32px 28px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
}

.subscribe-cta-copy {
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 22px;
    font-size: 1.15rem;
    line-height: 1.6;
}

.btn-subscribe {
    width: 100%;
    max-width: 400px;
}

.ml-fallback {
    margin-top: 14px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
}

.ml-url-plain {
    margin: 14px 0 8px;
    font-size: 0.9rem;
    word-break: break-all;
    line-height: 1.45;
}

.ml-url-plain a {
    color: var(--teal);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ml-url-on-dark a {
    color: #5eead4;
}

.unsubscribe-hint {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.78);
}

.unsubscribe-hint a {
    display: inline-block;
    margin-top: 10px;
    color: #5eead4;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.unsubscribe-hint a:hover { color: #fff; }

.unsubscribe-back {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.legal-content .btn-primary {
    margin: 12px 0 20px;
    color: #fff;
}

.subscribe-note {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.85;
}

.subscribe-note a {
    color: #5eead4;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- FOOTER --- */
footer {
    background: #061e36;
    padding: 64px 0 28px;
    color: #9db0c4;
}

.footer-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 28px;
    margin-bottom: 36px;
}

.footer-logo { margin-bottom: 12px; }
.footer-brand p { margin-bottom: 8px; }

.footer-parent a {
    color: #5eead4;
    font-weight: 500;
}

.footer-parent a:hover { color: #fff; }

.footer-links {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.footer-links a,
.footer-links button {
    background: none;
    border: none;
    font-size: 0.92rem;
    cursor: pointer;
    color: #9db0c4;
    font-weight: 500;
    font-family: inherit;
    padding: 0;
}

.footer-links a:hover,
.footer-links button:hover { color: #fff; }

.separator { color: #3d5368; }

.footer-copy {
    text-align: center;
    font-size: 0.85rem;
    color: #6b8096;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 24px;
}

/* --- COOKIES --- */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    padding: 22px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border);
    z-index: 2000;
    width: min(400px, calc(100vw - 32px));
}

.cookie-content p {
    font-size: 0.95rem;
    margin-bottom: 14px;
    color: var(--text-muted);
    line-height: 1.55;
}

.cookie-content a {
    color: var(--teal);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
}

.btn-solid {
    background: var(--navy);
    color: #fff;
    border: none;
}

.btn-solid:hover { background: var(--navy-deep); }

.btn-outline {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 30, 54, 0.55);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal-panel {
    background: #fff;
    width: 90%;
    max-width: 450px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.modal-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-head h4 {
    font-family: var(--font-display);
    color: var(--navy);
}

.close-x {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body { padding: 20px; }

.pref-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.pref-row p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.modal-foot {
    padding: 14px 20px;
    background: var(--bg);
    text-align: right;
    border-top: 1px solid var(--border);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cbd5e1;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--teal); }
input:checked + .slider:before { transform: translateX(20px); }

/* --- LEGAL PAGES --- */
.legal-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 140px 24px 80px;
    min-height: 80vh;
}

.legal-card {
    background: #fff;
    padding: 48px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px rgba(11, 61, 110, 0.04);
}

.legal-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 28px;
    margin-bottom: 36px;
}

.legal-header h1 {
    font-family: var(--font-display);
    color: var(--navy);
    font-size: 2.3rem;
    margin-bottom: 12px;
}

.legal-header p { color: var(--text-muted); font-size: 1.05rem; }

.legal-content h2 {
    font-family: var(--font-display);
    color: var(--navy);
    font-size: 1.45rem;
    margin: 36px 0 16px;
}

.legal-content h3 {
    font-family: var(--font-display);
    color: var(--text-main);
    font-size: 1.15rem;
    margin: 24px 0 12px;
}

.legal-content p,
.legal-content li {
    line-height: 1.8;
    margin-bottom: 14px;
    color: var(--text-muted);
}

.legal-content ul {
    padding-left: 20px;
    margin-bottom: 22px;
}

.legal-content a {
    color: var(--teal);
    font-weight: 600;
}

.highlight-box {
    background: #eef6f5;
    padding: 18px;
    margin: 18px 0;
    border-left: 4px solid var(--teal);
}

.cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin: 22px 0;
    border: 1px solid var(--border);
    font-size: 0.95rem;
}

.cookie-table th {
    background: #eef2f6;
    color: var(--navy);
    font-weight: 700;
    text-align: left;
    padding: 14px;
    border-bottom: 2px solid var(--border);
}

.cookie-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

/* --- ANIMATIONS --- */
.fade-in {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    html { font-size: 16px; }

    .nav-links { display: none; }
    .mobile-menu-icon { display: block; }

    .nav-links.nav-active {
        display: flex;
        position: fixed;
        top: 72px;
        left: 0;
        width: 100%;
        height: calc(100vh - 72px);
        background: var(--navy-deep);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 36px;
        animation: slideDown 0.35s ease-out;
    }

    .nav-links.nav-active a {
        color: #fff;
        font-size: 1.35rem;
        font-weight: 600;
    }

    .hero { min-height: auto; padding: 130px 0 90px; }
    .hero-kicker { letter-spacing: 0.08em; }
    .topic-list li { grid-template-columns: 52px 1fr; gap: 14px; }
    .legal-card { padding: 28px 20px; }
    .legal-header h1 { font-size: 1.9rem; }
}

@keyframes slideDown {
    from { transform: translateY(-12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
