/* ================================
   1. ROOT VARIABLES (Colors, Spacing)
   ================================ */
:root {
    --navy: #071b2d;
    --navy2: #0d2b3c;
    --teal: #0e7c79;
    --teal2: #d8f2ee;
    --cream: #f8f6ef;
    --white: #fff;
    --coral: #ee7058;
    --ink: #14212b;
    --muted: #5f6d75;
    --line: #dce3e3;
    --shadow: 0 20px 60px rgba(7, 27, 45, .12);
    --radius: 20px;
}

/* ================================
   2. RESET & BASE STYLES
   ================================ */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: #fff;
    font-family: 'DM Sans', sans-serif;
    line-height: 1.65;
}

h1,
h2,
h3,
h4 {
    font-family: Manrope, sans-serif;
    line-height: 1.12;
    margin: 0 0 16px;
}

h1 {
    font-size: clamp(2.65rem, 6vw, 5.6rem);
    letter-spacing: -.055em;
}

h2 {
    font-size: clamp(2rem, 4vw, 3.4rem);
    letter-spacing: -.035em;
}

h3 {
    font-size: 1.15rem;
}

p {
    margin: 0 0 20px;
    color: var(--muted);
}

a {
    color: inherit;
    text-decoration: none;
}

.wrap {
    width: min(1180px, calc(100% - 40px));
    margin: auto;
}

.skip {
    position: absolute;
    left: -9999px;
}

.skip:focus {
    left: 16px;
    top: 12px;
    background: #fff;
    padding: 10px;
    z-index: 99;
}

/* ================================
   3. TOP BAR & HEADER / NAVIGATION
   ================================ */
.topbar {
    background: var(--navy);
    color: #d8e6eb;
    font-size: .86rem;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.topbar a {
    color: #75ddd1;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(220, 227, 227, .8);
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: Manrope;
    font-size: 1.1rem;
    font-weight: 700;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--teal);
    color: white;
    font-size: 1.4rem;
}

.brand strong {
    color: var(--teal);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    font-weight: 600;
    font-size: .94rem;
}

.main-nav>a:not(.nav-cta) {
    padding: 27px 0;
    position: relative;
}

.main-nav>a.active:after,
.main-nav>a:not(.nav-cta):hover:after {
    content: '';
    height: 3px;
    border-radius: 3px;
    background: var(--teal);
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
}

.menu-btn {
    display: none;
    background: none;
    border: 0;
    font-size: 1.5rem;
}

/* ================================
   4. BUTTONS
   ================================ */
.nav-cta,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    padding: 13px 22px;
    background: var(--teal);
    color: #fff;
    font-weight: 700;
    border: 1px solid var(--teal);
    transition: .2s;
}

.nav-cta:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 25px rgba(14, 124, 121, .25);
}

.btn.secondary {
    background: transparent;
    color: var(--navy);
    border-color: #b8c6ca;
}

.btn.light {
    background: white;
    color: var(--navy);
    border-color: white;
}

/* ================================
   5. HERO SECTION
   ================================ */
.hero {
    background: var(--navy);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero:after {
    content: 'π  ∫  √  ∞';
    position: absolute;
    left: 5%;
    bottom: -25px;
    font: 800 8rem Manrope;
    color: rgba(255, 255, 255, .025);
    letter-spacing: .15em;
}

.hero-grid {
    min-height: 700px;
    display: grid;
    grid-template-columns: 1.04fr .96fr;
    align-items: center;
    gap: 48px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #66d9cf;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: .13em;
    font-size: .75rem;
    margin-bottom: 22px;
}

.eyebrow:before {
    content: '';
    width: 28px;
    height: 2px;
    background: currentColor;
}

.hero h1 span {
    color: #6ee0d4;
}

.hero p {
    font-size: 1.15rem;
    color: #bed0d7;
    max-width: 620px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin: 32px 0;
}

.hero .btn.secondary {
    color: white;
    border-color: #557080;
}

.hero-image {
    position: relative;
}

.hero-image img {
    width: 100%;
    height: 510px;
    object-fit: cover;
    border-radius: 30px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, .35);
}

.formula-card {
    position: absolute;
    left: -30px;
    bottom: 35px;
    background: #fff;
    color: var(--navy);
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    font-family: Manrope;
    font-weight: 700;
}

.trust-row {
    display: flex;
    gap: 28px;
    margin-top: 35px;
    color: #d5e2e6;
    font-size: .9rem;
}

.trust-row span {
    display: flex;
    gap: 8px;
    align-items: center;
}

.trust-row b {
    color: #69d8ce;
}

/* ================================
   6. GENERIC SECTION LAYOUT
   ================================ */
.section {
    padding: 95px 0;
}

.section.soft {
    background: var(--cream);
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 42px;
}

.section-head p {
    max-width: 560px;
}

.kicker {
    color: var(--teal);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .11em;
    font-size: .77rem;
    margin-bottom: 12px;
}

/* ================================
   7. STATS STRIP
   ================================ */
.stats {
    margin-top: -38px;
    position: relative;
    z-index: 2;
}

.stats-grid {
    background: #fff;
    border-radius: 22px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 28px;
}

.stat {
    text-align: center;
    border-right: 1px solid var(--line);
}

.stat:last-child {
    border: 0;
}

.stat b {
    font: 800 1.8rem Manrope;
    color: var(--navy);
    display: block;
}

.stat span {
    font-size: .85rem;
    color: var(--muted);
}

/* ================================
   8. CARDS (Class Cards / Notes)
   ================================ */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    transition: .25s;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
    border-color: transparent;
}

.icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--teal2);
    color: var(--teal);
    display: grid;
    place-items: center;
    font: 700 1.35rem Manrope;
    margin-bottom: 24px;
}

.card-link {
    color: var(--teal);
    font-weight: 700;
}

/* ================================
   9. ABOUT / TEACHER SECTION
   ================================ */
.about-grid {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 72px;
    align-items: center;
}

.portrait {
    min-height: 500px;
    border-radius: 30px;
    background: linear-gradient(145deg, var(--teal2), #c9d9ea);
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.portrait:before {
    content: 'FA';
    font: 800 10rem Manrope;
    color: rgba(7, 27, 45, .12);
}

.portrait-badge {
    position: absolute;
    bottom: 26px;
    left: 26px;
    right: 26px;
    background: #fff;
    padding: 18px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.check-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 25px 0;
}

.check-list span:before {
    content: '✓';
    color: var(--teal);
    font-weight: bold;
    margin-right: 8px;
}

/* ================================
   10. STEPS SECTION ("How it works")
   ================================ */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    counter-reset: step;
}

.step {
    padding: 30px;
    border-top: 3px solid var(--teal);
    background: #fff;
    box-shadow: 0 12px 35px rgba(7, 27, 45, .07);
    border-radius: 0 0 18px 18px;
}

.step:before {
    counter-increment: step;
    content: '0' counter(step);
    font: 800 2.2rem Manrope;
    color: #c4dfdc;
}

/* ================================
   11. TESTIMONIAL / CTA BAND
   ================================ */
.testimonial {
    background: var(--navy);
    color: #fff;
    border: 0;
}

.testimonial p {
    color: #c9d8de;
}

.cta-band {
    background: linear-gradient(120deg, var(--teal), #075d67);
    border-radius: 30px;
    padding: 55px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}

.cta-band p {
    color: #d6f1ee;
}

/* ================================
   12. INNER PAGE HERO (About/Courses/Notes)
   ================================ */
.page-hero {
    padding: 80px 0;
    background: linear-gradient(120deg, var(--navy), var(--navy2));
    color: white;
}

.page-hero p {
    color: #bed0d7;
    max-width: 700px;
}

/* ================================
   13. FILTERS & NOTES GRID
   ================================ */
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.filter {
    border: 1px solid var(--line);
    background: white;
    border-radius: 999px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 700;
}

.filter.selected {
    background: var(--navy);
    color: white;
    border-color: var(--navy);
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.note-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
}

.note-top {
    height: 10px;
    background: var(--teal);
}

.note-body {
    padding: 25px;
}

.tag {
    display: inline-block;
    background: var(--teal2);
    color: #096c69;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .76rem;
    font-weight: 800;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: .82rem;
    margin: 18px 0;
}

.ad-slot {
    border: 1px dashed #b8c6ca;
    background: #fafbfb;
    color: #8a969c;
    min-height: 90px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    margin: 35px 0;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .15em;
}

/* ================================
   14. CONTENT PAGES (About/Privacy/Terms)
   ================================ */
.content-page {
    max-width: 820px;
}

.content-page h2 {
    font-size: 1.8rem;
    margin-top: 42px;
}

/* ================================
   15. CONTACT FORM & ADMIN PANEL
   ================================ */
.contact-grid {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 55px;
}

.contact-form,
.admin-panel {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 32px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(7, 27, 45, .07);
}

label {
    display: block;
    font-weight: 700;
    margin: 0 0 7px;
}

.field {
    margin-bottom: 18px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cad5d7;
    border-radius: 11px;
    padding: 13px 14px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(14, 124, 121, .14);
    border-color: var(--teal);
}

.notice {
    padding: 14px 16px;
    border-radius: 10px;
    background: #e2f5ef;
    color: #096357;
    margin-bottom: 20px;
}

.notice.error {
    background: #ffebe6;
    color: #9b3525;
}

/* ================================
   16. FOOTER
   ================================ */
.footer {
    background: #061623;
    color: #c3d0d6;
    padding: 75px 0 25px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr .7fr .7fr 1.1fr;
    gap: 50px;
}

.footer h3 {
    color: #fff;
}

.footer a {
    display: block;
    margin: 9px 0;
}

.footer p {
    color: #8fa4ae;
}

.footer-brand {
    color: #fff;
    margin-bottom: 18px;
}

.mini-form {
    display: flex;
}

.mini-form input {
    border-radius: 10px 0 0 10px;
}

.mini-form button {
    border: 0;
    background: var(--coral);
    color: white;
    border-radius: 0 10px 10px 0;
    padding: 0 17px;
    font-weight: bold;
}

.footer-bottom {
    border-top: 1px solid #1d3340;
    margin-top: 50px;
    padding-top: 22px;
    display: flex;
    justify-content: space-between;
    color: #79909a;
    font-size: .84rem;
}

/* ================================
   17. WHATSAPP FLOATING BUTTON
   ================================ */
.whatsapp {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 54px;
    height: 54px;
    background: #20b86b;
    color: #fff;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow);
    z-index: 20;
}

/* ================================
   18. ADMIN PANEL (Table, Login)
   ================================ */
.admin-shell {
    max-width: 1050px;
    margin: 50px auto;
}

.admin-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.table-wrap {
    overflow: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    text-align: left;
    padding: 13px;
    border-bottom: 1px solid var(--line);
}

th {
    font-size: .78rem;
    text-transform: uppercase;
    color: var(--muted);
}

.danger {
    color: #b73928;
    font-weight: 700;
}

.login {
    max-width: 460px;
    margin: 70px auto;
}

.muted {
    color: var(--muted);
}

/* ================================
   19. RESPONSIVE — TABLET (max-width: 900px)
   ================================ */
@media (max-width: 900px) {
    .menu-btn {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 78px;
        left: 0;
        right: 0;
        background: #fff;
        padding: 20px;
        box-shadow: var(--shadow);
        flex-direction: column;
        gap: 5px;
    }

    .main-nav.open {
        display: flex;
    }

    .main-nav>a:not(.nav-cta) {
        padding: 10px;
    }

    .main-nav>a.active:after {
        bottom: 3px;
    }

    .hero-grid,
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .hero-grid {
        padding: 75px 0;
    }

    .hero-image img {
        height: 380px;
    }

    .formula-card {
        left: 15px;
    }

    .cards,
    .notes-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .stat:nth-child(2) {
        border: 0;
    }

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

    .section-head,
    .cta-band {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ================================
   20. RESPONSIVE — MOBILE (max-width: 600px)
   ================================ */
@media (max-width: 600px) {
    .wrap {
        width: min(100% - 28px, 1180px);
    }

    .topbar span {
        display: none;
    }

    .topbar-inner {
        justify-content: center;
    }

    .hero-grid {
        min-height: 0;
    }

    .hero h1 {
        font-size: 3.1rem;
    }

    .hero-image img {
        height: 300px;
    }

    .trust-row {
        flex-wrap: wrap;
        gap: 12px;
    }

    .stats {
        margin-top: 20px;
    }

    .stats-grid,
    .cards,
    .notes-grid,
    .steps,
    .check-list,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .stat {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding-bottom: 15px;
    }

    .section {
        padding: 70px 0;
    }

    .cta-band {
        padding: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
    }

    .portrait {
        min-height: 400px;
    }
}

/* ================================
   21. EXPANDED SECTIONS & RESOURCE MODULES
   ================================ */

/* Hero Byline & Badges */
.hero-subbrand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--teal);
    letter-spacing: -.02em;
    margin-bottom: 12px;
}
.hero-lead {
    font-size: 1.14rem;
    line-height: 1.7;
    color: #435460;
    margin-bottom: 26px;
    max-width: 620px;
}

/* 5 Pillars: Learn. Practice. Master. */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 24px;
}
.pillar-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(7, 27, 45, .04);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
}
.pillar-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(7, 27, 45, .08);
    border-color: var(--teal);
}
.pillar-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: #f0faf9;
    color: var(--teal);
    font-size: 1.6rem;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
}
.pillar-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--navy);
}
.pillar-card p {
    font-size: .84rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.45;
}

@media (max-width: 990px) {
    .pillars-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 600px) {
    .pillars-grid {
        grid-template-columns: 1fr;
    }
}

/* Entry Test Prep Strip */
.entry-prep-band {
    background: linear-gradient(135deg, #071b2d 0%, #0d344d 100%);
    border-radius: 24px;
    padding: 38px 42px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    margin-top: 28px;
    box-shadow: 0 16px 40px rgba(7,27,45,.15);
}
.entry-prep-band h3 {
    color: #fff;
    font-size: 1.6rem;
    margin-bottom: 8px;
}
.entry-prep-band p {
    color: #bad3e1;
    margin: 0;
    max-width: 640px;
    font-size: .98rem;
}
.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.entry-tag {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    color: #75ddd1;
    font-size: .78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}

@media(max-width: 800px) {
    .entry-prep-band {
        flex-direction: column;
        align-items: flex-start;
        padding: 28px 24px;
    }
}

/* Flagship Topic Showcase */
.flagship-card {
    background: #fff;
    border: 2px solid #e1e9eb;
    border-radius: 22px;
    padding: 32px;
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 32px;
    align-items: center;
    box-shadow: 0 10px 30px rgba(7, 27, 45, .05);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.flagship-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #feeceb;
    color: #c9362a;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.flagship-card h3 {
    font-size: 1.65rem;
    color: var(--navy);
    margin-bottom: 10px;
}
.flagship-syllabus {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 24px;
}
.flagship-chip {
    background: #f1f6f8;
    color: #384c59;
    font-size: .8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #e2eaec;
}
.flagship-chip.active {
    background: #e6f6f4;
    color: var(--teal);
    border-color: #b7e4df;
    font-weight: 700;
}
.flagship-box-preview {
    background: linear-gradient(145deg, #f7fafc, #edf4f7);
    border: 1px solid #dce8ec;
    border-radius: 16px;
    padding: 22px;
}
.preview-title {
    font-size: .85rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--teal);
    letter-spacing: .08em;
    margin-bottom: 12px;
}
.preview-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.preview-list li {
    font-size: .88rem;
    color: #334450;
    padding: 6px 0;
    border-bottom: 1px dashed #e0eaee;
    display: flex;
    align-items: center;
    gap: 8px;
}
.preview-list li:last-child {
    border-bottom: 0;
}
.preview-list span.check {
    color: var(--teal);
    font-weight: bold;
}

@media (max-width: 860px) {
    .flagship-card {
        grid-template-columns: 1fr;
    }
}

/* Online Classes Card Grid */
.classes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 24px;
}
.class-tier {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 32px 26px;
    box-shadow: 0 8px 24px rgba(7, 27, 45, .04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform .2s ease, box-shadow .2s ease;
    position: relative;
}
.class-tier:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(7, 27, 45, .09);
}
.class-tier.popular {
    border: 2px solid var(--teal);
    background: linear-gradient(180deg, #fbfefd 0%, #fff 100%);
}
.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--teal);
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.class-tier h3 {
    font-size: 1.35rem;
    margin: 10px 0 8px;
    color: var(--navy);
}
.class-features {
    list-style: none;
    margin: 20px 0 24px;
    padding: 0;
}
.class-features li {
    font-size: .92rem;
    color: #455662;
    padding: 7px 0;
    border-bottom: 1px solid #f0f4f5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.class-features li:last-child {
    border-bottom: 0;
}
.class-features span.tick {
    color: var(--teal);
    font-weight: 800;
}

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

/* Real Portrait Photo Overlay */
.real-portrait {
    position: relative;
    width: 100%;
    min-height: 480px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(7, 27, 45, .15);
    background: #0d2b3c;
}
.real-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}
.portrait-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(7,27,45,0.92) 0%, rgba(7,27,45,0.4) 65%, transparent 100%);
    padding: 26px;
    color: #fff;
}
.portrait-overlay h3 {
    color: #fff;
    font-size: 1.4rem;
    margin: 0 0 4px;
}
.portrait-overlay p {
    color: #a4c5d8;
    font-size: .88rem;
    margin: 0;
}

/* Comprehensive Topic Page Styling */
.topic-header {
    background: linear-gradient(135deg, var(--navy) 0%, #0d344d 100%);
    color: #fff;
    padding: 56px 0 48px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.topic-header h1 {
    color: #fff;
    margin: 8px 0 16px;
}
.topic-header p {
    color: #d1e5f0;
    max-width: 720px;
    font-size: 1.12rem;
    line-height: 1.6;
}
.topic-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.topic-badge {
    background: rgba(117,221,209,0.16);
    color: #75ddd1;
    font-size: .8rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(117,221,209,0.25);
}
.topic-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: flex-start;
}
.topic-sidebar {
    position: sticky;
    top: 96px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 4px 18px rgba(7, 27, 45, .04);
}
.topic-sidebar h4 {
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--teal);
    margin-bottom: 14px;
}
.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.toc-list a {
    display: block;
    padding: 6px 10px;
    font-size: .88rem;
    font-weight: 600;
    color: #3b4e5a;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: background .12s, color .12s;
}
.toc-list a:hover {
    background: #f0faf9;
    color: var(--teal);
}
.topic-content-section {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 36px 32px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(7, 27, 45, .03);
}
.topic-content-section h2 {
    font-size: 1.85rem;
    color: var(--navy);
    border-bottom: 2px solid #f0f4f5;
    padding-bottom: 12px;
    margin-bottom: 22px;
}
.topic-content-section h3 {
    font-size: 1.3rem;
    color: var(--navy);
    margin: 24px 0 12px;
}
.formula-box {
    background: #f4fbfb;
    border-left: 4px solid var(--teal);
    border-radius: 0 14px 14px 0;
    padding: 20px 24px;
    margin: 20px 0;
}
.worked-example-box {
    background: #fff;
    border: 1.5px solid #d9e6e8;
    border-radius: 16px;
    padding: 24px;
    margin: 22px 0;
    box-shadow: 0 4px 12px rgba(7,27,45,0.03);
}
.worked-example-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eaeff0;
    padding-bottom: 10px;
    margin-bottom: 16px;
}
.worked-example-badge {
    background: var(--navy);
    color: #fff;
    font-size: .75rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}
.pitfall-box {
    background: #fff7f6;
    border-left: 4px solid var(--coral);
    border-radius: 0 14px 14px 0;
    padding: 18px 22px;
    margin: 18px 0;
}
.tip-box {
    background: #f6faff;
    border-left: 4px solid #1976d2;
    border-radius: 0 14px 14px 0;
    padding: 18px 22px;
    margin: 18px 0;
}
.solution-toggle {
    margin-top: 14px;
    border: 1px solid #dce6e7;
    border-radius: 10px;
    background: #fafcfc;
}
.solution-toggle summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--teal);
    padding: 12px 16px;
    outline: none;
    font-size: .92rem;
}
.solution-toggle summary:hover {
    background: #f0faf9;
}
.solution-toggle[open] summary {
    border-bottom: 1px solid #dce6e7;
}
.solution-toggle-body {
    padding: 16px 20px;
    background: #fff;
}

@media(max-width: 900px) {
    .topic-layout {
        grid-template-columns: 1fr;
    }
    .topic-sidebar {
        position: static;
        margin-bottom: 24px;
    }
}