:root {
    --ink: #162137;
    --blue: #3155e7;
    --paper: #ffffff;
    --muted: #5c7192;
    --line: #dce4f2;
    --soft: #f5f7fc;
    --light-blue: #dce8ff;
    --radius: 16px;
}

body {
    font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

a:focus-visible, button:focus-visible, summary:focus-visible {
    outline-color: var(--blue);
}

.wrap { max-width: 1280px; }
.nav { min-height: 96px; height: auto; gap: clamp(16px, 2.1vw, 32px); }
.brand picture, .brand img { display: block; }
.brand img { width: 320px; height: auto; }
.nav > a:not(.brand) { flex: none; font-size: .9375rem; font-weight: 600; }
.pill { border-color: var(--blue); color: var(--blue); }
.pill:hover { background: var(--soft); }

.brand-hero {
    grid-template-columns: minmax(0, 1.13fr) minmax(0, 1fr);
    gap: clamp(34px, 5.5vw, 84px);
    padding: clamp(48px, 6vw, 92px) 0 58px;
}
.hero-location { color: var(--blue); font-weight: 650; margin-bottom: 13px; }
.brand-hero h1 { font-size: clamp(2.5rem, 5.2vw, 4.6rem); letter-spacing: -.045em; margin: 0 0 14px; }
.hero-subtitle { font-size: clamp(1.1rem, 2vw, 1.5rem); font-weight: 650; margin-bottom: 17px; }
.brand-hero .intro { max-width: 32em; font-size: 1.0625rem; }
.brand-hero .buttons { margin-bottom: 28px; }
.hero-credentials { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0; margin: 0; list-style: none; color: var(--muted); font-size: .875rem; }
.hero-credentials li { padding-left: 12px; border-left: 2px solid var(--light-blue); }
.hero-portrait {
    position: relative;
    display: grid;
    align-items: end;
    padding: 26px 26px 0;
    margin: 0;
    overflow: hidden;
    border-radius: 22px;
    background: var(--blue) url('../img/brand-pattern-blue.svg') center / cover;
}
.hero-portrait img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 12px 12px 0 0; }
.hero-portrait figcaption { color: white; display: flex; align-items: baseline; gap: 12px; padding: 12px 0; }
.hero-portrait strong { font-size: 1rem; }
.hero-portrait span { font-size: .875rem; }

.btn { border-radius: 8px; background: var(--blue); border-color: var(--blue); font-weight: 600; }
.btn:hover { background: #2747ca; border-color: #2747ca; }
.btn.secondary { color: var(--blue); border-color: var(--line); background: white; }
.btn.secondary:hover { background: var(--soft); border-color: var(--blue); }
section { padding: clamp(42px, 6vw, 76px) 0; }
.section-head h2, .course-detail h2 { margin-top: 0; }
.section-head p { font-size: 1rem; max-width: 36ch; }
.course-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.course-card, .outcome { border-radius: var(--radius); background: white; }
.course-card { grid-column: span 2; padding: 26px; }
.course-card:nth-child(n+4) { grid-column: span 3; }
.course-card h3 { font-size: 1.3rem; }
.course-card p { font-size: .9375rem; line-height: 1.7; }
.course-card .course-codes { color: var(--blue); font-weight: 600; }
.course-card .bottom { font-size: .9375rem; font-weight: 650; color: var(--blue); }
.course-card:hover, .outcome:hover { border-color: var(--blue); }

.result-card img { margin-bottom: 14px; border-radius: 9px; }
.result-label { display: block; color: var(--blue); font-size: .875rem; font-weight: 650; line-height: 1.5; }
.home-results-slider .result-card h3, .results-masonry .result-card h2 { margin: 10px 0; }
.result-card .read-story { font-weight: 600; font-size: .875rem; }
.result-card p { font-size: .9375rem; }
.results-slider { padding: 4px 4px 18px; scrollbar-color: #9eb3f2 var(--soft); }
.results-toolbar .text-link { margin-left: 4px; }

.step { border-top-color: var(--blue); }
.step p { font-size: .9375rem; }
.lesson { margin-top: 30px; padding: 24px; background: var(--soft); border-radius: var(--radius); }
.board { padding: 24px; border-radius: 12px; }
.board small { color: var(--light-blue); font: inherit; font-size: .875rem; }
.board .equation { margin: 12px 0; font-size: clamp(1.1rem, 2vw, 1.55rem); }
.teacher-profile { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 60px); }
.teacher-profile p { color: var(--muted); }
.profile-facts { display: grid; gap: 12px; margin: 0; }
.profile-facts div { display: grid; grid-template-columns: 5em 1fr; gap: 12px; padding: 12px 16px; background: var(--soft); border-radius: 9px; }
.profile-facts dt { color: var(--muted); font-size: .875rem; }
.profile-facts dd { margin: 0; font-size: .9375rem; font-weight: 600; }
.world-figure { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.world-figure figcaption { font-size: .875rem; color: var(--muted); }

.guide-feature { display: flex; align-items: center; justify-content: space-between; gap: 18px 30px; padding: 24px; border-radius: var(--radius); background: var(--soft); }
.guide-feature p { margin: 0; color: var(--muted); }
.guide-feature .text-link { flex: none; }
.guide-byline { color: var(--muted); }
.guide-article p a { display: inline; text-decoration: underline; color: var(--blue); margin-inline-start: .35em; }
#faq details:last-child { border-bottom: 1px solid var(--line); }
#faq summary { font-size: 1.0625rem; }
#faq details p { font-size: 1rem; }

.course-detail { padding-top: 30px; }
.course-detail .breadcrumbs { margin-bottom: 18px; font-size: .875rem; }
.course-detail-hero { background: var(--soft); border-radius: 20px; border: 1px solid var(--line); padding: clamp(24px, 5vw, 56px); }
.course-detail-hero h1 { margin: 0 0 12px; font-size: clamp(2.2rem, 4.3vw, 3.75rem); }
.course-detail-summary { max-width: 44em; color: var(--muted); font-size: 1.0625rem; }
.course-detail-codes { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 20px 0 25px; }
.course-detail-codes li { background: var(--light-blue); color: var(--ink); border-radius: 999px; padding: 5px 13px; font-size: .875rem; }
.course-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.course-detail h2 + .course-detail-grid { margin-top: 24px; }
.course-detail-panel { min-width: 0; border: 1px solid var(--line); padding: 24px; border-radius: var(--radius); }
.course-detail-panel h2 { font-size: 1.4rem; }
.course-detail-panel h3 { font-size: 1.125rem; }
.course-detail-panel p, .course-detail-panel li { color: var(--muted); }
.course-detail-panel p, .course-detail-panel ul { margin-bottom: 0; }
.course-detail-panel ul, .course-detail-links ul { padding-left: 1.2em; }
.course-detail-links a { color: var(--blue); text-decoration: underline; }
.guide-article .course-detail-links { display: flex; flex-wrap: wrap; gap: 14px 24px; margin-top: 30px; }

.contact { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); }
.contact h2 { margin-top: 0; }
.qr-card { border-radius: 12px; }
.mobile-contact { background: var(--blue); }

@media (max-width: 900px) {
    .brand-hero { gap: 28px; }
    .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .course-card, .course-card:nth-child(n+4) { grid-column: auto; }
}
@media (max-width: 760px) {
    .nav { min-height: 70px; gap: 16px; }
    .brand img { width: 40px; height: 40px; }
    .brand-hero, .teacher-profile { grid-template-columns: 1fr; }
    .brand-hero { padding-top: 34px; }
    .hero-portrait { width: min(100%, 500px); padding: 16px 16px 0; }
    .hero-portrait img { aspect-ratio: 4 / 3; object-position: center 25%; }
}
@media (max-width: 540px) {
    .wrap { padding-inline: 18px; }
    .nav { gap: 10px; }
    .nav > a:not(.brand) { font-size: .8125rem; }
    .hero-credentials { font-size: .875rem; }
    .course-grid, .course-detail-grid { grid-template-columns: 1fr; }
    .course-card, .course-detail-panel { padding: 20px; }
    .guide-feature { align-items: flex-start; flex-direction: column; }
    .lesson { padding: 16px; }
    .world-figure { padding: 12px; }
}

.school-list { margin-top: 18px; }
.school-list p { max-width: 100%; }
