/* ============================================================
   Modulus School — Design Tokens
   Palette: Navy (trust/academics) + warm gold (achievement),
   with a maroon accent nodding to the Kullu topi's trim.
   Type: Fraunces (display serif) + Source Sans 3 (body).
   ============================================================ */

:root {
  --navy: #16233F;
  --navy-deep: #0F1A30;
  --navy-tint: #EEF1F6;
  --gold: #C68A2E;
  --gold-dark: #A8721F;
  --maroon: #7A2331;
  --maroon-tint: #F7EAEC;
  --paper: #FBF9F5;
  --ink: #262421;
  --ink-soft: #5C5850;
  --line: #E1DCD1;
  --white: #FFFFFF;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, sans-serif;

  --radius: 4px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-size: 16px;
}

img { max-width: 100%; display: block; }
a { color: var(--maroon); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--navy);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { max-width: 68ch; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

.section { padding: 52px 0; }
.section--tight { padding: 36px 0; }
.section--tint { background: var(--navy-tint); }
.section--navy { background: var(--navy); color: #D7E2DA; }
.section--navy h2, .section--navy h3 { color: var(--white); }
.section--maroon { background: var(--maroon); color: #F3DCDF; }
.section--maroon h2 { color: var(--white); }

.section-head { margin-bottom: 30px; max-width: 66ch; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head .kicker {
  display: inline-block; color: var(--maroon); font-weight: 700;
  font-size: 0.85rem; margin-bottom: 8px;
  border-left: 3px solid var(--gold); padding-left: 9px;
}
.section-head.center .kicker { border-left: none; padding-left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: var(--radius); font-weight: 700;
  border: 2px solid transparent; cursor: pointer; font-family: var(--sans); font-size: 0.98rem;
}
.btn:hover { text-decoration: none; }
.btn--gold { background: var(--gold); color: var(--navy-deep); }
.btn--gold:hover { background: var(--gold-dark); }
.btn--outline { background: transparent; border-color: var(--white); color: var(--white); }
.btn--outline:hover { background: rgba(255,255,255,0.12); }
.btn--navy { background: var(--navy); color: var(--white); }
.btn--navy:hover { background: var(--navy-deep); }
.btn--ghost { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn--ghost:hover { background: var(--navy-tint); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Header / Nav ---------- */
.site-header { background: var(--navy); position: sticky; top: 0; z-index: 100; border-bottom: 3px solid var(--gold); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--white); }
.brand .crest { width: 42px; height: 42px; flex-shrink: 0; }
.brand .brand-text { line-height: 1.1; }
.brand .brand-text strong { font-family: var(--serif); font-size: 1.1rem; display: block; }
.brand .brand-text span { font-size: 0.7rem; letter-spacing: 0.03em; color: #B9C9BC; }

.main-nav ul { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.main-nav a { color: #D7E2DA; font-weight: 600; font-size: 0.93rem; padding: 6px 2px; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--white); border-bottom-color: var(--gold); text-decoration: none; }
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .main-nav { position: fixed; top: 74px; right: 0; bottom: 0; left: 0; background: var(--navy); padding: 18px; transform: translateX(100%); transition: transform .25s ease; overflow-y: auto; }
  .main-nav.open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; gap: 2px; }
  .main-nav a { display: block; padding: 13px 6px; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .nav-toggle { display: flex; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
  .nav-toggle span { width: 26px; height: 2px; background: var(--white); }
}

/* ---------- Hero with mountain motif ---------- */
.hero {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--white); position: relative; overflow: hidden;
  padding: 56px 0 0;
}
.hero .container { position: relative; z-index: 2; display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; align-items: center; padding-bottom: 40px; }
.hero-eyebrow { color: var(--gold); font-weight: 700; letter-spacing: 0.03em; margin-bottom: 12px; font-size: 0.92rem; }
.hero h1 { color: var(--white); }
.hero p.lede { color: #C9D6CC; font-size: 1.08rem; max-width: 50ch; }
.hero-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.hero-photo { position: relative; aspect-ratio: 6/5; border: 1px solid rgba(255,255,255,0.18); overflow: hidden; }
.hero-photo-stats {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex;
  background: rgba(15,26,48,0.88);
}
.hero-photo-stats div { flex: 1; text-align: center; padding: 14px 8px; border-right: 1px solid rgba(255,255,255,0.15); }
.hero-photo-stats div:last-child { border-right: none; }
.hero-photo-stats strong { display: block; font-family: var(--serif); font-size: 1.5rem; color: var(--gold); }
.hero-photo-stats span { font-size: 0.76rem; color: #B9C9BC; }
.hero-count { font-variant-numeric: tabular-nums; }

.hero-mountains { position: relative; z-index: 1; width: 100%; height: 110px; margin-top: 10px; }
.hero-mountains svg { display: block; width: 100%; height: 100%; }

@media (max-width: 800px) { .hero .container { grid-template-columns: 1fr; } }

/* ---------- Cards / Grids ---------- */
.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--3, .grid--4, .grid--2 { grid-template-columns: 1fr; } }

.card { background: var(--white); border: 1px solid var(--line); padding: 24px; }
.card--stream { border-top: 4px solid var(--maroon); }
.card--coaching { border-top: 4px solid var(--gold); }
.card h3 { margin-bottom: 8px; }
.card .tag { display: inline-block; font-size: 0.76rem; font-weight: 700; color: var(--maroon); margin-bottom: 10px; letter-spacing: 0.02em; }
.card .icon-badge { width: 46px; height: 46px; margin-bottom: 14px; color: var(--navy); }

.faculty-card { text-align: left; }
.faculty-card .photo {
  width: 100%; aspect-ratio: 1/1; background: var(--navy-tint); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--navy); font-family: var(--serif); font-size: 2rem; margin-bottom: 12px; position: relative; overflow: hidden;
}
.faculty-card strong { display: block; font-family: var(--serif); font-size: 1.05rem; color: var(--navy); }
.faculty-card .role { color: var(--maroon); font-size: 0.85rem; font-weight: 600; display: block; margin-bottom: 5px; }
.faculty-card .qual { color: var(--ink-soft); font-size: 0.87rem; }
.faculty-card .dept { display: inline-block; font-size: 0.72rem; font-weight: 700; color: var(--navy); background: var(--navy-tint); padding: 3px 8px; margin-top: 8px; }

/* ---------- Faculty filters ---------- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.filter-btn { padding: 8px 18px; border: 1px solid var(--line); background: var(--white); color: var(--ink-soft); font-weight: 600; font-size: 0.88rem; cursor: pointer; border-radius: 999px; }
.filter-btn:hover { border-color: var(--navy); }
.filter-btn.active { background: var(--navy); border-color: var(--navy); color: var(--white); }

/* ---------- Principal message ---------- */
.principal-block { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: center; background: var(--white); border: 1px solid var(--line); padding: 40px; }
.principal-photo { aspect-ratio: 4/5; background: var(--navy-tint); border: 1px solid var(--line); position: relative; overflow: hidden; }
.principal-quote-mark { font-family: var(--serif); font-size: 4rem; color: var(--gold); line-height: 0.5; display: block; margin-bottom: 6px; }
.principal-block blockquote { margin: 0 0 20px; font-family: var(--serif); font-size: 1.25rem; color: var(--navy); font-style: normal; }
.principal-sign strong { display: block; font-family: var(--serif); color: var(--navy); font-size: 1.05rem; }
.principal-sign span { color: var(--ink-soft); font-size: 0.88rem; }
@media (max-width: 760px) { .principal-block { grid-template-columns: 1fr; padding: 26px; } .principal-photo { max-width: 220px; margin: 0 auto; } }

/* ---------- Facilities: icon rows ---------- */
.facility-item { display: flex; gap: 18px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.facility-item:last-child { border-bottom: none; }
.facility-item .icon { width: 46px; height: 46px; flex-shrink: 0; background: var(--navy); color: var(--gold); display: flex; align-items: center; justify-content: center; padding: 10px; }
.facility-item .icon svg { width: 100%; height: 100%; }

/* ---------- Tabs (courses, facilities) ---------- */
.tab-bar { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 30px; }
.tab-btn { padding: 12px 20px; border: none; background: none; font-weight: 700; color: var(--ink-soft); cursor: pointer; font-size: 0.95rem; border-bottom: 3px solid transparent; margin-bottom: -2px; font-family: var(--sans); }
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Accordion (growth programs) ---------- */
.accordion-item { border: 1px solid var(--line); background: var(--white); margin-bottom: 10px; }
.accordion-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; cursor: pointer; background: none; border: none; width: 100%; text-align: left; font-family: var(--serif); font-size: 1.15rem; color: var(--navy); }
.accordion-head .plus { flex-shrink: 0; width: 26px; height: 26px; border: 1px solid var(--navy); border-radius: 50%; position: relative; }
.accordion-head .plus::before, .accordion-head .plus::after { content: ""; position: absolute; background: var(--navy); top: 50%; left: 50%; transform: translate(-50%,-50%); }
.accordion-head .plus::before { width: 12px; height: 2px; }
.accordion-head .plus::after { width: 2px; height: 12px; transition: transform .2s ease; }
.accordion-item.open .plus::after { transform: translate(-50%,-50%) rotate(90deg) scaleY(0); }
.accordion-item.open .plus { background: var(--navy); }
.accordion-item.open .plus::before, .accordion-item.open .plus::after { background: var(--white); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height .25s ease; padding: 0 24px; }
.accordion-item.open .accordion-body { max-height: 600px; padding: 0 24px 22px; }
.accordion-body .tag { color: var(--maroon); font-weight: 700; font-size: 0.78rem; display: block; margin-bottom: 8px; }

/* ---------- Gallery with filters + lightbox ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery-grid figure {
  margin: 0; aspect-ratio: 4/3; border: 1px solid var(--line); cursor: pointer;
  position: relative; overflow: hidden; display: flex; align-items: flex-end;
}
.gallery-grid figure figcaption {
  position: relative; z-index: 2; color: var(--white); font-size: 0.82rem; font-weight: 600;
  padding: 10px 12px; width: 100%; background: linear-gradient(0deg, rgba(20,42,31,0.85), transparent);
}
.gallery-grid figure.hidden { display: none; }
.gallery-grid figure:hover figcaption { text-decoration: underline; }
@media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }

.lightbox-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(20,42,31,0.92); z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 30px;
}
.lightbox-overlay.open { display: flex; }
.lightbox-box { max-width: 640px; width: 100%; background: var(--paper); padding: 30px; text-align: center; }
.lightbox-box .lb-visual { aspect-ratio: 4/3; margin-bottom: 16px; }
.lightbox-close { position: absolute; top: 24px; right: 30px; color: var(--white); font-size: 1.6rem; background: none; border: none; cursor: pointer; }

/* ---------- Counters ---------- */
.counter-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.counter-item strong { display: block; font-family: var(--serif); font-size: 2.6rem; color: var(--navy); }
.counter-item span { color: var(--ink-soft); font-size: 0.92rem; }
@media (max-width: 700px) { .counter-row { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Testimonial / quote strip ---------- */
.quote-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.quote-card { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--gold); padding: 22px; }
.quote-card p { font-style: normal; color: var(--ink); font-size: 0.95rem; }
.quote-card footer { margin-top: 12px; font-weight: 700; color: var(--navy); font-size: 0.88rem; }
@media (max-width: 800px) { .quote-strip { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #B9C9BC; padding: 48px 0 24px; margin-top: 0; }
.site-footer h4 { color: var(--white); font-family: var(--sans); font-size: 1rem; margin-bottom: 12px; }
.site-footer a { color: #B9C9BC; }
.site-footer a:hover { color: var(--gold); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 30px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 32px; padding-top: 18px; font-size: 0.84rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Sticky enquire button ---------- */
.sticky-enquire { position: fixed; right: 20px; bottom: 20px; z-index: 90; box-shadow: 0 6px 18px rgba(20,42,31,0.3); }

/* ---------- Homepage welcome popup ---------- */
.site-popup-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(15,26,48,0.6); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.site-popup-overlay.open { display: flex; }
.site-popup {
  background: var(--paper); max-width: 480px; width: 100%; padding: 0;
  border-top: 4px solid var(--gold); position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  overflow: hidden;
}
.site-popup-image { aspect-ratio: 16/7; background: var(--navy); }
.site-popup-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.site-popup-body { padding: 28px 32px 32px; }
.site-popup-close {
  position: absolute; top: 14px; right: 16px; background: rgba(15,26,48,0.55); border: none;
  color: var(--white); width: 32px; height: 32px; border-radius: 50%;
  font-size: 1.4rem; line-height: 1; cursor: pointer; z-index: 2;
  display: flex; align-items: center; justify-content: center;
}
.site-popup-close:hover { background: rgba(15,26,48,0.8); color: var(--white); }
.site-popup-kicker { display: block; color: var(--maroon); font-weight: 700; font-size: 0.82rem; margin-bottom: 8px; }
.site-popup-list { margin: 14px 0 20px; padding-left: 18px; color: var(--ink-soft); font-size: 0.92rem; display: grid; gap: 8px; }
.site-popup-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Reveal-on-scroll (single, restrained use) ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* Utility */
.center { text-align: center; }
.mt-0 { margin-top: 0; }

/* Centered CTA line — unlike .center on a <p>, this isn't shrunk by the
   global paragraph max-width, so the button box itself centers, not just its text. */
.cta-line { text-align: center; max-width: none; }

/* ============================================================
   Scholarship Calculator (multi-step) — retuned to new palette
   ============================================================ */
.calc-wrap { background: var(--white); border: 1px solid var(--line); max-width: 720px; margin: 0 auto; }
.calc-progress { display: flex; border-bottom: 1px solid var(--line); }
.calc-progress .step-indicator { flex: 1; text-align: center; padding: 15px 8px; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); border-bottom: 3px solid var(--line); }
.calc-progress .step-indicator.active { color: var(--navy); border-bottom-color: var(--gold); }
.calc-progress .step-indicator.done { color: var(--maroon); }
.calc-body { padding: 36px; }
.calc-step { display: none; }
.calc-step.active { display: block; }
.form-row { margin-bottom: 20px; }
.form-row label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--navy); font-size: 0.93rem; }
.form-row .hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=number], select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 1rem; font-family: var(--sans); background: var(--white);
}
input:focus, select:focus { border-color: var(--navy); }
.field-error { color: var(--maroon); font-size: 0.8rem; margin-top: 4px; display: none; }
.choice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.choice-grid.streams { grid-template-columns: repeat(2, 1fr); }
.choice-btn { padding: 15px 10px; text-align: center; border: 1px solid var(--line); background: var(--white); cursor: pointer; font-weight: 700; color: var(--navy); font-family: var(--sans); font-size: 0.93rem; border-radius: var(--radius); }
.choice-btn:hover { border-color: var(--gold); }
.choice-btn.selected { border-color: var(--navy); background: var(--navy); color: var(--white); }
@media (max-width: 520px) { .choice-grid { grid-template-columns: repeat(2, 1fr); } }
.calc-actions { display: flex; justify-content: space-between; margin-top: 30px; }
.marks-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 600px) { .marks-grid { grid-template-columns: 1fr; } }
.result-panel { text-align: center; padding: 16px 0; }
.result-panel #resultMessage, .result-panel #emailNote {
  text-align: left; max-width: 480px; margin-left: auto; margin-right: auto;
}
.result-panel #callAdmissionsBox { text-align: center; max-width: none; margin: 16px auto 0; }
.result-badge { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 165px; height: 165px; border-radius: 50%; border: 4px solid var(--gold); margin: 8px auto 20px; }
.result-badge strong { font-family: var(--serif); font-size: 2.5rem; color: var(--navy); }
.result-badge span { font-size: 0.82rem; color: var(--ink-soft); }
.result-summary { text-align: left; background: var(--navy-tint); padding: 18px 22px; margin-top: 18px; max-width: 480px; margin-left: auto; margin-right: auto; }
.result-summary dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin: 0; }
.result-summary dt { font-weight: 700; color: var(--ink-soft); font-size: 0.85rem; }
.result-summary dd { margin: 0; color: var(--navy); font-weight: 700; }
.calc-loading, .calc-error { text-align: center; padding: 26px; }
.calc-error { color: var(--maroon); }

/* ============================================================
   Info split: pairs body text with a highlight box so wide
   cards (accordion bodies, principal block) don't leave dead
   space beside a readable-width paragraph.
   ============================================================ */
.info-split { display: flex; gap: 34px; flex-wrap: wrap; align-items: flex-start; }
.info-split .text-col { flex: 1 1 380px; }
.info-split .text-col p, .info-split .text-col blockquote { max-width: none; }
.highlight-box { flex: 0 0 250px; background: var(--navy-tint); border-left: 4px solid var(--gold); padding: 18px 20px; }
.highlight-box h4 { font-family: var(--sans); font-size: 0.8rem; color: var(--navy); margin: 0 0 10px; font-weight: 700; }
.highlight-box ul { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 0.88rem; display: grid; gap: 7px; }
@media (max-width: 700px) { .highlight-box { flex-basis: 100%; } }
