/* Al-Nouri Institute in Cambodia — styles
   Palette drawn from the logo: royal blue, gold, green */
:root {
  --blue: #1f3a8a;
  --blue-dark: #142764;
  --blue-deep: #0d1b45;
  --gold: #d4a514;
  --gold-light: #f2d36b;
  --green: #1f8a4c;
  --cream: #fbf8ef;
  --ink: #1b2233;
  --muted: #5b6478;
  --line: #e7e1cf;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(13, 27, 69, .10);
  --font-en: "Inter", system-ui, sans-serif;
  --font-head: "Cormorant Garamond", Georgia, serif;
  --font-km: "Kantumruy Pro", "Khmer OS", sans-serif;
  --font-km-head: "Moul", "Kantumruy Pro", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { font-family: var(--font-en); color: var(--ink); background: #fff; line-height: 1.65; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: min(1160px, 92%); margin-inline: auto; }

/* Khmer mode */
body.km { font-family: var(--font-km); line-height: 1.85; }
body.km h1, body.km h2 { font-family: var(--font-km-head); font-weight: 400; line-height: 1.6; letter-spacing: 0; }
body.km h3 { font-family: var(--font-km); font-weight: 600; }
body.km .eyebrow { letter-spacing: 0; text-transform: none; }

.arabic { font-family: "Amiri", serif; direction: rtl; }
.brand-km { font-family: var(--font-km-head); }

/* Arabic mode (right-to-left) */
body.ar { font-family: "Cairo", var(--font-en); line-height: 1.9; }
body.ar h1, body.ar h2 { font-family: "Amiri", serif; font-weight: 700; line-height: 1.45; letter-spacing: 0; }
body.ar .hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); }
body.ar h3 { font-family: "Cairo", sans-serif; font-weight: 700; }
body.ar .eyebrow { letter-spacing: 0; text-transform: none; font-size: .9rem; }
[dir="rtl"] .hero-pattern { mask-image: linear-gradient(to left, #000 0%, transparent 70%); }
.brand-ar { font-family: "Amiri", serif; font-weight: 700; }
.brand-text .brand-ar { font-size: 1.15rem; color: var(--blue); line-height: 1.4; }
body:not(.ar) .brand-text .brand-ar { display: none; }
body.ar .brand-text .brand-km { display: none; }
.emblem-ar { font-family: "Amiri", serif; font-weight: 700; font-size: 1.5rem; color: #fff; margin-top: .2rem; }
.footer-ar { font-family: "Amiri", serif; font-weight: 700; font-size: 1.1rem; color: var(--gold-light); }

/* Top bar */
.topbar { background: var(--blue-deep); color: var(--gold-light); font-size: .85rem; }
.topbar-inner { display: flex; justify-content: flex-end; align-items: center; padding: .35rem 0; min-height: 40px; }
.lang-switch { display: flex; gap: 2px; background: rgba(255,255,255,.08); border-radius: 999px; padding: 2px; }
.lang-switch button { border: 0; background: transparent; color: #fff; padding: .25rem .8rem; border-radius: 999px; cursor: pointer; font: 500 .8rem "Kantumruy Pro", "Cairo", sans-serif; }
.lang-switch button.active { background: var(--gold); color: var(--blue-deep); }

/* Header */
.header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: .7rem 0; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; }
.brand img { border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.brand-text .brand-km { font-size: .95rem; color: var(--blue); }
.brand-text .brand-en { font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
.nav { display: flex; align-items: center; gap: 1.6rem; font-weight: 500; font-size: .95rem; }
.nav a:not(.btn) { position: relative; color: var(--blue-dark); }
.nav a:not(.btn)::after { content: ""; position: absolute; inset-inline-start: 0; bottom: -4px; width: 0; height: 2px; background: var(--gold); transition: width .25s; }
.nav a:not(.btn):hover::after { width: 100%; }
.menu-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 0; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--blue); border-radius: 2px; }
.nav-lang, .nav-backdrop { display: none; }

/* Buttons */
.btn { display: inline-block; padding: .8rem 1.6rem; border-radius: 999px; font-weight: 600; font-size: .95rem; border: 2px solid transparent; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; font-family: inherit; }
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--blue-deep); box-shadow: 0 6px 18px rgba(212,165,20,.35); }
.btn-outline { border-color: rgba(255,255,255,.7); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.1); }
.btn-sm { padding: .5rem 1.1rem; font-size: .88rem; }

/* Hero */
.hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(circle at 75% 40%, #2c4fb0 0%, var(--blue-dark) 45%, var(--blue-deep) 100%); }
.hero-pattern { position: absolute; inset: 0; opacity: .08;
  background-image:
    repeating-conic-gradient(from 22.5deg, var(--gold-light) 0 12.5%, transparent 0 25%);
  background-size: 60px 60px; mask-image: linear-gradient(to right, #000 0%, transparent 70%); }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; padding: 6rem 0 7rem; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; font-weight: 600; margin-bottom: .8rem; }
.hero h1 { font-family: var(--font-head); font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.1; font-weight: 700; margin-bottom: 1.2rem; }
body.km .hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
.lead { font-size: 1.1rem; color: rgba(255,255,255,.85); max-width: 560px; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-emblem { display: flex; flex-direction: column; align-items: center; }
.emblem-ring { --ring: min(340px, 75vw); width: var(--ring); height: var(--ring); flex: none; position: relative; overflow: hidden; border-radius: 50%; padding: 14px; box-sizing: border-box; background: conic-gradient(var(--gold-light), var(--gold), var(--green), var(--gold), var(--gold-light)); box-shadow: 0 25px 60px rgba(0,0,0,.35); animation: float 6s ease-in-out infinite; }
.emblem-ring img { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); max-width: none; object-fit: cover; border-radius: 50%; background: #fff; border: 6px solid #fff; box-sizing: border-box; }
.emblem-caption { margin-top: 1.4rem; font-family: var(--font-head); font-size: 1.6rem; letter-spacing: .4em; color: var(--gold-light); }
@keyframes float { 50% { transform: translateY(-12px); } }

/* Stats */
.stats { margin-top: -3rem; position: relative; z-index: 2; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border-top: 4px solid var(--gold); }
.stat { padding: 1.6rem 1rem; text-align: center; border-inline-end: 1px solid var(--line); }
.stat:last-child { border-inline-end: 0; }
.stat strong { display: block; font-family: var(--font-head); font-size: 2.4rem; color: var(--blue); line-height: 1.1; }
.stat span { font-size: .9rem; color: var(--muted); }

/* Sections */
.section { padding: 6rem 0; }
.section-tint { background: var(--cream); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
h2 { font-family: var(--font-head); font-size: clamp(2rem, 3.5vw, 2.8rem); color: var(--blue-dark); line-height: 1.15; margin-bottom: 1rem; }
body.km h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.15rem; color: var(--blue-dark); margin-bottom: .5rem; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 4rem; align-items: center; }
.about-card { aspect-ratio: 4/5; border-radius: 200px 200px var(--radius) var(--radius); background: linear-gradient(160deg, var(--blue), var(--blue-deep)); color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 2rem; position: relative; overflow: hidden; border: 3px solid var(--gold); }
.about-card::before { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(242,211,107,.4); border-radius: 190px 190px 8px 8px; }
.arabic.big { font-size: clamp(4rem, 9vw, 6.5rem); color: var(--gold-light); line-height: 1.4; }
.about-card p { color: rgba(255,255,255,.85); max-width: 260px; }
.mv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 2rem; }
.mv { padding: 1.4rem; border-radius: var(--radius); background: var(--cream); border-inline-start: 4px solid var(--green); }
.mv p { color: var(--muted); font-size: .95rem; }

/* Program cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.card { background: #fff; padding: 2rem 1.6rem; border-radius: var(--radius); box-shadow: var(--shadow); border-bottom: 4px solid transparent; transition: transform .25s, border-color .25s; }
.card:hover { transform: translateY(-6px); border-color: var(--gold); }
.card-icon { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; background: linear-gradient(135deg, #e9eefc, #fff5d6); margin-bottom: 1.2rem; }
.card p { color: var(--muted); font-size: .95rem; }

/* Why */
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.why { padding: 2rem 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); position: relative; }
.why .num { font-family: var(--font-head); font-size: 2.6rem; font-weight: 700; color: var(--gold); line-height: 1; display: block; margin-bottom: .8rem; }
.why p { color: var(--muted); font-size: .95rem; }

/* News */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.news { background: #fff; border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); border-top: 4px solid var(--blue); }
.news time { display: inline-block; font-size: .78rem; font-weight: 600; color: var(--green); background: #e6f4ec; padding: .15rem .6rem; border-radius: 999px; margin-bottom: .8rem; }
.news p { color: var(--muted); font-size: .95rem; }

/* CTA */
.cta { background: linear-gradient(120deg, var(--green), #146b39); color: #fff; padding: 4rem 0; }
.cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.cta h2 { color: #fff; margin-bottom: .4rem; }
.cta p { color: rgba(255,255,255,.85); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.contact-list { list-style: none; margin-top: 1.5rem; display: grid; gap: 1.2rem; }
.contact-list li { display: flex; gap: 1rem; align-items: flex-start; }
.contact-list li > span { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--cream); font-size: 1.2rem; }
.contact-list strong { color: var(--blue-dark); }
.contact-list p { color: var(--muted); }
.contact-form { background: var(--cream); padding: 2.2rem; border-radius: var(--radius); display: grid; gap: 1rem; border: 1px solid var(--line); }
.contact-form label { display: grid; gap: .35rem; font-weight: 500; font-size: .9rem; color: var(--blue-dark); }
.contact-form input, .contact-form select, .contact-form textarea { font: inherit; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.form-note { color: var(--green); font-weight: 600; }

/* Footer */
.footer { background: var(--blue-deep); color: rgba(255,255,255,.8); padding: 2.5rem 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 1rem; }
.footer-brand img { border-radius: 50%; border: 2px solid var(--gold); }
.footer .brand-km { color: var(--gold-light); }
.copy { font-size: .88rem; text-align: end; }
.copy a { color: var(--gold-light); }

/* Welcome card (language · terms · notifications) */
.consent { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1rem;
  background: rgba(13, 27, 69, .55); backdrop-filter: blur(6px); opacity: 0; transition: opacity .35s ease; }
.consent[hidden] { display: none; }
.consent.show { opacity: 1; }
.consent-card { position: relative; width: min(460px, 100%); max-height: calc(100vh - 2rem); overflow-y: auto;
  background: #fff; border-radius: 24px; padding: 2.2rem 1.8rem 1.6rem; text-align: center;
  border-top: 5px solid var(--gold); box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  transform: translateY(24px) scale(.95); transition: transform .5s cubic-bezier(.2, .9, .25, 1.15); }
.consent.show .consent-card { transform: none; }
.consent-x { position: absolute; top: .8rem; inset-inline-end: .9rem; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--cream); color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.consent-logo { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto .8rem; border: 3px solid var(--gold); box-shadow: var(--shadow); }
.consent h2 { font-size: 1.7rem; margin-bottom: .3rem; }
body.km .consent h2 { font-size: 1.3rem; }
.consent-sub { color: var(--muted); font-size: .95rem; margin-bottom: 1.3rem; }
.consent-label { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-bottom: .6rem; }
body.km .consent-label, body.ar .consent-label { letter-spacing: 0; text-transform: none; font-size: .9rem; }
.consent-langs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1.3rem; }
.consent-langs button { display: grid; gap: .1rem; padding: .8rem .4rem; border: 2px solid var(--line); border-radius: 14px; background: #fff;
  cursor: pointer; transition: border-color .2s, background .2s, transform .2s; font-family: "Kantumruy Pro", "Cairo", "Inter", sans-serif; }
.consent-langs button:hover { transform: translateY(-2px); border-color: var(--gold-light); }
.consent-langs button b { font-size: 1.05rem; color: var(--blue-dark); }
.consent-langs button b[lang="ar"] { font-family: "Cairo", sans-serif; }
.consent-langs button small { font-size: .72rem; color: var(--muted); }
.consent-langs button:focus-visible, .consent-go:focus-visible, .consent-x:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; }
.consent-langs button.active { border-color: var(--gold); background: #fff8e1; box-shadow: 0 0 0 3px rgba(212, 165, 20, .18); }
.consent-check, .consent-notify { display: flex; align-items: center; gap: .8rem; text-align: start; padding: .9rem 1rem;
  border: 1px solid var(--line); border-radius: 14px; margin-bottom: .7rem; cursor: pointer; font-size: .92rem; line-height: 1.5; }
.consent-check input, .consent-notify input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.consent-check .tick { flex: none; width: 24px; height: 24px; border: 2px solid var(--muted); border-radius: 7px; display: grid; place-items: center; transition: background .2s, border-color .2s; }
.consent-check .tick::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); margin-top: -3px; transition: transform .2s cubic-bezier(.2, .9, .25, 1.4); }
.consent-check input:checked + .tick { background: var(--green); border-color: var(--green); }
.consent-check input:checked + .tick::after { transform: rotate(45deg) scale(1); }
.consent-check input:focus-visible + .tick, .consent-notify input:focus-visible + .switch { outline: 3px solid var(--gold-light); outline-offset: 2px; }
.consent-check:has(input:checked) { border-color: var(--green); background: #f1faf4; }
.consent-check a { color: var(--blue); font-weight: 600; text-decoration: underline; }
.consent-notify .bell { font-size: 1.3rem; }
.consent-notify .txt { flex: 1; display: grid; }
.consent-notify .txt b { color: var(--blue-dark); }
.consent-notify .txt small { color: var(--muted); font-size: .82rem; }
.consent-notify .switch { flex: none; position: relative; width: 48px; height: 28px; border-radius: 999px; background: #cfd5e3; transition: background .25s; }
.consent-notify .switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .3s cubic-bezier(.2, .9, .25, 1.3); }
.consent-notify input:checked + .switch { background: var(--green); }
.consent-notify input:checked + .switch::after { transform: translateX(20px); }
[dir="rtl"] .consent-notify input:checked + .switch::after { transform: translateX(-20px); }
.consent-notify:has(input:checked) { border-color: var(--green); background: #f1faf4; }
.consent-msg { font-size: .85rem; padding: .6rem .8rem; border-radius: 10px; margin: -.2rem 0 .7rem; background: #fff3d6; color: #6b5200; text-align: start; }
.consent-msg.ok { background: #e6f4ec; color: #146b39; }
.consent-go { width: 100%; margin-top: .5rem; padding: .95rem; font-size: 1rem; }
.consent-go:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(.4); }
body.consent-open { overflow: hidden; }
@media (max-width: 420px) {
  .consent-card { padding: 1.8rem 1.1rem 1.2rem; border-radius: 20px; }
  .consent-logo { width: 68px; height: 68px; }
  .consent-langs { gap: .4rem; }
}

/* N.I.C cursor: gold arrow, navy arrow over links/buttons (computers with a mouse only) */
@media (hover: hover) and (pointer: fine) {
  html, body { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='.6' y2='1'%3E%3Cstop offset='0' stop-color='%23ffe9a3'/%3E%3Cstop offset='1' stop-color='%23d4a514'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M3 1.5V16.2L6.6 12.9L9.1 18.4L11.6 17.3L9.1 11.9H14Z' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linejoin='round' stroke-linecap='round'/%3E%3Cpath d='M3 1.5V16.2L6.6 12.9L9.1 18.4L11.6 17.3L9.1 11.9H14Z' fill='url%28%23g%29' stroke='%230d1b45' stroke-width='1.1' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E") 3 2, auto; }
  a, button, [role="button"], label, select, summary, .lang-switch button, .consent-langs button { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cdefs%3E%3ClinearGradient id='h' x1='0' y1='0' x2='.6' y2='1'%3E%3Cstop offset='0' stop-color='%233a5fc8'/%3E%3Cstop offset='1' stop-color='%230d1b45'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M3 1.5V16.2L6.6 12.9L9.1 18.4L11.6 17.3L9.1 11.9H14Z' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linejoin='round' stroke-linecap='round'/%3E%3Cpath d='M3 1.5V16.2L6.6 12.9L9.1 18.4L11.6 17.3L9.1 11.9H14Z' fill='url%28%23h%29' stroke='%23d4a514' stroke-width='1.1' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E") 3 2, pointer; }
  input:not([type="checkbox"]):not([type="radio"]), textarea { cursor: text; }
  button:disabled { cursor: not-allowed; }
}
/* sparkle trail + click ripple (js/cursor.js) */
.cursor-dust, .cursor-ripple { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; }
.cursor-dust { width: 100vw; height: 100vh; z-index: 9998; }
.cursor-ripple { width: 0; height: 0; }
.cursor-ripple::before { content: ""; position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 2px solid var(--gold); animation: cursor-ripple .6s ease-out forwards; }
@keyframes cursor-ripple { from { transform: scale(.3); opacity: .9; } to { transform: scale(2.2); opacity: 0; } }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s, transform .7s; }
.reveal.visible { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 980px) {
  .cards, .why-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-inline-end: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 860px) {
  /* language buttons live in the menu card on phones & tablets */
  .topbar .theme-switch, .topbar .lang-switch { display: none; }   /* they live in the menu card */
  .topbar-inner { padding: .3rem 0; min-height: 34px; }

  /* hamburger → ✕ */
  .menu-toggle { display: grid; place-items: center; position: relative; width: 44px; height: 44px; border-radius: 12px; transition: background .2s; }
  .menu-toggle:hover, .menu-toggle[aria-expanded="true"] { background: var(--cream); }
  .menu-toggle span { position: absolute; transition: transform .4s cubic-bezier(.68,-.35,.27,1.35), opacity .2s ease, width .3s ease; }
  .menu-toggle span:nth-child(1) { transform: translateY(-7px); }
  .menu-toggle span:nth-child(3) { transform: translateY(7px); width: 16px; margin-inline-start: 8px; }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg); width: 24px; margin-inline-start: 0; }

  /* the menu card */
  .nav { position: absolute; top: calc(100% + 10px); left: 4%; right: 4%; z-index: 60;
    flex-direction: column; align-items: stretch; gap: .15rem; padding: .7rem;
    background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 60px rgba(13, 27, 69, .25);
    max-height: calc(100vh - 140px); overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-16px) scale(.96); transform-origin: top right;
    transition: opacity .22s ease, transform .3s ease, visibility 0s linear .3s; }
  [dir="rtl"] .nav { transform-origin: top left; }
  .nav.open { opacity: 1; visibility: visible; transform: none;
    transition: opacity .25s ease, transform .45s cubic-bezier(.2, .9, .25, 1.15), visibility 0s; }
  .nav > * { opacity: 0; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease, background .2s; }
  .nav.open > * { opacity: 1; transform: none; transition: opacity .3s ease, transform .4s cubic-bezier(.2, .9, .25, 1.15), background .2s;
    transition-delay: calc(60ms + var(--i, 0) * 35ms); }
  .nav > a:not(.btn) { padding: .75rem 1rem; border-radius: 12px; font-size: 1rem; }
  .nav > a:not(.btn):hover, .nav > a:not(.btn):active { background: var(--cream); }
  .nav a:not(.btn)::after { display: none; }
  .nav > .btn { margin-top: .4rem; text-align: center; padding: .8rem 1rem; }
  .nav-lang { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .6rem; padding: .8rem .4rem .2rem 1rem; border-top: 1px solid var(--line); }
  [dir="rtl"] .nav-lang { padding: .8rem 1rem .2rem .4rem; }
  .nav-lang-label { color: var(--muted); font-size: .9rem; }
  .lang-switch--menu { background: var(--cream); border: 1px solid var(--line); }
  .lang-switch--menu button { color: var(--blue-dark); padding: .4rem .95rem; font-size: .9rem; }

  /* dim the page behind the menu */
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(13, 27, 69, .35); backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s; }
  .nav-backdrop.show { opacity: 1; visibility: visible; transition: opacity .3s ease, visibility 0s; }
  body.menu-open { overflow: hidden; }
  .hero-inner, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-inner { padding: 4rem 0 6rem; text-align: center; }
  .hero-emblem { order: -1; }
  .emblem-ring { --ring: 180px; padding: 10px; }
  .emblem-ring img { inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); border-width: 4px; }
  .emblem-caption { font-size: 1.3rem; margin-top: 1rem; }
  .emblem-ar { font-size: 1.25rem; }
  .lead { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .about-visual { max-width: 340px; margin: 0 auto; }
}
@media (max-width: 560px) {
  .cards, .why-grid, .mv-grid { grid-template-columns: 1fr; }
  /* phones: one school name, in the page's language */
  .brand-text .brand-en { display: none; }
  body:not(.km):not(.ar) .brand-text .brand-km { display: none; }
  body:not(.km):not(.ar) .brand-text .brand-en { display: block; font-size: 1rem; font-weight: 600; color: var(--blue); letter-spacing: 0; line-height: 1.3; }
  .section { padding: 4.5rem 0; }
}

/* ═════════ Appearance switch (Light · Dark · Auto) ═════════ */
.topbar-inner { gap: .7rem; }
.theme-switch { display: flex; gap: 2px; background: rgba(255,255,255,.08); border-radius: 999px; padding: 2px; }
.theme-switch button { display: inline-flex; align-items: center; gap: .35rem; border: 0; background: transparent; color: #fff; padding: .25rem .6rem;
  border-radius: 999px; font: 500 .8rem "Kantumruy Pro", "Cairo", "Inter", sans-serif; transition: background .25s, color .25s; }
.theme-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-switch svg .fill { fill: currentColor; stroke: none; }
.theme-switch button.active { background: var(--gold); color: var(--blue-deep); }
.theme-switch button.active[data-theme-set="dark"] svg path { fill: currentColor; }
.theme-switch button:hover svg { transform: rotate(-15deg); }
.theme-switch svg { transition: transform .3s; }
.theme-switch--top span { display: none; }
.nav-theme { display: none; }

/* smooth colour change when switching */
html.theme-anim, html.theme-anim *:not(.cursor-dust) { transition: background-color .5s ease, color .5s ease, border-color .5s ease, box-shadow .5s ease, fill .5s ease !important; }

/* ═════════ Dark mode ═════════ */
[data-theme="dark"] {
  --cream: #131f47; --line: #26366c; --ink: #e2e7f4; --muted: #9ea9c7;
  --shadow: 0 12px 34px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
[data-theme="dark"] body { background: #0a1230; }
[data-theme="dark"] .header { background: rgba(10, 18, 48, .92); }
[data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] .nav a:not(.btn), [data-theme="dark"] .contact-list strong,
[data-theme="dark"] .contact-form label, [data-theme="dark"] .consent-langs button b, [data-theme="dark"] .consent-notify .txt b { color: #eef2ff; }
[data-theme="dark"] .cta h2 { color: #fff; }
[data-theme="dark"] .brand-text .brand-km, [data-theme="dark"] .brand-text .brand-ar { color: var(--gold-light); }
[data-theme="dark"] .stats-grid, [data-theme="dark"] .card, [data-theme="dark"] .news { background: #111c42; }
[data-theme="dark"] .stat strong { color: var(--gold-light); }
[data-theme="dark"] .card-icon { background: linear-gradient(135deg, #1d2b5e, #33301f); }
[data-theme="dark"] .news time { background: rgba(31, 138, 76, .2); color: #7fd6a3; }
[data-theme="dark"] .contact-form input, [data-theme="dark"] .contact-form select, [data-theme="dark"] .contact-form textarea { background: #0d1636; color: var(--ink); }
[data-theme="dark"] .menu-toggle span { background: #eef2ff; }
[data-theme="dark"] .nav { background: transparent; }
[data-theme="dark"] .consent-card { background: #111c42; }
[data-theme="dark"] .consent-langs button { background: #0d1636; }
[data-theme="dark"] .consent-langs button.active { background: rgba(212, 165, 20, .16); }
[data-theme="dark"] .consent-check:has(input:checked), [data-theme="dark"] .consent-notify:has(input:checked) { background: rgba(31, 138, 76, .16); }
[data-theme="dark"] .consent-check a { color: var(--gold-light); }
[data-theme="dark"] .consent-notify .switch { background: #2c3c72; }
[data-theme="dark"] .consent-msg { background: rgba(212, 165, 20, .15); color: var(--gold-light); }
[data-theme="dark"] .consent-msg.ok { background: rgba(31, 138, 76, .18); color: #7fd6a3; }
[data-theme="dark"] .about-card, [data-theme="dark"] .emblem-ring { box-shadow: 0 25px 60px rgba(0,0,0,.55); }

/* ═════════ Loading screen ═════════ */
.loader { position: fixed; inset: 0; z-index: 10000; display: grid; place-content: center; justify-items: center; gap: .6rem; color: #fff;
  background: radial-gradient(circle at 50% 40%, #2c4fb0 0%, var(--blue-dark) 45%, var(--blue-deep) 100%);
  transition: opacity .6s ease, visibility 0s linear .6s; }
.loader.done { opacity: 0; visibility: hidden; }
.loader.done .loader-emblem { transform: scale(1.15); }
.loader-emblem { position: relative; width: 132px; height: 132px; display: grid; place-items: center; transition: transform .6s ease; }
.loader-emblem img { width: 104px; height: 104px; border-radius: 50%; background: #fff; border: 4px solid #fff; animation: loader-pulse 1.6s ease-in-out infinite; }
.loader-ring { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 25%, var(--gold-light) 50%, var(--gold) 70%, var(--green) 85%, transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  animation: loader-spin 1.1s linear infinite; }
.loader-name { font-family: var(--font-head); font-size: 1.5rem; letter-spacing: .45em; color: var(--gold-light); margin-top: .8rem; padding-left: .45em; }
.loader-sub { font-family: var(--font-km-head); font-size: .85rem; opacity: .85; }
.loader-bar { width: 160px; height: 3px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; margin-top: .6rem; }
.loader-bar i { display: block; width: 40%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-light), var(--gold)); animation: loader-slide 1.2s ease-in-out infinite; }
@keyframes loader-spin { to { transform: rotate(360deg); } }
@keyframes loader-pulse { 50% { transform: scale(.94); } }
@keyframes loader-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }

/* ═════════ Online / offline bar ═════════ */
.net-bar { position: fixed; top: 14px; left: 50%; z-index: 300; display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1.1rem .6rem .7rem; border-radius: 999px; color: #fff; background: #3a3f52;
  box-shadow: 0 14px 40px rgba(0,0,0,.3); transform: translate(-50%, -140%); transition: transform .5s cubic-bezier(.2,.9,.25,1.2), background .4s; }
.net-bar.show { transform: translate(-50%, 0); }
.net-bar.online { background: var(--green); }
.net-bar .net-text { display: grid; line-height: 1.3; }
.net-bar .net-text b { font-size: .92rem; }
.net-bar .net-text small { font-size: .78rem; opacity: .85; }
.net-icon { position: relative; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.15); display: grid; place-items: center; }
.net-icon::before { content: ""; width: 18px; height: 18px; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M2 8.8a15 15 0 0 1 20 0M5.5 12.5a10 10 0 0 1 13 0M9 16.2a5 5 0 0 1 6 0'/%3E%3Ccircle cx='12' cy='19.5' r='1.2' fill='black'/%3E%3Cpath d='M3 3l18 18'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M2 8.8a15 15 0 0 1 20 0M5.5 12.5a10 10 0 0 1 13 0M9 16.2a5 5 0 0 1 6 0'/%3E%3Ccircle cx='12' cy='19.5' r='1.2' fill='black'/%3E%3Cpath d='M3 3l18 18'/%3E%3C/svg%3E") center / contain no-repeat; }
.net-bar:not(.online) .net-icon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); animation: net-pulse 1.6s ease-out infinite; }
.net-bar.online .net-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M2 8.8a15 15 0 0 1 20 0M5.5 12.5a10 10 0 0 1 13 0M9 16.2a5 5 0 0 1 6 0'/%3E%3Ccircle cx='12' cy='19.5' r='1.2' fill='black'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M2 8.8a15 15 0 0 1 20 0M5.5 12.5a10 10 0 0 1 13 0M9 16.2a5 5 0 0 1 6 0'/%3E%3Ccircle cx='12' cy='19.5' r='1.2' fill='black'/%3E%3C/svg%3E");
  animation: net-pop .5s cubic-bezier(.2,.9,.25,1.6); }
@keyframes net-pulse { from { transform: scale(1); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
@keyframes net-pop { 0% { transform: scale(.3); } 100% { transform: scale(1); } }

/* ═════════ Pop-up notification cards ═════════ */
.toasts { position: fixed; bottom: 1.2rem; inset-inline-end: 1.2rem; z-index: 250; display: grid; gap: .7rem; width: min(370px, calc(100vw - 2rem)); pointer-events: none; }
.toast { pointer-events: auto; position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: start;
  padding: 1rem 1rem 1.1rem; border-radius: 18px; background: #fff; color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(13, 27, 69, .25); transform: translateX(calc(100% + 2rem)) scale(.95); opacity: 0;
  transition: transform .55s cubic-bezier(.2,.9,.25,1.15), opacity .35s ease; }
[dir="rtl"] .toast { transform: translateX(calc(-100% - 2rem)) scale(.95); }
.toast.show { transform: none; opacity: 1; }
.toast.hide { transform: translateY(20px) scale(.95); opacity: 0; transition: transform .3s ease, opacity .3s ease; }
.toast-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; background: #fff3d1; }
.toast.ok .toast-icon { background: #e3f4ea; } .toast.warn .toast-icon { background: #fde7e4; }
.toast.show .toast-icon { animation: toast-icon .6s .15s cubic-bezier(.2,.9,.25,1.6) both; }
@keyframes toast-icon { from { transform: scale(.2) rotate(-25deg); } to { transform: none; } }
.toast-body b { display: block; color: var(--blue-dark); font-size: .98rem; line-height: 1.35; margin-bottom: .15rem; }
.toast-body p { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.toast-action { display: inline-block; margin-top: .6rem; padding: .4rem .9rem; border-radius: 999px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--blue-deep); font: 600 .85rem inherit; font-family: inherit; }
.toast-x { border: 0; background: var(--cream); color: var(--muted); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 1.05rem; line-height: 1; }
.toast-time { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: linear-gradient(90deg, var(--gold-light), var(--gold)); transform-origin: left; }
[dir="rtl"] .toast-time { transform-origin: right; }
.toast.ok .toast-time { background: var(--green); } .toast.warn .toast-time { background: #c0392b; }
[data-theme="dark"] .toast { background: #111c42; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
[data-theme="dark"] .toast-body b { color: #eef2ff; }
[data-theme="dark"] .toast-icon { background: rgba(212,165,20,.18); }
[data-theme="dark"] .toast.ok .toast-icon { background: rgba(31,138,76,.22); } [data-theme="dark"] .toast.warn .toast-icon { background: rgba(192,57,43,.25); }

/* ═════════ phones & tablets: appearance row in the menu card ═════════ */
@media (max-width: 860px) {
  .nav-theme { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .4rem 1rem; padding: .7rem .4rem .2rem 1rem; }
  [dir="rtl"] .nav-theme { padding: .7rem 1rem .2rem .4rem; }
  .theme-switch--menu { background: var(--cream); border: 1px solid var(--line); }
  .theme-switch--menu button { color: var(--blue-dark); padding: .4rem .7rem; font-size: .82rem; }
  [data-theme="dark"] .theme-switch--menu button, [data-theme="dark"] .lang-switch--menu button { color: #eef2ff; }
  .theme-switch--menu button.active, [data-theme="dark"] .theme-switch--menu button.active { color: var(--blue-deep); }
  .theme-hint { grid-column: 1 / -1; color: var(--muted); font-size: .78rem; }
  [data-theme="dark"] .nav { background: #111c42; }
  .toasts { bottom: .8rem; inset-inline-end: .8rem; }
}
@media (max-width: 380px) { .emblem-ring { --ring: 160px; } }
@media (max-width: 420px) { .theme-switch--menu span { display: none; } .theme-switch--menu button { padding: .45rem .7rem; } }
@media (prefers-reduced-motion: reduce) {
  .loader-ring, .loader-emblem img, .loader-bar i, .net-icon::after { animation: none !important; }
}

/* ═════════ News ticker (top bar, auto-sliding loop) ═════════ */
.ticker { flex: 1; min-width: 0; display: flex; align-items: center; gap: .7rem; margin-inline-end: .6rem; }
.ticker-badge { flex: none; display: inline-flex; align-items: center; gap: .4rem; padding: .18rem .7rem; border-radius: 999px;
  background: var(--gold); color: var(--blue-deep); font: 700 .75rem "Kantumruy Pro", "Cairo", "Inter", sans-serif; letter-spacing: .03em; }
.ticker-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #c0392b; box-shadow: 0 0 0 0 rgba(192,57,43,.6); animation: ticker-live 1.6s infinite; }
.ticker-viewport { flex: 1; min-width: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ticker-track { display: flex; width: max-content; animation: ticker-move var(--ticker-time, 40s) linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker-group { display: flex; list-style: none; flex: none; }
.ticker-group li { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; font-size: .86rem; color: rgba(255,255,255,.9); }
.ticker-group li::after { content: "◆"; margin-inline: 1.6rem; color: var(--gold); font-size: .55rem; opacity: .8; }
body.km .ticker-group li { font-size: .88rem; }
body.ar .ticker-group li { font-size: .92rem; }
.tk-ico { font-size: .95rem; }
@keyframes ticker-move { from { transform: translateX(0); } to { transform: translateX(-50%); } }
[dir="rtl"] .ticker-track { animation-name: ticker-move-rtl; }
@keyframes ticker-move-rtl { from { transform: translateX(0); } to { transform: translateX(50%); } }
@keyframes ticker-live { 70% { box-shadow: 0 0 0 7px rgba(192,57,43,0); } 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0); } }
@media (max-width: 860px) { .ticker { margin: 0; } .ticker-group li { font-size: .82rem; } }
@media (max-width: 420px) { .ticker-badge { padding: .15rem .55rem; font-size: .7rem; } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .ticker-viewport { overflow-x: auto; }
  .ticker-group[aria-hidden="true"] { display: none; }
}

.contact-list a { color: inherit; border-bottom: 1px dashed transparent; transition: color .2s, border-color .2s; }
.contact-list a:hover { color: var(--blue); border-color: currentColor; }
[data-theme="dark"] .contact-list a:hover { color: var(--gold-light); }
