:root {
    --primary: #0a1628;
    --secondary: #1e3a5f;
    --accent: #c9a227;
    --accent-light: #e8d5a3;
    --glass: rgba(255,255,255,0.05);
    --glass-border: rgba(255,255,255,0.1);
    --text: #ffffff;
    --muted: rgba(255,255,255,0.74);
    --footer: #050d1a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', 'Noto Sans CJK SC', 'Microsoft YaHei', sans-serif;
    background: var(--primary);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--primary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, select { font: inherit; }
a, button, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 4px; }
.skip-link {
    position: fixed; inset: 12px auto auto 12px; z-index: 2000;
    padding: 10px 16px; color: var(--primary); background: var(--accent-light);
    border-radius: 6px; font-weight: 700; text-decoration: none;
    transform: translateY(-180%); transition: transform .2s ease-out;
}
.skip-link:focus { transform: translateY(0); }
[dir="rtl"] .skip-link { inset: 12px 12px auto auto; }
.container { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }

/* Main homepage navigation */
.navbar {
    position: relative; z-index: 1000;
    background: rgba(10,22,40,0.95); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border); padding: 0 2rem;
}
.nav-container {
    max-width: 1400px; margin: 0 auto; display: flex; justify-content: space-between;
    align-items: center; min-height: 82px; padding: .35rem 0; row-gap: .55rem; flex-wrap: wrap;
}
.logo {
    font-family: 'Playfair Display', Georgia, 'Noto Serif CJK SC', serif;
    font-size: 1.4rem; font-weight: 700; color: var(--accent); text-decoration: none;
    display: flex; align-items: center; gap: .65rem; line-height: 1.1; min-height: 58px;
}
.logo-image {
    display: block; width: 58px; height: 58px; object-fit: cover; border-radius: 50%;
    flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(201,162,39,.35);
}
.logo span { white-space: nowrap; }
.nav-links { display: flex; gap: 1.5rem; list-style: none; align-items: center; }
.nav-links a {
    color: var(--text); text-decoration: none; font-weight: 500; font-size: .85rem;
    transition: color .25s; min-height: 44px; display: inline-flex; align-items: center;
}
.nav-links a:hover { color: var(--accent); }
.nav-controls { display: flex; gap: .8rem; align-items: center; }
.lang-select, .currency-select {
    background: var(--glass); border: 1px solid var(--glass-border); color: var(--text);
    padding: .4rem .6rem; border-radius: 6px; font-size: .85rem; cursor: pointer; outline: none;
}
.lang-select option, .currency-select option { background: var(--primary); color: var(--text); }
.flag-select-native {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
    margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important;
    white-space: nowrap !important; border: 0 !important;
}
.flag-select { position: relative; display: inline-block; }
.flag-select-button {
    background: var(--glass); border: 1px solid var(--glass-border); color: var(--text);
    padding: .4rem .6rem; border-radius: 6px; font: inherit; font-size: .85rem; cursor: pointer;
    outline: none; min-height: 44px; display: flex; align-items: center; gap: .45rem;
}
.flag-select-button:hover, .flag-select-button:focus-visible { border-color: var(--accent); }
.flag-select-button img, .flag-select-option img {
    width: 22px; height: 16px; object-fit: cover; border-radius: 2px; flex: 0 0 auto;
    box-shadow: 0 0 0 1px rgba(255,255,255,.15);
}
.flag-select-label { white-space: nowrap; }
.flag-select-chevron { font-size: .65rem; margin-inline-start: .15rem; transition: transform .2s; }
.flag-select.open .flag-select-chevron { transform: rotate(180deg); }
.flag-select-menu {
    position: absolute; top: calc(100% + 6px); right: 0; min-width: 178px;
    max-height: min(380px,70vh); overflow-y: auto; background: #0d1f3c;
    border: 1px solid var(--glass-border); border-radius: 8px; padding: .35rem;
    z-index: 1600; box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
[dir="rtl"] .flag-select-menu { right: auto; left: 0; }
.flag-select-menu[hidden] { display: none; }
.flag-select-option {
    display: flex; width: 100%; min-height: 44px; align-items: center; gap: .55rem;
    background: transparent; color: var(--text); border: 0; border-radius: 4px;
    padding: .5rem .55rem; font: inherit; font-size: .85rem; text-align: left; cursor: pointer;
}
[dir="rtl"] .flag-select-option { text-align: right; }
.flag-select-option:hover, .flag-select-option:focus-visible { background: rgba(201,162,39,.18); outline: none; }
.flag-select-option[aria-selected="true"] { color: var(--accent-light); background: rgba(201,162,39,.1); }

/* Main homepage hero and buttons */
.hero {
    min-height: calc(100vh - 82px); min-height: calc(100svh - 82px);
    display: flex; align-items: center; justify-content: center; position: relative;
    overflow: hidden; padding: 70px 0; isolation: isolate;
}
.hero-bg {
    position: absolute; inset: 0; z-index: -1;
    background-image: linear-gradient(90deg,rgba(10,22,40,.92) 0%,rgba(10,22,40,.76) 48%,rgba(10,22,40,.6) 100%), var(--hero-image);
    background-position: center; background-size: cover; background-repeat: no-repeat;
}
[dir="rtl"] .hero-bg {
    background-image: linear-gradient(-90deg,rgba(10,22,40,.92) 0%,rgba(10,22,40,.76) 48%,rgba(10,22,40,.6) 100%), var(--hero-image);
}
.hero-content {
    position: relative; z-index: 2; text-align: center; width: min(960px,100%);
    padding: 2rem; text-shadow: 0 2px 24px rgba(0,0,0,.45);
}
.hero-badge {
    display: inline-block; background: var(--glass); border: 1px solid var(--glass-border);
    padding: .5rem 1.5rem; border-radius: 50px; font-size: .9rem; margin-bottom: 2rem;
    backdrop-filter: blur(10px); overflow-wrap: anywhere;
}
.hero h1 {
    font-family: 'Playfair Display', Georgia, 'Noto Serif CJK SC', serif;
    font-size: clamp(3rem,6vw,4.5rem); font-weight: 700; margin-bottom: 1.5rem;
    line-height: 1.1; letter-spacing: -.025em; overflow-wrap: anywhere;
}
.hero h1 span { color: var(--accent); }
.hero-description {
    font-size: clamp(1.05rem,2vw,1.3rem); color: rgba(255,255,255,.86);
    margin: 0 auto 2.5rem; max-width: 760px; line-height: 1.65;
}
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-primary, .btn-secondary {
    min-height: 52px; display: inline-flex; align-items: center; justify-content: center;
    padding: 1rem 2.5rem; border-radius: 50px; text-decoration: none; font-weight: 600;
    transition: transform .25s,box-shadow .25s,background .25s,color .25s,border-color .25s;
    cursor: pointer; font-size: 1rem; text-align: center;
}
.btn-primary {
    background: linear-gradient(135deg,#c9a227,#e8d5a3); color: var(--primary); border: 0;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(201,162,39,.3); }
.btn-secondary { background: transparent; color: var(--text); border: 2px solid var(--accent); }
.btn-secondary:hover { background: var(--accent); color: var(--primary); }

/* Sections and class cards use the homepage division-card system */
.section { padding: 5rem 0; }
.section-shade { background: linear-gradient(180deg,var(--primary) 0%,#0d1f3c 100%); }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2, .contact-cta h2 {
    font-family: 'Playfair Display', Georgia, 'Noto Serif CJK SC', serif;
    font-size: clamp(2rem,4vw,2.8rem); margin-bottom: 1rem; line-height: 1.2;
}
.section-header p { color: var(--muted); font-size: 1.05rem; max-width: 760px; margin: 0 auto; }
.image-notice { color: rgba(255,255,255,.64) !important; font-size: .85rem !important; margin-top: 1.25rem !important; }
.divisions-grid {
    max-width: 1400px; margin: 0 auto; display: grid;
    grid-template-columns: repeat(auto-fit,minmax(min(100%,300px),1fr)); gap: 2rem;
}
.division-card {
    min-width: 0; background: var(--glass); border: 1px solid var(--glass-border);
    border-radius: 16px; padding: 2rem; transition: transform .25s,border-color .25s,box-shadow .25s;
    display: flex; flex-direction: column; scroll-margin-top: 24px;
}
.division-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 20px 40px rgba(0,0,0,.3); }
.division-media {
    display: block; margin: -2rem -2rem 1.5rem; aspect-ratio: 16/9; overflow: hidden;
    border-radius: 15px 15px 0 0; background: #0d1f3c;
}
.division-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.division-media:hover img { transform: scale(1.025); }
.division-icon {
    width: 60px; height: 60px; background: linear-gradient(135deg,#c9a227,#e8d5a3);
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; color: var(--primary); margin-bottom: 1.2rem; flex: 0 0 auto;
}
.division-card h3 { font-size: 1.3rem; margin-bottom: .6rem; line-height: 1.35; overflow-wrap: anywhere; }
.division-card > p { color: var(--muted); font-size: .94rem; line-height: 1.75; margin-bottom: 1.5rem; }
.division-card .btn-primary { margin-top: auto; width: 100%; padding-inline: 1.25rem; }
.class-number { color: var(--accent-light); font-size: .78rem; font-weight: 700; letter-spacing: .14em; display: block; margin-bottom: .75rem; }

.class-overview { background: var(--primary); }
.overview-panel {
    max-width: 900px; margin: 0 auto; padding: 2.5rem; background: var(--glass);
    border: 1px solid var(--glass-border); border-radius: 16px;
}
.overview-panel h2 {
    font-family: 'Playfair Display', Georgia, 'Noto Serif CJK SC', serif;
    font-size: clamp(2rem,4vw,2.8rem); margin-bottom: 1.25rem;
}
.overview-panel > p { color: var(--muted); font-size: 1.04rem; max-width: 75ch; }

.contact-cta {
    padding: 4.5rem 0; background: linear-gradient(135deg,var(--primary) 0%,#0d1f3c 100%);
    border-top: 1px solid var(--glass-border);
}
.contact-cta-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center; }
.contact-cta h2 { margin-bottom: .75rem; }
.contact-cta p { color: var(--muted); max-width: 680px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: flex-end; }

/* Main homepage footer, with the requested public contact column */
.footer { background: var(--footer); padding: 3rem 2rem 2rem; border-top: 1px solid var(--glass-border); }
.footer-grid {
    max-width: 1400px; margin: 0 auto 2rem; display: grid;
    grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 2rem;
}
.footer-col { min-width: 0; }
.footer-col h4 { color: var(--accent); margin-bottom: 1rem; font-size: 1rem; }
.footer-col p { color: var(--muted); font-size: .88rem; line-height: 1.75; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .55rem; }
.footer-col ul li a {
    color: var(--muted); text-decoration: none; font-size: .85rem; transition: color .25s;
    min-height: 32px; display: inline-flex; align-items: center; overflow-wrap: anywhere;
}
.footer-col ul li a:hover { color: var(--accent); }
.footer-contact li { margin-bottom: .8rem; }
.footer-contact strong { display: block; color: var(--text); font-size: .8rem; font-weight: 600; }
.footer-contact a { overflow-wrap: anywhere; }
.footer-bottom {
    max-width: 1400px; margin: 0 auto; padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border); display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 1rem;
}
.footer-bottom p { color: rgba(255,255,255,.62); font-size: .85rem; }
.footer-home { color: var(--accent-light); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.footer-home:hover { color: var(--text); }

[dir="rtl"] .class-number { letter-spacing: 0; }
[dir="rtl"] .contact-actions { justify-content: flex-start; }

@media (max-width: 1100px) {
    .nav-links { gap: .9rem; }
    .nav-links a { font-size: .78rem; }
    .contact-cta-inner { grid-template-columns: 1fr; gap: 1.75rem; }
    .contact-actions { justify-content: flex-start; }
}
@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-controls { margin-inline-start: auto; }
}
@media (max-width: 768px) {
    .container { width: min(100% - 40px,1200px); }
    .navbar { padding: 0 1rem; }
    .nav-container { min-height: 76px; }
    .logo { font-size: 1.08rem; min-height: 46px; }
    .logo-image { width: 46px; height: 46px; }
    .nav-controls { gap: .5rem; }
    .hero { min-height: 680px; padding: 54px 0; }
    .hero-content { padding: 1rem; }
    .hero h1 { font-size: clamp(2.35rem,10vw,3.4rem); }
    .hero-description { font-size: 1.02rem; }
    .section { padding: 4rem 0; }
    .divisions-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .division-card { padding: 1.5rem; }
    .division-media { margin: -1.5rem -1.5rem 1.5rem; }
    .overview-panel { padding: 1.5rem; }
    .contact-cta { padding: 3.5rem 0; }
    .footer { padding: 2.5rem 1.25rem 1.5rem; }
    .footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.75rem 1.25rem; }
    .footer-col:first-child, .footer-contact { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .nav-container { justify-content: center; }
    .logo { margin-inline-end: auto; font-size: .98rem; }
    .logo-image { width: 42px; height: 42px; }
    .nav-controls { width: 100%; justify-content: flex-end; }
    .flag-select-button { font-size: .8rem; }
    .hero { min-height: 640px; }
    .hero-badge { font-size: .78rem; padding-inline: 1rem; }
    .hero-buttons { flex-direction: column; align-items: stretch; }
    .btn-primary, .btn-secondary { width: 100%; padding-inline: 1.25rem; }
    .contact-actions { flex-direction: column; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-col:first-child, .footer-contact { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
    .division-card:hover, .btn-primary:hover { transform: none; }
}
