:root {
    --bf-ink: #17211b;
    --bf-muted: #657069;
    --bf-paper: #f6f7f2;
    --bf-white: #fff;
    --bf-green: #1e624a;
    --bf-lime: #d7e8b0;
    --bf-line: rgba(23, 33, 27, 0.14);
    --bg-main: var(--bf-paper);
    --panel-bg: rgba(255, 255, 255, 0.92);
    --primary: var(--bf-green);
    --secondary: #7d9d43;
    --interactive: #287856;
    --text-main: var(--bf-ink);
    --text-muted: #536057;
    --border-strong: var(--bf-line);
    --border-soft: var(--bf-line);
    --shadow-color: rgba(23, 33, 27, 0.08);
    --secondary-soft: rgba(215, 232, 176, 0.4);
}

body {
    font-family: 'Inter', 'Trebuchet MS', 'Segoe UI', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    background-image: none;
    min-height: 100vh;
}

header {
    background: rgba(246, 247, 242, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--bf-line);
    padding: 16px max(22px, calc((100% - 1240px) / 2));
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 6px 18px rgba(23, 33, 27, 0.04);
}

.logo {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-main);
    text-shadow: none;
}

.logo span { color: var(--primary); }

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 0;
    padding: 9px 11px;
    border-radius: 5px;
    font-size: 0.82rem;
    font-weight: 700;
    transition: color 0.18s ease, background-color 0.18s ease, outline-color 0.18s ease;
    text-transform: none;
    letter-spacing: 0;
}

nav a:hover,
nav a:focus-visible,
.active {
    color: var(--bf-green);
    background: rgba(215, 232, 176, 0.34);
    text-shadow: none;
}

.page-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 28px 24px 80px;
}

.site-footer {
    max-width: 1300px;
    margin: 0 auto;
    padding: 22px 24px 30px;
    border-top: 1px solid var(--border-soft);
    color: var(--text-muted);
    text-align: center;
    font-size: 0.88rem;
}

.site-footer p {
    margin: 0;
}

.site-footer a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    text-decoration: underline;
}

.cookie-banner {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    display: grid;
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: center;
    width: min(760px, calc(100% - 48px));
    max-height: min(760px, calc(100dvh - 48px));
    padding: 24px 26px;
    border: 1px solid rgba(30, 98, 74, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 70px rgba(23, 33, 27, 0.2);
    backdrop-filter: blur(18px);
    overflow-y: auto;
    animation: cookie-banner-in 0.45s ease both;
}

.cookie-banner--hidden {
    pointer-events: none;
    animation: cookie-banner-out 0.35s ease both;
}

.cookie-banner__eyebrow {
    margin: 0 0 5px;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.cookie-banner h2 {
    margin: 0 0 7px;
    font-size: 1.25rem;
    line-height: 1.2;
}

.cookie-banner__description {
    max-width: 540px;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.cookie-banner__link {
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
}

.cookie-banner__actions {
    display: grid;
    gap: 9px;
    min-width: 178px;
}

.cookie-button {
    min-height: 42px;
    padding: 9px 15px;
    border-radius: 9px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cookie-button:hover,
.cookie-button:focus-visible {
    transform: translateY(-1px);
}

.cookie-button--primary {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 9px 20px rgba(30, 98, 74, 0.22);
}

.cookie-button--primary:hover,
.cookie-button--primary:focus-visible {
    background: var(--interactive);
}

.cookie-button--secondary {
    border: 1px solid rgba(30, 98, 74, 0.3);
    background: transparent;
    color: var(--primary);
}

.cookie-button--secondary:hover,
.cookie-button--secondary:focus-visible {
    background: rgba(30, 98, 74, 0.07);
}

.cookie-settings-button {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 999;
    border: 1px solid rgba(30, 98, 74, 0.25);
    border-radius: 999px;
    padding: 8px 13px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--primary);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(23, 33, 27, 0.12);
}

.cookie-settings-button:hover,
.cookie-settings-button:focus-visible {
    border-color: var(--bf-green);
    background: var(--bf-paper);
}

@keyframes cookie-banner-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cookie-banner-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(18px); }
}

@media (max-width: 700px) {
    .cookie-banner {
        right: 12px;
        bottom: 12px;
        grid-template-columns: 1fr;
        gap: 16px;
        width: calc(100% - 24px);
        padding: 20px;
    }

    .cookie-banner__actions {
        grid-template-columns: 1fr 1fr;
        min-width: 0;
    }

    .cookie-settings-button {
        position: static;
        display: block;
        width: fit-content;
        margin: 12px 12px 20px auto;
    }
}

.info-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 42px 24px 80px;
}

.info-hero {
    padding: 42px clamp(24px, 5vw, 64px);
    border: 1px solid rgba(30, 98, 74, 0.16);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(30, 98, 74, 0.13), rgba(215, 232, 176, 0.12));
    box-shadow: 0 20px 48px rgba(23, 33, 27, 0.07);
}

.info-hero--contact {
    background: linear-gradient(135deg, rgba(215, 232, 176, 0.14), rgba(30, 98, 74, 0.1));
}

.info-eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.info-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.05;
}

.info-hero > p:last-child {
    max-width: 720px;
    margin: 0;
    color: var(--text-muted);
    font-size: 1.08rem;
    line-height: 1.75;
}

.team-section,
.contact-layout {
    margin-top: 56px;
}

.section-heading h2,
.mission-section h2,
.contact-form h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 22px;
}

.team-card,
.contact-card,
.contact-form,
.contact-note {
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 34px var(--shadow-color);
}

.team-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 26px;
}

.avatar {
    display: grid;
    flex: 0 0 58px;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(30, 98, 74, 0.12);
    color: var(--primary);
    font-weight: 800;
    letter-spacing: 0.04em;
}

.avatar--gold {
    background: rgba(215, 232, 176, 0.22);
    color: #8a6500;
}

.team-card h3 {
    margin: 2px 0 8px;
    font-size: 1.15rem;
}

.team-card p,
.contact-note p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.mission-section {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    margin-top: 24px;
    padding: 28px;
    border-radius: 12px;
    background: var(--text-main);
    color: #fff;
    box-shadow: 0 18px 42px rgba(23, 33, 27, 0.14);
}

.mission-section h2 { color: #fff; }
.mission-section p { max-width: 760px; color: rgba(255, 255, 255, 0.78); line-height: 1.75; }

.mission-icon {
    display: grid;
    flex: 0 0 48px;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--secondary);
    color: var(--text-main);
    font-size: 1.4rem;
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
    gap: 34px;
    align-items: start;
}

.contact-details { display: grid; gap: 14px; }
.contact-details .section-heading { margin-bottom: 6px; }

.contact-card {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 18px;
    color: var(--text-main);
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-card:hover,
.contact-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(30, 98, 74, 0.4);
    box-shadow: 0 18px 36px rgba(30, 98, 74, 0.12);
}

.contact-card__icon {
    display: grid;
    flex: 0 0 42px;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(30, 98, 74, 0.1);
    color: var(--primary);
    font-size: 1.4rem;
}

.contact-card__icon--instagram svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.contact-card__icon--instagram svg circle:last-child {
    fill: currentColor;
    stroke: none;
}

.contact-card strong,
.contact-card small { display: block; }
.contact-card small { margin-top: 3px; color: var(--text-muted); }

.contact-note { padding: 20px; background: rgba(215, 232, 176, 0.14); }
.contact-note strong { display: block; margin-bottom: 6px; }

.contact-form {
    display: grid;
    gap: 10px;
    padding: 28px;
}

.contact-form h2 { margin-bottom: 8px; }
.contact-form label { color: var(--text-muted); font-size: 0.9rem; font-weight: 700; }
.contact-form input,
.contact-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(23, 33, 27, 0.14);
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff;
    color: var(--text-main);
    font: inherit;
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: 2px solid rgba(30, 98, 74, 0.25);
    border-color: var(--primary);
}

.form-honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.contact-form .btn-neon { justify-self: start; margin-top: 6px; cursor: pointer; font: inherit; }
.contact-form .btn-neon:disabled { cursor: wait; opacity: 0.7; transform: none; }
.form-hint { margin: 0; color: var(--text-muted); font-size: 0.8rem; }
.contact-status { margin: 4px 0 0; font-weight: 700; }
.contact-status--success { color: #15803d; }
.contact-status--error { color: #b91c1c; }

.search-panel {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 247, 242, 0.9));
    border: 1px solid var(--border-strong);
    border-radius: 30px;
    padding: 34px 38px 32px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(23, 33, 27, 0.08);
}

.search-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 16% 30%, rgba(30, 98, 74, 0.14), transparent 18%),
                radial-gradient(circle at 84% 24%, rgba(215, 232, 176, 0.16), transparent 17%);
    pointer-events: none;
}

.panel-inner {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 18px;
    justify-items: center;
}

.intro-card {
    width: min(100%, 900px);
    padding: 24px 28px 22px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(30, 98, 74, 0.13), rgba(215, 232, 176, 0.12));
    border: 1px solid rgba(30, 98, 74, 0.18);
    box-shadow: 0 20px 48px rgba(30, 98, 74, 0.08);
    backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
}

.intro-card::before,
.intro-card::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.intro-card::before {
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.28);
    top: -70px;
    right: -40px;
}

.intro-card::after {
    width: 120px;
    height: 120px;
    background: rgba(215, 232, 176, 0.18);
    bottom: -30px;
    left: -20px;
}

.hero-eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.hero-title {
    margin: 0 0 8px;
    font-size: clamp(1.3rem, 2.2vw, 1.7rem);
    line-height: 1.25;
    color: var(--text-main);
    text-align: center;
}

.hero-subtitle {
    margin: 0 0 8px;
    color: var(--primary);
    font-weight: 700;
    text-align: center;
    font-size: 1rem;
}

.hero-copy {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.7;
    text-align: center;
}

.search-label {
    color: var(--text-muted);
    letter-spacing: 0.55em;
    text-transform: uppercase;
    font-size: 0.82rem;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(100%, 860px);
    border: 1px solid rgba(30, 98, 74, 0.16);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 999px;
    padding: 16px 20px;
    box-shadow: 0 12px 30px rgba(23, 33, 27, 0.05);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.search-field:focus-within {
    border-color: rgba(30, 98, 74, 0.35);
    box-shadow: 0 16px 36px rgba(30, 98, 74, 0.12);
}

.search-results {
    width: min(100%, 860px);
    display: none;
    gap: 12px;
    padding: 14px;
    border-radius: 22px;
    border: 1px solid var(--border-strong);
    background: rgba(246, 247, 242, 0.96);
    box-shadow: 0 20px 40px var(--shadow-color);
    backdrop-filter: blur(14px);
    margin-top: 2px;
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: min(100%, 860px);
}

.search-filters label {
    display: grid;
    gap: 5px;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.search-filters select {
    min-width: 190px;
    border: 1px solid rgba(30, 98, 74, 0.18);
    border-radius: 9px;
    padding: 9px 30px 9px 11px;
    background: #fff;
    color: var(--text-main);
    font: inherit;
    font-size: 0.84rem;
    cursor: pointer;
}

.trust-strip {
    width: min(100%, 860px);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 10px 0 4px;
}

.trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 10px 8px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(30, 98, 74, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.trust-item strong {
    color: var(--primary);
    font-size: 0.95rem;
}

.trust-item span {
    color: var(--text-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.search-results.is-visible {
    display: grid;
}

.search-result-item {
    width: 100%;
    border: 1px solid rgba(23, 33, 27, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-main);
    padding: 14px 16px;
    border-radius: 16px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.search-result-item:hover,
.search-result-item:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(30, 98, 74, 0.4);
    background: rgba(30, 98, 74, 0.08);
}

.search-result-title {
    display: block;
    font-weight: 700;
}

.search-result-meta,
.search-result-description {
    display: block;
}

.search-result-meta {
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.search-result-description {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.search-empty {
    margin: 0;
    color: var(--text-muted);
    padding: 4px 6px;
}

.search-field input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 1rem;
    padding: 16px 0;
}

.search-field input::placeholder {
    color: rgba(83, 96, 87, 0.75);
}

.search-field button {
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(30, 98, 74, 0.2);
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.search-field button:hover,
.search-field button:focus-visible {
    background: var(--interactive);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(30, 98, 74, 0.24);
}


.about-section {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 36px;
    align-items: center;
    margin-top: 64px;
}

.about-text h1 {
    font-size: clamp(2.4rem, 4.1vw, 3.4rem);
    margin: 0 0 16px;
    letter-spacing: 0.04em;
    line-height: 1.08;
    color: var(--text-main);
}

.about-text p {
    color: var(--text-muted);
    line-height: 1.9;
    font-size: 1rem;
    max-width: 680px;
    margin-bottom: 24px;
}

.about-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(246, 247, 242, 0.92));
    border: 1px solid var(--border-strong);
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 24px 70px rgba(23, 33, 27, 0.08);
    position: relative;
    overflow: hidden;
}

.about-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(30, 98, 74, 0.04), transparent 55%);
    pointer-events: none;
}

.section-title {
    color: var(--primary);
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.96rem;
}

.card-image {
    position: relative;
    min-height: 420px;
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(180deg, #f6f7f2, #f6f7f2);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 30px 20px;
    align-content: center;
    justify-items: center;
}

.card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 25% 24%, rgba(30, 98, 74, 0.14), transparent 17%),
                radial-gradient(circle at 80% 20%, rgba(215, 232, 176, 0.16), transparent 15%);
}

.card-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 104px;
    height: 104px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(30, 98, 74, 0.16);
    color: var(--text-main);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    box-shadow: 0 10px 24px rgba(30, 98, 74, 0.08);
    text-align: center;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.card-node::before {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.card-node:hover,
.card-node:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(30, 98, 74, 0.16);
    border-color: rgba(30, 98, 74, 0.3);
    background: rgba(255, 255, 255, 0.98);
}

.card-node.center {
    width: 128px;
    height: 128px;
    background: linear-gradient(135deg, rgba(30, 98, 74, 0.22), rgba(215, 232, 176, 0.18));
}

.subject-physics::before { content: '⚛️'; }
.subject-philosophy::before { content: '💭'; }
.subject-language::before { content: '📖'; }
.subject-drawing::before { content: '📐'; }
.subject-maths::before { content: '📊'; }
.subject-history::before { content: '🏛️'; }
.subject-english::before {
    content: '';
    display: block;
    width: 24px;
    height: 20px;
    margin-bottom: 5px;
    background-image: url('uk-flag.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.subject-biology::before { content: '🧬'; }
.subject-chemistry::before { content: '🧪'; }

.card-tag {
    position: absolute;
    right: 20px;
    bottom: 16px;
    background: rgba(30, 98, 74, 0.1);
    color: var(--primary);
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.card-node.top-left {
    left: auto;
    top: auto;
}

.card-node.top-right {
    right: auto;
    top: auto;
}

.card-node.bottom-left {
    left: auto;
    bottom: auto;
}

.card-node.bottom-right {
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
    padding: 12px 22px;
    border-radius: 999px;
    background: rgba(30, 98, 74, 0.14);
    color: var(--primary);
    font-size: 0.88rem;
    letter-spacing: 0.18em;
}

@media (max-width: 1024px) {
    .about-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    header {
        align-items: flex-start;
        gap: 14px;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px 16px;
    }

    nav a {
        margin-left: 0;
        font-size: 0.78rem;
    }

    .page-container {
        padding: 24px 18px 60px;
    }

    .search-panel {
        padding: 24px 18px 24px;
    }

    .search-field {
        flex-direction: column;
        align-items: stretch;
        border-radius: 24px;
    }

    .search-results {
        width: 100%;
    }

    .search-filters {
        justify-content: stretch;
    }

    .search-filters label,
    .search-filters select {
        width: 100%;
    }

    .trust-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-field button {
        width: 100%;
        height: 56px;
        border-radius: 18px;
    }

    .about-text h1 {
        font-size: 2.3rem;
    }

    .about-card {
        padding: 22px;
    }

    .info-page {
        padding: 28px 18px 60px;
    }

    .info-hero {
        padding: 30px 24px;
    }

    .team-grid,
    .contact-layout {
        grid-template-columns: 1fr;
    }

    .team-section,
    .contact-layout {
        margin-top: 38px;
    }

    .mission-section {
        flex-direction: column;
    }

    .template-blocks {
        grid-template-columns: 1fr;
    }
}


.container {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px 60px;
}

h1, h2, h3 { color: var(--text-main); }

.btn-neon {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--interactive));
    color: #fff;
    border: none;
    border-radius: 999px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    box-shadow: 0 12px 28px rgba(30, 98, 74, 0.18);
}

.btn-neon:hover,
.btn-neon:focus-visible {
    background: linear-gradient(135deg, var(--secondary), #b5ce80);
    color: var(--text-main);
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(215, 232, 176, 0.2);
}

.subject-hero {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr;
    gap: 20px;
    align-items: center;
    margin: 10px 0 28px;
    padding: 28px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(30, 98, 74, 0.12), rgba(215, 232, 176, 0.08));
    border: 1px solid rgba(30, 98, 74, 0.16);
    box-shadow: 0 20px 48px rgba(23, 33, 27, 0.06);
    position: relative;
    overflow: hidden;
}

.subject-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.45), transparent 30%);
    pointer-events: none;
}

.subject-hero__content {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.subject-hero__icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.85);
    font-size: 1.8rem;
    box-shadow: 0 10px 24px rgba(30, 98, 74, 0.12);
}

.subject-hero__eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.subject-hero h2 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 2.6vw, 2.6rem);
}

.subject-hero p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.chemistry-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: center;
    margin: 10px 0 28px;
    padding: 22px 12px 26px;
    border-bottom: 1px solid rgba(30, 98, 74, 0.14);
    position: relative;
    overflow: hidden;
}

.chemistry-hero__content {
    position: relative;
    z-index: 1;
}

.chemistry-hero__content h2 {
    margin: 0 0 8px;
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1.1;
}

.subject-page-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
    gap: 24px;
    align-items: center;
    margin: -8px 0 30px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(30, 98, 74, 0.14);
}

.subject-page-heading h2 {
    margin: 0 0 10px;
}

.subject-page-heading > div:first-child p {
    margin: 0;
    color: var(--text-muted);
}

.subject-biology-visual,
.subject-drawing-visual,
.subject-english-visual {
    min-height: 190px;
    display: grid;
    place-items: center;
    opacity: 0.92;
}

.subject-biology-visual svg,
.subject-drawing-visual svg,
.subject-english-visual svg {
    width: min(100%, 360px);
    height: auto;
    overflow: visible;
}

.subject-biology-visual__dna,
.subject-biology-visual__rungs,
.subject-biology-visual__membrane {
    fill: none;
    stroke: rgba(30, 98, 74, 0.62);
    stroke-linecap: round;
    stroke-width: 2;
}

.subject-biology-visual__rungs {
    stroke: rgba(23, 33, 27, 0.26);
    stroke-width: 1.3;
}

.subject-biology-visual__cell {
    fill: rgba(125, 211, 190, 0.14);
    stroke: rgba(30, 98, 74, 0.48);
    stroke-width: 1.5;
}

.subject-biology-visual__nucleus {
    fill: rgba(215, 232, 176, 0.3);
    stroke: rgba(109, 93, 72, 0.36);
    stroke-width: 1.5;
}

.subject-biology-visual__membrane {
    stroke: rgba(23, 33, 27, 0.24);
    stroke-width: 1.2;
}

.subject-drawing-visual__triangle,
.subject-drawing-visual__circle,
.subject-drawing-visual__ruler,
.subject-drawing-visual__axis {
    fill: none;
    stroke: rgba(30, 98, 74, 0.58);
    stroke-linejoin: round;
    stroke-linecap: round;
    stroke-width: 1.5;
}

.subject-drawing-visual__circle {
    stroke: rgba(250, 160, 75, 0.72);
    stroke-dasharray: 4 5;
}

.subject-drawing-visual__ruler {
    stroke: rgba(23, 33, 27, 0.44);
    stroke-width: 5;
}

.subject-drawing-visual__ticks {
    fill: none;
    stroke: rgba(215, 232, 176, 0.86);
    stroke-width: 1.5;
}

.subject-drawing-visual__axis {
    stroke: rgba(23, 33, 27, 0.24);
    stroke-width: 1;
}

.subject-english-visual__book {
    fill: rgba(30, 98, 74, 0.06);
    stroke: rgba(30, 98, 74, 0.58);
    stroke-linejoin: round;
    stroke-width: 1.5;
}

.subject-english-visual__line {
    fill: none;
    stroke: rgba(23, 33, 27, 0.26);
    stroke-linecap: round;
    stroke-width: 1.2;
}

.subject-english-visual__bubble {
    fill: rgba(215, 232, 176, 0.18);
    stroke: rgba(109, 93, 72, 0.42);
    stroke-width: 1.2;
}

.subject-biology-visual text,
.subject-drawing-visual text,
.subject-english-visual text {
    fill: rgba(23, 33, 27, 0.56);
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 13px;
    font-style: italic;
}

.subject-philosophy-portrait {
    display: grid;
    place-items: center;
    min-height: 210px;
}

.subject-philosophy-portrait svg {
    width: min(100%, 260px);
    height: auto;
}

.subject-philosophy-portrait__halo {
    fill: rgba(215, 232, 176, 0.12);
    stroke: rgba(109, 93, 72, 0.24);
    stroke-width: 1;
}

.subject-philosophy-portrait__column {
    fill: rgba(255, 255, 255, 0.48);
    stroke: rgba(23, 33, 27, 0.46);
    stroke-linejoin: round;
    stroke-width: 1.4;
}

.subject-philosophy-portrait__column-lines,
.subject-philosophy-portrait__branch {
    fill: none;
    stroke: rgba(178, 145, 68, 0.78);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.4;
}

.subject-philosophy-portrait__column-lines {
    stroke: rgba(23, 33, 27, 0.28);
    stroke-width: 1.1;
}

.subject-philosophy-portrait__leaf {
    fill: rgba(178, 145, 68, 0.4);
    stroke: rgba(178, 145, 68, 0.78);
    stroke-width: 0.9;
}

.subject-philosophy-portrait__capital {
    fill: rgba(255, 255, 255, 0.68);
    stroke: rgba(23, 33, 27, 0.46);
    stroke-linejoin: round;
    stroke-width: 1.4;
}

.subject-philosophy-portrait__scrolls {
    fill: none;
    stroke: rgba(23, 33, 27, 0.62);
    stroke-linecap: round;
    stroke-width: 1.6;
}

.subject-philosophy-portrait__book-cover {
    fill: rgba(30, 98, 74, 0.62);
    stroke: rgba(23, 33, 27, 0.72);
    stroke-linejoin: round;
    stroke-width: 1.5;
}

.subject-philosophy-portrait__book {
    fill: rgba(30, 98, 74, 0.12);
    stroke: rgba(23, 33, 27, 0.58);
    stroke-linejoin: round;
    stroke-width: 1.5;
}

.subject-philosophy-portrait__book-line {
    fill: none;
    stroke: rgba(178, 145, 68, 0.68);
    stroke-linecap: round;
    stroke-width: 1;
}

.subject-philosophy-portrait__greek {
    fill: rgba(23, 33, 27, 0.68);
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 9px;
    letter-spacing: 0.08em;
}

.subject-philosophy-portrait__ground {
    fill: none;
    stroke: rgba(30, 98, 74, 0.68);
    stroke-linecap: round;
    stroke-width: 1.5;
}

@media (max-width: 700px) {
    .subject-page-heading {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: -4px;
        padding-bottom: 18px;
    }

    .subject-biology-visual,
    .subject-drawing-visual,
    .subject-english-visual {
        min-height: 150px;
    }

    .subject-philosophy-portrait {
        min-height: 180px;
    }
}

.chemistry-hero__content p:last-child {
    max-width: 520px;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.chemistry-hero__composition {
    align-self: stretch;
    min-height: 220px;
    display: grid;
    place-items: center;
    position: relative;
    z-index: 1;
    opacity: 0.92;
}

.chemistry-hero__composition svg {
    width: min(100%, 440px);
    height: auto;
    overflow: visible;
}

.chemistry-hero__molecules {
    fill: rgba(30, 98, 74, 0.16);
    stroke: rgba(30, 98, 74, 0.54);
    stroke-width: 1.3;
}

.chemistry-hero__molecules path {
    fill: none;
    stroke: rgba(23, 33, 27, 0.34);
    stroke-linecap: round;
}

.chemistry-hero__flask {
    fill: rgba(125, 211, 190, 0.12);
    stroke: rgba(23, 33, 27, 0.42);
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chemistry-hero__flask path:nth-child(2) {
    fill: rgba(30, 98, 74, 0.16);
    stroke: rgba(30, 98, 74, 0.42);
}

.chemistry-hero__labels {
    fill: rgba(23, 33, 27, 0.58);
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 12px;
    font-style: italic;
}

@media (max-width: 700px) {
    .chemistry-hero {
        grid-template-columns: 1fr;
        padding: 20px 0 24px;
    }

    .chemistry-hero__composition {
        min-height: 190px;
    }
}

.subject-summary-card {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(30, 98, 74, 0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
    position: relative;
    z-index: 1;
}

.subject-summary-card__item {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(246, 247, 242, 0.95);
    color: var(--text-main);
    font-weight: 600;
}

.subject-math-visual {
    align-self: stretch;
    min-height: 220px;
    display: grid;
    place-items: center;
    position: relative;
    z-index: 1;
    opacity: 0.92;
}

.subject-math-visual svg {
    width: min(100%, 420px);
    height: auto;
    overflow: visible;
}

.subject-math-visual__grid path {
    fill: none;
    stroke: rgba(23, 33, 27, 0.18);
    stroke-width: 1;
}

.subject-math-visual__grid path:first-child {
    stroke: rgba(30, 98, 74, 0.3);
}

.subject-math-visual__curve {
    fill: none;
    stroke: url(#math-curve);
    stroke-linecap: round;
    stroke-width: 2.5;
}

.subject-math-visual__points circle {
    fill: #fff;
    stroke: var(--primary);
    stroke-width: 2;
}

.subject-math-visual text {
    fill: rgba(23, 33, 27, 0.58);
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 16px;
    font-style: italic;
}

.subject-literature-visual {
    align-self: stretch;
    min-height: 220px;
    display: grid;
    place-items: center;
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

.subject-literature-visual svg {
    width: min(100%, 440px);
    height: auto;
    overflow: visible;
}

.subject-literature-visual__book,
.subject-literature-visual__page-lines,
.subject-literature-visual__pen {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.subject-literature-visual__book {
    stroke: rgba(23, 33, 27, 0.42);
    stroke-width: 1.4;
}

.subject-literature-visual__page-lines {
    stroke: rgba(109, 93, 72, 0.25);
    stroke-width: 1;
}

.subject-literature-visual__quote {
    fill: rgba(30, 98, 74, 0.35);
}

.subject-literature-visual__pen {
    stroke: rgba(30, 98, 74, 0.48);
    stroke-width: 1.5;
}

.subject-literature-visual__word {
    fill: rgba(23, 33, 27, 0.48);
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 15px;
    font-style: italic;
}

.subject-literature-visual__dot {
    fill: rgba(109, 93, 72, 0.42);
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 4px;
}

.subject-block-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 22px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(23, 33, 27, 0.08);
    box-shadow: 0 16px 36px rgba(23, 33, 27, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.subject-block-card:hover {
    transform: translateY(-5px);
    border-color: rgba(30, 98, 74, 0.2);
    box-shadow: 0 22px 44px rgba(30, 98, 74, 0.1);
}

.subject-block-card__number {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(30, 98, 74, 0.12), rgba(215, 232, 176, 0.16));
    color: var(--primary);
    font-weight: 800;
    font-size: 0.9rem;
}

.subject-block-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-right: 54px;
}

.subject-block-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(30, 98, 74, 0.1);
    font-size: 1.1rem;
}

.subject-block-card h2,
.subject-block-card h3 {
    margin: 0;
    font-size: 1.05rem;
}

.btn-ghost {
    background: linear-gradient(135deg, var(--primary), var(--interactive));
    color: #fff;
    border: none;
}

.btn-outline {
    background: #fff;
    color: var(--primary);
    border: 1px solid rgba(30, 98, 74, 0.25);
    box-shadow: none;
}

.btn-back {
    margin-bottom: 24px;
}

.glass-panel {
    padding: 36px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 32px 80px rgba(23, 33, 27, 0.08);
    backdrop-filter: blur(22px);
}

.grid {
    display: grid;
    gap: 24px;
}

.grid-2cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
    padding: 30px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(23, 33, 27, 0.08);
    box-shadow: 0 16px 40px rgba(23, 33, 27, 0.06);
}

.bloque-header {
    margin: 0 0 16px;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
}

.bullet-list,
.card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: grid;
    gap: 12px;
}

.bullet-list li::before,
.card ul li::before {
    content: '•';
    margin-right: 10px;
    color: var(--primary);
    font-weight: 700;
}

.recursos-links {
    display: flex;
    justify-content: flex-start;
}

.subject-hero {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
    margin-bottom: 36px;
    padding: 32px 36px;
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(246, 247, 242, 0.92));
    border: 1px solid rgba(30, 98, 74, 0.14);
    box-shadow: 0 25px 70px rgba(23, 33, 27, 0.08);
}

.subject-hero__content {
    display: flex;
    align-items: flex-start;
    gap: 22px;
}

@media (max-width: 700px) {
/* Ajustes específicos para la página de valoraciones: recortar cuadros si exceden */
.valoraciones-grid .subject-block-card {
    max-height: 230px;
    overflow: hidden;
}

.valoraciones-grid .subject-block-card p {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.valoraciones-grid .subject-block-card a {
    margin-top: 18px;
}

.subject-hero__icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: rgba(30, 98, 74, 0.1);
    font-size: 2rem;
}

.subject-hero__eyebrow {
    margin: 0 0 10px;
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.subject-hero h2 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1.1;
}

.subject-hero p {
    margin: 0;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.8;
    max-width: 680px;
}

.subject-summary-card {
    padding: 22px 24px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(30, 98, 74, 0.12);
}

.subject-summary-card__item {
    padding: 12px 16px;
    border-radius: 18px;
    background: rgba(246, 247, 242, 0.96);
    color: var(--text-main);
    font-weight: 600;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    row-gap: 72px;
    align-items: start;
}

.subject-block-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
}

.subject-block-card h2,
.subject-block-card h3 {
    margin: 0;
    font-size: 1.15rem;
}

.subject-block-card__header {
    margin-bottom: 16px;
}

.subject-block-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: grid;
    gap: 12px;
}

.subject-block-card ul li::before {
    content: '•';
    margin-right: 10px;
    color: var(--secondary);
    font-weight: 800;
}

.subject-block-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(215, 232, 176, 0.14);
    color: var(--secondary);
    font-size: 1.2rem;
}

.subject-block-card__number {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: rgba(30, 98, 74, 0.12);
    color: var(--primary);
    display: grid;
    place-items: center;
}

.subject-block-card {
    position: relative;
    padding: 28px 24px 24px;
    border-radius: 28px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(23, 33, 27, 0.08);
    box-shadow: 0 18px 44px rgba(23, 33, 27, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.subject-block-card:hover {
    transform: translateY(-6px);
    border-color: rgba(30, 98, 74, 0.2);
    box-shadow: 0 24px 54px rgba(30, 98, 74, 0.1);
}

.subject-block-card a {
    align-self: flex-start;
}

    .valoraciones-grid > .subject-block-card {
        max-height: 210px !important;
        min-height: auto !important;
        height: auto !important;
        overflow: hidden !important;
        padding: 22px !important;
    }

    .valoraciones-grid > .subject-block-card .subject-block-card__header {
        margin-bottom: 10px;
    }

    .subject-hero__content {
        flex-direction: column;
        align-items: flex-start;
    }

    .subject-hero__icon {
        width: 62px;
        height: 62px;
    }

    .btn-back {
        display: inline-flex;
        margin-bottom: 18px;
    }
}

.btn-outline:hover,
.btn-outline:focus-visible {
    background: rgba(30, 98, 74, 0.08);
    color: var(--primary);
    box-shadow: 0 10px 24px rgba(30, 98, 74, 0.12);
}

.page-hero {
    margin: 8px 0 24px;
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(30, 98, 74, 0.11), rgba(215, 232, 176, 0.1));
    border: 1px solid rgba(30, 98, 74, 0.16);
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(23, 33, 27, 0.06);
}

.page-hero__eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    font-size: 0.74rem;
}

.page-hero h2 {
    margin: 0 0 8px;
    font-size: clamp(1.7rem, 2.4vw, 2.3rem);
}

.page-hero p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.btn-back {
    margin-left: 12px;
    padding: 8px 14px;
    font-size: 0.82rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
    margin-top: 18px;
}

.grid.grid-2cols {
    grid-template-columns: repeat(2, minmax(300px, 1fr));
}

.grid-horizontal {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1200px) {
    .grid-horizontal {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .grid-horizontal {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 16px 40px;
    }

    .page-hero {
        padding: 18px 20px;
    }

    .card {
        padding: 18px;
    }

    .subject-hero {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .subject-grid {
        grid-template-columns: 1fr;
    }

}

.physics-hero {
    background: linear-gradient(135deg, rgba(30, 98, 74, 0.14), rgba(215, 232, 176, 0.1));
}

.physics-hero__composition {
    align-self: stretch;
    min-height: 220px;
    display: grid;
    place-items: center;
    position: relative;
    z-index: 1;
    opacity: 0.92;
}

.physics-hero__composition svg {
    width: min(100%, 440px);
    height: auto;
    overflow: visible;
}

.physics-hero__orbit {
    fill: none;
    stroke: rgba(30, 98, 74, 0.22);
    stroke-width: 1;
    stroke-dasharray: 3 6;
}

.physics-hero__orbit circle {
    fill: rgba(215, 232, 176, 0.2);
    stroke: rgba(30, 98, 74, 0.3);
    stroke-dasharray: none;
}

.physics-hero__axes {
    fill: none;
    stroke: rgba(23, 33, 27, 0.2);
    stroke-width: 1;
    stroke-linecap: round;
}

.physics-hero__trajectory {
    fill: none;
    stroke: rgba(30, 98, 74, 0.72);
    stroke-width: 2;
    stroke-linecap: round;
}

.physics-hero__vector {
    fill: none;
    stroke: rgba(23, 33, 27, 0.56);
    stroke-width: 1.4;
    stroke-linecap: round;
}

.physics-hero__vector + .physics-hero__particle {
    fill: #fff;
    stroke: var(--primary);
    stroke-width: 2.5;
}

.physics-hero__vector marker path {
    fill: rgba(23, 33, 27, 0.56);
    stroke: none;
}

.physics-hero__formulas {
    fill: rgba(23, 33, 27, 0.5);
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 14px;
    font-style: italic;
}

.philosophy-hero {
    background: linear-gradient(135deg, rgba(30, 98, 74, 0.12), rgba(215, 232, 176, 0.08));
    position: relative;
    overflow: hidden;
}

.philosophy-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 20%, rgba(30, 98, 74, 0.08), transparent 18%),
                      radial-gradient(circle at 80% 40%, rgba(215, 232, 176, 0.08), transparent 22%),
                      linear-gradient(120deg, rgba(255,255,255,0.3), transparent 60%);
    pointer-events: none;
}

.philosophy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 8px;
}

.philosophy-card {
    position: relative;
    overflow: hidden;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.philosophy-card::after {
    content: '';
    position: absolute;
    inset: auto -20px -20px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(30, 98, 74, 0.08), transparent 70%);
    pointer-events: none;
}

.philosophy-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: rgba(30, 98, 74, 0.1);
    font-size: 1.5rem;
}

.philosophy-tags {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 6px;
}

.philosophy-tags li {
    font-size: 0.74rem;
    line-height: 1.5;
}

.philosophy-value-strip {
    margin-top: 24px;
}

@media (max-width: 700px) {
    .philosophy-grid {
        grid-template-columns: 1fr;
    }

    .philosophy-tags {
        grid-template-columns: 1fr;
    }
}

.history-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    align-items: center;
    margin: 10px 0 22px;
    padding: 28px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(30, 98, 74, 0.12), rgba(215, 232, 176, 0.08));
    border: 1px solid rgba(30, 98, 74, 0.16);
    box-shadow: 0 20px 48px rgba(23, 33, 27, 0.06);
    position: relative;
    overflow: hidden;
}

.history-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(120deg, rgba(255,255,255,0.35), transparent 60%),
                      radial-gradient(circle at 85% 20%, rgba(215, 232, 176, 0.14), transparent 18%);
    pointer-events: none;
}

.history-hero__content,
.history-hero__stats {
    position: relative;
    z-index: 1;
}

.history-hero__content h2 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 2.6vw, 2.6rem);
}

.history-hero__content p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.history-hero__stats {
    display: grid;
    gap: 10px;
}

.history-hero__composition {
    align-self: stretch;
    min-height: 220px;
    display: grid;
    place-items: center;
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

.history-hero__composition svg {
    width: min(100%, 440px);
    height: auto;
    overflow: visible;
}

.history-hero__document {
    fill: rgba(155, 126, 86, 0.05);
    stroke: rgba(109, 93, 72, 0.23);
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.history-hero__map {
    fill: rgba(155, 126, 86, 0.08);
    stroke: rgba(109, 93, 72, 0.3);
    stroke-width: 1.1;
    stroke-linejoin: round;
}

.history-hero__map-lines {
    fill: none;
    stroke: rgba(109, 93, 72, 0.16);
    stroke-width: 0.8;
}

.history-hero__timeline {
    fill: var(--primary);
    stroke: rgba(30, 98, 74, 0.38);
    stroke-width: 1;
}

.history-hero__timeline path {
    stroke-width: 1.2;
    stroke-linecap: round;
}

.history-hero__dates,
.history-hero__caption {
    fill: rgba(23, 33, 27, 0.52);
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.history-hero__caption {
    fill: rgba(109, 93, 72, 0.52);
    font-size: 10px;
    font-style: italic;
}

.timeline-shell {
    margin-bottom: 20px;
    padding: 16px 18px 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(23, 33, 27, 0.06);
    box-shadow: 0 12px 28px rgba(23, 33, 27, 0.04);
}

.timeline-line {
    position: relative;
    height: 3px;
    margin: 8px 0 16px;
    background: linear-gradient(90deg, var(--primary), rgba(30, 98, 74, 0.2));
    border-radius: 999px;
}

.timeline-line::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(255,255,255,0.7) 18px, rgba(255,255,255,0.7) 36px);
    opacity: 0.4;
}

.timeline-points {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.history-card {
    position: relative;
    padding: 22px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(23, 33, 27, 0.08);
    box-shadow: 0 16px 36px rgba(23, 33, 27, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    min-height: 250px;
}

.history-card:hover {
    transform: translateY(-5px);
    border-color: rgba(30, 98, 74, 0.2);
    box-shadow: 0 22px 44px rgba(30, 98, 74, 0.1);
}

.history-card--featured {
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(246, 247, 242,0.96));
    border-color: rgba(30, 98, 74, 0.16);
}

.history-card--intro {
    background: linear-gradient(135deg, rgba(215, 232, 176, 0.1), rgba(255,255,255,0.95));
}

.history-card__number {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(30, 98, 74, 0.1);
    color: var(--primary);
    font-weight: 800;
}

.history-card__icon {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(30, 98, 74, 0.1);
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.history-card h2,
.history-card h3 {
    margin: 0 0 10px;
    font-size: 1.02rem;
    padding-right: 50px;
}

.btn-history {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.btn-history:hover {
    transform: translateY(-2px);
}

.btn-history--primary {
    background: linear-gradient(135deg, var(--primary), var(--interactive));
    color: white;
    box-shadow: 0 10px 24px rgba(30, 98, 74, 0.16);
}

.btn-history--secondary {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
    border: 1px solid rgba(30, 98, 74, 0.18);
}

@media (max-width: 900px) {
    .history-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .history-grid {
        grid-template-columns: 1fr;
    }

}

.library-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    align-items: center;
    margin: 10px 0 22px;
    padding: 28px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(30, 98, 74, 0.12), rgba(215, 232, 176, 0.08));
    border: 1px solid rgba(30, 98, 74, 0.16);
    box-shadow: 0 20px 48px rgba(23, 33, 27, 0.06);
}

.library-hero__content h2 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 2.6vw, 2.6rem);
}

.library-hero__content p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.library-hero__eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.library-hero__stats {
    display: grid;
    gap: 10px;
}

.library-stat {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(30, 98, 74, 0.12);
    box-shadow: 0 10px 24px rgba(23, 33, 27, 0.04);
    font-weight: 700;
    color: var(--text-main);
}

.library-search-shell {
    display: grid;
    gap: 12px;
    margin-bottom: 22px;
}

.library-search-field {
    width: 100%;
    border-radius: 20px;
    padding: 12px 16px;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-pill {
    border: 1px solid rgba(30, 98, 74, 0.16);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 9px 14px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.25s ease;
}

.filter-pill:hover,
.filter-pill.is-active {
    background: linear-gradient(135deg, var(--primary), var(--interactive));
    color: white;
    box-shadow: 0 10px 22px rgba(30, 98, 74, 0.16);
}

.library-era-section {
    margin-top: 22px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(23, 33, 27, 0.06);
    box-shadow: 0 16px 36px rgba(23, 33, 27, 0.05);
}

.library-era-section.is-empty {
    display: none;
}

.library-era-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    margin-bottom: 16px;
}

.library-era-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.library-era-title h3 {
    margin: 0;
    color: var(--primary);
}

.library-era-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.era-badge {
    display: inline-flex;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    background: rgba(30, 98, 74, 0.1);
    font-size: 1.15rem;
}

.library-grid .card {
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.library-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.library-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(30, 98, 74, 0.05), transparent 55%);
    pointer-events: none;
}

.library-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 42px rgba(30, 98, 74, 0.14);
    border-color: rgba(30, 98, 74, 0.24);
}

.library-card.is-hidden {
    display: none;
}

.author-avatar {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(30, 98, 74, 0.14), rgba(215, 232, 176, 0.16));
    font-size: 1.45rem;
    margin-bottom: 12px;
}

.author-topline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.author-era-pill,
.author-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.author-era-pill {
    background: rgba(30, 98, 74, 0.1);
    color: var(--primary);
}

.author-chip {
    background: rgba(215, 232, 176, 0.16);
    color: var(--text-main);
}

.library-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
}

.btn-library {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.btn-library:hover {
    transform: translateY(-2px);
}

.btn-library--primary {
    background: linear-gradient(135deg, var(--primary), var(--interactive));
    color: white;
    box-shadow: 0 10px 24px rgba(30, 98, 74, 0.16);
}

.btn-library--secondary {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    border: 1px solid rgba(30, 98, 74, 0.2);
}

@media (max-width: 900px) {
    .library-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .library-era-header {
        flex-direction: column;
        align-items: start;
    }

    .library-card__actions {
        flex-direction: column;
    }
}

.highlight-item {
    display: inline-block;
    margin-right: 4px;
    color: var(--primary);
}

.subject-block-card .bullet-list li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.comparison-hero {
    margin-bottom: 28px;
}

.comparison-section {
    margin-top: 28px;
    padding: 24px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(23, 33, 27, 0.06);
    box-shadow: 0 18px 44px rgba(23, 33, 27, 0.05);
    overflow: hidden;
}

.comparison-section__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(30, 98, 74, 0.12);
}

.comparison-section__title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comparison-section__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(30, 98, 74, 0.1);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.comparison-section__eyebrow {
    margin: 0 0 4px;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.comparison-section__header h2,
.comparison-section__header h3 {
    margin: 0;
    color: var(--text-main);
    font-size: clamp(1.08rem, 1.4vw, 1.24rem);
}

.comparison-section__subtitle {
    margin: 0;
    max-width: 280px;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.comparison-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
    border: 1px solid rgba(23, 33, 27, 0.08);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 247, 242, 0.95));
    box-shadow: 0 12px 26px rgba(23, 33, 27, 0.04);
    overflow: hidden;
    transition: transform 250ms ease, box-shadow 250ms ease, border-color 250ms ease;
    box-sizing: border-box;
}

.comparison-card:hover,
.comparison-card:focus-within {
    transform: translateY(-6px);
    border-color: rgba(30, 98, 74, 0.24);
    box-shadow: 0 22px 40px rgba(30, 98, 74, 0.12);
}

.comparison-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.comparison-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(30, 98, 74, 0.12), rgba(215, 232, 176, 0.12));
    font-size: 1.08rem;
    flex-shrink: 0;
}

.comparison-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.comparison-card__pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(30, 98, 74, 0.1);
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.comparison-card__pill--accent {
    background: rgba(215, 232, 176, 0.16);
    color: var(--text-main);
}

.comparison-card__body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    flex: 1;
}

.comparison-card__title {
    margin: 0 0 8px;
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.45;
}

.comparison-card__divider {
    width: 100%;
    height: 1px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, rgba(30, 98, 74, 0.18), transparent);
}

.comparison-card__concepts {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.comparison-card__concepts li {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(246, 247, 242, 0.95);
    border: 1px solid rgba(23, 33, 27, 0.06);
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.2;
}

.comparison-card__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 90%;
    height: 44px;
    margin: 0 auto 16px;
    padding: 0 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--interactive));
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    box-shadow: 0 10px 24px rgba(30, 98, 74, 0.14);
    transition: transform 250ms ease, box-shadow 280ms ease, filter 250ms ease;
    cursor: pointer;
}

.comparison-card__button:hover,
.comparison-card__button:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(30, 98, 74, 0.2);
    filter: brightness(1.08);
}

@media (max-width: 1200px) {
    .comparison-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .comparison-section {
        padding: 18px;
    }

    .comparison-section__header {
        flex-direction: column;
        align-items: start;
    }

    .comparison-section__subtitle {
        max-width: none;
        text-align: left;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(23, 33, 27, 0.08);
    border-radius: 20px;
    padding: 22px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 12px 30px rgba(23, 33, 27, 0.05);
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(30, 98, 74, 0.24);
    box-shadow: 0 18px 34px rgba(30, 98, 74, 0.12);
}

.subject-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 270px;
    justify-content: flex-start;
}

.subject-card.featured {
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(246, 247, 242,0.96));
}

.card-icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(30, 98, 74, 0.1);
    font-size: 1.3rem;
}

.card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(215, 232, 176, 0.18);
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
}

.card-tags li {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(246, 247, 242, 0.9);
    border: 1px solid rgba(23, 33, 27, 0.06);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.card-btn {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
}

.bloque-header {
    border-bottom: 1px solid rgba(23, 33, 27, 0.08);
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: var(--primary);
}

.section-title {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.9rem;
    margin-bottom: 18px;
}

.course-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.summary-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    padding: 22px;
    box-shadow: inset 0 0 40px rgba(30, 98, 74, 0.04);
}

.summary-highlight {
    background: linear-gradient(180deg, rgba(30, 98, 74, 0.08), rgba(215, 232, 176, 0.06));
    border-color: rgba(30, 98, 74, 0.2);
}

.bullet-list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-muted);
}

.bullet-list li {
    margin-bottom: 10px;
    line-height: 1.7;
}

.recursos-links {
    display: flex;
    gap: 15px;
    margin-top: auto;
}

.recursos-links a {
    flex: 1;
    text-align: center;
    padding: 8px;
    font-size: 0.85rem;
}


.chat-box {
    height: 400px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    border: 1px solid rgba(30, 98, 74, 0.16);
    margin-bottom: 20px;
}

.subject-template__hero {
    margin: 10px 0 38px;
    padding: clamp(26px, 5vw, 54px);
    border: 1px solid rgba(30, 98, 74, 0.16);
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(30, 98, 74, 0.13), rgba(215, 232, 176, 0.12));
    box-shadow: 0 20px 48px rgba(23, 33, 27, 0.07);
}

.subject-template__hero h1 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.08;
}

.subject-template__hero > p:not(.subject-hero__eyebrow) {
    max-width: 720px;
    margin: 0 0 24px;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.75;
}

.template-heading {
    margin: 0 0 18px;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.template-blocks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.template-block {
    position: relative;
    padding: 24px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 28px var(--shadow-color);
}

.template-block__number {
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.template-block h2 {
    margin: 9px 0 8px;
    font-size: 1.2rem;
}

.template-block p {
    min-height: 3.4em;
    margin: 0 0 20px;
    color: var(--text-muted);
    line-height: 1.65;
}

/* Homepage refresh */
/* Portada BF: identidad editorial aislada del resto del sitio. */
.bf-home {
    --bf-ink: #17211b;
    --bf-muted: #657069;
    --bf-paper: #f6f7f2;
    --bf-white: #fff;
    --bf-green: #1e624a;
    --bf-lime: #d7e8b0;
    --bf-line: rgba(23, 33, 27, 0.14);
    background: var(--bf-paper);
    color: var(--bf-ink);
    font-family: 'Inter', 'Trebuchet MS', 'Segoe UI', sans-serif;
    background-image: none;
    overflow-x: hidden;
}
.bf-home a { color: inherit; }
.bf-header { position: sticky; z-index: 200; top: 0; display: flex; align-items: center; justify-content: space-between; max-width: none; padding: 18px max(24px, calc((100% - 1240px) / 2)); border-bottom: 1px solid var(--bf-line); background: rgba(246, 247, 242, 0.94); box-shadow: none; backdrop-filter: blur(12px); }
.bf-brand { color: var(--bf-ink); font-family: 'Fraunces', Georgia, serif; font-size: 1.28rem; font-weight: 700; letter-spacing: -0.04em; text-decoration: none; }
.bf-brand span { color: var(--bf-green); }
.bf-nav { display: flex; align-items: center; gap: 24px; }
.bf-nav a { margin: 0; padding: 8px 0; color: var(--bf-muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.01em; text-decoration: none; text-transform: none; transition: color 180ms ease; }
.bf-nav a:hover, .bf-nav a:focus-visible, .bf-nav a.is-current { color: var(--bf-green); text-shadow: none; }
.bf-nav a.is-current { border-bottom: 2px solid var(--bf-green); }
.bf-nav__action { padding: 9px 13px !important; border: 1px solid var(--bf-green); border-radius: 6px; color: var(--bf-green) !important; }
.bf-menu-toggle { display: none; border: 1px solid var(--bf-line); border-radius: 6px; padding: 8px 10px; background: transparent; color: var(--bf-ink); font: inherit; font-size: 0.78rem; font-weight: 700; }
.bf-home main { max-width: 1240px; margin: 0 auto; padding: 0 28px 110px; }
.bf-hero { position: relative; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(480px, 1.1fr); gap: 46px; align-items: center; min-height: 690px; padding: 78px 0 100px; }
.bf-hero__copy { position: relative; z-index: 2; padding-bottom: 70px; }
.bf-eyebrow, .bf-search-kicker { margin: 0 0 18px; color: var(--bf-green); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.bf-hero h1 { max-width: 630px; margin: 0 0 24px; color: var(--bf-ink); font-family: 'Fraunces', Georgia, serif; font-size: clamp(3.8rem, 7vw, 7rem); font-weight: 400; letter-spacing: -0.075em; line-height: 0.91; }
.bf-hero h1 em, .bf-pau h2 em { color: var(--bf-green); font-style: normal; }
.bf-hero__summary { max-width: 450px; margin: 0 0 26px; color: var(--bf-muted); font-size: 1.05rem; line-height: 1.65; }
.bf-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: var(--bf-space-4); }
.bf-hero__cta, .bf-hero__cta-secondary { margin: 0; }
.bf-hero__meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--bf-muted); font-size: 0.75rem; }.bf-hero__meta span::before { content: '—'; margin-right: 6px; color: var(--bf-green); }
.bf-hero__search { position: relative; z-index: 4; align-self: end; box-sizing: border-box; width: min(100%, 560px); margin-bottom: 3px; padding: 30px; border: 1px solid var(--bf-line); border-radius: 14px; background: var(--bf-white); box-shadow: 0 18px 42px rgba(23, 33, 27, 0.09); }
.bf-search-heading h2 { margin: 0; font-family: 'Fraunces', Georgia, serif; font-size: 2rem; font-weight: 400; letter-spacing: -0.035em; }.bf-search-kicker { display: block; margin-bottom: 9px; font-size: 0.65rem; }
.bf-search { display: flex; align-items: center; gap: 11px; margin-top: 22px; padding: 0 13px; border: 1px solid var(--bf-line); border-radius: 8px; background: #fbfcf8; transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease; }.bf-search:focus-within { border-color: var(--bf-green); box-shadow: 0 0 0 4px rgba(30, 98, 74, 0.09); transform: translateY(-1px); }.bf-search__icon { color: var(--bf-green); font-size: 1.45rem; line-height: 1; }.bf-search input { min-width: 0; flex: 1; padding: 15px 0; border: 0; outline: 0; background: transparent; color: var(--bf-ink); font: inherit; font-size: 0.88rem; }.bf-search input::placeholder { color: #8a958d; }.bf-search kbd { padding: 3px 5px; border: 1px solid var(--bf-line); border-radius: 4px; color: var(--bf-muted); font-family: inherit; font-size: 0.63rem; }.bf-search button { border: 0; background: transparent; color: var(--bf-muted); font: inherit; font-size: 0.65rem; cursor: pointer; }.bf-quick-search { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 13px; color: var(--bf-muted); font-size: 0.7rem; }.bf-quick-search button { padding: 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--bf-green); font: inherit; cursor: pointer; }.bf-quick-search button:hover, .bf-quick-search button:focus-visible { border-color: var(--bf-green); }
.bf-search-results { display: none; max-height: 370px; margin-top: 13px; overflow-y: auto; border-top: 1px solid var(--bf-line); }.bf-search-results.is-open { display: block; }.bf-search-result { position: relative; display: block; padding: 14px 62px 13px 0; border-bottom: 1px solid var(--bf-line); text-decoration: none; }.bf-search-result:last-child { border-bottom: 0; }.bf-search-result:hover, .bf-search-result:focus-visible, .bf-search-result.is-active { outline: 0; background: #f4f7ee; }.bf-search-result__type { display: block; margin-bottom: 5px; color: var(--bf-green); font-size: 0.63rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }.bf-search-result strong { display: block; font-family: 'Fraunces', Georgia, serif; font-size: 1.05rem; font-weight: 400; }.bf-search-result mark { padding: 0 2px; background: var(--bf-lime); color: inherit; }.bf-search-result__action { position: absolute; right: 0; bottom: 17px; color: var(--bf-green); font-size: 0.68rem; font-weight: 800; }.bf-search-empty { padding: 18px 0 4px; }.bf-search-empty strong, .bf-search-empty span { display: block; }.bf-search-empty strong { margin-bottom: 5px; font-family: 'Fraunces', Georgia, serif; font-size: 1.05rem; font-weight: 400; }.bf-search-empty span { color: var(--bf-muted); font-size: 0.78rem; }
.bf-hero__figure { position: absolute; z-index: 1; right: -12px; bottom: 20px; width: min(57vw, 690px); height: 420px; border: 1px solid rgba(30, 98, 74, 0.17); border-radius: 50% 45% 45% 50%; background: #e3edcf; transform: rotate(-7deg); overflow: hidden; }.bf-hero__figure::before { content: ''; position: absolute; inset: 24% 16%; border: 1px solid rgba(30, 98, 74, 0.18); border-radius: 50%; }.bf-figure__label { position: absolute; top: 54px; right: 83px; color: var(--bf-green); font-family: 'Fraunces', Georgia, serif; font-size: 7rem; line-height: 1; transform: rotate(7deg); }.bf-figure__line { position: absolute; width: 310px; height: 1px; left: 18%; top: 51%; background: var(--bf-green); opacity: 0.55; transform: rotate(-28deg); }.bf-figure__line--two { width: 220px; left: 41%; top: 63%; transform: rotate(37deg); opacity: 0.32; }.bf-figure__axis { position: absolute; background: rgba(23, 33, 27, 0.24); }.bf-figure__axis--x { width: 72%; height: 1px; left: 13%; bottom: 27%; }.bf-figure__axis--y { width: 1px; height: 63%; left: 29%; bottom: 17%; }.bf-figure__dot { position: absolute; left: 47%; top: 43%; width: 13px; height: 13px; border: 3px solid var(--bf-green); border-radius: 50%; background: var(--bf-lime); }.bf-figure__caption { position: absolute; left: 22%; bottom: 17%; color: var(--bf-green); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; transform: rotate(7deg); }
.bf-section-label { display: flex; gap: 11px; align-items: center; margin-bottom: 17px; color: var(--bf-green); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }.bf-section-label span:first-child { color: #9ca89c; }.bf-section-label span:first-child::after { content: '/'; margin-left: 10px; color: var(--bf-line); }.bf-explore { display: grid; grid-template-columns: 0.32fr 1fr; gap: 35px; padding: 24px 0 88px; border-top: 1px solid var(--bf-line); }.bf-explore h2, .bf-section-heading h2, .bf-editorial h2, .bf-suggestions h2, .bf-about h2 { margin: 0; font-family: 'Fraunces', Georgia, serif; font-size: clamp(2rem, 3.7vw, 3.4rem); font-weight: 400; letter-spacing: -0.055em; line-height: 1.02; }.bf-explore__links { display: flex; flex-wrap: wrap; gap: 9px; align-content: start; }.bf-explore__links a { padding: 10px 13px; border: 1px solid var(--bf-line); border-radius: 5px; color: var(--bf-ink); font-size: 0.77rem; text-decoration: none; transition: border-color 180ms ease, color 180ms ease, background 180ms ease; }.bf-explore__links a span { margin-left: 7px; color: var(--bf-green); }.bf-explore__links a:hover, .bf-explore__links a:focus-visible { border-color: var(--bf-green); background: #edf4e2; color: var(--bf-green); }
.bf-section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 27px; }.bf-text-link { display: inline-flex; gap: 8px; align-items: center; color: var(--bf-green); font-size: 0.78rem; font-weight: 800; text-decoration: none; white-space: nowrap; }.bf-text-link span { transition: transform 180ms ease; }.bf-text-link:hover span, .bf-text-link:focus-visible span { transform: translateX(4px); }.bf-subjects { padding: 24px 0 100px; border-top: 1px solid var(--bf-line); }.bf-subjects__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }.bf-subject { position: relative; min-height: 156px; padding: 18px; border-top: 3px solid var(--bf-accent); background: var(--bf-white); text-decoration: none; overflow: hidden; transition: transform 200ms ease, box-shadow 200ms ease; }.bf-subject::after { content: ''; position: absolute; right: -35px; bottom: -48px; width: 145px; height: 145px; border: 1px solid var(--bf-accent); border-radius: 50%; opacity: 0.32; }.bf-subject:hover, .bf-subject:focus-visible { z-index: 1; outline: 0; transform: translateY(-4px); box-shadow: 0 15px 28px rgba(23, 33, 27, 0.09); }.bf-subject__number { display: block; color: #9ca89c; font-size: 0.63rem; font-weight: 800; }.bf-subject__symbol { display: block; margin: 16px 0 14px; color: var(--bf-accent); font-family: 'Fraunces', Georgia, serif; font-size: 1.75rem; line-height: 1; }.bf-subject strong { display: block; font-family: 'Fraunces', Georgia, serif; font-size: 1.16rem; font-weight: 400; }.bf-subject small { display: block; margin-top: 5px; color: var(--bf-muted); font-size: 0.68rem; }.bf-subject__arrow { position: absolute; right: 17px; top: 17px; color: var(--bf-accent); font-size: 1rem; }.bf-subject--math { --bf-accent: #276c59; }.bf-subject--physics { --bf-accent: #486e8a; }.bf-subject--philosophy { --bf-accent: #785d76; }.bf-subject--language { --bf-accent: #b26845; }.bf-subject--drawing { --bf-accent: #55745c; }.bf-subject--history { --bf-accent: #8b6841; }.bf-subject--english { --bf-accent: #52619a; }.bf-subject--biology { --bf-accent: #438170; }.bf-subject--chemistry { --bf-accent: #7d687e; }
.bf-editorial { padding: 24px 0 100px; border-top: 1px solid var(--bf-line); }.bf-editorial__body { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 80px; }.bf-editorial__body p { max-width: 280px; margin: 20px 0 0; color: var(--bf-muted); font-size: 0.86rem; line-height: 1.65; }.bf-resource-list { border-top: 1px solid var(--bf-line); }.bf-resource-list a { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) auto; gap: 10px 18px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--bf-line); text-decoration: none; }.bf-resource-list a:hover, .bf-resource-list a:focus-visible { color: var(--bf-green); outline: 0; }.bf-resource-list__type { color: var(--bf-muted); font-size: 0.67rem; text-transform: uppercase; }.bf-resource-list strong { font-family: 'Fraunces', Georgia, serif; font-size: 1.12rem; font-weight: 400; }.bf-resource-list__meta { display: block; grid-column: 2; margin-top: -6px; color: var(--bf-green); font-size: 0.63rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }.bf-resource-list__arrow { color: var(--bf-green); font-size: 0.72rem; font-weight: 800; }
.bf-pau { display: grid; grid-template-columns: 0.23fr 1fr 0.7fr; gap: 28px; align-items: center; margin: 0 0 100px; padding: 47px; background: var(--bf-green); color: #f6f7f2; }.bf-pau .bf-section-label { color: #cfe4ad; }.bf-pau .bf-section-label span:first-child { color: rgba(255,255,255,0.5); }.bf-pau h2 { margin: 0 0 17px; color: #fff; font-family: 'Fraunces', Georgia, serif; font-size: clamp(2.1rem, 4vw, 3.8rem); font-weight: 400; letter-spacing: -0.055em; line-height: 0.98; }.bf-pau p { max-width: 410px; margin: 0 0 24px; color: rgba(255,255,255,0.72); font-size: 0.88rem; line-height: 1.65; }.bf-pau__index { color: #d7e8b0; font-family: 'Fraunces', Georgia, serif; font-size: 2rem; line-height: 0.9; }.bf-pau__index span { font-family: 'Inter', 'Trebuchet MS', sans-serif; font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; }.bf-button { display: inline-flex; align-items: center; gap: 18px; padding: 11px 14px; border: 1px solid #d7e8b0; color: #fff; font-size: 0.78rem; font-weight: 800; text-decoration: none; }.bf-button span { color: #d7e8b0; }.bf-pau__years { display: grid; gap: 10px; align-self: stretch; justify-items: end; color: rgba(255,255,255,0.55); font-family: 'Fraunces', Georgia, serif; font-size: 1.2rem; }.bf-pau__years span:nth-child(1) { color: #d7e8b0; font-size: 2.2rem; }
.bf-suggestions { display: grid; grid-template-columns: 0.8fr 1.2fr auto; gap: 32px; align-items: end; padding: 24px 0 100px; border-top: 1px solid var(--bf-line); }.bf-suggestions p { max-width: 260px; margin: 18px 0 0; color: var(--bf-muted); font-size: 0.84rem; line-height: 1.6; }.bf-suggestions__actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }.bf-suggestion-choice { display: grid; gap: 12px; min-height: 125px; padding: 15px; border: 1px solid var(--bf-line); background: #fff; text-decoration: none; }.bf-suggestion-choice:hover, .bf-suggestion-choice:focus-visible { outline: 0; border-color: var(--bf-green); }.bf-suggestion-choice > span:first-child { color: #9ca89c; font-size: 0.65rem; }.bf-suggestion-choice strong { font-family: 'Fraunces', Georgia, serif; font-size: 0.98rem; font-weight: 400; }.bf-suggestion-choice small { color: var(--bf-muted); font-size: 0.68rem; }.bf-suggestion-choice > span:last-child { align-self: end; color: var(--bf-green); }.bf-about { display: grid; grid-template-columns: 0.2fr 1fr; gap: 28px; align-items: start; max-width: 810px; padding: 24px 0 100px; border-top: 1px solid var(--bf-line); }.bf-about__mark { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%; background: var(--bf-lime); color: var(--bf-green); font-family: 'Fraunces', Georgia, serif; font-size: 1.2rem; }.bf-about p { max-width: 480px; margin: 20px 0 18px; color: var(--bf-muted); font-size: 0.88rem; line-height: 1.7; }
.bf-footer { padding: 52px max(28px, calc((100% - 1240px) / 2)) 22px; background: #e9eddf; color: var(--bf-ink); }.bf-footer__main { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr; gap: 40px; max-width: 1240px; margin: 0 auto; }.bf-footer p { max-width: 240px; margin: 13px 0 0; color: var(--bf-muted); font-size: 0.77rem; line-height: 1.6; }.bf-footer h2 { margin: 3px 0 15px; color: var(--bf-green); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; }.bf-footer__main > div:not(:first-child) a { display: block; width: fit-content; margin-bottom: 9px; color: var(--bf-muted); font-size: 0.76rem; text-decoration: none; }.bf-footer__main > div:not(:first-child) a:hover, .bf-footer__main > div:not(:first-child) a:focus-visible { color: var(--bf-green); }.bf-footer__bottom { display: flex; justify-content: space-between; max-width: 1240px; margin: 50px auto 0; padding-top: 15px; border-top: 1px solid var(--bf-line); color: var(--bf-muted); font-size: 0.68rem; }
@media (max-width: 920px) { .bf-hero { grid-template-columns: 1fr; min-height: auto; padding-top: 70px; }.bf-hero__copy { padding-bottom: 0; }.bf-hero__search { width: min(100%, 650px); margin-top: 20px; }.bf-hero__figure { position: absolute; right: -120px; bottom: 55px; width: 580px; height: 350px; opacity: 0.68; }.bf-subjects__grid { grid-template-columns: repeat(2, 1fr); }.bf-editorial__body { gap: 35px; }.bf-pau { grid-template-columns: 0.2fr 1fr; }.bf-pau__years { display: none; }.bf-suggestions { grid-template-columns: 0.65fr 1.35fr; }.bf-suggestions > .bf-text-link { grid-column: 2; }.bf-footer__main { grid-template-columns: 1.5fr 1fr 1fr; }.bf-footer__main > div:last-child { grid-column: 2 / 4; } }
@media (max-width: 680px) { .bf-header { padding: 15px 18px; }.bf-menu-toggle { display: block; }.bf-nav { position: absolute; left: 12px; right: 12px; top: calc(100% + 8px); display: none; flex-direction: column; align-items: stretch; gap: 3px; padding: 10px; border: 1px solid var(--bf-line); border-radius: 8px; background: var(--bf-white); box-shadow: 0 16px 30px rgba(23, 33, 27, 0.12); }.bf-nav.is-open { display: flex; }.bf-nav a { padding: 11px 12px; }.bf-nav__action { border: 0 !important; }.bf-home main { padding: 0 18px 70px; }.bf-hero { gap: 22px; padding: 57px 0 75px; }.bf-hero h1 { font-size: clamp(3.35rem, 16vw, 5rem); }.bf-hero__summary { font-size: 0.93rem; }.bf-hero__meta { gap: 8px 12px; font-size: 0.67rem; }.bf-hero__figure { position: relative; right: auto; bottom: auto; width: calc(100% + 34px); height: 245px; margin: -18px -17px 0; opacity: 1; }.bf-figure__label { top: 38px; right: 54px; font-size: 5rem; }.bf-figure__caption { left: 18%; bottom: 18%; font-size: 0.55rem; }.bf-hero__search { padding: 22px 18px; }.bf-search-heading h2 { font-size: 1.65rem; }.bf-search kbd { display: none; }.bf-explore { grid-template-columns: 1fr; gap: 8px; padding-bottom: 65px; }.bf-explore h2 { font-size: 2rem; }.bf-section-heading { align-items: start; flex-direction: column; }.bf-section-heading h2 { font-size: 2.2rem; }.bf-subjects__grid { grid-template-columns: 1fr; }.bf-subject { min-height: 130px; }.bf-editorial__body { grid-template-columns: 1fr; gap: 26px; }.bf-editorial h2 { font-size: 2.25rem; }.bf-resource-list a { grid-template-columns: 1fr auto; gap: 4px 12px; }.bf-resource-list__type { grid-column: 1 / -1; }.bf-resource-list__arrow { grid-column: 2; grid-row: 2; }.bf-pau { grid-template-columns: 1fr; margin-bottom: 72px; padding: 28px 22px; }.bf-pau h2 { font-size: 2.55rem; }.bf-suggestions { grid-template-columns: 1fr; padding-bottom: 72px; }.bf-suggestions__actions { grid-template-columns: 1fr; }.bf-suggestions > .bf-text-link { grid-column: auto; }.bf-about { grid-template-columns: 1fr; padding-bottom: 72px; }.bf-footer { padding: 42px 22px 18px; }.bf-footer__main { grid-template-columns: 1fr 1fr; gap: 28px 22px; }.bf-footer__main > div:first-child { grid-column: 1 / -1; }.bf-footer__main > div:last-child { grid-column: auto; }.bf-footer__bottom { gap: 8px; flex-direction: column; margin-top: 32px; } }
@media (prefers-reduced-motion: reduce) { .bf-home *, .bf-home *::before, .bf-home *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }
.bf-subject {
	border: 1px solid var(--bf-line);
	border-radius: 8px;
}

/* Shared visual and interaction layer for every page template. */
body {
    background: var(--bf-paper);
    color: var(--bf-ink);
    font-family: 'Inter', 'Trebuchet MS', 'Segoe UI', sans-serif;
}

h1,
h2,
h3,
h4,
.logo,
.bf-brand,
.subject-block-card h2,
.subject-block-card h3,
.library-hero h2 {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
}

header {
    min-height: 68px;
    box-sizing: border-box;
}

nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

nav a {
    color: var(--bf-muted);
}

nav a:hover,
nav a:focus-visible,
nav a[aria-current="page"],
nav a.active {
    color: var(--bf-green);
}

a[href]:hover {
    color: var(--bf-green);
}

button:hover,
[role="button"]:hover {
    color: var(--bf-green);
}

.container,
.page-container {
    width: min(100% - 48px, 1240px);
    box-sizing: border-box;
}

.container {
    margin: 42px auto 0;
    padding: 0 0 72px;
}

.subject-hero,
.chemistry-hero,
.glass-panel,
.subject-template__hero,
.subject-summary-card,
.subject-block-card,
.card,
.library-hero,
.comparison-card,
.exam-card,
.info-hero,
.about-card,
.contact-card {
    border-radius: 8px;
}

.subject-hero,
.subject-template__hero,
.info-hero {
    border-color: var(--bf-line);
    background: var(--bf-white);
    box-shadow: 0 12px 30px rgba(23, 33, 27, 0.06);
}

.subject-block-card,
.card,
.exam-card,
.comparison-card,
.subject-summary-card {
    border-color: var(--bf-line);
    background: var(--bf-white);
    box-shadow: 0 8px 24px rgba(23, 33, 27, 0.045);
}

.subject-block-card:hover,
.card:hover,
.exam-card:hover,
.comparison-card:hover {
    border-color: rgba(30, 98, 74, 0.36);
    box-shadow: 0 14px 30px rgba(23, 33, 27, 0.09);
}

.btn-neon,
.btn-library,
.btn-history,
.home-button--primary {
    border-radius: 6px;
    background: var(--bf-green);
    color: #fff;
    box-shadow: none;
    letter-spacing: 0;
    text-transform: none;
}

.btn-neon:hover,
.btn-neon:focus-visible,
.btn-library:hover,
.btn-library:focus-visible,
.btn-history:hover,
.btn-history:focus-visible,
.home-button--primary:hover,
.home-button--primary:focus-visible {
    background: #174c39;
    color: #fff;
}

.bf-button:hover,
.bf-button:focus-visible {
    border-color: var(--bf-lime);
    background: var(--bf-paper);
    color: var(--bf-green);
}

.bf-button:hover span,
.bf-button:focus-visible span {
    color: var(--bf-green);
}

body .filters select:focus,
body .filters input[type="text"]:focus {
    border-color: var(--bf-green);
}

.btn-outline,
.btn-ghost,
.home-button--quiet {
    border: 1px solid var(--bf-line);
    background: var(--bf-white);
    color: var(--bf-green);
    box-shadow: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button,
[role="button"] {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid var(--interactive) !important;
    outline-offset: 3px;
}

a,
button,
input,
select,
textarea {
    transition-duration: 180ms;
}

@media (max-width: 920px) {
    header:not(.bf-header) {
        gap: 12px;
        padding-right: 24px;
        padding-left: 24px;
    }

    .container,
    .page-container {
        width: min(100% - 40px, 1240px);
    }

    .subject-grid,
    .grid-2cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    header:not(.bf-header) {
        align-items: center;
        flex-wrap: wrap;
        padding: 14px 18px;
    }

    header:not(.bf-header) nav {
        width: 100%;
        justify-content: flex-start;
    }

    header:not(.bf-header) nav a {
        padding: 8px;
        font-size: 0.76rem;
    }

    .container,
    .page-container {
        width: calc(100% - 32px);
        margin-top: 24px;
        padding-bottom: 52px;
    }

    .subject-grid,
    .grid-2cols {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .subject-hero,
    .glass-panel,
    .subject-template__hero {
        padding: 22px 18px;
    }

    .subject-hero,
    .chemistry-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .recursos-links {
        flex-wrap: wrap;
        gap: 10px;
    }

    .cookie-banner {
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.bf-home main.bf-study-page {
    max-width: 1120px;
    padding-top: var(--bf-space-6);
}

.bf-study-hero {
    max-width: 770px;
    margin: 0 auto var(--bf-space-6);
    text-align: center;
}

.bf-study-hero h1 {
    margin: 0;
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 400;
    letter-spacing: -0.07em;
    line-height: 0.98;
}

.bf-study-hero h1 em {
    color: var(--bf-green);
    font-style: italic;
}

.bf-study-hero > p:not(.bf-api-notice) {
    max-width: 570px;
    margin: var(--bf-space-3) auto;
    color: var(--bf-muted);
    line-height: 1.65;
}

.bf-api-notice {
    margin: var(--bf-space-4) auto 0;
    padding: 12px 14px;
    border: 1px solid var(--bf-line);
    border-left: 3px solid #b26845;
    border-radius: 6px;
    background: var(--bf-white);
    color: var(--bf-muted);
    font-size: 0.78rem;
    line-height: 1.55;
    text-align: left;
}

.bf-study-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--bf-space-3);
}

.bf-study-card {
    min-width: 0;
    padding: var(--bf-space-4);
    border: 1px solid var(--bf-line);
    border-radius: 10px;
    background: var(--bf-white);
    box-shadow: 0 7px 22px rgba(23, 33, 27, 0.05);
}

.bf-study-card--wide {
    grid-column: 1 / -1;
}

.bf-study-card h2 {
    margin: 0 0 var(--bf-space-3);
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.55rem;
    font-weight: 400;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.bf-study-form {
    display: grid;
    gap: 9px;
    margin-top: var(--bf-space-3);
}

.bf-study-form label {
    color: var(--bf-ink);
    font-size: 0.76rem;
    font-weight: 700;
}

.bf-study-form .bf-study-consent {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 5px 0;
    color: var(--bf-muted);
    font-size: 0.74rem;
    font-weight: 400;
    line-height: 1.5;
}

.bf-study-form .bf-study-consent input {
    flex: 0 0 auto;
    width: 18px;
    min-height: 18px;
    margin: 2px 0 0;
    accent-color: var(--bf-green);
}

.bf-study-consent a {
    color: var(--bf-green);
}

.bf-study-form input,
.bf-study-form select,
.bf-study-form textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 10px 11px;
    border: 1px solid var(--bf-line);
    border-radius: 6px;
    background: var(--bf-paper);
    color: var(--bf-ink);
    font: inherit;
    font-size: 0.85rem;
}

.bf-study-form textarea {
    min-height: 100px;
    resize: vertical;
}

.bf-study-form select[multiple] {
    min-height: 150px;
    padding: 5px;
}

.bf-study-form input:focus-visible,
.bf-study-form select:focus-visible,
.bf-study-form textarea:focus-visible,
.bf-study-secondary:focus-visible,
.bf-auth__mode button:focus-visible {
    outline: 3px solid rgba(30, 98, 74, 0.32);
    outline-offset: 2px;
}

.bf-study-form .bf-button {
    justify-self: start;
    min-height: 44px;
    cursor: pointer;
}

.bf-study-secondary {
    min-height: 42px;
    margin-top: var(--bf-space-2);
    padding: 8px 11px;
    border: 1px solid var(--bf-green);
    border-radius: 6px;
    background: transparent;
    color: var(--bf-green);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.bf-study-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.bf-study-copy {
    color: var(--bf-muted);
    font-size: 0.82rem;
    line-height: 1.6;
}

.bf-study-secondary:hover {
    background: #edf4e2;
}

.bf-auth__mode {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: var(--bf-space-3) 0;
}

.bf-auth__mode button {
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid var(--bf-line);
    border-radius: 6px;
    background: var(--bf-paper);
    color: var(--bf-ink);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

.bf-auth__mode button[aria-pressed="true"] {
    border-color: var(--bf-green);
    background: var(--bf-green);
    color: #fff;
}

.bf-study-status {
    min-height: 1.5em;
    margin: var(--bf-space-2) 0 0;
    color: var(--bf-muted);
    font-size: 0.76rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.bf-study-status[data-state="success"] {
    color: var(--bf-green);
}

.bf-study-status[data-state="error"] {
    color: #a83f30;
}

.bf-study-status[data-state="pending"] {
    color: var(--bf-muted);
}

.bf-study-list {
    display: grid;
    gap: 8px;
    margin: var(--bf-space-3) 0;
    padding: 0;
    list-style: none;
}

.bf-study-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--bf-line);
    border-radius: 6px;
    overflow-wrap: anywhere;
}

.bf-study-list li button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 9px;
    border: 1px solid var(--bf-line);
    border-radius: 5px;
    background: transparent;
    color: var(--bf-green);
    cursor: pointer;
}

.bf-study-metric {
    color: var(--bf-muted);
    font-size: 0.84rem;
    line-height: 1.6;
}

.bf-study-share {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: var(--bf-space-3);
}

.bf-study-share a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 7px 10px;
    border: 1px solid var(--bf-line);
    border-radius: 6px;
    color: var(--bf-green);
    font-size: 0.75rem;
    font-weight: 800;
    text-decoration: none;
}

.bf-study-share a:hover,
.bf-study-share a:focus-visible {
    border-color: var(--bf-green);
    background: #edf4e2;
}

.bf-study-card [hidden] {
    display: none !important;
}

.bf-api-contract {
    margin: var(--bf-space-5) 0 0;
    padding: var(--bf-space-4);
    border: 1px solid var(--bf-line);
    border-radius: 8px;
    background: var(--bf-white);
    color: var(--bf-muted);
    font-size: 0.78rem;
    line-height: 1.65;
}

.bf-api-contract summary {
    color: var(--bf-ink);
    font-weight: 800;
    cursor: pointer;
}

.bf-api-contract code {
    color: var(--bf-green);
    overflow-wrap: anywhere;
}

.bf-home[data-theme="dark"] .bf-api-notice,
.bf-home[data-theme="dark"] .bf-study-card,
.bf-home[data-theme="dark"] .bf-api-contract {
    background: var(--bf-white);
}

.bf-home[data-theme="dark"] .bf-study-form input,
.bf-home[data-theme="dark"] .bf-study-form select,
.bf-home[data-theme="dark"] .bf-study-form textarea,
.bf-home[data-theme="dark"] .bf-auth__mode button {
    border-color: var(--bf-line);
    background: #152019;
    color: var(--bf-ink);
}

.bf-home[data-theme="dark"] .bf-study-secondary:hover,
.bf-home[data-theme="dark"] .bf-study-share a:hover {
    background: #293a2f;
}

.bf-home[data-theme="dark"] .bf-study-status[data-state="error"] {
    color: #ffaaa0;
}

@media (min-width: 681px) and (max-width: 1080px) {
    .bf-header {
        padding: 15px 24px;
    }

    .bf-menu-toggle {
        display: block;
    }

    .bf-nav {
        position: absolute;
        top: calc(100% + 8px);
        right: 12px;
        left: 12px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 3px;
        padding: 10px;
        border: 1px solid var(--bf-line);
        border-radius: 8px;
        background: var(--bf-white);
        box-shadow: 0 16px 30px rgba(23, 33, 27, 0.12);
    }

    .bf-nav.is-open {
        display: flex;
    }

    .bf-nav a {
        padding: 11px 12px;
    }

    .bf-nav .bf-theme-toggle {
        align-self: flex-start;
        margin: 3px 10px;
    }
}

@media (max-width: 680px) {
    .bf-home main.bf-study-page {
        padding-top: var(--bf-space-5);
    }

    .bf-study-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .bf-study-card--wide {
        grid-column: auto;
    }

    .bf-study-card {
        padding: var(--bf-space-3);
    }

    .bf-study-hero h1 {
        font-size: clamp(2.5rem, 13vw, 4rem);
    }
}

@media print {
    body,
    .bf-home {
        background: #fff !important;
        color: #111 !important;
        font-family: 'Fraunces', Georgia, serif !important;
    }

    .bf-header,
    .bf-footer,
    .bf-menu-toggle,
    .bf-theme-toggle,
    .bf-api-notice,
    .bf-study-form,
    .bf-study-secondary,
    .bf-study-share,
    .bf-study-status,
    .bf-api-contract,
    .bf-auth__mode,
    .bf-cookie-banner,
    .cookie-consent {
        display: none !important;
    }

    .bf-home main,
    .bf-home main.bf-study-page {
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .bf-study-card {
        break-inside: avoid;
        border: 1px solid #888;
        background: #fff !important;
        box-shadow: none;
    }

    .bf-study-card h2,
    .bf-study-hero h1,
    .bf-study-hero h1 em {
        color: #111 !important;
    }
}

.bf-library-search {
    width: min(100%, 860px);
    box-sizing: border-box;
    margin: 0 auto 38px;
    padding: 28px;
    border: 1px solid var(--bf-line);
    border-radius: 8px;
    background: var(--bf-white);
    box-shadow: 0 12px 30px rgba(23, 33, 27, 0.06);
}

.bf-library-search .bf-search {
    margin-top: 18px;
}

.bf-search-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.bf-search-controls label {
    display: grid;
    min-width: 0;
    gap: 6px;
    color: var(--bf-muted);
    font-size: 0.7rem;
    font-weight: 700;
}

.bf-search-controls select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--bf-line);
    border-radius: 6px;
    background: var(--bf-white);
    color: var(--bf-ink);
    font: inherit;
}

.bf-search-controls select:focus-visible {
    border-color: var(--bf-green);
    box-shadow: 0 0 0 3px rgba(30, 98, 74, 0.14);
}

.bf-search-results {
    box-sizing: border-box;
    margin: 13px 0 0;
    padding: 0;
    list-style: none;
}

.bf-search-results[hidden] {
    display: none;
}

.bf-search-results.is-open {
    display: block;
}

.bf-search-result {
    cursor: pointer;
}

.bf-search-status {
    margin: 10px 0 0;
    color: var(--bf-muted);
    font-size: 0.76rem;
}

.bf-search-status:empty {
    display: none;
}

.bf-extra-resources__grid {
    margin-top: 22px;
}

.bf-contact-section {
    grid-template-columns: minmax(120px, 0.2fr) minmax(0, 1fr);
    align-items: start;
}

.bf-contact-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: min(100%, 640px);
    margin-top: 22px;
}

.bf-contact-form label {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.84rem;
    font-weight: 700;
}

.bf-contact-form input:not([type="hidden"]):not(.form-honeypot),
.bf-contact-form textarea {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    background: #fff;
    color: var(--bf-ink);
    font: inherit;
    box-shadow: inset 0 1px 2px rgba(23, 33, 27, 0.04);
}

.bf-contact-form input:not([type="hidden"]):not(.form-honeypot) {
    min-height: 46px;
}

.bf-contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

.bf-contact-form input:focus-visible,
.bf-contact-form textarea:focus-visible {
    outline-color: var(--bf-lime) !important;
    outline-offset: 2px;
}

.bf-contact-form .bf-study-consent {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    max-width: 640px;
    margin: 8px 0 4px;
    color: rgba(255, 255, 255, 0.96);
    font-size: clamp(1.05rem, 1.2vw, 1.35rem);
    line-height: 1.45;
    text-align: left;
}

.bf-contact-form .bf-study-consent input {
    width: 26px;
    height: 26px;
    margin: 0;
    accent-color: var(--bf-lime);
    justify-self: center;
}

.bf-contact-form .bf-study-consent span {
    display: block;
    min-width: 0;
}

.bf-contact-form .bf-study-consent a {
    color: var(--bf-lime);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.bf-contact-form .bf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    justify-self: start;
    min-height: 52px;
    min-width: 210px;
    margin-top: 10px;
    padding: 0.9rem 1.5rem;
    border: 1px solid rgba(215, 232, 176, 0.9);
    border-radius: 14px;
    background: linear-gradient(135deg, #dfecc0 0%, #cfe1a8 100%);
    color: var(--bf-ink);
    box-shadow: 0 10px 24px rgba(215, 232, 176, 0.24);
    cursor: pointer;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 800;
}

.bf-contact-form .bf-button span {
    color: var(--bf-green);
    font-size: 1.2rem;
    line-height: 1;
}

.bf-contact-form .bf-button:hover,
.bf-contact-form .bf-button:focus-visible {
    border-color: #edf4dc;
    background: linear-gradient(135deg, #edf4dc 0%, #dfecc0 100%);
    color: var(--bf-ink);
    transform: translateY(-1px);
}

.bf-contact-form .bf-button:disabled {
    opacity: 0.76;
    cursor: wait;
    transform: none;
}

.bf-contact-form .contact-status {
    color: #fff;
}

.bf-contact-form .contact-status--error {
    color: #ffe1dc;
}

@media (max-width: 680px) {
    .bf-contact-section {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .bf-contact-form {
        margin-top: 16px;
    }

    .bf-contact-form .bf-study-consent {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 12px;
        font-size: 1.02rem;
    }

    .bf-contact-form .bf-study-consent input {
        width: 22px;
        height: 22px;
    }

    .bf-contact-form .bf-button {
        width: 100%;
        min-width: 0;
        justify-self: stretch;
    }
}

@media (max-width: 680px) {
    .bf-library-search {
        margin-bottom: 28px;
        padding: 22px 18px;
    }

    .bf-search-controls {
        gap: 8px;
    }
}

.bf-home {
    --bf-space-1: 0.5rem;
    --bf-space-2: 0.75rem;
    --bf-space-3: 1rem;
    --bf-space-4: 1.5rem;
    --bf-space-5: 2rem;
    --bf-space-6: 3rem;
    --bf-space-7: 4.5rem;
}

.bf-hero {
    background:
        radial-gradient(ellipse at 83% 28%, rgba(215, 232, 176, 0.48), transparent 43%),
        linear-gradient(125deg, rgba(255, 255, 255, 0.45), transparent 67%);
}

.bf-hero h1 {
    font-size: clamp(3rem, 6.1vw, 6.4rem);
    line-height: 0.98;
}

.bf-hero h1 em {
    font-style: italic;
}

.bf-hero__cta {
    margin-bottom: var(--bf-space-4);
}

.btn-primary,
.bf-home .bf-button--primary,
.bf-button--primary {
    border-color: var(--bf-green);
    background: var(--bf-green);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible,
.bf-home .bf-button--primary:hover,
.bf-button--primary:hover,
.bf-button--primary:focus-visible {
    border-color: #174c39;
    background: #174c39;
    color: #fff;
}

.btn-primary span,
.bf-button--primary span {
    color: var(--bf-lime);
}

.btn-outline,
.btn-pdf,
.bf-home .bf-button--light,
.bf-button--light {
    border: 1px solid var(--bf-green);
    border-radius: 6px;
    background: transparent;
    color: var(--bf-green);
}

.btn-outline:hover,
.btn-outline:focus-visible,
.btn-pdf:hover,
.btn-pdf:focus-visible,
.bf-home .bf-button--light:hover,
.bf-home .bf-button--light:focus-visible,
.bf-button--light:hover,
.bf-button--light:focus-visible {
    background: #edf4e2;
    color: #174c39;
}

.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bf-home .bf-button--light:hover,
.bf-home .bf-button--light:focus-visible {
    background: #edf4e2;
    color: #174c39;
}

.bf-search-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--bf-space-3);
}

.bf-search-controls label {
    min-width: 0;
}

.bf-search-controls select {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
}

.bf-search input::placeholder {
    color: #626e66;
    opacity: 1;
}

.bf-quick-search {
    row-gap: var(--bf-space-2);
}

.bf-subject {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    border-radius: 8px;
    background: var(--bf-white);
    box-shadow: 0 5px 16px rgba(23, 33, 27, 0.045);
}

.bf-subject:hover,
.bf-subject:focus-visible {
    background: #f0f5e9;
}

.bf-subject__symbol {
    margin: var(--bf-space-2) 0 var(--bf-space-3);
}

.bf-subject small {
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 180ms ease, margin 180ms ease, opacity 180ms ease;
}

.bf-subject:hover small,
.bf-subject:focus-visible small {
    max-height: 4rem;
    margin-top: var(--bf-space-2);
    opacity: 1;
}

.bf-subject[hidden] {
    display: none !important;
}

.bf-text-link,
.bf-resource-list__arrow {
    min-height: 40px;
    box-sizing: border-box;
}

.bf-home .bf-text-link {
    padding: 8px 12px;
    border: 1px solid var(--bf-green);
    border-radius: 6px;
    color: var(--bf-green);
}

.bf-home .bf-text-link:hover,
.bf-home .bf-text-link:focus-visible {
    background: #edf4e2;
    color: #174c39;
}

.bf-resource-list__arrow {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border: 1px solid rgba(30, 98, 74, 0.32);
    border-radius: 6px;
    background: #f4f7ee;
}

.bf-resource-list a:hover .bf-resource-list__arrow,
.bf-resource-list a:focus-visible .bf-resource-list__arrow {
    border-color: var(--bf-green);
    background: var(--bf-green);
    color: #fff;
}

.bf-footer {
    padding-top: var(--bf-space-7);
    background: #174c39;
    color: #fff;
}

.bf-footer .bf-brand {
    color: #fff;
}

.bf-footer .bf-brand span,
.bf-footer h2 {
    color: var(--bf-lime);
}

.bf-footer p,
.bf-footer__main > div:not(:first-child) a,
.bf-footer__bottom {
    color: #e0e9e3;
}

.bf-footer__main > div:not(:first-child) a:hover,
.bf-footer__main > div:not(:first-child) a:focus-visible {
    color: var(--bf-lime);
}

.bf-footer__social {
    margin-top: var(--bf-space-3);
    padding: 9px 12px;
    border: 1px solid rgba(215, 232, 176, 0.7);
    border-radius: 6px;
}

.bf-footer__bottom {
    border-color: rgba(255, 255, 255, 0.24);
}

.bf-team-page {
    max-width: 1100px;
    padding: 48px 0 80px;
}

.bf-team-intro {
    max-width: 760px;
    margin: 0 auto 32px;
    text-align: center;
}

.bf-team-intro h1 {
    margin: 0;
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 400;
    letter-spacing: -0.065em;
    line-height: 0.96;
}

.bf-team-intro p {
    max-width: 660px;
    margin: 16px auto 0;
    color: var(--bf-muted);
    font-size: 1.02rem;
    line-height: 1.75;
}

.bf-team-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 48px;
}

.bf-team-card {
    display: grid;
    gap: 16px;
    padding: 28px;
    border: 1px solid var(--bf-line);
    border-radius: 16px;
    background: var(--bf-white);
    box-shadow: 0 10px 24px rgba(23, 33, 27, 0.05);
}

.bf-team-card__avatar {
    display: grid;
    place-items: center;
    width: 90px;
    height: 90px;
    border: 1px solid rgba(30, 98, 74, 0.3);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(215, 232, 176, 0.45), rgba(30, 98, 74, 0.12));
    color: var(--bf-green);
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.bf-team-card h2 {
    margin: 0;
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 1.04;
}

.bf-team-card p {
    margin: 0;
    color: var(--bf-muted);
    font-size: 0.96rem;
    line-height: 1.7;
}

.bf-trust {
    padding: 28px 0 0;
    border-top: 1px solid var(--bf-line);
}

.bf-trust h2 {
    max-width: 840px;
    margin: 0;
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2.1rem, 4vw, 3.2rem);
    font-weight: 400;
    letter-spacing: -0.06em;
    line-height: 1.05;
}

.bf-trust__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 28px;
}

.bf-trust__stats article,
.bf-trust__quote {
    padding: 22px 24px;
    border: 1px solid var(--bf-line);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(30, 98, 74, 0.03), rgba(215, 232, 176, 0.16));
}

.bf-trust__stats strong {
    display: block;
    color: var(--bf-green);
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 400;
    line-height: 1;
}

.bf-trust__stats span {
    display: block;
    margin-top: 8px;
    color: var(--bf-muted);
    font-size: 0.8rem;
}

.bf-trust__quote {
    margin-top: 18px;
    display: grid;
    gap: 8px;
    background: #fff;
}

.bf-trust__quote p {
    margin: 0;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.2rem;
    line-height: 1.5;
}

.bf-trust__quote span {
    color: var(--bf-green);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (max-width: 680px) {
    .bf-team-grid,
    .bf-trust__stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .bf-team-card {
        padding: 20px;
    }
}

@media (max-width: 680px) {
    .bf-hero h1 {
        font-size: clamp(2.35rem, 10.5vw, 4rem);
        line-height: 1.02;
        letter-spacing: -0.065em;
    }

    .bf-search-controls {
        grid-template-columns: minmax(0, 1fr);
    }

    .bf-search-controls label,
    .bf-search-controls select {
        width: 100%;
    }

    .bf-subject small {
        max-height: none;
        margin-top: var(--bf-space-2);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .bf-footer {
        padding: var(--bf-space-6) 20px 20px;
    }

    .bf-footer__main {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--bf-space-5);
    }

    .bf-footer__main > div:first-child {
        grid-column: auto;
    }
}

.bf-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--bf-line);
    border-radius: 6px;
    background: transparent;
    color: var(--bf-ink);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.bf-theme-toggle:hover,
.bf-theme-toggle:focus-visible {
    border-color: var(--bf-green);
    color: var(--bf-green);
}

.bf-theme-toggle [data-theme-icon] {
    font-size: 1.05rem;
}

.bf-popular-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: var(--bf-space-3);
    color: var(--bf-muted);
    font-size: 0.72rem;
}

.bf-popular-search button {
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid var(--bf-line);
    border-radius: 999px;
    background: var(--bf-paper);
    color: var(--bf-green);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.bf-popular-search button:hover,
.bf-popular-search button:focus-visible {
    border-color: var(--bf-green);
    background: #edf4e2;
}

.bf-stats,
.bf-testimonials,
.bf-timeline,
.bf-progress {
    margin: 0 0 var(--bf-space-7);
}

.bf-stats {
    padding: var(--bf-space-6);
    border: 1px solid var(--bf-line);
    border-radius: 14px;
    background: linear-gradient(135deg, #edf3e5, #f9faf6);
}

.bf-stats h2,
.bf-testimonials h2,
.bf-timeline h2,
.bf-progress h2 {
    max-width: 700px;
    margin: 0;
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2rem, 3.7vw, 3.2rem);
    font-weight: 400;
    letter-spacing: -0.05em;
    line-height: 1.05;
}

.bf-stats__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--bf-space-3);
    margin-top: var(--bf-space-5);
}

.bf-stats__grid article {
    display: grid;
    gap: 5px;
    padding: var(--bf-space-4);
    border-left: 2px solid var(--bf-green);
    background: rgba(255, 255, 255, 0.76);
}

.bf-stats__grid strong {
    color: var(--bf-green);
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    line-height: 1;
}

.bf-stats__grid span {
    color: var(--bf-muted);
    font-size: 0.8rem;
}

.bf-testimonials {
    padding: 16px 0 var(--bf-space-6);
    border-bottom: 1px solid var(--bf-line);
}

.bf-testimonials__notice {
    max-width: 660px;
    margin: var(--bf-space-3) 0 var(--bf-space-4);
    color: var(--bf-muted);
    font-size: 0.78rem;
    line-height: 1.6;
}

.bf-testimonials__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--bf-space-3);
}

.bf-testimonials figure {
    display: flex;
    flex-direction: column;
    gap: var(--bf-space-4);
    min-height: 170px;
    margin: 0;
    padding: var(--bf-space-4);
    border: 1px solid var(--bf-line);
    border-radius: 10px;
    background: var(--bf-white);
    box-shadow: 0 5px 16px rgba(23, 33, 27, 0.045);
}

.bf-testimonials blockquote {
    margin: 0;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.5;
}

.bf-testimonials figcaption {
    display: grid;
    gap: 4px;
    margin-top: auto;
    color: var(--bf-muted);
    font-size: 0.76rem;
}

.bf-testimonials figcaption span {
    color: var(--bf-green);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bf-timeline {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: var(--bf-space-6);
    padding: var(--bf-space-6);
    border-radius: 14px;
    background: var(--bf-green);
    color: #fff;
}

.bf-timeline .bf-section-label {
    color: var(--bf-lime);
}

.bf-timeline .bf-section-label span:first-child {
    color: rgba(255, 255, 255, 0.72);
}

.bf-timeline h2 {
    color: #fff;
}

.bf-timeline__intro > p {
    max-width: 380px;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.6;
}

.bf-timeline__countdown {
    min-height: 3em;
    margin: var(--bf-space-4) 0;
    font-size: 1.08rem;
    font-weight: 700;
}

.bf-timeline .bf-text-link {
    border-color: rgba(255, 255, 255, 0.76);
    color: #fff;
}

.bf-timeline .bf-text-link:hover,
.bf-timeline .bf-text-link:focus-visible {
    background: #fff;
    color: #174c39;
}

.bf-timeline__items {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bf-timeline__items li {
    position: relative;
    display: grid;
    gap: 5px;
    padding: 0 0 var(--bf-space-4) var(--bf-space-5);
    border-left: 1px solid rgba(255, 255, 255, 0.48);
}

.bf-timeline__items li:last-child {
    padding-bottom: 0;
    border-left-color: transparent;
}

.bf-timeline__items li::before {
    position: absolute;
    top: 2px;
    left: -5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bf-lime);
    content: '';
}

.bf-timeline__items time {
    color: var(--bf-lime);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.bf-timeline__items li span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.84rem;
    line-height: 1.5;
}

.bf-progress {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: var(--bf-space-6);
    padding: var(--bf-space-6) 0;
    border-top: 1px solid var(--bf-line);
    border-bottom: 1px solid var(--bf-line);
}

.bf-progress__intro > p,
.bf-progress__badges p {
    max-width: 470px;
    color: var(--bf-muted);
    font-size: 0.84rem;
    line-height: 1.6;
}

.bf-progress__meter {
    display: grid;
    gap: 9px;
    margin-top: var(--bf-space-5);
}

.bf-progress__meter label {
    font-size: 0.78rem;
    font-weight: 800;
}

.bf-progress__meter progress {
    width: 100%;
    height: 12px;
    accent-color: var(--bf-green);
}

.bf-progress__meter output {
    color: var(--bf-muted);
    font-size: 0.76rem;
}

.bf-progress__badges {
    margin-top: var(--bf-space-5);
}

.bf-progress__badges h3 {
    margin: 0;
    font-size: 0.9rem;
}

.bf-progress__badges p {
    margin: 8px 0 0;
}

.bf-progress__badges > div {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: var(--bf-space-2);
}

.bf-progress__badge,
.bf-progress__group-badge {
    padding: 5px 9px;
    border: 1px solid #b79a45;
    border-radius: 999px;
    background: #fff7d8;
    color: #624d11;
    font-size: 0.66rem;
    font-weight: 800;
}

.bf-progress__topics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-content: start;
}

.bf-progress__group {
    align-self: start;
    border: 1px solid var(--bf-line);
    border-radius: 8px;
    background: var(--bf-white);
}

.bf-progress__summary {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    min-height: 44px;
    padding: 8px 11px;
    color: var(--bf-ink);
    font-size: 0.78rem;
    cursor: pointer;
    list-style: none;
}

.bf-progress__summary::-webkit-details-marker {
    display: none;
}

.bf-progress__summary::after {
    color: var(--bf-green);
    content: '+';
    font-size: 1.1rem;
}

.bf-progress__group[open] .bf-progress__summary::after {
    content: '−';
}

.bf-progress__group-badge {
    flex: 0 0 auto;
}

.bf-progress__topic-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0 10px 10px;
}

.bf-progress__topic {
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid var(--bf-line);
    border-radius: 999px;
    background: var(--bf-paper);
    color: var(--bf-ink);
    font: inherit;
    font-size: 0.7rem;
    cursor: pointer;
}

.bf-progress__topic:hover,
.bf-progress__topic:focus-visible {
    border-color: var(--bf-green);
}

.bf-progress__topic.is-complete {
    border-color: var(--bf-green);
    background: var(--bf-green);
    color: #fff;
}

.bf-home[data-theme="dark"] {
    color-scheme: dark;
    --bf-ink: #edf3ee;
    --bf-muted: #b5c1b9;
    --bf-paper: #121a16;
    --bf-white: #1d2922;
    --bf-green: #8dc9a3;
    --bf-lime: #d7e8b0;
    --bf-line: rgba(225, 238, 228, 0.17);
    background: var(--bf-paper);
    color: var(--bf-ink);
}

.bf-home[data-theme="dark"] .bf-header {
    background: rgba(18, 26, 22, 0.96);
}

.bf-home[data-theme="dark"] .bf-hero {
    background:
        radial-gradient(ellipse at 83% 28%, rgba(84, 134, 97, 0.22), transparent 43%),
        linear-gradient(125deg, rgba(255, 255, 255, 0.025), transparent 67%);
}

.bf-home[data-theme="dark"] .bf-hero__search,
.bf-home[data-theme="dark"] .bf-subject,
.bf-home[data-theme="dark"] .bf-testimonials figure,
.bf-home[data-theme="dark"] .bf-progress__group {
    background: var(--bf-white);
}

.bf-home[data-theme="dark"] .bf-search,
.bf-home[data-theme="dark"] .bf-search-controls select {
    border-color: var(--bf-line);
    background: #152019;
    color: var(--bf-ink);
}

.bf-home[data-theme="dark"] .bf-search input,
.bf-home[data-theme="dark"] .bf-search-controls select {
    color: var(--bf-ink);
}

.bf-home[data-theme="dark"] .bf-search input::placeholder {
    color: #b5c1b9;
}

.bf-home[data-theme="dark"] .bf-search-result:hover,
.bf-home[data-theme="dark"] .bf-search-result:focus-visible,
.bf-home[data-theme="dark"] .bf-search-result.is-active,
.bf-home[data-theme="dark"] .bf-subject:hover,
.bf-home[data-theme="dark"] .bf-subject:focus-visible {
    background: #293a2f;
}

.bf-home[data-theme="dark"] .bf-subject {
    border-color: var(--bf-line);
}

.bf-home[data-theme="dark"] .bf-popular-search button,
.bf-home[data-theme="dark"] .bf-progress__topic {
    border-color: var(--bf-line);
    background: #152019;
    color: var(--bf-ink);
}

.bf-home[data-theme="dark"] .bf-popular-search button:hover,
.bf-home[data-theme="dark"] .bf-popular-search button:focus-visible {
    border-color: var(--bf-green);
    background: #293a2f;
}

.bf-home[data-theme="dark"] .bf-stats {
    background: linear-gradient(135deg, #1b2a20, #18221c);
}

.bf-home[data-theme="dark"] .bf-stats__grid article {
    background: rgba(18, 26, 22, 0.68);
}

.bf-home[data-theme="dark"] .bf-pau,
.bf-home[data-theme="dark"] .bf-timeline {
    background: #24573e;
}

.bf-home[data-theme="dark"] .bf-footer {
    background: #0b120e;
}

.bf-home[data-theme="dark"] .bf-button--primary {
    border-color: #276543;
    background: #276543;
}

.bf-home[data-theme="dark"] .bf-button--primary:hover,
.bf-home[data-theme="dark"] .bf-button--primary:focus-visible {
    border-color: #34794f;
    background: #34794f;
}

.bf-home[data-theme="dark"] .bf-button--light,
.bf-home[data-theme="dark"] .bf-text-link {
    border-color: var(--bf-green);
    color: var(--bf-green);
}

.bf-home[data-theme="dark"] .bf-button--light:hover,
.bf-home[data-theme="dark"] .bf-text-link:hover {
    background: #293a2f;
    color: #e3f3e8;
}

.bf-home[data-theme="dark"] .bf-resource-list__arrow {
    border-color: var(--bf-line);
    background: #152019;
    color: #b8e2c5;
}

.bf-home[data-theme="dark"] .bf-resource-list a:hover .bf-resource-list__arrow {
    background: #24573e;
    color: #fff;
}

.bf-home[data-theme="dark"] .bf-progress__badge,
.bf-home[data-theme="dark"] .bf-progress__group-badge {
    border-color: #ad9140;
    background: #423719;
    color: #ffebad;
}

@media (max-width: 920px) {
    .bf-timeline,
    .bf-progress {
        grid-template-columns: minmax(0, 1fr);
    }

    .bf-timeline {
        gap: var(--bf-space-5);
    }
}

@media (max-width: 680px) {
    .bf-nav .bf-theme-toggle {
        justify-content: flex-start;
        margin: 3px 10px;
    }

    .bf-stats,
    .bf-timeline {
        padding: var(--bf-space-4);
    }

    .bf-stats__grid,
    .bf-testimonials__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .bf-stats__grid {
        gap: 8px;
        margin-top: var(--bf-space-4);
    }

    .bf-stats__grid article {
        grid-template-columns: minmax(70px, 0.35fr) 1fr;
        align-items: center;
        padding: 12px;
    }

    .bf-testimonials figure {
        min-height: auto;
    }

    .bf-progress__topics {
        grid-template-columns: minmax(0, 1fr);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.bf-hero__copy > * {
    opacity: 0;
    transform: translateY(18px);
    animation: hero-enter 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.bf-hero__copy > *:nth-child(2) { animation-delay: 0.08s; }
.bf-hero__copy > *:nth-child(3) { animation-delay: 0.16s; }
.bf-hero__copy > *:nth-child(4) { animation-delay: 0.24s; }
.bf-hero__copy > *:nth-child(5) { animation-delay: 0.32s; }
.bf-hero__copy > *:nth-child(6) { animation-delay: 0.4s; }

.bf-hero__search {
    opacity: 0;
    transform: translateY(24px);
    animation: hero-search-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

@keyframes hero-enter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hero-search-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

button,
a,
.bf-button,
.bf-subject,
.bf-suggestion-choice,
.bf-theme-toggle,
.bf-text-link {
    position: relative;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease, color 0.22s ease;
}

button:hover,
a:hover,
.bf-button:hover,
.bf-subject:hover,
.bf-suggestion-choice:hover,
.bf-theme-toggle:hover,
.bf-text-link:hover {
    transform: translateY(-1px);
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(30, 98, 74, 0.22);
    pointer-events: none;
    transform: scale(0);
    animation: ripple 0.48s linear forwards;
}

@keyframes ripple {
    to {
        opacity: 0;
        transform: scale(2.8);
    }
}

.site-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: rgba(246, 247, 242, 0.92);
    backdrop-filter: blur(8px);
    transition: opacity 0.34s ease, visibility 0.34s ease;
}

.site-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.site-loader__card {
    display: flex;
    gap: 10px;
    padding: 18px 20px;
    border: 1px solid var(--bf-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 12px 30px rgba(23, 33, 27, 0.08);
}

.site-loader__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bf-green);
    animation: loader-bounce 0.95s infinite ease-in-out alternate;
}

.site-loader__dot:nth-child(2) { animation-delay: 0.15s; }
.site-loader__dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes loader-bounce {
    to {
        transform: translateY(-4px);
        opacity: 0.6;
    }
}

.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(30, 98, 74, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 28px rgba(23, 33, 27, 0.15);
    color: var(--bf-green);
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
    background: var(--bf-green);
    color: #fff;
}

.toast-container {
    position: fixed;
    right: 22px;
    bottom: 86px;
    z-index: 2000;
    display: grid;
    gap: 10px;
    width: min(320px, calc(100vw - 32px));
}

.toast {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(30, 98, 74, 0.18);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 28px rgba(23, 33, 27, 0.14);
    color: var(--bf-ink);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast--success {
    border-color: rgba(32, 116, 75, 0.22);
    background: rgba(218, 245, 223, 0.96);
    color: #164b34;
}

.toast--error {
    border-color: rgba(163, 42, 42, 0.2);
    background: rgba(255, 232, 232, 0.96);
    color: #7d1d1d;
}

body[data-theme="dark"],
body.theme-dark,
.bf-home[data-theme="dark"] {
    --bf-paper: #0d1713;
    --bf-white: #121f1a;
    --bf-ink: #edf9f0;
    --bf-muted: #bfd2c5;
    --bf-green: #8ed8ac;
    --bf-lime: #dfeab8;
    --text-main: var(--bf-ink);
    --text-muted: var(--bf-muted);
    --bg-main: var(--bf-paper);
    --panel-bg: rgba(21, 33, 28, 0.96);
    --shadow-color: rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] .bf-header,
body[data-theme="dark"] .bf-hero__search,
body[data-theme="dark"] .bf-subject,
body[data-theme="dark"] .bf-testimonials figure,
body[data-theme="dark"] .bf-progress__group,
body[data-theme="dark"] .bf-footer,
body[data-theme="dark"] .cookie-banner,
body[data-theme="dark"] .cookie-settings-button {
    background-color: rgba(18, 31, 26, 0.96);
    color: var(--bf-ink);
}

body[data-theme="dark"] .bf-button--light,
body[data-theme="dark"] .bf-text-link,
body[data-theme="dark"] .bf-button--primary,
body[data-theme="dark"] .bf-theme-toggle {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

body[data-theme="dark"] .bf-theme-toggle {
    border-color: rgba(142, 216, 172, 0.38);
    color: var(--bf-ink);
    background: rgba(18, 31, 26, 0.96);
}

body[data-theme="dark"] .bf-button--light,
body[data-theme="dark"] .bf-text-link {
    border-color: rgba(142, 216, 172, 0.5);
    color: var(--bf-green);
}

body[data-theme="dark"] .bf-button--light:hover,
body[data-theme="dark"] .bf-text-link:hover,
body[data-theme="dark"] .bf-button--primary:hover {
    background: rgba(142, 216, 172, 0.12);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .bf-progress *,
    .bf-timeline *,
    .bf-testimonials *,
    .reveal,
    .bf-hero__copy > *,
    .bf-hero__search,
    .site-loader,
    .back-to-top,
    .toast,
    .ripple {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ======================================================
   Modernization pass — global polish layer
   Safe, additive refinements on top of the existing
   bf- editorial design system. Does not remove or
   override structural/layout rules above.
   ====================================================== */

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

::selection {
    background: var(--bf-lime, #d7e8b0);
    color: var(--bf-ink, #17211b);
}

:focus-visible {
    outline: 2px solid var(--bf-green, #1e624a);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Refined, consistent easing + lift for interactive surfaces that already
   use transform/shadow transitions (buttons, cards, subject tiles). */
.bf-button, .btn-neon, .bf-subject, .card, .glass-panel, .bf-resource-list a {
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.bf-subject:hover, .card:hover {
    transform: translateY(-3px);
}

/* Subtle depth behind the hero search panel for a less flat first impression */
.bf-hero__search {
    position: relative;
}

.bf-hero__search::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: inherit;
    background: radial-gradient(120% 140% at 15% 0%, rgba(215, 232, 176, 0.45), transparent 60%);
    pointer-events: none;
}

/* Scrollbar polish (progressive enhancement, ignored where unsupported) */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bf-paper, #f6f7f2); }
::-webkit-scrollbar-thumb { background: rgba(23, 33, 27, 0.18); border-radius: 999px; border: 3px solid var(--bf-paper, #f6f7f2); }
::-webkit-scrollbar-thumb:hover { background: rgba(23, 33, 27, 0.3); }

.bf-home[data-theme="dark"] ::-webkit-scrollbar-thumb { border-color: transparent; }



/* =========================================================
   BACHILLERATOFACILITO — VISUAL SYSTEM 2026
   Premium UI layer: motion, depth, responsive layout,
   subject identities and accessible interaction states.
   ========================================================= */

:root {
  --bf-bg: #f5f7fb;
  --bf-surface: rgba(255,255,255,.78);
  --bf-surface-solid: #ffffff;
  --bf-text: #101828;
  --bf-text-2: #475467;
  --bf-text-3: #667085;
  --bf-border: rgba(16,24,40,.10);
  --bf-border-strong: rgba(16,24,40,.16);
  --bf-brand: #6757f5;
  --bf-brand-2: #8b5cf6;
  --bf-cyan: #16b8d4;
  --bf-green: #19a974;
  --bf-yellow: #f5b942;
  --bf-danger: #ef6a6a;
  --bf-shadow: 0 18px 55px rgba(16,24,40,.10);
  --bf-shadow-lg: 0 35px 90px rgba(16,24,40,.16);
  --bf-radius: 22px;
  --bf-radius-sm: 14px;
  --bf-ease: cubic-bezier(.16,1,.3,1);
}

html {
  background: var(--bf-bg);
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(circle at 8% 8%, rgba(103,87,245,.10), transparent 28rem),
    radial-gradient(circle at 92% 12%, rgba(22,184,212,.09), transparent 26rem),
    radial-gradient(circle at 50% 100%, rgba(139,92,246,.07), transparent 34rem),
    var(--bf-bg);
  color: var(--bf-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .34;
  background-image:
    linear-gradient(rgba(16,24,40,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,24,40,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

a { color: inherit; }

::selection {
  background: rgba(103,87,245,.20);
  color: var(--bf-text);
}

.bf-header,
header {
  background: rgba(255,255,255,.72) !important;
  border-bottom: 1px solid var(--bf-border) !important;
  box-shadow: 0 8px 35px rgba(16,24,40,.055) !important;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

.bf-brand {
  font-family: Inter, sans-serif !important;
  font-size: 1.08rem !important;
  font-weight: 850 !important;
  letter-spacing: -.035em !important;
  transition: transform .35s var(--bf-ease), opacity .25s ease !important;
}

.bf-brand:hover { transform: translateY(-2px) !important; opacity: .86; }

.bf-brand span {
  color: var(--bf-brand) !important;
}

.bf-nav a {
  position: relative;
  border-radius: 999px !important;
  padding: 9px 13px !important;
  color: var(--bf-text-2) !important;
  font-size: .82rem !important;
  font-weight: 750 !important;
}

.bf-nav a::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg,var(--bf-brand),var(--bf-cyan));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .35s var(--bf-ease);
}

.bf-nav a:hover::after,
.bf-nav a.is-current::after { transform: scaleX(1); }

.bf-nav a:hover,
.bf-nav a.is-current {
  color: var(--bf-text) !important;
  background: rgba(103,87,245,.07) !important;
}

.bf-theme-toggle {
  border: 1px solid var(--bf-border-strong) !important;
  background: rgba(255,255,255,.72) !important;
  color: var(--bf-text) !important;
  border-radius: 999px !important;
  padding: 8px 13px !important;
}

.bf-theme-toggle:hover {
  border-color: rgba(103,87,245,.35) !important;
  box-shadow: 0 8px 25px rgba(103,87,245,.10);
}

.bf-menu-toggle {
  border: 1px solid var(--bf-border-strong) !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.75) !important;
  color: var(--bf-text) !important;
}

/* ---------- HOME ---------- */

.bf-home main {
  position: relative;
  isolation: isolate;
}

.bf-hero {
  position: relative;
  min-height: min(720px, calc(100vh - 78px));
  max-width: 1380px !important;
  margin: 0 auto !important;
  padding: clamp(52px,8vw,104px) clamp(22px,5vw,70px) 80px !important;
  display: grid !important;
  grid-template-columns: minmax(0,1.02fr) minmax(400px,.78fr) !important;
  gap: clamp(35px,6vw,95px) !important;
  align-items: center;
}

.bf-hero::before,
.bf-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(4px);
  animation: bf-float-background 8s ease-in-out infinite;
}

.bf-hero::before {
  width: 300px;
  height: 300px;
  top: 8%;
  right: 31%;
  background: radial-gradient(circle, rgba(103,87,245,.16), transparent 68%);
}

.bf-hero::after {
  width: 260px;
  height: 260px;
  left: -80px;
  bottom: 2%;
  background: radial-gradient(circle, rgba(22,184,212,.13), transparent 68%);
  animation-delay: -3s;
}

.bf-eyebrow,
.bf-section-label,
.bf-search-kicker {
  color: var(--bf-brand) !important;
  letter-spacing: .15em !important;
  font-size: .69rem !important;
  font-weight: 850 !important;
  text-transform: uppercase !important;
}

.bf-hero__copy h1 {
  max-width: 760px;
  margin: 12px 0 22px !important;
  color: var(--bf-text) !important;
  font-size: clamp(3.2rem,6.2vw,6.6rem) !important;
  line-height: .93 !important;
  letter-spacing: -.065em !important;
  font-weight: 850 !important;
}

.bf-hero__copy h1 em {
  font-style: normal;
  background: linear-gradient(100deg,var(--bf-brand) 5%,var(--bf-brand-2) 48%,var(--bf-cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 180% auto;
  animation: bf-gradient-shift 7s ease infinite;
}

.bf-hero__summary {
  max-width: 660px !important;
  color: var(--bf-text-2) !important;
  font-size: clamp(1rem,1.5vw,1.18rem) !important;
  line-height: 1.75 !important;
}

.bf-hero__actions { margin-top: 30px !important; }

.bf-button {
  border-radius: 999px !important;
  min-height: 48px;
  padding: 12px 19px !important;
  font-weight: 800 !important;
  box-shadow: none;
}

.bf-button--primary {
  border: 0 !important;
  background: linear-gradient(135deg,var(--bf-brand),var(--bf-brand-2)) !important;
  box-shadow: 0 15px 32px rgba(103,87,245,.25) !important;
  color: #fff !important;
}

.bf-button--primary:hover {
  transform: translateY(-3px) scale(1.015) !important;
  box-shadow: 0 22px 40px rgba(103,87,245,.30) !important;
}

.bf-button--light,
.bf-text-link {
  border: 1px solid var(--bf-border-strong) !important;
  background: rgba(255,255,255,.72) !important;
  color: var(--bf-text) !important;
  box-shadow: 0 8px 22px rgba(16,24,40,.05);
}

.bf-hero__meta {
  display: flex !important;
  flex-wrap: wrap;
  gap: 9px !important;
  margin-top: 22px !important;
}

.bf-hero__meta span {
  padding: 7px 11px;
  border: 1px solid var(--bf-border);
  border-radius: 999px;
  background: rgba(255,255,255,.52);
  color: var(--bf-text-3);
  font-size: .73rem;
  font-weight: 700;
}

.bf-hero__search,
.bf-library-search {
  border: 1px solid rgba(103,87,245,.17) !important;
  border-radius: 30px !important;
  background:
    linear-gradient(145deg,rgba(255,255,255,.92),rgba(248,249,255,.72)) !important;
  box-shadow: var(--bf-shadow-lg) !important;
  padding: clamp(23px,3vw,34px) !important;
  overflow: hidden;
}

.bf-hero__search::after,
.bf-library-search::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -70px;
  top: -75px;
  border-radius: 50%;
  background: radial-gradient(circle,rgba(22,184,212,.20),transparent 68%);
  pointer-events: none;
}

.bf-search-heading h2 {
  margin: 7px 0 18px !important;
  color: var(--bf-text) !important;
  font-size: clamp(1.45rem,2.4vw,2rem) !important;
  letter-spacing: -.04em;
}

.bf-search {
  min-height: 62px !important;
  border: 1px solid var(--bf-border-strong) !important;
  border-radius: 17px !important;
  background: rgba(255,255,255,.90) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 10px 30px rgba(16,24,40,.055) !important;
  transition: border-color .3s ease, box-shadow .3s ease, transform .3s var(--bf-ease) !important;
}

.bf-search:focus-within {
  transform: translateY(-2px);
  border-color: rgba(103,87,245,.50) !important;
  box-shadow: 0 0 0 5px rgba(103,87,245,.09), 0 16px 36px rgba(16,24,40,.08) !important;
}

.bf-search input { color: var(--bf-text) !important; font-size: .98rem !important; }
.bf-search input::placeholder { color: #98a2b3 !important; }

.bf-search-controls select {
  border: 1px solid var(--bf-border) !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,.8) !important;
  color: var(--bf-text-2) !important;
}

.bf-quick-search button,
.bf-popular-search button {
  border: 1px solid var(--bf-border) !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.66) !important;
  color: var(--bf-text-2) !important;
  font-weight: 700 !important;
  transition: all .28s var(--bf-ease) !important;
}

.bf-quick-search button:hover,
.bf-popular-search button:hover {
  transform: translateY(-2px);
  border-color: rgba(103,87,245,.35) !important;
  background: rgba(103,87,245,.07) !important;
  color: var(--bf-brand) !important;
}

/* Subject cards */
.bf-subjects {
  max-width: 1380px !important;
  margin: 0 auto !important;
  padding: 76px clamp(22px,5vw,70px) !important;
}

.bf-section-heading {
  margin-bottom: 25px !important;
}

.bf-section-heading h2,
.bf-timeline h2,
.bf-progress h2 {
  color: var(--bf-text) !important;
  letter-spacing: -.045em !important;
  font-size: clamp(1.8rem,3.5vw,3rem) !important;
}

.bf-subjects__grid {
  display: grid !important;
  grid-template-columns: repeat(3,minmax(0,1fr)) !important;
  gap: 14px !important;
}

.bf-subject {
  min-height: 185px;
  position: relative;
  isolation: isolate;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--bf-border) !important;
  border-radius: 22px !important;
  padding: 23px !important;
  background: rgba(255,255,255,.75) !important;
  box-shadow: 0 8px 30px rgba(16,24,40,.055) !important;
  color: var(--bf-text) !important;
  transform: translateZ(0);
  transition: transform .5s var(--bf-ease), box-shadow .5s var(--bf-ease), border-color .35s ease !important;
}

.bf-subject::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 170px;
  height: 170px;
  top: -72px;
  right: -45px;
  border-radius: 50%;
  background: var(--subject-glow,rgba(103,87,245,.15));
  filter: blur(4px);
  transition: transform .65s var(--bf-ease);
}

.bf-subject:hover {
  transform: translateY(-8px) !important;
  border-color: color-mix(in srgb,var(--subject-accent,#6757f5) 35%, transparent) !important;
  box-shadow: 0 25px 55px rgba(16,24,40,.13) !important;
}

.bf-subject:hover::before { transform: scale(1.35); }

.bf-subject__symbol {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 17px;
  background: linear-gradient(145deg,rgba(255,255,255,.78),rgba(255,255,255,.30));
  box-shadow: 0 10px 25px rgba(16,24,40,.08);
  color: var(--subject-accent,#6757f5);
  font-weight: 900;
  font-size: 1.12rem;
  transform: rotate(-4deg);
  transition: transform .5s var(--bf-ease);
}

.bf-subject:hover .bf-subject__symbol { transform: rotate(4deg) translateY(-4px) scale(1.06); }

.bf-subject strong {
  font-size: 1.15rem !important;
  letter-spacing: -.025em;
}

.bf-subject small {
  margin-top: 5px;
  color: var(--bf-text-3) !important;
}

.bf-subject__arrow {
  position: absolute;
  right: 22px;
  bottom: 21px;
  color: var(--subject-accent,#6757f5);
  font-size: 1.25rem;
  opacity: .75;
  transition: transform .4s var(--bf-ease);
}

.bf-subject:hover .bf-subject__arrow { transform: translate(4px,-4px); }

/* Subject palette */
.bf-subject--math { --subject-accent:#6757f5; --subject-glow:rgba(103,87,245,.18); }
.bf-subject--physics { --subject-accent:#06a6c7; --subject-glow:rgba(6,166,199,.18); }
.bf-subject--philosophy { --subject-accent:#c05a96; --subject-glow:rgba(192,90,150,.17); }
.bf-subject--language { --subject-accent:#ef7d35; --subject-glow:rgba(239,125,53,.17); }
.bf-subject--drawing { --subject-accent:#dc8b27; --subject-glow:rgba(220,139,39,.17); }
.bf-subject--history { --subject-accent:#a56b46; --subject-glow:rgba(165,107,70,.17); }
.bf-subject--english { --subject-accent:#3478dd; --subject-glow:rgba(52,120,221,.17); }
.bf-subject--biology { --subject-accent:#16a66b; --subject-glow:rgba(22,166,107,.17); }
.bf-subject--chemistry { --subject-accent:#8a5cf0; --subject-glow:rgba(138,92,240,.17); }

/* Lower homepage sections */
.bf-timeline,
.bf-progress,
.bf-stats,
.bf-pau,
.bf-testimonials {
  border-radius: 28px !important;
  border: 1px solid var(--bf-border) !important;
  box-shadow: var(--bf-shadow) !important;
}

.bf-timeline {
  max-width: 1240px !important;
  margin: 30px auto 55px !important;
  background: linear-gradient(135deg,#16182b,#23204a) !important;
  color: #fff !important;
  position: relative;
  overflow: hidden;
}

.bf-timeline::before {
  content:"";
  position:absolute;
  width:380px;height:380px;
  right:-130px;top:-180px;
  border-radius:50%;
  background: radial-gradient(circle,rgba(139,92,246,.42),transparent 68%);
  animation: bf-float-background 9s ease-in-out infinite;
}

.bf-timeline h2,
.bf-timeline p { color: #fff !important; }

.bf-timeline__items li {
  border-color: rgba(255,255,255,.13) !important;
}

.bf-progress {
  max-width: 1240px !important;
  margin: 30px auto 70px !important;
  background: rgba(255,255,255,.75) !important;
}

.bf-progress__meter progress {
  accent-color: var(--bf-brand);
}

.bf-stats {
  background: linear-gradient(135deg,rgba(103,87,245,.09),rgba(22,184,212,.06)) !important;
}

/* ---------- Generic content / subject pages ---------- */

.container,
.page-container,
.info-page {
  max-width: 1240px !important;
}

.container { padding-top: 32px !important; }

.btn-back {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  border-radius: 999px !important;
  border: 1px solid var(--bf-border) !important;
  background: rgba(255,255,255,.68) !important;
  color: var(--bf-text-2) !important;
  box-shadow: 0 8px 22px rgba(16,24,40,.05);
}

.subject-hero,
.chemistry-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--bf-border) !important;
  border-radius: 32px !important;
  background:
    radial-gradient(circle at 90% 10%, var(--subject-glow,rgba(103,87,245,.18)), transparent 31%),
    linear-gradient(135deg,rgba(255,255,255,.94),rgba(248,249,255,.72)) !important;
  box-shadow: var(--bf-shadow-lg) !important;
}

.subject-hero::after,
.chemistry-hero::after {
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background: linear-gradient(115deg,transparent 25%,rgba(255,255,255,.34) 48%,transparent 68%);
  transform: translateX(-120%);
  animation: bf-shine 7s ease-in-out infinite;
}

.subject-hero__content h1,
.chemistry-hero h1,
.subject-page-heading h1 {
  color: var(--bf-text) !important;
  font-size: clamp(2.6rem,6vw,5.4rem) !important;
  letter-spacing: -.06em !important;
  line-height: .95 !important;
}

.subject-hero__eyebrow { color: var(--bf-brand) !important; font-weight: 850 !important; }

.subject-summary-card,
.subject-block-card,
.card,
.glass-panel,
.contact-card,
.contact-form,
.team-card {
  border-color: var(--bf-border) !important;
  background: rgba(255,255,255,.74) !important;
  box-shadow: 0 12px 38px rgba(16,24,40,.065) !important;
  border-radius: 20px !important;
}

.subject-block-card,
.card {
  transition: transform .45s var(--bf-ease), box-shadow .45s var(--bf-ease), border-color .35s ease !important;
}

.subject-block-card:hover,
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(103,87,245,.22) !important;
  box-shadow: 0 24px 55px rgba(16,24,40,.11) !important;
}

.bloque-header {
  letter-spacing: -.025em;
}

/* Make existing subject SVG illustrations feel alive */
.physics-hero__composition,
.chemistry-hero__composition,
.subject-biology-visual {
  filter: drop-shadow(0 20px 30px rgba(103,87,245,.10));
}

.physics-hero__composition svg,
.chemistry-hero__composition svg,
.subject-biology-visual svg {
  overflow: visible;
}

.physics-hero__composition svg *,
.chemistry-hero__composition svg *,
.subject-biology-visual svg * {
  transition: opacity .4s ease, transform .6s var(--bf-ease);
}

.physics-hero__composition svg {
  animation: bf-orbit-float 6s ease-in-out infinite;
}

.chemistry-hero__molecules {
  transform-origin: 223px 94px;
  animation: bf-molecule-spin 14s linear infinite;
}

.subject-biology-visual__dna {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: bf-draw 3s ease forwards .25s;
}

/* ---------- Search / library ---------- */

.bf-library-search {
  max-width: 1240px !important;
  margin: 38px auto 24px !important;
}

.bf-search-results {
  border-radius: 18px !important;
  border: 1px solid var(--bf-border) !important;
  box-shadow: var(--bf-shadow) !important;
  overflow: hidden;
}

.bf-search-result {
  transition: background .25s ease, transform .25s var(--bf-ease) !important;
}

.bf-search-result:hover { transform: translateX(4px); }

/* ---------- Footer ---------- */

.bf-footer,
.site-footer {
  border-top: 1px solid var(--bf-border) !important;
  background: rgba(255,255,255,.45) !important;
  color: var(--bf-text-3) !important;
}

/* ---------- Cookie / notices ---------- */

.cookie-banner {
  border: 1px solid var(--bf-border) !important;
  border-radius: 24px !important;
  background: rgba(255,255,255,.88) !important;
  box-shadow: 0 30px 90px rgba(16,24,40,.20) !important;
  backdrop-filter: blur(25px) saturate(150%);
}

.cookie-button--primary {
  background: linear-gradient(135deg,var(--bf-brand),var(--bf-brand-2)) !important;
  border: 0 !important;
}

/* ---------- Motion ---------- */

.reveal {
  opacity: 0;
  transform: translateY(30px) scale(.985);
  transition: opacity .8s var(--bf-ease), transform .8s var(--bf-ease) !important;
}

.reveal.is-visible { opacity:1; transform:none; }

@keyframes bf-float-background {
  0%,100% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(0,-18px,0); }
}

@keyframes bf-gradient-shift {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes bf-shine {
  0%,65%,100% { transform:translateX(-120%); }
  78% { transform:translateX(120%); }
}

@keyframes bf-orbit-float {
  0%,100% { transform:translateY(0) rotate(0deg); }
  50% { transform:translateY(-7px) rotate(.8deg); }
}

@keyframes bf-molecule-spin {
  to { transform:rotate(360deg); }
}

@keyframes bf-draw { to { stroke-dashoffset:0; } }

/* ---------- New page transition overlay ---------- */

.bf-transition {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%,rgba(139,92,246,.28),transparent 28rem),
    linear-gradient(135deg,#0d1020,#17142e 55%,#101c29);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .55s ease, visibility .55s ease;
}

.bf-transition.is-active {
  opacity: 1;
  visibility: visible;
}

.bf-transition__inner {
  width: min(440px,calc(100vw - 40px));
  display:grid;
  justify-items:center;
  gap:20px;
}

.bf-transition__label {
  font-size:.72rem;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:rgba(255,255,255,.58);
  font-weight:800;
}

.bf-transition__title {
  margin:0;
  font-size:clamp(2rem,7vw,4rem);
  line-height:1;
  letter-spacing:-.06em;
  text-align:center;
}

.bf-transition__art {
  position:relative;
  width:230px;
  height:150px;
  display:grid;
  place-items:center;
}

/* A real CSS book-opening animation for Lengua */
.bf-transition[data-subject="lengua"] .bf-transition__art::before,
.bf-transition[data-subject="lengua"] .bf-transition__art::after {
  content:"";
  position:absolute;
  width:105px;
  height:125px;
  top:12px;
  background:linear-gradient(145deg,#fffaf0,#e8dfcf);
  border:2px solid rgba(255,255,255,.48);
  box-shadow:0 18px 35px rgba(0,0,0,.24);
}

.bf-transition[data-subject="lengua"] .bf-transition__art::before {
  right:50%;
  transform-origin:right center;
  border-radius:8px 3px 3px 8px;
  transform:perspective(700px) rotateY(88deg);
  animation: bf-book-left 1.05s var(--bf-ease) forwards;
}

.bf-transition[data-subject="lengua"] .bf-transition__art::after {
  left:50%;
  transform-origin:left center;
  border-radius:3px 8px 8px 3px;
  transform:perspective(700px) rotateY(-88deg);
  animation: bf-book-right 1.05s var(--bf-ease) forwards;
}

.bf-transition[data-subject="lengua"] .bf-transition__art .bf-transition__symbol {
  z-index:2;
  font-size:2rem;
  color:#ef7d35;
  opacity:0;
  animation:bf-symbol-in .55s ease .58s forwards;
}

@keyframes bf-book-left { to { transform:perspective(700px) rotateY(0); } }
@keyframes bf-book-right { to { transform:perspective(700px) rotateY(0); } }
@keyframes bf-symbol-in { to { opacity:1; transform:translateY(-3px) scale(1.08); } }

.bf-transition[data-subject="matematicas"] .bf-transition__art::before {
  content:"∑  ∫  π";
  font-size:2.5rem;
  letter-spacing:.16em;
  color:#a99cff;
  animation:bf-math-art 1.15s ease both;
}
.bf-transition[data-subject="fisica"] .bf-transition__art::before {
  content:"●  ⟲  →";
  font-size:2.5rem;
  color:#68ddf2;
  animation:bf-physics-art 1.2s ease both;
}
.bf-transition[data-subject="filosofia"] .bf-transition__art::before {
  content:"✦";
  font-size:5rem;
  color:#ef9cc5;
  animation:bf-philo-art 1.2s ease both;
}
.bf-transition[data-subject="quimica"] .bf-transition__art::before {
  content:"⚗";
  font-size:5rem;
  color:#b79aff;
  animation:bf-chem-art 1.1s ease both;
}
.bf-transition[data-subject="biologia"] .bf-transition__art::before {
  content:"🧬";
  font-size:4rem;
  filter:grayscale(.15);
  animation:bf-dna-art 1.2s ease both;
}
.bf-transition[data-subject="ingles"] .bf-transition__art::before {
  content:"A  B  C";
  font-size:2rem;
  letter-spacing:.18em;
  color:#75aaff;
  animation:bf-letters-art 1.1s ease both;
}
.bf-transition[data-subject="historia"] .bf-transition__art::before {
  content:"I  ·  II  ·  III";
  font-size:1.45rem;
  color:#e6b18d;
  animation:bf-history-art 1.1s ease both;
}
.bf-transition[data-subject="dibujo"] .bf-transition__art::before {
  content:"△  ◇  ⌗";
  font-size:2.4rem;
  color:#f0b55a;
  animation:bf-drawing-art 1.1s ease both;
}

@keyframes bf-math-art { from{opacity:0;transform:scale(.45) rotate(-15deg)} to{opacity:1;transform:scale(1) rotate(0)} }
@keyframes bf-physics-art { from{opacity:0;transform:translateX(-90px) rotate(-90deg)} to{opacity:1;transform:none} }
@keyframes bf-philo-art { from{opacity:0;transform:scale(.2)} to{opacity:1;transform:scale(1)} }
@keyframes bf-chem-art { from{opacity:0;transform:translateY(45px) scale(.6)} to{opacity:1;transform:none} }
@keyframes bf-dna-art { from{opacity:0;transform:rotate(-80deg) scale(.4)} to{opacity:1;transform:rotate(0) scale(1)} }
@keyframes bf-letters-art { from{opacity:0;letter-spacing:.8em} to{opacity:1;letter-spacing:.18em} }
@keyframes bf-history-art { from{opacity:0;transform:translateX(-60px)} to{opacity:1;transform:none} }
@keyframes bf-drawing-art { from{opacity:0;transform:rotate(180deg) scale(.3)} to{opacity:1;transform:none} }

/* ---------- Scroll progress ---------- */
.bf-scroll-progress {
  position:fixed;
  z-index:10001;
  top:0;left:0;
  width:100%;
  height:3px;
  pointer-events:none;
}
.bf-scroll-progress span {
  display:block;
  width:100%;
  height:100%;
  background:linear-gradient(90deg,var(--bf-brand),var(--bf-cyan));
  box-shadow:0 0 14px rgba(103,87,245,.45);
}

/* ---------- Dark mode ---------- */
body[data-theme="dark"],
body.theme-dark {
  --bf-bg:#080b12;
  --bf-surface:rgba(18,22,32,.74);
  --bf-surface-solid:#111620;
  --bf-text:#f3f5f9;
  --bf-text-2:#b7c0ce;
  --bf-text-3:#8994a5;
  --bf-border:rgba(255,255,255,.09);
  --bf-border-strong:rgba(255,255,255,.15);
  --bf-shadow:0 18px 55px rgba(0,0,0,.30);
  --bf-shadow-lg:0 35px 90px rgba(0,0,0,.42);
  background:
    radial-gradient(circle at 10% 10%,rgba(103,87,245,.14),transparent 28rem),
    radial-gradient(circle at 90% 10%,rgba(22,184,212,.09),transparent 25rem),
    #080b12;
}

body[data-theme="dark"]::before,
body.theme-dark::before {
  opacity:.22;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.025) 1px, transparent 1px);
}

body[data-theme="dark"] .bf-header,
body.theme-dark .bf-header,
body[data-theme="dark"] header,
body.theme-dark header {
  background:rgba(8,11,18,.72) !important;
  border-color:var(--bf-border) !important;
}

body[data-theme="dark"] .bf-nav a { color:var(--bf-text-2) !important; }
body[data-theme="dark"] .bf-nav a:hover,
body[data-theme="dark"] .bf-nav a.is-current { color:#fff !important; background:rgba(103,87,245,.11) !important; }

body[data-theme="dark"] .bf-theme-toggle,
body.theme-dark .bf-theme-toggle,
body[data-theme="dark"] .bf-menu-toggle,
body.theme-dark .bf-menu-toggle {
  background:rgba(17,22,32,.78) !important;
  color:var(--bf-text) !important;
  border-color:var(--bf-border-strong) !important;
}

body[data-theme="dark"] .bf-hero__copy h1,
body[data-theme="dark"] .bf-section-heading h2,
body[data-theme="dark"] .bf-timeline h2,
body[data-theme="dark"] .bf-progress h2,
body[data-theme="dark"] .bf-search-heading h2,
body[data-theme="dark"] .subject-hero__content h1,
body[data-theme="dark"] .chemistry-hero h1,
body[data-theme="dark"] .subject-page-heading h1 {
  color:var(--bf-text) !important;
}

body[data-theme="dark"] .bf-hero__summary,
body[data-theme="dark"] .bf-subject small { color:var(--bf-text-2) !important; }

body[data-theme="dark"] .bf-hero__search,
body[data-theme="dark"] .bf-library-search,
body[data-theme="dark"] .bf-subject,
body[data-theme="dark"] .card,
body[data-theme="dark"] .glass-panel,
body[data-theme="dark"] .subject-hero,
body[data-theme="dark"] .chemistry-hero,
body[data-theme="dark"] .subject-block-card,
body[data-theme="dark"] .subject-summary-card,
body[data-theme="dark"] .contact-card,
body[data-theme="dark"] .contact-form,
body[data-theme="dark"] .team-card {
  background:rgba(17,22,32,.74) !important;
  border-color:var(--bf-border) !important;
  color:var(--bf-text) !important;
}

body[data-theme="dark"] .bf-search,
body[data-theme="dark"] .bf-search-controls select {
  background:rgba(9,13,20,.82) !important;
  border-color:var(--bf-border-strong) !important;
  color:var(--bf-text) !important;
}

body[data-theme="dark"] .bf-quick-search button,
body[data-theme="dark"] .bf-popular-search button,
body[data-theme="dark"] .bf-button--light,
body[data-theme="dark"] .bf-text-link,
body[data-theme="dark"] .btn-back {
  background:rgba(17,22,32,.72) !important;
  border-color:var(--bf-border-strong) !important;
  color:var(--bf-text-2) !important;
}

body[data-theme="dark"] .bf-footer,
body[data-theme="dark"] .site-footer {
  background:rgba(8,11,18,.55) !important;
}

@media (max-width: 980px) {
  .bf-hero {
    grid-template-columns:1fr !important;
    min-height:auto;
    padding-top:60px !important;
  }
  .bf-hero__search { max-width:760px; width:100%; margin:auto; }
  .bf-subjects__grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
}

@media (max-width: 680px) {
  .bf-hero {
    padding:42px 18px 55px !important;
    gap:38px !important;
  }
  .bf-hero__copy h1 { font-size:clamp(2.8rem,15vw,4.5rem) !important; }
  .bf-hero__meta { gap:6px !important; }
  .bf-hero__meta span { font-size:.66rem; }
  .bf-subjects { padding:55px 18px !important; }
  .bf-subjects__grid { grid-template-columns:1fr !important; }
  .bf-subject { min-height:155px; }
  .bf-library-search { margin:22px 14px !important; }
  .subject-hero,.chemistry-hero { border-radius:22px !important; }
  .subject-hero__content h1,.chemistry-hero h1,.subject-page-heading h1 { font-size:clamp(2.5rem,14vw,4rem) !important; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after {
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
    scroll-behavior:auto !important;
  }
}

/* Accessibility utility */
.bf-skip-link {
  position: fixed;
  left: 14px;
  top: 10px;
  z-index: 100002;
  transform: translateY(-160%);
  padding: 10px 15px;
  border-radius: 999px;
  background: #101828;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(0,0,0,.2);
  transition: transform .25s ease;
}
.bf-skip-link:focus { transform: translateY(0); }
/* @view-transition desactivado: las transiciones entre páginas las gestiona page-transitions.js */
::view-transition-old(root) { animation: bf-vt-out .25s ease both; }
::view-transition-new(root) { animation: bf-vt-in .45s var(--bf-ease) both; }
@keyframes bf-vt-out { to { opacity:0; transform:scale(.985); filter:blur(3px); } }
@keyframes bf-vt-in { from { opacity:0; transform:translateY(8px) scale(.992); filter:blur(2px); } }

.bf-transition[data-subject="generic"] .bf-transition__art::before {
  content:"BF";
  display:grid;
  place-items:center;
  width:104px;
  height:104px;
  border:1px solid rgba(255,255,255,.25);
  border-radius:30px;
  background:linear-gradient(145deg,rgba(103,87,245,.9),rgba(22,184,212,.75));
  box-shadow:0 25px 55px rgba(103,87,245,.25);
  font-size:2rem;
  font-weight:900;
  letter-spacing:-.06em;
  animation:bf-generic-art 1s var(--bf-ease) both;
}
.bf-hero__search {
  translate: var(--bf-mx, 0px) var(--bf-my, 0px);
  will-change: translate;
}
@media (max-width: 980px) {
  .bf-hero__search { translate: none; }
}
