:root {
  --primary: #2e3192;
  --primary-dark: #1c1e5e;
  --primary-soft: #eceefb;
  --accent: #e9a722;
  --accent-soft: #fdf3dc;
  --text: #1c1f33;
  --muted: #5f6478;
  --bg: #ffffff;
  --bg-soft: #f6f5f1;
  --border: #e6e4dd;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 22, 60, .04), 0 8px 28px rgba(20, 22, 60, .07);
  --shadow-hover: 0 2px 4px rgba(20, 22, 60, .06), 0 18px 40px rgba(20, 22, 60, .12);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  /* 8-point star from the school emblem, used as a subtle background pattern */
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.09' stroke-width='1.2'%3E%3Crect x='22' y='22' width='28' height='28'/%3E%3Crect x='22' y='22' width='28' height='28' transform='rotate(45 36 36)'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
h1, h2 { font-family: var(--serif); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
h3 { font-weight: 650; line-height: 1.3; letter-spacing: -.01em; }

.container { width: min(1160px, 100% - 32px); margin-inline: auto; }
.section { padding: 96px 0; }
.section-soft { background: var(--bg-soft); }
.section-title { text-align: center; max-width: 660px; margin: 0 auto 52px; }
.section-title h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); margin-bottom: 14px; }
.section-title p { color: var(--muted); font-size: 1.05rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; color: #b07a0c; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; margin-bottom: 12px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); }
.section-title .eyebrow::after { content: ""; width: 22px; height: 2px; background: var(--accent); }

/* Buttons */
.btn {
  display: inline-block; background: var(--accent); color: #1c1f33; font-weight: 600;
  padding: 14px 28px; border-radius: 999px; border: none; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s; font-size: 1rem; font-family: inherit;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(233, 167, 34, .35); background: #f0b43a; }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.6); }
.btn-outline:hover { background: rgba(255,255,255,.12); box-shadow: none; }
.btn-small { padding: 9px 18px; font-size: .9rem; }

/* Header */
#site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border);
}
.nav-bar { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1rem; line-height: 1.2; color: var(--primary-dark); }
.logo span { max-width: 220px; }
.logo-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--primary); flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a:not(.btn) { color: var(--text); font-weight: 500; font-size: .95rem; position: relative; }
.nav-links a:not(.btn):hover, .nav-links a.active { color: var(--primary); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px; background: var(--accent); border-radius: 2px;
}
.lang-switch {
  background: none; border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px;
  font: inherit; font-size: .88rem; font-weight: 500; color: var(--text); cursor: pointer;
}
.lang-switch:hover { border-color: var(--primary); color: var(--primary); }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; }

/* Hero */
.hero {
  position: relative; color: #fff; padding: 120px 0 170px;
  background:
    linear-gradient(100deg, rgba(20,22,70,.94) 0%, rgba(28,30,94,.82) 45%, rgba(28,30,94,.25) 100%),
    url("../images/chemistry-class.jpg") center 30%/cover;
}
.hero::after {
  content: ""; position: absolute; inset: 0; background: var(--pattern); pointer-events: none;
  mask-image: linear-gradient(90deg, #000 0%, transparent 55%); -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 55%);
}
.hero .container { position: relative; z-index: 1; }
.hero .eyebrow { color: var(--accent); }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); max-width: 720px; margin-bottom: 22px; }
.hero p { font-size: 1.15rem; max-width: 560px; opacity: .88; margin-bottom: 36px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.page-hero {
  position: relative; overflow: hidden; color: #fff; padding: 84px 0 80px; text-align: center;
  background: var(--pattern), linear-gradient(120deg, var(--primary-dark), var(--primary));
}
.page-hero h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); margin-bottom: 12px; }
.page-hero p { opacity: .85; max-width: 620px; margin: 0 auto; font-size: 1.08rem; }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); margin-top: -72px; position: relative; z-index: 2;
  background: #fff; border-radius: 20px; box-shadow: var(--shadow-hover); overflow: hidden;
}
.stat { padding: 30px 20px; text-align: center; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat strong { display: block; font-family: var(--serif); font-size: 2.4rem; line-height: 1.1; color: var(--primary); margin-bottom: 6px; }
.stat span { color: var(--muted); font-size: .92rem; }

/* Graduate results (home page achievements) */
.grad-results {
  display: grid; grid-template-columns: 1fr 2fr; margin-bottom: 28px; border-radius: 20px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow);
}
.grad-hero {
  display: flex; flex-direction: column; justify-content: center; padding: 36px 32px; color: #fff;
  background: var(--pattern), linear-gradient(120deg, var(--primary-dark), var(--primary));
}
.grad-hero strong { font-family: var(--serif); font-size: clamp(3rem, 6vw, 4.2rem); line-height: 1; color: var(--accent); }
.grad-hero span { margin-top: 10px; font-size: 1.05rem; opacity: .9; }
.grad-stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.grad-stats > div { display: flex; flex-direction: column; justify-content: center; padding: 28px 18px; text-align: center; }
.grad-stats > div + div { border-left: 1px solid var(--border); }
.grad-stats strong { font-family: var(--serif); font-size: 2.2rem; line-height: 1.1; color: var(--primary); margin-bottom: 6px; }
.grad-stats span { color: var(--muted); font-size: .9rem; }

/* Cards & grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  border: 1px solid rgba(230, 228, 221, .7); transition: transform .2s, box-shadow .2s;
}
.card-body { padding: 26px; }
.card h3 { margin-bottom: 8px; font-size: 1.15rem; }
.card p { color: var(--muted); font-size: .97rem; }
.feature { padding: 32px; }
.feature:hover, .news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.feature-icon {
  width: 52px; height: 52px; border-radius: 14px; background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; margin-bottom: 20px; flex-shrink: 0;
}
.feature-icon svg { width: 26px; height: 26px; }
.feature:nth-child(3n+2) .feature-icon { background: var(--accent-soft); color: #a8700a; }
.tag {
  display: inline-block; background: var(--accent-soft); color: #8a5b06; font-size: .8rem;
  font-weight: 600; padding: 4px 12px; border-radius: 999px; margin-bottom: 12px;
}

/* Split layout */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split > img, .split-media > img { border-radius: 20px; box-shadow: var(--shadow-hover); width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.split-media { position: relative; isolation: isolate; }
.split-media::before {
  content: ""; position: absolute; inset: 24px -24px -24px 24px; border-radius: 20px; z-index: -1;
  background: var(--pattern), var(--primary);
}
.badge {
  position: absolute; left: -20px; bottom: 28px; display: flex; align-items: center; gap: 12px;
  background: #fff; padding: 12px 18px 12px 12px; border-radius: 14px; box-shadow: var(--shadow-hover);
  max-width: 300px; font-size: .85rem; font-weight: 600; color: var(--primary-dark); line-height: 1.3;
}
.badge img { width: 44px; height: 44px; border-radius: 10px; }
.split h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); margin-bottom: 18px; }
.split p { color: var(--muted); margin-bottom: 16px; }
.check-list { list-style: none; margin: 22px 0 30px; }
.check-list li { padding-left: 34px; position: relative; margin-bottom: 12px; }
.check-list li::before {
  content: "✓"; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: .72rem; display: grid; place-items: center; font-weight: 700;
}

/* Photo cards */
.news-card img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }

/* CTA */
.cta {
  background: var(--pattern), linear-gradient(120deg, var(--primary-dark), var(--primary));
  color: #fff; border-radius: 24px; padding: 64px 40px; text-align: center;
}
.cta h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: 12px; }
.cta p { opacity: .85; margin: 0 auto 30px; max-width: 560px; }

/* Admission steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; }
.step { background: #fff; padding: 30px 26px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(230,228,221,.7); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  display: block; font-family: var(--serif); font-size: 2.2rem; font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 16px;
}
.step h3 { font-size: 1.1rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: .95rem; }

.notice {
  display: flex; gap: 18px; align-items: center; background: var(--accent-soft); border: 1px solid #f3dca8;
  border-radius: var(--radius); padding: 22px 26px; margin-bottom: 64px;
}
.notice .feature-icon { margin: 0; background: #fff; color: #a8700a; }
.notice strong { display: block; font-size: 1.05rem; margin-bottom: 2px; }
.notice p { color: var(--muted); }

/* Teachers */
.teacher-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.teacher-card { display: grid; grid-template-columns: 210px 1fr; }
.teacher-card img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; object-position: top; background: var(--primary-soft); }
.teacher-card .card-body { padding: 28px; }
.teacher-card h3 { font-family: var(--serif); font-size: 1.35rem; }
.teacher-card p { font-size: .93rem; }

/* Table */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 16px 22px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--primary); color: #fff; font-weight: 600; font-size: .92rem; }
td:last-child { font-weight: 700; color: var(--primary); }
tr:last-child td { border-bottom: none; }

.dates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 64px; }
.date-box { background: #fff; border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow); border-top: 4px solid var(--accent); }
.date-box span { color: var(--muted); font-size: .9rem; }
.date-box strong { display: block; font-size: 1.5rem; color: var(--primary); font-family: var(--serif); }

/* FAQ */
.faq { max-width: 780px; margin: 0 auto; }
.faq-item { background: #fff; border-radius: 14px; margin-bottom: 12px; border: 1px solid var(--border); }
.faq-question {
  width: 100%; text-align: left; background: none; border: none; padding: 20px 24px; font-size: 1.02rem; gap: 16px;
  font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-family: inherit; color: var(--text);
}
.faq-question::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--primary); transition: transform .2s; }
.faq-item.open .faq-question::after { transform: rotate(45deg); }
.faq-answer { display: none; padding: 0 24px 20px; color: var(--muted); }
.faq-item.open .faq-answer { display: block; }

/* Forms */
.form-card { background: #fff; padding: 44px; border-radius: 24px; box-shadow: var(--shadow-hover); max-width: 780px; margin: 0 auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-weight: 500; margin-bottom: 6px; font-size: .92rem; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid #d9d7cf; border-radius: 10px;
  font: inherit; background: #fcfcfa; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46,49,146,.15); background: #fff; }
textarea { min-height: 120px; resize: vertical; }
.form-status { margin-top: 16px; font-weight: 500; }
.form-status.success { color: #047857; }
.form-status.error { color: #b91c1c; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; align-items: start; }
.contact-info .card { padding: 22px; margin-bottom: 16px; display: flex; gap: 16px; align-items: center; }
.contact-info .feature-icon { margin: 0; }
.contact-info h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.contact-info p { color: var(--text); font-weight: 500; word-break: break-word; }
.map { width: 100%; height: 400px; border: 0; border-radius: 20px; margin-top: 48px; box-shadow: var(--shadow); }

.side-cta {
  background: var(--pattern), linear-gradient(140deg, var(--primary-dark), var(--primary));
  color: #fff; border-radius: var(--radius); padding: 28px; margin-top: 8px;
}
.side-cta img { width: 48px; height: 48px; border-radius: 12px; margin-bottom: 16px; }
.contact-info .side-cta h3 { text-transform: none; letter-spacing: -.01em; color: #fff; font-family: var(--serif); font-size: 1.35rem; margin-bottom: 8px; }
.contact-info .side-cta p { color: #fff; font-weight: 400; opacity: .85; margin-bottom: 20px; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.gallery-item { position: relative; border: none; padding: 0; cursor: pointer; border-radius: 20px; overflow: hidden; background: none; display: block; }
.gallery-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; object-position: center 30%; transition: transform .4s; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 22px 18px; color: #fff; text-align: left;
  background: linear-gradient(transparent, rgba(10,12,40,.75)); font-weight: 600; font-size: 1.05rem;
}
.lightbox {
  position: fixed; inset: 0; background: rgba(8,10,30,.92); display: none; z-index: 100;
  align-items: center; justify-content: center; flex-direction: column; padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 80vh; max-width: 90vw; border-radius: 12px; }
.lightbox p { color: #fff; margin-top: 14px; }
.lightbox button { position: absolute; background: rgba(255,255,255,.15); color: #fff; border: none; width: 48px; height: 48px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.3); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; }
.lb-next { right: 20px; top: 50%; }

/* Footer */
#site-footer { background: var(--pattern), #14164a; color: #c9cbe0; padding-top: 72px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.5fr; gap: 48px; padding-bottom: 52px; }
#site-footer h4 { color: #fff; margin-bottom: 16px; font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; }
#site-footer a { color: #c9cbe0; display: block; margin-bottom: 8px; }
#site-footer a:hover { color: var(--accent); }
#site-footer .logo { display: flex; margin-bottom: 16px; color: #fff; }
#site-footer p { margin-bottom: 8px; max-width: 360px; }
.footer-agency { font-size: .88rem; opacity: .65; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 22px 0; font-size: .88rem; text-align: center; opacity: .8; }

/* Responsive */
@media (max-width: 1180px) {
  .menu-toggle { display: block; }
  .nav-links {
    position: absolute; top: 76px; left: 0; right: 0; background: #fff; flex-direction: column;
    gap: 0; padding: 12px 16px 20px; border-bottom: 1px solid var(--border); display: none; align-items: stretch;
    box-shadow: 0 12px 24px rgba(20,22,60,.08);
  }
  .nav-links.open { display: flex; }
  .nav-links a:not(.btn) { padding: 12px 4px; font-size: 1rem; }
  .nav-links a.active::after { display: none; }
  .nav-links .btn, .nav-links .lang-switch { margin-top: 8px; text-align: center; }
}
@media (max-width: 960px) {
  .grid-4, .steps { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .teacher-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .grad-results { grid-template-columns: 1fr; }
  .grad-stats { grid-template-columns: repeat(2, 1fr); }
  .grad-stats > div:nth-child(3) { border-left: none; }
  .grad-stats > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .split, .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .section { padding: 64px 0; }
  .section-title { margin-bottom: 36px; }
  .grid-2, .grid-3, .grid-4, .steps, .gallery-grid, .dates, .form-grid { grid-template-columns: 1fr; }
  .hero {
    padding: 72px 0 128px;
    background:
      linear-gradient(180deg, rgba(20,22,70,.88) 0%, rgba(24,26,84,.9) 100%),
      url("../images/chemistry-class.jpg") 70% center/cover;
  }
  .hero::after { mask-image: none; -webkit-mask-image: none; }
  .feature { display: grid; grid-template-columns: 48px 1fr; column-gap: 16px; padding: 22px; }
  .feature .feature-icon { width: 48px; height: 48px; margin: 0; grid-row: span 2; }
  .feature h3 { margin: 2px 0 4px; }
  .hero p { font-size: 1.02rem; }
  .stats { margin-top: -64px; }
  .stat { padding: 20px 10px; }
  .stat strong { font-size: 1.8rem; }
  .grad-hero { padding: 28px 22px; }
  .grad-stats strong { font-size: 1.8rem; }
  .teacher-card { grid-template-columns: 1fr; }
  .teacher-card img { aspect-ratio: 1; min-height: 0; }
  .split-media::before { inset: 14px -10px -14px 14px; }
  .badge { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .notice { flex-direction: column; align-items: flex-start; }
  .form-card, .cta { padding: 30px 20px; }
  .page-hero { padding: 60px 0; }
}
