/* ==========================================================================
   eMind Academy — v2
   Cream "graph paper" + ink typography + abacus bead motif.
   ========================================================================== */

:root {
    --paper: #FBF6EE;
    --paper-2: #F4ECDF;
    --card: #FFFFFF;
    --ink: #1D1A2C;
    --ink-2: #4A4659;
    --ink-3: #736D80;
    --line: #E7DCCC;
    --line-2: #D7C8B3;
    --grid: rgba(29, 26, 44, .055);

    --orange: #F3842A;
    --orange-2: #E8721A;
    --orange-ink: #A94B05;
    --sun: #FCCB0B;
    --sky: #00AEEF;
    --coral: #EF5B45;
    --plum: #6D4AA8;
    --wood: #C98B4E;

    --radius: 24px;
    --radius-sm: 14px;
    --shadow: 0 1px 0 rgba(29, 26, 44, .04), 0 18px 40px -18px rgba(29, 26, 44, .25);
    --shadow-lg: 0 2px 0 rgba(29, 26, 44, .05), 0 40px 80px -30px rgba(29, 26, 44, .45);

    --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
    --font-body: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

    --container: 1200px;
    --gutter: 24px;
    --header-h: 76px;
    color-scheme: light;
}

/* Course colour themes: --c accent, --c-soft tint, --c-ink readable text */
.c-orange { --c: var(--orange); --c-soft: #FDE7D3; --c-ink: #9A4405; }
.c-sun    { --c: var(--sun);    --c-soft: #FEF2C2; --c-ink: #7A5900; }
.c-sky    { --c: var(--sky);    --c-soft: #D5F0FB; --c-ink: #00597F; }
.c-coral  { --c: var(--coral);  --c-soft: #FCE0DA; --c-ink: #A0301F; }
.c-plum   { --c: var(--plum);   --c-soft: #E9E1F6; --c-ink: #4E3283; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.025em;
    margin: 0 0 .5em;
    text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 5.4vw, 4.4rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(2rem, 3.8vw, 3.1rem); }
h3 { font-size: 1.5rem; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
address { font-style: normal; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; }
.skip-link:focus { top: 12px; }

.icon { width: 1.25em; height: 1.25em; flex: none; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--font-body);
    font-size: .8125rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--orange-ink);
    margin-bottom: 16px;
}
.eyebrow::before { content: ''; width: 18px; height: 10px; border-radius: 50%; background: var(--orange); box-shadow: 22px 0 0 var(--line-2); margin-right: 22px; }
.lead { font-size: clamp(1.125rem, 1.6vw, 1.3rem); color: var(--ink-2); line-height: 1.55; max-width: 40ch; }

.graph-paper {
    background-color: var(--paper);
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 32px 32px;
    background-position: -1px -1px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 50px; padding: 12px 24px;
    border-radius: 999px; border: 2px solid transparent; background: transparent;
    font: 650 1rem/1.2 var(--font-body);
    text-decoration: none; cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn .icon { width: 1.15em; height: 1.15em; }
.btn-primary { background: var(--orange); color: var(--ink); }
.btn-primary:hover { background: var(--orange-2); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #2E2A43; }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-ghost-light { border-color: rgba(255, 255, 255, .3); color: #fff; }
.btn-ghost-light:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: .9rem; }

.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.link-arrow .icon { transition: transform .2s; }
a:hover > .link-arrow .icon, .link-arrow:hover .icon { transform: translateX(4px); }
.text-link { font-weight: 650; color: var(--orange-ink); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- Bead rule (divider) ---------- */
.bead-rule { display: flex; align-items: center; gap: 6px; }
.bead-rule span { flex: 1; height: 2px; background: var(--line-2); border-radius: 2px; }
.bead-rule i { width: 22px; height: 12px; border-radius: 50%; }
.b-orange { background: var(--orange); } .b-sun { background: var(--sun); } .b-sky { background: var(--sky); }
.b-coral { background: var(--coral); } .b-plum { background: var(--plum); }

/* ---------- Top bar + header ---------- */
.topbar { background: var(--ink); color: #D8D2E4; font-size: .84rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 40px; }
.topbar p { margin: 0; display: flex; align-items: center; gap: 8px; }
.topbar .icon { width: 15px; height: 15px; color: var(--orange); }
.topbar a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.topbar a:hover { color: #fff; }
.topbar-right { gap: 20px !important; }

.site-header {
    position: sticky; top: 0; z-index: 50;
    border-bottom: 1px solid transparent;
    transition: border-color .2s, box-shadow .2s;
}
/* Blur lives on a pseudo-element: backdrop-filter on the header itself would
   trap the fixed-position mobile menu inside the header box. */
.site-header::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: rgba(251, 246, 238, .92);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 8px 24px -20px rgba(29, 26, 44, .5); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--header-h); }
.brand img { height: 54px; width: auto; }

.nav-toggle {
    display: none; width: 48px; height: 48px; border-radius: 14px;
    border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink);
    align-items: center; justify-content: center; cursor: pointer;
}
.nav-toggle .icon { width: 24px; height: 24px; }
.nav-toggle-close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle-open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle-close { display: block; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.nav-list { display: flex; align-items: center; gap: 4px; }
.nav-list > li { position: relative; }
.nav-list > li > a, .drop-toggle {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 10px 14px; border-radius: 999px;
    font: 600 .98rem/1 var(--font-body); color: var(--ink-2);
    text-decoration: none; background: none; border: 0; cursor: pointer;
    transition: color .2s, background-color .2s;
}
.drop-toggle .icon { width: 16px; height: 16px; transition: transform .2s; }
.nav-list > li > a:hover, .drop-toggle:hover, .has-drop.is-open > .drop-toggle { color: var(--ink); background: var(--paper-2); }
.nav-list > li > a[aria-current="page"], .nav-list > li.is-active > a, .nav-list > li.is-active > .drop-toggle {
    color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line-2);
}
.has-drop.is-open > .drop-toggle .icon { transform: rotate(180deg); }

.drop {
    position: absolute; top: calc(100% + 10px); left: 50%; transform: translate(-50%, 6px);
    min-width: 220px; padding: 10px;
    background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transition: opacity .18s, transform .18s, visibility .18s;
}
.drop::before { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.has-drop.is-open > .drop { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.drop a { display: block; padding: 10px 14px; border-radius: 12px; text-decoration: none; font-weight: 600; }
.drop a:hover, .drop a[aria-current="page"] { background: var(--paper); }
.drop small { display: block; font-weight: 500; color: var(--ink-3); font-size: .82rem; }
.drop-wide { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; width: 600px; left: 0; transform: translate(-20%, 6px); }
.has-drop.is-open > .drop-wide { transform: translate(-20%, 0); }
.drop-course { display: flex !important; align-items: center; gap: 14px; }
.drop-course .course-icon { width: 40px; height: 40px; border-radius: 12px; }
.drop-course .course-icon .icon { width: 22px; height: 22px; }
.drop-side { background: var(--paper); border-radius: 14px; padding: 14px 8px 8px; }
.drop-label { margin: 0 14px 6px; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.drop-side a:hover, .drop-side a[aria-current="page"] { background: var(--card); }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-tight { padding: clamp(48px, 6vw, 72px) 0; }
.section-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head p:not(.eyebrow) { color: var(--ink-2); font-size: 1.125rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.section-head-row .section-head { margin-bottom: 0; }
.section-alt { background: var(--paper-2); }

/* ---------- Home hero ---------- */
.hero { position: relative; padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 8vw, 104px); overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: auto 0 0 0; height: 120px; background: linear-gradient(transparent, var(--paper)); pointer-events: none; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.75rem, 6.3vw, 5.4rem); line-height: .96; font-weight: 750; margin-bottom: 24px; }
.mark { background: linear-gradient(transparent 58%, var(--sun) 58%, var(--sun) 90%, transparent 90%); padding: 0 .06em; margin: 0 -.06em; }
.hero .lead { margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-points li {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 999px;
    background: var(--card); border: 1px solid var(--line);
    font-size: .92rem; font-weight: 600; color: var(--ink-2);
}
.hero-points .icon { width: 18px; height: 18px; color: var(--orange-ink); }

/* ---------- Soroban (interactive abacus) ---------- */
.soroban {
    --rods: 7; --slot: 25px; --bh: 22px;
    position: relative;
    background: var(--ink); color: #fff;
    border-radius: 32px; padding: 24px;
    box-shadow: var(--shadow-lg);
}
.soroban::before {
    content: 'Try me'; position: absolute; top: -16px; right: 28px;
    background: var(--sun); color: var(--ink);
    font: 700 .82rem/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase;
    padding: 9px 14px; border-radius: 999px; transform: rotate(4deg);
    box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .5);
}
.sb-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sb-label { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #ADA6BD; }
.sb-value {
    margin: 2px 0 0; font: 750 clamp(2.2rem, 4.2vw, 3rem)/1 var(--font-display);
    letter-spacing: -0.02em; color: var(--sun); font-variant-numeric: tabular-nums;
}
.sb-frame {
    background: #2A2640;
    border: 10px solid var(--wood);
    border-radius: 18px;
    padding: 4px 6px;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25), inset 0 10px 24px rgba(0, 0, 0, .35);
}
.sb-deck { display: grid; grid-template-columns: repeat(var(--rods), 1fr); }
.sb-rod { position: relative; }
.sb-upper .sb-rod { height: calc(var(--slot) * 2 + 4px); }
.sb-lower .sb-rod { height: calc(var(--slot) * 5 + 4px); }
.sb-rod::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: linear-gradient(90deg, #8E86A2, #C9C2D8, #8E86A2); }
.sb-beam { display: grid; grid-template-columns: repeat(var(--rods), 1fr); align-items: center; height: 12px; margin: 0 -6px; background: var(--wood); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.sb-beam i { justify-self: center; width: 5px; height: 5px; border-radius: 50%; }
.sb-beam i.dot { background: var(--ink); }
.sb-bead {
    position: absolute; left: 50%; top: 2px;
    width: min(46px, 90%); height: var(--bh);
    padding: 0; border: 0; border-radius: 50%;
    background: radial-gradient(120% 90% at 50% 20%, #FFF8EC 0%, #E9DCC6 45%, #B9A88E 100%);
    box-shadow: 0 2px 0 rgba(0, 0, 0, .3);
    transform: translate(-50%, calc(var(--p, 0) * var(--slot)));
    transition: transform .24s cubic-bezier(.3, .75, .35, 1.15), background .2s;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.sb-bead.is-on { background: radial-gradient(120% 90% at 50% 20%, #FFD2A6 0%, var(--orange) 45%, #B85808 100%); }
.sb-bead:hover { filter: brightness(1.08); }
.sb-bead:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 50%; }
.sb-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.sb-hint { margin: 0; font-size: .9rem; color: #ADA6BD; max-width: 30ch; line-height: 1.4; }
.sb-buttons { display: flex; gap: 8px; }

/* ---------- Stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line-2); }
.stats > div { padding: 28px 24px; border-left: 1px solid var(--line); }
.stats > div:first-child { border-left: 0; padding-left: 0; }
.stats strong { display: block; font: 750 clamp(2rem, 3.4vw, 2.8rem)/1 var(--font-display); letter-spacing: -0.03em; margin-bottom: 8px; }
.stats span { color: var(--ink-2); font-size: .98rem; line-height: 1.4; display: block; }

/* ---------- Course cards ---------- */
.course-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.course-grid > :nth-child(-n+2) { grid-column: span 3; }
.course-grid > :nth-child(n+3) { grid-column: span 2; }
.course-card {
    position: relative; isolation: isolate; overflow: hidden;
    display: flex; flex-direction: column;
    padding: 28px; min-height: 300px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    color: var(--ink); text-decoration: none;
    transition: transform .25s, box-shadow .25s, border-color .25s;
}
.course-card::before {
    content: ''; position: absolute; z-index: -1; width: 220px; height: 220px; right: -80px; top: -90px;
    border-radius: 50%; background: var(--c-soft); transition: transform .4s;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--c); }
.course-card:hover::before { transform: scale(1.15); }
.course-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--c-soft); color: var(--c-ink); }
.course-card .course-icon { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--c); }
.course-icon .icon { width: 30px; height: 30px; }
.age-chip { position: absolute; top: 28px; right: 28px; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: .82rem; font-weight: 700; letter-spacing: .02em; }
.course-card h3 { font-size: 1.75rem; margin: 28px 0 10px; }
.course-card p { color: var(--ink-2); flex: 1; margin-bottom: 20px; }
.course-card .link-arrow { color: var(--c-ink); }
.course-grid > :nth-child(-n+2) h3 { font-size: 2.1rem; }

/* ---------- Split / whole brain ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.photo-stack { position: relative; padding: 0 0 18% 12%; }
.photo-stack img { border-radius: var(--radius); box-shadow: var(--shadow); object-fit: cover; }
.photo-stack .ps-main { width: 100%; aspect-ratio: 4 / 3.3; }
.photo-stack .ps-small { position: absolute; left: 0; bottom: 0; width: 52%; aspect-ratio: 1; border: 8px solid var(--paper); }
.photo-stack .ps-tag {
    position: absolute; right: -8px; bottom: 9%; background: var(--card); border-radius: 18px; padding: 14px 18px;
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px; max-width: 250px; font-size: .92rem; line-height: 1.35;
}
.ps-tag strong { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.ps-tag .course-icon { width: 44px; height: 44px; flex: none; }
.brain-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 10px; margin: 28px 0; }
.brain-pair > div { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.brain-pair h3 { font-size: 1.15rem; margin-bottom: 6px; }
.brain-pair p { margin: 0; font-size: .95rem; color: var(--ink-2); line-height: 1.45; }
.brain-plus { align-self: center; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--orange); font: 750 1.4rem/1 var(--font-display); }

/* ---------- Benefits ---------- */
.benefits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.benefits li { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 550; line-height: 1.35; }
.benefits .icon { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--c-soft, #FDE7D3); color: var(--c-ink, #9A4405); stroke-width: 2.6; }
.benefits li span { padding-top: 2px; }

/* ---------- Dark (competition) section ---------- */
.section-dark { background: var(--ink); color: #E9E5F0; position: relative; overflow: hidden; }
.section-dark::before {
    content: ''; position: absolute; inset: 0; opacity: .5; pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 32px 32px;
}
.section-dark .container { position: relative; }
.section-dark h2 { color: #fff; }
.section-dark .eyebrow { color: var(--sun); }
.section-dark .eyebrow::before { background: var(--sun); box-shadow: 22px 0 0 rgba(255, 255, 255, .25); }
.section-dark p { color: #C9C3D6; }
.comp-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.comp-points { display: grid; gap: 14px; margin: 28px 0 32px; }
.comp-points li { display: flex; gap: 14px; align-items: flex-start; }
.comp-points .icon { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: rgba(252, 203, 11, .14); color: var(--sun); }
.comp-points strong { display: block; color: #fff; font-size: 1.05rem; }
.comp-points span { color: #C9C3D6; font-size: .95rem; }
.comp-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.mosaic { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 12px; }
.mosaic li:first-child { grid-column: span 2; grid-row: span 2; }
.mosaic a, .mosaic img { display: block; width: 100%; height: 100%; }
.mosaic img { object-fit: cover; border-radius: 18px; aspect-ratio: 1; }
.mosaic li:first-child img { aspect-ratio: auto; }
.year-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--sun); color: var(--ink); font-weight: 700; font-size: .85rem; margin-bottom: 18px; }
.year-badge .icon { width: 16px; height: 16px; }

/* ---------- Photo grids ---------- */
.photo { display: block; overflow: hidden; border-radius: var(--radius-sm); background: var(--paper-2); position: relative; }
.photo img { width: 100%; transition: transform .5s, filter .3s; }
.photo:hover img { transform: scale(1.04); }
.photo-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.photo-strip img { aspect-ratio: 1; object-fit: cover; }
.photo-strip li:nth-child(even) { transform: translateY(24px); }
.photo-masonry { columns: 4 240px; column-gap: 14px; }
.photo-masonry li { break-inside: avoid; margin-bottom: 14px; }

/* ---------- Visit ---------- */
.visit-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px; align-items: stretch; }
.visit-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); }
.visit-card h3 { font-size: 1.1rem; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.visit-card h3 .icon { color: var(--orange-ink); }
.visit-card > div + div { margin-top: 24px; padding-top: 24px; border-top: 1px dashed var(--line-2); }
.visit-card p { margin: 0; color: var(--ink-2); }
.visit-card a { text-decoration: none; font-weight: 600; color: var(--ink); }
.visit-card a:hover { color: var(--orange-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips li { padding: 6px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: .9rem; font-weight: 600; }
.hours { display: grid; gap: 6px; margin: 0; }
.hours div { display: flex; justify-content: space-between; gap: 12px; }
.hours dt { color: var(--ink-2); }
.hours dd { margin: 0; font-weight: 650; }
.phone-list { display: grid; gap: 4px; }
.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); min-height: 420px; background: var(--paper-2); }
.map-frame iframe { width: 100%; height: 100%; min-height: 420px; border: 0; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--orange); position: relative; overflow: hidden; }
.cta-band::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(rgba(29, 26, 44, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(29, 26, 44, .07) 1px, transparent 1px);
    background-size: 32px 32px;
}
.cta-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-block: clamp(48px, 7vw, 80px); flex-wrap: wrap; }
.cta-inner h2 { margin-bottom: 10px; max-width: 18ch; }
.cta-inner p { margin: 0; max-width: 52ch; color: #3B2A1C; font-size: 1.1rem; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-band .btn-primary { background: var(--ink); color: #fff; }
.cta-band .btn-primary:hover { background: #2E2A43; }
.cta-band .btn-ghost-light { color: var(--ink); border-color: rgba(29, 26, 44, .35); }
.cta-band .btn-ghost-light:hover { border-color: var(--ink); background: rgba(255, 255, 255, .15); }

/* ---------- Inner page hero ---------- */
.page-hero { padding: 28px 0 clamp(48px, 6vw, 72px); border-bottom: 1px solid var(--line); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; font-size: .9rem; color: var(--ink-3); margin-bottom: clamp(28px, 4vw, 48px); }
.crumbs li + li::before { content: '/'; margin-right: 6px; color: var(--line-2); }
.crumbs a { text-decoration: none; color: var(--ink-2); font-weight: 600; }
.crumbs a:hover { color: var(--orange-ink); }
.page-hero-body { display: flex; gap: 28px; align-items: flex-start; }
.page-hero-badge { flex: none; display: grid; place-items: center; width: 88px; height: 88px; border-radius: 26px; background: var(--card); box-shadow: inset 0 0 0 2px var(--c), 8px 8px 0 var(--c-soft); color: var(--c-ink); }
.page-hero-badge .icon { width: 44px; height: 44px; }
.page-hero h1 { margin-bottom: 16px; }
.page-hero .eyebrow { color: var(--c-ink); }
.page-hero .eyebrow::before { background: var(--c); }
.page-hero .lead { max-width: 60ch; margin: 0; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 12px; margin: 36px 0 0; }
.hero-facts > div {
    display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center;
    padding: 14px 20px 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 18px;
}
.hero-facts .icon { grid-row: span 2; width: 38px; height: 38px; padding: 8px; border-radius: 12px; background: var(--c-soft); color: var(--c-ink); }
.hero-facts dt { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.hero-facts dd { margin: 0; font-weight: 700; font-size: 1.05rem; }

/* ---------- Course page layout ---------- */
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 5vw, 72px); align-items: start; }
.glance { position: sticky; top: calc(var(--header-h) + 24px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.glance h2 { font-size: 1.35rem; margin-bottom: 16px; }
.glance dl { margin: 0 0 24px; display: grid; }
.glance dl div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line-2); }
.glance dt { color: var(--ink-3); }
.glance dd { margin: 0; font-weight: 700; text-align: right; }
.glance .btn + .btn { margin-top: 10px; }

.prose { max-width: 70ch; }
.prose > * + h2 { margin-top: 1.6em; }
.prose h2 { font-size: clamp(1.7rem, 2.8vw, 2.2rem); }
.prose h3 { font-size: 1.3rem; margin-top: 1.4em; }
.prose p { color: var(--ink-2); font-size: 1.0938rem; line-height: 1.75; }
.prose p.intro { font-size: 1.25rem; color: var(--ink); line-height: 1.6; }
.prose figure { margin: 32px 0; }
.prose figure img { border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.prose figcaption { font-size: .9rem; color: var(--ink-3); margin-top: 10px; }
.prose .benefits { margin: 20px 0 8px; }
.callout { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--c, var(--orange)); border-radius: var(--radius-sm); padding: 20px 24px; margin: 28px 0; }
.callout p { margin: 0; color: var(--ink); }
.callout strong { font-family: var(--font-display); font-size: 1.15rem; }
.example-sum { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.example-sum div { flex: 1 1 200px; background: var(--ink); color: #fff; border-radius: 18px; padding: 18px 20px; }
.example-sum b { display: block; font: 750 1.9rem/1.1 var(--font-display); color: var(--sun); letter-spacing: -0.02em; }
.example-sum span { font-size: .92rem; color: #C9C3D6; }

/* Timeline (Rubik's sessions) */
.timeline { counter-reset: step; display: grid; gap: 0; margin: 24px 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 21px; top: 12px; bottom: 12px; width: 2px; background: var(--line-2); }
.timeline li { position: relative; display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: start; padding: 12px 0; }
.timeline li::before {
    counter-increment: step; content: counter(step);
    position: relative; display: grid; place-items: center; width: 44px; height: 30px; border-radius: 50%;
    background: var(--c, var(--orange)); color: var(--ink); font: 750 1rem/1 var(--font-display);
    box-shadow: 0 0 0 6px var(--paper);
}
.timeline h3 { font-size: 1.1rem; margin: 4px 0 4px; }
.timeline p { margin: 0; font-size: 1rem; }
.timeline .dur { margin-top: 4px; white-space: nowrap; font-size: .85rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }

/* Abacus tracks */
.tracks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.track { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 36px); display: flex; flex-direction: column; }
.track-age { display: inline-block; font: 750 clamp(2.4rem, 4.5vw, 3.4rem)/1 var(--font-display); letter-spacing: -0.03em; color: var(--c-ink); margin-bottom: 6px; }
.track-age small { font-size: .4em; letter-spacing: 0; color: var(--ink-3); margin-left: 6px; }
.track h3 { font-size: 1.8rem; }
.track > p { color: var(--ink-2); flex: 1; }
.track-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 24px; }
.track-facts div { background: var(--paper); border-radius: 14px; padding: 12px; text-align: center; }
.track-facts b { display: block; font: 750 1.5rem/1.1 var(--font-display); }
.track-facts span { font-size: .82rem; color: var(--ink-3); line-height: 1.3; display: block; }
.level-bar { display: flex; gap: 4px; margin: 0 0 20px; }
.level-bar i { flex: 1; height: 10px; border-radius: 999px; background: var(--c); opacity: .9; }
.level-bar i:nth-child(odd) { opacity: .55; }

/* Mini course list */
.mini-courses { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.mini-course { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; text-decoration: none; transition: border-color .2s, transform .2s; }
.mini-course:hover { border-color: var(--c); transform: translateY(-2px); }
.mini-course .course-icon { width: 46px; height: 46px; border-radius: 14px; flex: none; }
.mini-course .course-icon .icon { width: 24px; height: 24px; }
.mini-course strong { display: block; font-family: var(--font-display); font-size: 1.1rem; line-height: 1.15; }
.mini-course small { color: var(--ink-3); font-weight: 600; }
.mini-course .arrow { margin-left: auto; color: var(--ink-3); }

/* ---------- Tabs (competition years) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tab {
    min-height: 44px; padding: 8px 20px; border-radius: 999px;
    border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink-2);
    font: 700 1rem/1 var(--font-display); cursor: pointer; transition: all .2s;
}
.tab:hover { border-color: var(--ink); color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab small { font: 600 .78rem var(--font-body); opacity: .7; margin-left: 4px; }
.tab-panel[hidden] { display: none; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); }
.panel-head p { margin: 0; color: var(--ink-3); font-weight: 600; }

/* ---------- Video ---------- */
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--ink); box-shadow: var(--shadow-lg); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Rows of videos: portrait clips sit side by side, landscape (YouTube) ones get more width */
.video-shelf { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.video-card { margin: 0; flex: 0 1 300px; min-width: 0; }
.video-card.is-wide { flex: 1 1 440px; max-width: 720px; }
.video-card figcaption { margin-top: 10px; font-weight: 600; color: var(--ink-2); font-size: .95rem; line-height: 1.4; }
.video-card .video-frame { box-shadow: none; border-radius: 18px; }
.video-file { display: block; width: 100%; height: auto; border-radius: 18px; background: var(--ink); box-shadow: var(--shadow); }
.video-lite { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: var(--ink); box-shadow: var(--shadow); }
.video-lite img { width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: transform .4s, opacity .2s; }
.video-lite:hover img { transform: scale(1.03); opacity: 1; }
.video-play {
    position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%;
    display: grid; place-items: center; background: var(--orange); color: var(--ink);
    box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .55); transition: transform .2s;
}
.video-play .icon { width: 28px; height: 28px; margin-left: 4px; }
.video-lite:hover .video-play { transform: scale(1.08); }

/* ---------- Forms ---------- */
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 24px; align-items: start; }
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow); }
.form-card h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 650; font-size: .95rem; }
.field .opt { font-weight: 500; color: var(--ink-3); }
.field input, .field select, .field textarea {
    width: 100%; padding: 13px 16px; font: inherit; color: var(--ink);
    background: var(--paper); border: 1.5px solid var(--line-2); border-radius: 14px;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--orange); background: #fff; box-shadow: 0 0 0 4px rgba(243, 132, 42, .2); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; margin-bottom: 20px; font-weight: 600; }
.notice .icon { width: 22px; height: 22px; margin-top: 1px; }
.notice-ok { background: #E4F5EC; color: #135A35; border: 1px solid #B6E2C9; }
.notice-err { background: #FCE6E2; color: #8C2716; border: 1px solid #F3C1B8; }
.form-note { font-size: .88rem; color: var(--ink-3); margin: 14px 0 0; }

/* ---------- About ---------- */
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.value { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.value .course-icon { margin-bottom: 20px; }
.value h3 { font-size: 1.35rem; }
.value p { color: var(--ink-2); margin: 0; }
.quote-block { font: 650 clamp(1.5rem, 2.8vw, 2.1rem)/1.25 var(--font-display); letter-spacing: -0.02em; max-width: 30ch; margin: 0; }
.quote-block::before { content: '“'; display: block; font-size: 3em; line-height: .6; color: var(--orange); }

.empty-state { text-align: center; background: var(--card); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: clamp(32px, 6vw, 64px); }
.empty-state .icon { width: 48px; height: 48px; margin: 0 auto 16px; color: var(--orange-ink); }
.empty-state p { color: var(--ink-2); max-width: 52ch; margin-inline: auto; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #C9C3D6; padding: clamp(56px, 7vw, 88px) 0 28px; font-size: .98rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr .8fr .8fr 1.3fr; gap: 40px; }
.footer-logo { display: inline-block; background: #fff; border-radius: 18px; padding: 10px 16px; margin-bottom: 20px; }
.footer-logo img { height: 64px; width: auto; }
.footer-brand p { max-width: 34ch; }
.footer-title { font: 700 .8rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--sun); margin-bottom: 18px; }
.footer-links { display: grid; gap: 10px; }
.footer-links a, .footer-contact a { color: #E9E5F0; text-decoration: none; }
.footer-links a:hover, .footer-contact a:hover { color: var(--orange); }
.footer-contact p { display: flex; gap: 12px; margin-bottom: 14px; line-height: 1.5; }
.footer-contact .icon { margin-top: 3px; color: var(--orange); }
.socials { display: flex; gap: 10px; margin-top: 20px; }
.socials a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .2); color: #fff; transition: background-color .2s, border-color .2s; }
.socials a:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .88rem; color: #9D96AE; }
.footer-bottom p { margin: 0; }

/* ---------- Lightbox ---------- */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(16, 14, 26, .94); color: #fff; }
.lightbox::backdrop { background: rgba(16, 14, 26, .6); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 12px; padding: 64px 72px; }
.lightbox img { max-width: min(92vw, 1600px); max-height: calc(100vh - 160px); width: auto; height: auto; border-radius: 12px; }
.lightbox figcaption { font-size: .92rem; color: #C9C3D6; }
.lb-btn { position: fixed; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; transition: background-color .2s; }
.lb-btn:hover { background: var(--orange); color: var(--ink); }
.lb-btn .icon { width: 24px; height: 24px; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; margin-top: -26px; }
.lb-next { right: 16px; top: 50%; margin-top: -26px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
    .course-grid { grid-template-columns: repeat(2, 1fr); }
    .course-grid > * { grid-column: auto !important; }
    .course-grid > :last-child:nth-child(odd) { grid-column: 1 / -1 !important; }
    .mini-courses { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1023px) {
    :root { --header-h: 68px; }
    .brand img { height: 46px; }
    .nav-toggle { display: inline-flex; }
    .site-nav {
        position: fixed; left: 0; right: 0; top: var(--nav-top, var(--header-h)); bottom: 0;
        flex-direction: column; align-items: stretch; gap: 20px;
        padding: 20px var(--gutter) 32px; overflow-y: auto;
        background: var(--paper); border-top: 1px solid var(--line);
        opacity: 0; visibility: hidden; transform: translateY(-8px);
        transition: opacity .2s, transform .2s, visibility .2s;
    }
    .site-nav.is-open { opacity: 1; visibility: visible; transform: none; }
    .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
    .nav-list > li > a, .drop-toggle { width: 100%; justify-content: space-between; padding: 16px 12px; font-size: 1.15rem; border-radius: 14px; }
    .drop, .drop-wide {
        position: static; transform: none !important; width: auto; min-width: 0;
        box-shadow: none; border: 0; border-radius: 0; padding: 0 0 8px 8px; background: transparent;
        display: none; opacity: 1; visibility: visible;
    }
    .has-drop.is-open > .drop { display: block; }
    .drop-wide { grid-template-columns: 1fr; }
    .has-drop.is-open > .drop-wide { display: grid; }
    .drop::before { display: none; }
    .drop-side { background: var(--card); }
    .nav-cta { width: 100%; }
    body.nav-open { overflow: hidden; }

    .hero-grid, .split, .comp-grid, .visit-grid, .contact-grid, .course-layout { grid-template-columns: 1fr; }
    .hero-visual { max-width: 520px; width: 100%; margin-inline: auto; }
    .glance { position: static; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stats > div:nth-child(3) { border-left: 0; padding-left: 0; }
    .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
    .values { grid-template-columns: 1fr; }
    .photo-strip { grid-template-columns: repeat(3, 1fr); }
    .photo-strip li:nth-child(even) { transform: none; }
    .photo-stack { max-width: 560px; }
}

@media (max-width: 720px) {
    :root { --gutter: 16px; }
    body { font-size: 1rem; }
    .topbar-inner > p:first-child { display: none; }
    .topbar-inner { justify-content: center; }
    .course-grid, .tracks, .benefits, .mini-courses, .footer-grid, .form-grid { grid-template-columns: 1fr; }
    .course-grid > :last-child:nth-child(odd) { grid-column: auto !important; }
    .course-card { min-height: 0; }
    .brain-pair { grid-template-columns: 1fr; }
    .brain-plus { justify-self: center; }
    .stats > div { padding: 20px 12px 20px 0; }
    .stats > div:nth-child(even) { padding-left: 16px; }
    .page-hero-body { flex-direction: column; gap: 20px; }
    .page-hero-badge { width: 68px; height: 68px; border-radius: 20px; }
    .page-hero-badge .icon { width: 34px; height: 34px; }
    .timeline li { grid-template-columns: 44px 1fr; }
    .timeline .dur { grid-column: 2; justify-self: start; }
    .video-shelf { gap: 12px; }
    .video-card { flex-basis: calc(50% - 6px); }
    .video-card.is-wide { flex-basis: 100%; }
    .photo-masonry { columns: 2; column-gap: 10px; }
    .photo-masonry li { margin-bottom: 10px; }
    .lightbox figure { padding: 64px 8px 80px; }
    .lb-prev, .lb-next { top: auto; bottom: 16px; margin-top: 0; }
    .lb-prev { left: calc(50% - 64px); } .lb-next { right: calc(50% - 64px); }
    .soroban { padding: 18px; border-radius: 26px; }
    .sb-frame { border-width: 8px; }
    .photo-stack .ps-tag { right: 0; }
    .cta-actions .btn { flex: 1 1 auto; }
    .footer-bottom { flex-direction: column; }
}

@media (max-width: 400px) {
    .soroban { --slot: 22px; --bh: 19px; }
    .hero-actions .btn { flex: 1 1 100%; }
}
