: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: '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: 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: 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: 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: 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: 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: 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: 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: 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: '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: 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: 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__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: 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: 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: 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: 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: 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: Georgia, serif; font-size: 1.75rem; line-height: 1; }.bf-subject strong { display: block; font-family: 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: 1fr 1.35fr auto; gap: 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: Georgia, serif; font-size: 1.12rem; font-weight: 400; }.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: 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: Georgia, serif; font-size: 2rem; line-height: 0.9; }.bf-pau__index span { font-family: '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: 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: 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: 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: '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: 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-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: 6px;
    background: #fff;
    color: var(--bf-ink);
    font: inherit;
}

.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-button {
    justify-self: start;
    min-height: 46px;
    margin-top: 12px;
    border-color: var(--bf-lime);
    background: var(--bf-lime);
    color: var(--bf-ink);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.bf-contact-form .bf-button span {
    color: var(--bf-green);
}

.bf-contact-form .bf-button:hover,
.bf-contact-form .bf-button:focus-visible {
    border-color: #edf4dc;
    background: #edf4dc;
    color: var(--bf-ink);
}

.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;
    }
}

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

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