/* =====================================================================
   Alisher Navoiy nomidagi IDUM — stylesheet
   1. Tokens  2. Base & language blocks  3. Layout & utilities
   4. Components  5. Header & footer  6. Home  7. About  8. News
   9. Gallery & lightbox  10. Motion & preferences
   Naming: BEM-like (.block__element--modifier). Mobile-first.
   ===================================================================== */

/* 1. TOKENS ----------------------------------------------------------- */
:root {
  --navy-950: #071528;
  --navy-900: #0B1F3A;
  --navy-800: #12294A;
  --navy-700: #1C3A63;
  --gold-300: #E4CB8C;
  --gold-500: #C9A24B;   /* decorative / on navy only */
  --gold-700: #7D5F1C;   /* gold-toned text on light backgrounds (AA) */
  --cream: #FAF7F0;
  --cream-200: #F2ECDF;
  --mist: #E8EDF3;
  --white: #FFFFFF;
  --teal: #0F766E;       /* the single vivid accent */
  --teal-100: #D5EFEC;
  --ink: #1B2433;
  --muted: #4A5568;
  --on-navy: #E9EEF5;
  --on-navy-muted: #B9C5D6;
  --line: rgba(11, 31, 58, .12);

  --font-serif: 'Playfair Display', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  --fs-sm: .875rem;
  --fs-base: 1.0625rem;
  --fs-lead: clamp(1.1rem, 1rem + .4vw, 1.3rem);
  --fs-h3: clamp(1.2rem, 1.1rem + .4vw, 1.45rem);
  --fs-h2: clamp(1.9rem, 1.4rem + 2vw, 3rem);
  --fs-h1: clamp(2.3rem, 1.5rem + 3.6vw, 4.6rem);

  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: clamp(4rem, 3rem + 4vw, 7rem);

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(11, 31, 58, .06), 0 2px 8px rgba(11, 31, 58, .06);
  --shadow: 0 2px 6px rgba(11, 31, 58, .06), 0 12px 32px rgba(11, 31, 58, .10);
  --shadow-lg: 0 8px 20px rgba(11, 31, 58, .10), 0 30px 60px rgba(11, 31, 58, .16);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 76px;
  --pattern: url('../assets/ornament-pattern.svg');
}

/* 2. BASE -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.15; color: var(--navy-900); margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--teal); text-underline-offset: .18em; }
a:hover { color: var(--navy-900); }
button { font: inherit; color: inherit; cursor: pointer; }
ul, ol.timeline { padding: 0; margin: 0; list-style: none; }
figure { margin: 0; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--gold-300); color: var(--navy-900); }
[hidden] { display: none !important; } /* the one intentional !important: `hidden` must always win */

/* Language blocks: long prose lives in HTML as <x data-lang="uz">…</x><x data-lang="en">…</x>.
   Add a line for each new language (e.g. ru). */
html[lang="uz"] [data-lang]:not([data-lang="uz"]),
html[lang="en"] [data-lang]:not([data-lang="en"]) { display: none; }

/* 3. LAYOUT & UTILITIES ------------------------------------------------ */
.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 1.25rem; }
.container--narrow { max-width: 820px; }
@media (min-width: 768px) { .container { padding-inline: 2rem; } }

.section { padding-block: var(--space-6); position: relative; }
.section--mist { background: var(--mist); }
.section--cream-dark { background: var(--cream-200); }
.section--navy { background: var(--navy-900); color: var(--on-navy); }
.section--navy h2, .section--navy h3 { color: var(--white); }

.section-head { max-width: 720px; margin-bottom: var(--space-5); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--split { max-width: none; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.section-head--split > div { max-width: 640px; }
.section-title { font-size: var(--fs-h2); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-700); margin-bottom: .9rem;
}
.eyebrow::before { content: ''; width: 28px; height: 2px; background: currentColor; }
.section--navy .eyebrow, .hero .eyebrow, .page-hero .eyebrow { color: var(--gold-300); }
.lead { font-size: var(--fs-lead); color: var(--muted); line-height: 1.6; }
.section--navy .lead, .langfocus .lead { color: var(--on-navy-muted); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: .75rem; left: .75rem; z-index: 200;
  padding: .75rem 1.1rem; border-radius: 10px; background: var(--navy-900); color: var(--white);
  font-weight: 600; transform: translateY(-160%); transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; color: var(--white); }

/* ornamental divider */
.divider { height: 24px; background: url('../assets/divider.svg') center / 240px 24px no-repeat; margin-block: var(--space-4); }
.divider--light { opacity: .7; margin-block: var(--space-3); }
.divider--left { background-position: left center; }

/* 4. COMPONENTS -------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .75rem 1.5rem; border-radius: 999px;
  font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none;
  border: 2px solid transparent; transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.btn .icon { width: 20px; height: 20px; }
.btn:hover { transform: translateY(-2px); }
.btn--gold { background: var(--gold-500); color: var(--navy-900); box-shadow: 0 8px 24px rgba(201, 162, 75, .35); }
.btn--gold:hover { background: var(--gold-300); color: var(--navy-900); }
.btn--glass { background: rgba(255, 255, 255, .08); color: var(--white); border-color: rgba(255, 255, 255, .55); backdrop-filter: blur(6px); }
.btn--glass:hover { background: var(--white); color: var(--navy-900); }
.btn--primary { background: var(--navy-900); color: var(--white); }
.btn--primary:hover { background: var(--teal); color: var(--white); }
.btn--outline { border-color: var(--navy-900); color: var(--navy-900); background: transparent; }
.btn--outline:hover { background: var(--navy-900); color: var(--white); }
.btn--ghost { background: var(--mist); color: var(--navy-900); }
.btn--ghost:hover { background: var(--teal-100); color: var(--navy-900); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: var(--space-3); }

.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.text-link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--navy-900); text-decoration: none; min-height: 44px; }
.text-link .icon { width: 18px; transition: transform .25s var(--ease); }
.text-link:hover { color: var(--teal); }
.text-link:hover .icon { transform: translateX(4px); }

.badge {
  display: inline-block; padding: .2rem .65rem; border-radius: 999px;
  background: var(--teal); color: var(--white); font-size: .75rem; font-weight: 600; letter-spacing: .03em;
}
.badge--muted { background: var(--mist); color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: var(--space-4); }
.chip {
  min-height: 44px; padding: .55rem 1.15rem; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--white); color: var(--navy-900);
  font-weight: 500; transition: background-color .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--teal); color: var(--teal); }
.chip[aria-pressed="true"] { background: var(--navy-900); border-color: var(--navy-900); color: var(--white); }

/* media frame + ornamental placeholder when a photo is not uploaded yet */
.media { position: relative; overflow: hidden; background: var(--navy-800); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--missing { background: var(--navy-900) var(--pattern) center / 64px; }
.media--missing::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 64px; height: 72px;
  background: url('../assets/logo.svg') center / contain no-repeat; opacity: .9;
}
.media--missing img { visibility: hidden; }

.state-box {
  grid-column: 1 / -1; padding: var(--space-5) var(--space-3); border-radius: var(--radius);
  background: var(--white); border: 1.5px dashed var(--line); text-align: center; color: var(--muted);
}
.state-box p { margin: 0; }
.state-box .state-box__hint { margin-top: .5rem; font-size: var(--fs-sm); }
.state-box--error { border-color: #B45309; color: #7C2D12; background: #FFF7ED; }
.state-box--loading p::before {
  content: ''; display: inline-block; width: 1em; height: 1em; margin-right: .6em; vertical-align: -.15em;
  border: 2px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 5. HEADER & FOOTER --------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--header-h);
  color: var(--white);
  transition: height .3s var(--ease), background-color .3s, box-shadow .3s, color .3s;
}
.site-header__inner { height: 100%; display: flex; align-items: center; gap: 1rem; }
.site-header.is-scrolled {
  --header-h: 62px;
  background: rgba(250, 247, 240, .9); color: var(--navy-900);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 var(--line), 0 6px 24px rgba(11, 31, 58, .06);
}
.brand { display: flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; min-height: 44px; margin-right: auto; }
.brand:hover { color: inherit; }
.brand__logo { width: 40px; height: 45px; transition: transform .3s var(--ease); }
.is-scrolled .brand__logo { transform: scale(.88); }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 700; }
.brand__sub { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; opacity: .85; }

.site-header__tools { display: flex; align-items: center; gap: .5rem; }
.lang-switch { display: flex; align-items: center; border: 1.5px solid currentColor; border-radius: 999px; padding: 2px; }
.lang-switch__sep { opacity: .35; font-size: .8rem; }
.lang-switch__btn {
  min-width: 44px; min-height: 40px; padding: 0 .6rem; border: 0; border-radius: 999px;
  background: transparent; font-size: .82rem; font-weight: 700; letter-spacing: .06em; opacity: .75;
}
.lang-switch__btn[aria-pressed="true"] { background: var(--gold-500); color: var(--navy-900); opacity: 1; }

.menu-toggle {
  width: 48px; height: 48px; border: 0; border-radius: 12px; background: transparent;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.menu-toggle__bar { width: 24px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.is-menu-open .menu-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.is-menu-open .menu-toggle__bar:nth-child(2) { opacity: 0; }
.is-menu-open .menu-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* mobile navigation panel */
.nav {
  position: fixed; inset: var(--header-h) 0 0; z-index: -1;
  background: var(--navy-900) var(--pattern) center / 80px; background-blend-mode: soft-light;
  padding: var(--space-4) 1.25rem; overflow-y: auto;
  opacity: 0; visibility: hidden; transform: translateY(-12px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s .3s;
}
.site-header.is-menu-open { background: var(--navy-900); color: var(--white); -webkit-backdrop-filter: none; backdrop-filter: none; }
.is-menu-open .nav { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.nav__link {
  display: flex; align-items: center; min-height: 56px; border-bottom: 1px solid rgba(255, 255, 255, .1);
  color: var(--white); text-decoration: none; font-family: var(--font-serif); font-size: 1.6rem;
}
.nav__link[aria-current="page"] { color: var(--gold-300); }
.nav__link:hover { color: var(--gold-300); }

@media (min-width: 960px) {
  .menu-toggle { display: none; }
  .nav { position: static; z-index: auto; opacity: 1; visibility: visible; transform: none; background: none; padding: 0; overflow: visible; }
  .nav__list { display: flex; gap: .25rem; }
  .nav__link {
    position: relative; min-height: 44px; padding: 0 .85rem; border: 0;
    color: inherit; font-family: var(--font-sans); font-size: .95rem; font-weight: 500;
  }
  .nav__link::after {
    content: ''; position: absolute; left: .85rem; right: .85rem; bottom: 6px; height: 2px;
    background: var(--gold-500); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
  }
  .nav__link:hover, .nav__link[aria-current="page"] { color: inherit; }
  .nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); }
  .site-header__tools { margin-left: .75rem; }
}

.site-footer {
  position: relative; background: var(--navy-950); color: var(--on-navy-muted); padding-top: var(--space-5);
  font-size: .95rem; overflow: hidden;
}
.site-footer::before { content: ''; position: absolute; inset: 0; background: var(--pattern) center / 80px; opacity: .06; pointer-events: none; }
.site-footer__ornament { position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, transparent, var(--gold-500), transparent); }
.site-footer__grid { position: relative; display: grid; gap: var(--space-4); }
.site-footer__name { font-family: var(--font-serif); color: var(--white); font-size: 1.15rem; line-height: 1.35; margin-top: 1rem; max-width: 34ch; }
.site-footer__motto { font-style: italic; color: var(--gold-300); max-width: 36ch; }
.site-footer__title { font-family: var(--font-sans); font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-300); margin-bottom: 1rem; }
.site-footer__links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--on-navy); text-decoration: none; }
.site-footer__links a:hover { color: var(--gold-300); }
.site-footer .contact-list__value { color: var(--on-navy); }
.site-footer .contact-list a:hover { color: var(--gold-300); }
.site-footer__bottom { position: relative; padding-bottom: var(--space-3); font-size: var(--fs-sm); text-align: center; }
.site-footer__bottom p { margin: 0; }
@media (min-width: 768px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1.3fr; } }

.contact-list { display: grid; gap: 1rem; }
.contact-list__item { display: flex; gap: .85rem; align-items: flex-start; }
.contact-list__item .icon { margin-top: .15rem; color: var(--gold-500); }
.contact-list__item > span { display: flex; flex-direction: column; }
.contact-list__label { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.contact-list__value { color: var(--ink); text-decoration: none; font-weight: 500; }
a.contact-list__value { display: inline-flex; align-items: center; min-height: 44px; margin-block: -.6rem; }
a.contact-list__value:hover { color: var(--teal); }

/* 6. HOME -------------------------------------------------------------- */
.hero {
  position: relative; min-height: 640px; min-height: max(640px, 100svh); display: flex; align-items: flex-end;
  color: var(--white); background: var(--navy-900); overflow: hidden; isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { object-position: center 35%; animation: heroZoom 18s var(--ease) both; }
.hero__media.media--missing::after { display: none; }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(7, 21, 40, .55) 0%, rgba(11, 31, 58, .35) 35%, rgba(11, 31, 58, .88) 78%, var(--navy-900) 100%),
    linear-gradient(90deg, rgba(7, 21, 40, .7) 0%, rgba(7, 21, 40, 0) 70%);
}
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--pattern) center / 90px; opacity: .07; }
.hero__content { padding-top: calc(var(--header-h) + var(--space-5)); padding-bottom: clamp(7rem, 12vw, 10rem); max-width: 900px; }
.hero__title { font-size: var(--fs-h1); color: var(--white); margin-bottom: .35em; text-wrap: balance; }
.hero__title em { font-style: italic; color: var(--gold-300); }
.hero__subtitle { font-size: var(--fs-lead); color: var(--on-navy); max-width: 44ch; }
.hero__motto {
  position: relative; margin: var(--space-3) 0 0; padding-left: 1.25rem; max-width: 42ch;
  font-family: var(--font-serif); font-style: italic; font-size: clamp(1.1rem, 1rem + .6vw, 1.45rem); color: var(--gold-300);
  border-left: 2px solid var(--gold-500);
}
.hero__scroll {
  position: absolute; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  width: 44px; height: 44px; display: grid; place-items: center; color: var(--white); opacity: .8;
}
.hero__scroll .icon { transform: rotate(90deg); animation: nudge 2s ease-in-out infinite; }
@media (max-width: 767px) { .hero__scroll { display: none; } }

/* hero entrance */
.hero-in { opacity: 0; transform: translateY(24px); animation: rise .9s var(--ease) forwards; }
.hero-in:nth-child(2) { animation-delay: .12s; }
.hero-in:nth-child(3) { animation-delay: .24s; }
.hero-in:nth-child(4) { animation-delay: .36s; }
.hero-in:nth-child(5) { animation-delay: .48s; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes heroZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes nudge { 50% { transform: rotate(90deg) translateX(5px); } }

/* stats: overlaps the hero */
.stats { position: relative; z-index: 2; margin-top: -5rem; }
.stats__grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
}
.stat { position: relative; padding: clamp(1.4rem, 1rem + 2vw, 2.5rem) 1rem; text-align: center; }
.stat + .stat::before { content: ''; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: var(--line); }
.stat:nth-child(3)::before { display: none; }
.stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
.stat__num {
  display: block; font-family: var(--font-serif); font-weight: 700; line-height: 1;
  font-size: clamp(2.3rem, 1.6rem + 3vw, 3.8rem); color: var(--navy-900); font-variant-numeric: tabular-nums;
}
.stat__label { display: block; margin-top: .5rem; font-size: .85rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-700); }
@media (min-width: 768px) {
  .stats__grid { grid-template-columns: repeat(4, 1fr); }
  .stat:nth-child(3)::before { display: block; }
  .stat:nth-child(n + 3) { border-top: 0; }
}

/* language focus — the strongest block after the hero */
.langfocus { background: var(--navy-900); color: var(--on-navy); overflow: hidden; }
.langfocus::before { content: ''; position: absolute; inset: 0; background: var(--pattern) center / 80px; opacity: .06; }
.langfocus__grid { position: relative; display: grid; gap: var(--space-4); align-items: center; }
.langfocus__title { font-size: var(--fs-h2); color: var(--white); text-wrap: balance; }
.langfocus__big {
  display: flex; align-items: baseline; margin: var(--space-3) 0 .5rem;
  font-family: var(--font-serif); font-weight: 700; line-height: .9; color: var(--gold-500);
  font-size: clamp(5rem, 3rem + 10vw, 10rem);
}
.langfocus__big small { font-size: .45em; }
.langfocus__cert { font-size: var(--fs-lead); color: var(--white); max-width: 34ch; }
.langfocus__levels { display: flex; flex-wrap: wrap; gap: .6rem; margin: var(--space-3) 0; }
.level {
  display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1rem; border-radius: 999px;
  border: 1px solid rgba(228, 203, 140, .45); color: var(--gold-300); font-weight: 600;
}
.level b { background: var(--gold-500); color: var(--navy-900); border-radius: 6px; padding: .05rem .4rem; font-size: .85rem; }
.langfocus__visual { position: relative; }
.langfocus__photo { border-radius: var(--radius-lg); aspect-ratio: 4 / 3; box-shadow: 0 30px 60px rgba(0, 0, 0, .35); }
.langfocus__photo figcaption {
  position: absolute; left: 1rem; bottom: 1rem; padding: .35rem .8rem; border-radius: 999px;
  background: rgba(7, 21, 40, .75); color: var(--white); font-size: var(--fs-sm);
}
.sat {
  position: relative; margin: -3rem 1rem 0; padding: var(--space-3);
  background: var(--cream); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--teal);
}
.sat__title { font-family: var(--font-sans); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin-bottom: 1rem; font-weight: 700; }
.sat__row { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; }
.sat__row + .sat__row { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.sat__num { font-family: var(--font-serif); font-weight: 700; font-size: 2.8rem; line-height: 1; color: var(--navy-900); min-width: 2.2ch; }
.sat__row p { margin: 0; color: var(--muted); line-height: 1.4; }
.sat__row p strong { display: block; color: var(--navy-900); font-size: 1.05rem; }
.sat__bar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--mist); overflow: hidden; }
.sat__bar span { display: block; height: 100%; width: calc(var(--frac, 1) * 100%); background: linear-gradient(90deg, var(--teal), #14B8A6); border-radius: inherit; transform-origin: left; transform: scaleX(0); transition: transform 1.4s .4s var(--ease); }
.is-visible .sat__bar span { transform: scaleX(1); }
.sat__bar-label { grid-column: 1 / -1; margin: -.4rem 0 0; font-size: .8rem; color: var(--muted); }
@media (min-width: 960px) {
  .langfocus__grid { grid-template-columns: 1fr 1.05fr; gap: var(--space-5); }
  .sat { position: absolute; left: -3rem; bottom: -2.5rem; margin: 0; width: min(360px, 80%); }
}

/* results ring */
.results__grid { display: grid; gap: var(--space-4); align-items: center; }
.ring { position: relative; width: min(320px, 80vw); margin-inline: auto; aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__track { fill: none; stroke: var(--mist); stroke-width: 10; }
.ring__value {
  fill: none; stroke: url(#ringGrad); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.8s var(--ease);
}
.ring.is-drawn .ring__value { stroke-dashoffset: calc(100 - var(--frac, 0) * 100); }
.ring__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring__num { font-family: var(--font-serif); font-weight: 700; font-size: clamp(3.2rem, 2.5rem + 3vw, 4.5rem); line-height: 1; color: var(--navy-900); }
.ring__of { color: var(--muted); font-weight: 500; margin-top: .3rem; }
.results__facts { display: grid; gap: 1rem; }
.fact {
  display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center;
  padding: 1.25rem 1.5rem; border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-sm);
}
.fact__num { font-family: var(--font-serif); font-size: 2.6rem; font-weight: 700; color: var(--navy-900); line-height: 1; min-width: 3ch; }
.fact--accent { background: var(--navy-900); }
.fact--accent .fact__num { color: var(--gold-500); }
.fact p { margin: 0; color: var(--muted); font-weight: 500; }
.fact--accent p { color: var(--on-navy); }
@media (min-width: 900px) { .results__grid { grid-template-columns: 1.1fr .9fr 1fr; } }

/* director */
.director__card {
  display: grid; gap: var(--space-4); padding: clamp(1.5rem, 1rem + 3vw, 3.5rem);
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.director__card::after { content: ''; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; background: var(--pattern) center / 60px; opacity: .12; border-radius: 50%; }
.portrait {
  position: relative; aspect-ratio: 4 / 5; max-width: 300px; border-radius: var(--radius);
  display: grid; place-items: center; text-align: center; padding: 1.5rem;
  background: var(--navy-900) var(--pattern) center / 64px; color: var(--on-navy-muted);
  outline: 1px solid var(--gold-500); outline-offset: -12px;
}
.portrait__mono { font-family: var(--font-serif); font-size: 4rem; color: var(--gold-500); line-height: 1; display: block; margin-bottom: .75rem; }
.portrait__note { font-size: var(--fs-sm); }
.director__text p { font-size: 1.08rem; }
.director__sign { margin-top: var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--line); }
.director__name { font-family: var(--font-serif); font-size: 1.35rem; color: var(--navy-900); margin: 0; }
.director__role { color: var(--gold-700); font-weight: 600; margin: 0; }
@media (min-width: 768px) { .director__card { grid-template-columns: 280px 1fr; align-items: center; } }

/* news cards */
.news-grid { display: grid; gap: var(--space-3); }
@media (min-width: 700px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .news-grid { grid-template-columns: repeat(3, 1fr); } }
.news-card {
  position: relative; display: flex; flex-direction: column; background: var(--white);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.news-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.news-card__media { display: block; aspect-ratio: 16 / 10; }
.news-card__media img { transition: transform .6s var(--ease); }
.news-card:hover .news-card__media img { transform: scale(1.05); }
.news-card__body { display: flex; flex-direction: column; flex: 1; padding: 1.4rem 1.5rem 1.6rem; }
.news-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; font-size: var(--fs-sm); color: var(--muted); margin-bottom: .8rem; }
.news-card__title { font-size: var(--fs-h3); margin-bottom: .6rem; }
.news-card__title a { color: var(--navy-900); text-decoration: none; }
.news-card__title a::after { content: ''; position: absolute; inset: 0; } /* whole card clickable */
.news-card__title a:focus-visible { outline: none; }
.news-card:focus-within { outline: 3px solid var(--teal); outline-offset: 3px; }
.news-card__summary { color: var(--muted); font-size: .98rem; }
.news-card__more { margin-top: auto; display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--teal); }
.news-card__more .icon { width: 18px; transition: transform .25s var(--ease); }
.news-card:hover .news-card__more .icon { transform: translateX(4px); }
@media (min-width: 1024px) {
  .news-card--featured { grid-column: 1 / -1; flex-direction: row; }
  .news-card--featured .news-card__media { flex: 1.3; aspect-ratio: auto; min-height: 380px; }
  .news-card--featured .news-card__body { flex: 1; padding: 2.5rem; justify-content: center; }
  .news-card--featured .news-card__title { font-size: 2rem; }
  .news-card--featured .news-card__more { margin-top: 1rem; }
}

/* gallery mosaic (home) */
.mosaic { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
.mosaic__item { border-radius: var(--radius); display: block; }
.mosaic__item--1 { grid-column: span 2; grid-row: span 2; }
.mosaic--n6 .mosaic__item--6 { grid-column: span 2; }
.mosaic__item img { transition: transform .6s var(--ease); }
.mosaic__item:hover img { transform: scale(1.06); }
.mosaic__caption {
  position: absolute; inset: auto 0 0; padding: 2.5rem 1rem .9rem; color: var(--white); font-size: var(--fs-sm); font-weight: 500;
  background: linear-gradient(transparent, rgba(7, 21, 40, .85)); opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s var(--ease);
}
.mosaic__item:hover .mosaic__caption, .mosaic__item:focus-visible .mosaic__caption { opacity: 1; transform: none; }
@media (hover: none) { .mosaic__caption { opacity: 1; transform: none; } }
@media (min-width: 768px) {
  .mosaic { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 190px; }
  .mosaic--n6 .mosaic__item--6 { grid-column: span 2; }
  .mosaic--n6 .mosaic__item--3 { grid-row: span 2; }
  .mosaic--n6 .mosaic__item--5 { grid-column: span 2; }
}
@media (min-width: 1100px) { .mosaic { grid-auto-rows: 230px; } }

/* contact */
.contact__grid { display: grid; gap: var(--space-4); align-items: stretch; }
.contact__map { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); min-height: 360px; background: var(--mist); }
.contact__map iframe { width: 100%; height: 100%; min-height: 360px; border: 0; }
@media (min-width: 960px) { .contact__grid { grid-template-columns: 1fr 1.25fr; } }

/* motto banner */
.motto {
  position: relative; overflow: hidden; text-align: center; background: var(--navy-900); color: var(--white);
  padding-block: clamp(4rem, 3rem + 5vw, 7rem);
}
.motto::before { content: ''; position: absolute; inset: 0; background: var(--pattern) center / 90px; opacity: .08; }
.motto__label { position: relative; font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-300); margin-bottom: 1.25rem; }
.motto__text {
  position: relative; max-width: 22ch; margin: 0 auto; font-family: var(--font-serif); font-style: italic;
  font-size: clamp(1.8rem, 1.2rem + 2.8vw, 3.4rem); line-height: 1.25; color: var(--white); text-wrap: balance;
}
.motto__text::before { content: '“'; display: block; font-size: 2.2em; line-height: .6; color: var(--gold-500); font-style: normal; }
.motto .divider { position: relative; margin-bottom: 0; }

/* inner page hero */
.page-hero {
  position: relative; overflow: hidden; background: var(--navy-900); color: var(--white);
  padding: calc(var(--header-h) + clamp(3rem, 2rem + 4vw, 6rem)) 0 clamp(3rem, 2rem + 4vw, 5.5rem);
}
.page-hero::before { content: ''; position: absolute; inset: 0; background: var(--pattern) center / 80px; opacity: .07; }
.page-hero::after { content: ''; position: absolute; right: -10%; top: -30%; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(201, 162, 75, .22), transparent 65%); }
.page-hero .container { position: relative; z-index: 1; }
.page-hero__title { font-size: var(--fs-h1); color: var(--white); margin-bottom: .3em; }
.page-hero__lead { font-size: var(--fs-lead); color: var(--on-navy); max-width: 52ch; margin: 0; }
.page-hero--photo { padding-bottom: clamp(4rem, 3rem + 6vw, 8rem); }
.page-hero__media { position: absolute; inset: 0; z-index: 0; opacity: .32; }
.page-hero__media.media--missing::after { display: none; }

/* 7. ABOUT ------------------------------------------------------------- */
.prose { font-size: 1.08rem; }
.prose p { max-width: 68ch; }
.prose h3 { font-size: var(--fs-h3); margin-top: 1.8em; }
.split { display: grid; gap: var(--space-4); align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: var(--space-5); }
  .split--reverse > :first-child { order: 2; }
}
.photo-card { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); background: var(--white); }
.photo-card .media { aspect-ratio: 4 / 3; }
.photo-card figcaption { padding: .9rem 1.2rem; font-size: var(--fs-sm); color: var(--muted); border-top: 3px solid var(--gold-500); }

.mission { font-family: var(--font-serif); font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2.1rem); line-height: 1.4; color: var(--navy-900); max-width: 30ch; }
.mission em { color: var(--gold-700); }

/* timeline */
.timeline { position: relative; display: grid; gap: var(--space-3); padding-left: 2.25rem; }
.timeline::before { content: ''; position: absolute; left: 10px; top: .5rem; bottom: .5rem; width: 2px; background: linear-gradient(var(--gold-500), var(--teal)); }
.timeline__item { position: relative; padding: 1.5rem 1.6rem; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.timeline__item::before {
  content: ''; position: absolute; left: calc(-2.25rem + 3px); top: 1.9rem; width: 16px; height: 16px;
  background: var(--gold-500); transform: rotate(45deg); box-shadow: 0 0 0 5px var(--cream);
}
.timeline__year { font-family: var(--font-serif); font-size: 2.2rem; font-weight: 700; color: var(--navy-900); line-height: 1; margin-bottom: .5rem; }
.timeline__item h3 { font-family: var(--font-sans); font-size: 1.05rem; font-weight: 700; margin-bottom: .35rem; }
.timeline__item p { margin: 0; color: var(--muted); }
@media (min-width: 900px) {
  .timeline { grid-template-columns: repeat(3, 1fr); padding: 3rem 0 0; }
  .timeline::before { left: 0; right: 0; top: 10px; bottom: auto; width: auto; height: 2px; background: linear-gradient(90deg, var(--gold-500), var(--teal)); }
  .timeline__item::before { left: 1.6rem; top: -2.9rem; }
}

/* education model cards */
.cards { display: grid; gap: var(--space-3); }
@media (min-width: 768px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  position: relative; padding: 2rem 1.75rem; border-radius: var(--radius); background: var(--white);
  box-shadow: var(--shadow-sm); border-top: 4px solid var(--gold-500); transition: transform .3s var(--ease), box-shadow .3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--navy-900); color: var(--gold-500); margin-bottom: 1.25rem; }
.card__icon .icon { width: 26px; height: 26px; }
.card h3 { font-size: var(--fs-h3); }
.card p { color: var(--muted); margin: 0; }
.card--teal { border-top-color: var(--teal); }
.card--navy { border-top-color: var(--navy-700); }

.numbers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.number { padding: 1.5rem; border-radius: var(--radius); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); }
.number__value { display: block; font-family: var(--font-serif); font-weight: 700; font-size: clamp(2.2rem, 1.8rem + 2vw, 3.2rem); color: var(--gold-500); line-height: 1; }
.number__label { display: block; margin-top: .5rem; color: var(--on-navy); font-size: .95rem; }
@media (min-width: 900px) { .numbers { grid-template-columns: repeat(3, 1fr); } }

.life { display: grid; gap: var(--space-3); }
@media (min-width: 700px) { .life { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .life { grid-template-columns: repeat(3, 1fr); } .life .photo-card:first-child { grid-column: span 2; grid-row: span 2; } .life .photo-card:first-child { display: flex; flex-direction: column; } .life .photo-card:first-child .media { aspect-ratio: auto; flex: 1; min-height: 300px; } }
.life .photo-card figcaption strong { display: block; color: var(--navy-900); font-family: var(--font-serif); font-size: 1.15rem; margin-bottom: .2rem; }

/* 8. NEWS PAGE --------------------------------------------------------- */
.news-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.load-more { display: flex; justify-content: center; margin-top: var(--space-4); }
.article { padding-top: calc(var(--header-h) + var(--space-5)); padding-bottom: var(--space-6); }
.back-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--navy-900); text-decoration: none; margin-bottom: var(--space-3); }
.back-link:hover { color: var(--teal); }
.article__title { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); text-wrap: balance; }
.article__lead { font-size: var(--fs-lead); color: var(--muted); }
.article__media { border-radius: var(--radius-lg); aspect-ratio: 16 / 9; margin: var(--space-4) 0; box-shadow: var(--shadow); }
.article__share { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.article__copied { color: var(--teal); font-weight: 600; font-size: var(--fs-sm); }
/* on the article view the header sits on cream: use dark text */
.page--article .site-header:not(.is-menu-open) { color: var(--navy-900); }

/* 9. GALLERY & LIGHTBOX ------------------------------------------------ */
.gallery-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.gallery-toolbar .chips { margin: 0; }
.gallery__count { color: var(--muted); font-size: var(--fs-sm); margin: 0; }
.gallery { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); grid-auto-rows: 240px; grid-auto-flow: dense; margin-top: var(--space-4); transition: opacity .15s; }
.gallery.is-filtering { opacity: 0; }
.gallery__item--wide { grid-column: span 1; }
@media (min-width: 600px) { .gallery__item--wide { grid-column: span 2; } }
@media (min-width: 1100px) { .gallery { grid-auto-rows: 280px; } }
.gallery__btn { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: var(--radius); text-align: left; }
.gallery__btn img { transition: transform .6s var(--ease); }
.gallery__btn:hover img { transform: scale(1.05); }
.gallery__caption {
  position: absolute; inset: auto 0 0; display: flex; flex-direction: column; gap: .25rem;
  padding: 3rem 1.1rem 1rem; color: var(--white); font-size: .95rem; line-height: 1.35;
  background: linear-gradient(transparent, rgba(7, 21, 40, .9));
}
.gallery__cat { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-300); }

.lightbox { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 4rem 1rem 1rem; opacity: 0; transition: opacity .25s; }
.lightbox.is-open { opacity: 1; }
.lightbox__backdrop { position: absolute; inset: 0; background: rgba(4, 12, 24, .97); }
.lightbox__figure { position: relative; width: min(1200px, 100%); display: flex; flex-direction: column; gap: .75rem; }
.lightbox__media { border-radius: 10px; max-height: 78vh; aspect-ratio: 3 / 2; background-color: var(--navy-900); }
.lightbox__media img { object-fit: contain; }
.lightbox__caption { display: flex; justify-content: space-between; gap: 1rem; color: var(--on-navy); font-size: .95rem; }
.lightbox__counter { color: var(--gold-300); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lightbox__btn {
  position: absolute; z-index: 1; width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08); color: var(--white); display: grid; place-items: center; transition: background-color .2s;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .2); }
.lightbox__btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lightbox__btn--close { top: .75rem; right: .75rem; }
.lightbox__btn--prev { left: .75rem; top: 50%; transform: translateY(-50%); }
.lightbox__btn--next { right: .75rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 767px) {
  .lightbox__btn--prev, .lightbox__btn--next { top: auto; bottom: 1rem; transform: none; }
  .lightbox { padding-bottom: 5rem; }
}

/* 404 */
.notfound { min-height: 80vh; display: grid; place-items: center; text-align: center; }
.notfound__code { font-family: var(--font-serif); font-size: clamp(6rem, 4rem + 10vw, 11rem); line-height: 1; color: var(--gold-500); margin: 0; }

/* 10. MOTION & PREFERENCES --------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal.reveal--delay-1 { transition-delay: .12s; }
.js .reveal.reveal--delay-2 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal, .hero-in { opacity: 1; transform: none; }
}

/* late additions */
.btn-row--center { position: relative; justify-content: center; }
.langfocus > .container { position: relative; }
.notfound .page-hero__lead { margin-inline: auto; }
.brand__name, .brand__sub { white-space: nowrap; }
@media (max-width: 400px) {
  .brand__name { font-size: 1.05rem; }
  .brand__sub { font-size: .65rem; letter-spacing: .1em; }
  .brand__logo { width: 34px; height: 38px; }
  .lang-switch__btn { min-width: 40px; }
}
/* About › student life: hide cards whose photo is not uploaded yet and fall back to a tidy 2-column grid */
.life .photo-card:has(.media--missing) { display: none; }
@media (min-width: 1100px) {
  .life:has(.media--missing) { grid-template-columns: repeat(2, 1fr); }
  .life:has(.media--missing) .photo-card:first-child { grid-column: auto; grid-row: auto; }
  .life:has(.media--missing) .photo-card:first-child .media { aspect-ratio: 4 / 3; height: auto; min-height: 0; }
}

/* Leadership: photo portraits + deputy cards.
   The source photos are small (≈150 px), so they are shown at modest sizes to stay sharp. */
.director__text .director__name { font-size: 1.35rem; font-weight: 700; }
.director__text .director__role { font-size: 1rem; }
.portrait--photo { padding: 0; overflow: hidden; background: var(--mist); width: 100%; max-width: 220px; margin-inline: auto; }
.portrait--photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
@media (min-width: 768px) { .director__card:has(.portrait--photo) { grid-template-columns: 220px 1fr; } }
.team__mail { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; color: var(--teal); font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.team__mail .icon { width: 18px; height: 18px; flex: none; }
.team__mail:hover { color: var(--navy-900); text-decoration: underline; }
.team__heading { font-size: var(--fs-h3); margin: var(--space-5) 0 var(--space-3); }
.team { display: grid; gap: var(--space-3); }
@media (min-width: 700px) { .team { grid-template-columns: repeat(2, 1fr); max-width: 820px; } }
.team__card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 2rem 1.25rem 1.25rem; background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border-top: 4px solid var(--gold-500);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.team__card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.team__photo {
  width: 140px; height: 140px; border-radius: 50%; overflow: hidden; background: var(--mist);
  box-shadow: 0 0 0 4px var(--white), 0 0 0 6px var(--gold-500);
  margin-bottom: 1.25rem;
}
.team__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.team__body { display: flex; flex-direction: column; align-items: center; flex: 1; }
.team__name { font-size: 1.3rem; margin-bottom: .35rem; }
.team__role { color: var(--gold-700); font-weight: 600; font-size: .95rem; line-height: 1.4; margin-bottom: .5rem; }
.team__card .team__mail { margin-top: auto; font-size: .9rem; }
@media (max-width: 699px) {
  .team__card { flex-direction: row; align-items: center; text-align: left; gap: 1rem; padding: 1.1rem; }
  .team__photo { width: 88px; height: 88px; flex: none; margin: 0 0 0 4px; }
  .team__body { align-items: flex-start; }
  .team__name { font-size: 1.15rem; }
}
