/* =============================================================
   O.E.S.M.C. — Ordo Equestris Sancti Martini Caritativa
   Design system & styles
   Palette : bleu roi · rouge héraldique · or · ivoire
   ============================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Brand colours */
  --c-royal:        #1A3F96; /* bleu de la cape — primaire */
  --c-royal-700:    #132C6E; /* royal profond (hero / footer) */
  --c-royal-900:    #0B1A45; /* royal nuit */
  --c-royal-500:    #2C57C2; /* royal vif (boutons secondaires) */
  --c-azure:        #5481DE; /* azur clair (reflets) */
  --c-red:          #B01225; /* rouge de la cape — secondaire/action */
  --c-red-600:      #8C0E1D;
  --c-red-400:      #CB2236;
  --c-gold:         #C7A24B; /* or — accents */
  --c-gold-soft:    #E3C97A;
  --c-gold-deep:    #9C7C2E;

  /* Neutrals */
  --c-ivory:        #F6EDD9; /* parchemin (crème secondaire) */
  --c-paper:        #FFFFFF; /* cartes */
  --c-paper-warm:   #FCF9F1;
  --c-ink:          #1A1B26; /* texte principal */
  --c-ink-soft:     #4C4E5E; /* texte secondaire */
  --c-ink-faint:    #5E607A; /* assombri pour AA (≥4.5:1 sur crème/blanc) tout en restant « faible » */
  --c-line:         rgba(20, 22, 40, 0.12);
  --c-line-soft:    rgba(20, 22, 40, 0.07);

  /* Typography */
  --font-display: "Cinzel", "Times New Roman", serif;
  --font-serif:   "Cormorant Garamond", Georgia, serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Layout */
  --container:    1180px;
  --container-narrow: 820px;
  --radius:       14px;
  --radius-sm:    8px;
  --radius-lg:    22px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(8, 19, 54, 0.06), 0 2px 6px rgba(8, 19, 54, 0.05);
  --shadow:    0 10px 30px -12px rgba(8, 19, 54, 0.22);
  --shadow-lg: 0 30px 60px -24px rgba(8, 19, 54, 0.35);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 84px;
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--c-ink);
  background-color: var(--c-ivory);
  background-image: url("../assets/pattern-fleur-gold-light.svg");
  background-size: 150px;
  background-position: center top;
  background-attachment: fixed; /* filigrane continu, ancré au viewport */
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { list-style: none; padding: 0; }

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

::selection { background: var(--c-gold-soft); color: var(--c-royal-900); }

/* ---------- 3. Typography ---------- */
h1, h2, h3, h4 { line-height: 1.12; font-weight: 600; letter-spacing: 0.01em; }

.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 1.08rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-red);
  font-weight: 700;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.55rem, 1.05rem + 1.8vw, 2.45rem);
  color: var(--c-royal);
  letter-spacing: 0.02em;
}
/* filet rouge — signature récurrente sous chaque titre de section */
.section-title::after {
  content: ""; display: block; height: 3px; width: 104px; border-radius: 3px;
  background: var(--c-red); margin-top: 0.85rem;
}
.section-head.center .section-title::after { margin-inline: auto; }

.lead {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 1.05rem + 1vw, 1.7rem);
  line-height: 1.5;
  color: var(--c-ink-soft);
  font-weight: 500;
}

.prose p { margin-bottom: 1.1em; color: var(--c-ink-soft); }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--c-ink); font-weight: 600; }

.text-center { text-align: center; }
.muted { color: var(--c-ink-faint); }

/* ---------- 4. Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 0.5rem + 3vw, 2.5rem);
}
.container.narrow { max-width: var(--container-narrow); }

.section { padding-block: clamp(3.5rem, 2rem + 6vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem); }
/* warm cream sections — carry the fleur-de-lis motif like the blue sections */
.section--warm {
  /* translucent warm wash — the single continuous body pattern shows through,
     so the fleur-de-lis grid never restarts at section seams */
  background-color: rgba(201, 162, 75, 0.06);
  border-block: 1px solid var(--c-line-soft);
}
/* deep royal-blue section (light cards float on top) */
.section--royal {
  position: relative; color: #fff; overflow: hidden;
  border-block: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(90% 120% at 50% -12%, rgba(110,156,240,0.30), transparent 60%),
    radial-gradient(80% 120% at 100% 116%, rgba(176,18,37,0.32), transparent 60%),
    linear-gradient(160deg, var(--c-royal-700), var(--c-royal-900));
}
.section--royal::after {
  content: ""; position: absolute; inset: 0; opacity: 0.14; pointer-events: none;
  background-image: url("../assets/pattern-fleur-gold.svg");
  background-size: 150px; background-position: center top; background-attachment: fixed;
}
.section--royal > .container { position: relative; z-index: 1; }
.section--royal .section-title { color: #fff; }
.section--royal .eyebrow { color: var(--c-gold-soft); }
.section--royal .lead { color: rgba(255,255,255,0.82); }
.section--royal .prose p { color: rgba(255,255,255,0.82); }
.section--royal .prose strong { color: #fff; }
.section--royal .btn-primary {
  background: var(--c-gold); border-color: var(--c-gold); color: var(--c-royal-900);
}
.section--royal .btn-primary:hover {
  background: var(--c-gold-soft); border-color: var(--c-gold-soft);
}
/* degrees ladder readable on a royal-blue section */
.section--royal .rung h3 { color: #fff; }
.section--royal .rung .it-name { color: var(--c-gold-soft); }
.section--royal .rung p { color: rgba(255,255,255,0.82); }
.section--royal .rung .medallion { background: rgba(255,255,255,0.96); }
.section--royal .rung:last-child .medallion { background: var(--c-gold); color: var(--c-royal-900); border-color: var(--c-gold); }
.section--royal .ladder::before { background: linear-gradient(var(--c-gold-soft), var(--c-red)); opacity: 0.6; }

.section-head { max-width: 720px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .section-title { margin-top: 0.7rem; }
.section-head .lead { margin-top: 1.1rem; }

/* Decorative ornament divider (gold rule + cross) */
.ornament {
  display: flex; align-items: center; justify-content: center;
  gap: 0.9rem; color: var(--c-gold);
}
.ornament::before, .ornament::after {
  content: ""; height: 1px; width: clamp(40px, 12vw, 120px);
  background: linear-gradient(90deg, transparent, var(--c-gold));
}
.ornament::after { background: linear-gradient(90deg, var(--c-gold), transparent); }
.ornament svg { width: 20px; height: 20px; color: var(--c-red-400); }
.ornament.center { margin-inline: auto; }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-body);
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.02em;
  padding: 0.85rem 1.7rem; border-radius: 999px;
  border: 1.5px solid transparent;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
              color 0.25s var(--ease), border-color 0.25s var(--ease),
              box-shadow 0.25s var(--ease);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; }

/* Système : .btn-red = action (partout) · .btn-primary = bleu secondaire sur fond CLAIR
   · .btn-ghost = bleu secondaire sur fond SOMBRE (hero/cta) · .btn-gold = sur .section--royal.
   (.section--royal transforme automatiquement .btn-primary en or.) */
.btn-red { background: var(--c-red); color: #fff; box-shadow: var(--shadow); }
.btn-red:hover { background: var(--c-red-400); }

.btn-primary { background: var(--c-royal); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--c-royal-500); }

.btn-ghost { background: var(--c-royal-500); border-color: rgba(255,255,255,0.32); color: #fff; box-shadow: var(--shadow); }
.btn-ghost:hover { background: var(--c-royal); border-color: var(--c-gold); color: #fff; }

.btn-gold { background: var(--c-gold); color: var(--c-royal-900); }
.btn-gold:hover { background: var(--c-gold-soft); }

/* ---------- 6. Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease),
              height 0.4s var(--ease);
}
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(8,19,54,0.55), rgba(8,19,54,0));
  opacity: 1; transition: opacity 0.4s var(--ease);
}
body.scrolled .site-header {
  height: 70px;
  background: rgba(251, 247, 238, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--c-line), var(--shadow-sm);
}
body.scrolled .site-header::before { opacity: 0; }

.header-inner {
  width: 100%; max-width: var(--container); margin-inline: auto;
  padding-inline: clamp(1.1rem, 0.5rem + 3vw, 2.5rem);
  display: flex; align-items: center; gap: 1.5rem;
}

.brand { display: flex; align-items: center; gap: 0.8rem; margin-right: auto; }
.brand img { height: 52px; width: auto; transition: height 0.4s var(--ease); filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25)); }
body.scrolled .brand img { height: 44px; filter: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.02rem; letter-spacing: 0.12em; color: #fff;
}
.brand-text span {
  font-size: 0.62rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--c-gold-soft); font-weight: 600;
}
body.scrolled .brand-text b { color: var(--c-royal); }
body.scrolled .brand-text span { color: var(--c-gold-deep); }

/* Primary nav */
.nav { display: flex; align-items: center; gap: 0.3rem; }
.nav a {
  position: relative; padding: 0.5rem 0.9rem; border-radius: 8px;
  font-weight: 500; font-size: 0.95rem; color: rgba(255,255,255,0.92);
  transition: color 0.25s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 0.9rem; right: 0.9rem; bottom: 0.32rem;
  height: 2px; background: var(--c-red); transform: scaleX(0);
  transform-origin: left; transition: transform 0.3s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--c-gold-soft); }
body.scrolled .nav a { color: var(--c-ink); }
body.scrolled .nav a:hover, body.scrolled .nav a[aria-current="page"] { color: var(--c-royal); }

.header-actions { display: flex; align-items: center; gap: 0.9rem; }

/* Language switch */
.lang-switch {
  display: inline-flex; align-items: center;
  border: 1.5px solid rgba(255,255,255,0.45); border-radius: 999px;
  padding: 2px; gap: 2px;
}
body.scrolled .lang-switch { border-color: var(--c-line); }
.lang-switch button {
  border: 0; background: transparent; color: rgba(255,255,255,0.85);
  font-family: var(--font-display); font-weight: 600;
  font-size: 0.72rem; letter-spacing: 0.08em;
  padding: 0.32rem 0.7rem; border-radius: 999px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
body.scrolled .lang-switch button { color: var(--c-ink-soft); }
.lang-switch button.is-active { background: var(--c-gold); color: var(--c-royal-900); }

/* Burger */
.burger {
  display: none; width: 44px; height: 44px; border: 0; background: transparent;
  position: relative; border-radius: 10px;
}
.burger span {
  position: absolute; left: 11px; right: 11px; height: 2px; border-radius: 2px;
  background: #fff; transition: transform 0.3s var(--ease), opacity 0.2s var(--ease), top 0.3s var(--ease);
}
body.scrolled .burger span { background: var(--c-royal); }
.burger span:nth-child(1) { top: 15px; }
.burger span:nth-child(2) { top: 21px; }
.burger span:nth-child(3) { top: 27px; }
body.nav-open .burger span:nth-child(1) { top: 21px; transform: rotate(45deg); }
body.nav-open .burger span:nth-child(2) { opacity: 0; }
body.nav-open .burger span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* Mobile drawer is hidden on desktop; shown as a full-screen drawer ≤900px (see responsive) */
.mobile-nav { display: none; }

/* ---------- 7. Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding-top: var(--header-h);
  color: #fff; overflow: hidden;
  background:
    radial-gradient(115% 95% at 82% -5%, rgba(96,140,232,0.55), transparent 55%),
    radial-gradient(112% 100% at 2% 116%, rgba(176,18,37,0.78), transparent 62%),
    radial-gradient(85% 85% at 102% 102%, rgba(176,18,37,0.46), transparent 62%),
    linear-gradient(158deg, #2750B6, #15326F);
}
.hero::after { /* fleur-de-lis texture */
  content: ""; position: absolute; inset: 0; opacity: 0.16; pointer-events: none;
  background-image: url("../assets/pattern-fleur-gold.svg");
  background-size: 150px; background-position: center top; background-attachment: fixed;
}
.hero-inner {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center; width: 100%;
}
.hero-copy { max-width: 620px; }
.hero .eyebrow { color: var(--c-gold-soft); }
.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.4rem, 1.4rem + 4.4vw, 4.4rem);
  line-height: 1.05; letter-spacing: 0.02em; margin-top: 1rem;
  text-wrap: balance;
}
.hero h1 .accent { color: var(--c-gold-soft); display: block; }
.hero-motto {
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(1.3rem, 1rem + 1.2vw, 1.9rem);
  color: var(--c-gold-soft); margin-top: 1.1rem; letter-spacing: 0.02em;
}
.hero-text {
  margin-top: 1.6rem; font-size: 1.08rem; line-height: 1.7;
  color: rgba(255,255,255,0.82); max-width: 540px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.2rem; }

.hero-emblem { position: relative; display: flex; justify-content: center; }
.hero-emblem .crest {
  width: min(360px, 70%);
  filter: drop-shadow(0 24px 50px rgba(0,0,0,0.45));
  animation: floaty 7s var(--ease) infinite;
}
.hero-emblem .halo {
  position: absolute; inset: 0; margin: auto; width: 78%; aspect-ratio: 1;
  border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(227,201,122,0.32), transparent 65%);
  filter: blur(8px);
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.hero-scroll {
  position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%);
  z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  color: rgba(255,255,255,0.7); font-size: 0.7rem; letter-spacing: 0.25em; text-transform: uppercase;
}
.hero-scroll .mouse {
  width: 22px; height: 36px; border: 1.5px solid rgba(255,255,255,0.5); border-radius: 12px;
  position: relative;
}
.hero-scroll .mouse::after {
  content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 3px; height: 7px; border-radius: 2px; background: var(--c-gold-soft);
  animation: scrolldot 1.8s var(--ease) infinite;
}
@keyframes scrolldot { 0% { opacity: 0; top: 6px; } 40% { opacity: 1; } 80% { opacity: 0; top: 16px; } }
/* hide scroll cue when the hero is too short to avoid overlapping the CTAs */
@media (max-height: 880px) { .hero-scroll { display: none; } }

/* ---------- 8. Crest mini / motto band ---------- */
.motto-band {
  background: var(--c-royal); color: #fff; text-align: center;
  padding-block: 1.4rem;
  background-image: linear-gradient(90deg, var(--c-royal-700), var(--c-royal), var(--c-royal-700));
  border-block: 3px solid var(--c-red);
}
.motto-band p {
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(1.1rem, 0.9rem + 0.8vw, 1.5rem); letter-spacing: 0.03em;
}
.motto-band .latin { color: var(--c-gold-soft); font-weight: 600; font-style: normal;
  font-family: var(--font-display); letter-spacing: 0.18em; }

/* ---------- 9. Intro / presentation split ---------- */
.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.split.reverse .split-media { order: 2; }
.split-media { position: relative; }
.split-media .frame {
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
  border: 1px solid var(--c-line);
}
.split-media .frame img { width: 100%; height: 100%; object-fit: cover; }
.split-media .badge {
  position: absolute; bottom: -22px; right: -10px;
  background: var(--c-paper); border: 1px solid var(--c-line); box-shadow: var(--shadow);
  border-radius: var(--radius); padding: 0.9rem 1.2rem; display: flex; gap: 0.8rem; align-items: center;
}
.split-media .badge b { font-family: var(--font-display); color: var(--c-royal); font-size: 1.4rem; }
.split-media .badge span { font-size: 0.82rem; color: var(--c-ink-soft); line-height: 1.2; }
.split-media .badge .ico { color: var(--c-red); }

/* gold corner accents */
.media-corners { position: relative; }
.media-corners::before, .media-corners::after {
  content: ""; position: absolute; width: 46px; height: 46px; z-index: 2;
  border: 2px solid var(--c-gold);
}
.media-corners::before { top: -10px; left: -10px; border-right: 0; border-bottom: 0; }
.media-corners::after { bottom: -10px; right: -10px; border-left: 0; border-top: 0; }

/* standalone framed feature photo (e.g. the Grand Council) */
.feature-media { max-width: 780px; margin: 3.2rem auto 0; }
.feature-media .frame {
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid var(--c-line);
}
.feature-media .frame img { display: block; width: 100%; height: auto; }
.feature-media figcaption {
  text-align: center; margin-top: 1.1rem; font-family: var(--font-serif);
  font-style: italic; font-size: 1.18rem; color: var(--c-red);
}

/* ---------- 10. Stats strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
}
.stat { text-align: center; padding: 1.2rem; }
.stat b {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 1.4rem + 2vw, 3rem); color: var(--c-royal);
  line-height: 1;
}
.stat span { display: block; margin-top: 0.5rem; font-size: 0.86rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-ink-faint); }
.stat .bar { width: 58px; height: 3px; background: var(--c-red); margin: 0.9rem auto 0; border-radius: 3px; }
/* chiffres uniformes (bleu) — le rouge reste porté par les barres, pas par une alternance décorative qui se lirait comme sémantique */

/* ---------- 11. Degrees (cards) ---------- */
.degrees {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem;
}
.degree {
  position: relative; background: var(--c-paper); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 1.7rem 1.6rem 1.6rem;
  overflow: hidden; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.degree::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(var(--c-royal), var(--c-red));
}
.degree:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.degree .num {
  font-family: var(--font-display); font-weight: 700; font-size: 2.6rem;
  color: var(--c-gold); line-height: 1; opacity: 0.55;
}
.degree h3 {
  font-family: var(--font-display); font-size: 1.04rem; color: var(--c-royal);
  margin-top: 0.6rem; letter-spacing: 0.02em;
}
.degree .it-name { font-family: var(--font-serif); font-style: italic; font-size: 1.28rem; font-weight: 600; color: var(--c-red); margin-top: 0.2rem; }
.degree p { margin-top: 0.6rem; font-size: 0.85rem; color: var(--c-ink-soft); }

/* ---------- 11b. Ladder (degrees timeline) ---------- */
.ladder { position: relative; max-width: 820px; margin-inline: auto; }
.ladder::before {
  content: ""; position: absolute; left: 27px; top: 10px; bottom: 10px; width: 2px;
  background: linear-gradient(var(--c-royal), var(--c-red)); opacity: 0.5;
}
.rung { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 1.3rem;
  padding: 1rem 0; align-items: start; }
.rung .medallion {
  width: 56px; height: 56px; border-radius: 50%; flex: none; z-index: 2;
  display: grid; place-items: center; background: var(--c-paper);
  border: 2px solid var(--c-gold); color: var(--c-royal);
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  box-shadow: var(--shadow-sm);
}
.rung:last-child .medallion { background: var(--c-royal); color: var(--c-gold-soft); border-color: var(--c-royal); }
.rung .rung-body { padding-top: 0.3rem; }
.rung h3 { font-family: var(--font-display); font-size: 1.2rem; color: var(--c-royal); letter-spacing: 0.02em; }
.rung .it-name { font-family: var(--font-serif); font-style: italic; font-size: 1.46rem; font-weight: 600; color: var(--c-red); }
.rung p { margin-top: 0.4rem; color: var(--c-ink-soft); font-size: 0.97rem; }

/* ---------- 11c. Offices (governance) ---------- */
.offices { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.office {
  background: var(--c-paper); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 1.5rem; text-align: center;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.office:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.office .ico { width: 52px; height: 52px; margin: 0 auto 0.9rem; border-radius: 50%;
  display: grid; place-items: center; background: rgba(26,63,150,0.08); color: var(--c-royal); }
.office .ico svg { width: 26px; height: 26px; }
.office h4 { font-family: var(--font-display); color: var(--c-royal); font-size: 1.05rem; }
.office p { margin-top: 0.4rem; font-size: 0.9rem; color: var(--c-ink-soft); }

/* ---------- 12. Structure (pyramid) ---------- */
.structure { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.level {
  background: var(--c-paper-warm); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 1.8rem 1.6rem; text-align: center;
  position: relative; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.level:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.level .ico {
  width: 58px; height: 58px; margin: 0 auto 1rem; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--c-royal);
}
.level:nth-child(2) .ico { background: var(--c-red); }
.level:nth-child(3) .ico { background: var(--c-gold-deep); }
.level .ico svg { width: 28px; height: 28px; }
.level h3 { font-family: var(--font-display); color: var(--c-royal); font-size: 1.2rem; }
.level .sub { font-family: var(--font-serif); font-style: italic; color: var(--c-red); font-size: 1.34rem; font-weight: 600; }
.level p { margin-top: 0.6rem; font-size: 0.92rem; color: var(--c-ink-soft); }

/* ---------- 13. Commende grid ---------- */
/* "Gallery of nations" — circular flag medallions with a gold ring */
.commende-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 2rem 1rem;
}
.commende {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 0.7rem; padding: 0.3rem; transition: transform 0.28s var(--ease);
}
.commende:hover { transform: translateY(-6px); }
.commende .flag {
  flex: none; width: 86px; height: 86px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--c-gold-soft); background: var(--c-paper);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.28s var(--ease), border-color 0.28s var(--ease);
}
.commende .flag img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
/* flags whose emblem sits in a corner/edge — shift the crop onto the motif */
.commende .flag img[src*="/us.png"],
.commende .flag img[src*="/cn.png"],
.commende .flag img[src*="/cf.png"],
.commende .flag img[src*="/cd.png"],
.commende .flag img[src*="/gw.png"] { object-position: left center; }
.commende:hover .flag { box-shadow: var(--shadow); border-color: var(--c-gold); }
.commende b {
  font-family: var(--font-serif); font-weight: 600; font-size: 1.1rem;
  color: var(--c-ink); line-height: 1.25;
}
.commende.forming .flag { filter: grayscale(1); opacity: 0.6; border-color: var(--c-line); }
.commende.forming b { color: var(--c-ink-faint); font-weight: 500; font-style: italic; }

.legend { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.6rem; font-size: 0.85rem; color: var(--c-ink-faint); }
.legend span { display: inline-flex; align-items: center; gap: 0.5rem; }
.legend .dot { width: 12px; height: 12px; border-radius: 3px; background: var(--c-royal); }
.legend .dot.dash { background: transparent; border: 1.5px dashed var(--c-ink-faint); }

/* ---------- 14. Gallery ---------- */
.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: 220px; gap: 0.8rem;
}
.gallery figure {
  position: relative; overflow: hidden; border-radius: var(--radius-sm);
  cursor: zoom-in; background: var(--c-royal-900);
}
.gallery figure.tall { grid-row: span 2; }
.gallery figure.wide { grid-column: span 2; }
.gallery img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s var(--ease), opacity 0.4s var(--ease);
}
.gallery figure:hover img { transform: scale(1.07); }
.gallery figure::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(8,19,54,0.5), transparent 50%);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.gallery figure:hover::after { opacity: 1; }
.gallery figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 0.9rem 1rem; color: #fff; font-size: 0.85rem;
  transform: translateY(8px); opacity: 0; transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.gallery figure:hover figcaption { transform: translateY(0); opacity: 1; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(8,19,54,0.92); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 4vmin;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 10px; box-shadow: var(--shadow-lg); }
.lightbox .lb-close, .lightbox .lb-nav {
  position: absolute; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  transition: background 0.25s var(--ease);
}
.lightbox .lb-close:hover, .lightbox .lb-nav:hover { background: var(--c-gold); color: var(--c-royal-900); }
.lightbox .lb-close { top: 3vmin; right: 3vmin; }
.lightbox .lb-nav.prev { left: 3vmin; top: 50%; transform: translateY(-50%); }
.lightbox .lb-nav.next { right: 3vmin; top: 50%; transform: translateY(-50%); }
.lightbox .lb-nav svg, .lightbox .lb-close svg { width: 24px; height: 24px; }

/* ---------- 15. CTA band ---------- */
.cta {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  background:
    radial-gradient(95% 120% at 50% -10%, rgba(96,140,232,0.42), transparent 60%),
    radial-gradient(92% 120% at 100% 115%, rgba(176,18,37,0.66), transparent 62%),
    radial-gradient(92% 120% at 0% 115%, rgba(176,18,37,0.50), transparent 62%),
    linear-gradient(160deg, #1c43A2, #112456);
}
.cta::after {
  content: ""; position: absolute; inset: 0; opacity: 0.14;
  background-image: url("../assets/pattern-fleur-gold.svg"); background-size: 150px; background-position: center top; background-attachment: fixed;
}
.cta .container { position: relative; z-index: 2; }
.cta h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3rem); }
.cta p { color: rgba(255,255,255,0.8); max-width: 560px; margin: 1rem auto 0; font-size: 1.08rem; }
.cta .hero-cta { justify-content: center; }

/* ---------- 16. Page hero (inner pages) ---------- */
.page-hero {
  position: relative; padding-top: calc(var(--header-h) + 3rem); padding-bottom: 3.2rem;
  color: #fff; overflow: hidden;
  background:
    radial-gradient(90% 120% at 85% -10%, rgba(96,140,232,0.5), transparent 55%),
    radial-gradient(88% 120% at 0% 120%, rgba(176,18,37,0.6), transparent 62%),
    linear-gradient(158deg, #1f44A4, #112456);
}
.page-hero::after {
  content: ""; position: absolute; inset: 0; opacity: 0.15;
  background-image: url("../assets/pattern-fleur-gold.svg"); background-size: 150px; background-position: center top; background-attachment: fixed;
}
.page-hero .container { position: relative; z-index: 2; }
.page-hero .eyebrow { color: var(--c-gold-soft); }
.page-hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.1rem, 1.4rem + 3vw, 3.6rem); margin-top: 0.8rem; letter-spacing: 0.02em;
}
.page-hero p { color: rgba(255,255,255,0.82); max-width: 620px; margin-top: 1rem; font-size: 1.08rem; }

/* Breadcrumb */
.crumbs { display: flex; gap: 0.5rem; align-items: center; font-size: 0.82rem; color: rgba(255,255,255,0.7); margin-bottom: 0.4rem; }
.crumbs a:hover { color: var(--c-gold-soft); }
.crumbs svg { width: 14px; height: 14px; opacity: 0.6; }

/* ---------- 17. Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.info-card {
  display: flex; gap: 1rem; align-items: flex-start; padding: 1.3rem 0;
  border-bottom: 1px solid var(--c-line);
}
.info-card:last-child { border-bottom: 0; }
.info-card .ico {
  flex: none; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--c-royal); color: #fff;
}
.info-card:nth-child(2) .ico { background: var(--c-red); }
.info-card:nth-child(3) .ico { background: var(--c-gold-deep); }
.info-card .ico svg { width: 22px; height: 22px; }
.info-card h4 { font-family: var(--font-display); color: var(--c-royal); font-size: 1.02rem; }
.info-card p, .info-card a { color: var(--c-ink-soft); font-size: 0.98rem; }
.info-card a:hover { color: var(--c-red); }

form .field { margin-bottom: 1.1rem; }
form label { display: block; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--c-ink-soft); margin-bottom: 0.4rem; }
form input, form textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--c-ink);
  background: var(--c-paper); border: 1.5px solid var(--c-line); border-radius: 10px;
  padding: 0.8rem 1rem; transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
form input:focus, form textarea:focus {
  outline: none; border-color: var(--c-royal);
  box-shadow: 0 0 0 4px rgba(26,63,150,0.12);
}
form textarea { resize: vertical; min-height: 130px; }
.form-card { background: var(--c-paper); border: 1px solid var(--c-line); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 1rem + 2vw, 2.6rem); box-shadow: var(--shadow); }

.map-wrap { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--c-line); box-shadow: var(--shadow); margin-top: 2.5rem; }
.map-wrap iframe { width: 100%; height: 360px; border: 0; display: block; filter: grayscale(0.2); }

/* ---------- 18. Footer ---------- */
.site-footer {
  background: var(--c-royal-900); color: rgba(255,255,255,0.72);
  padding-top: clamp(3rem, 2rem + 3vw, 4.5rem);
  position: relative; overflow: hidden;
  border-top: 3px solid var(--c-red);
}
.site-footer::before {
  content: ""; position: absolute; inset: 0; opacity: 0.11;
  background-image: url("../assets/pattern-fleur-gold.svg"); background-size: 150px; background-position: center top; background-attachment: fixed;
}
.footer-top { position: relative; z-index: 2; display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2.2rem; padding-bottom: 3rem; }
.footer-brand img { height: 70px; margin-bottom: 1rem; }
.footer-brand b { font-family: var(--font-display); color: #fff; font-size: 1.05rem; letter-spacing: 0.08em; display: block; }
.footer-brand p { margin-top: 0.8rem; font-size: 0.92rem; max-width: 320px; line-height: 1.7; }
.footer-col h5 {
  font-family: var(--font-display); color: var(--c-gold-soft); font-size: 0.82rem;
  letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 1.1rem;
}
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a, .footer-col p { font-size: 0.94rem; transition: color 0.2s var(--ease); }
.footer-col a:hover { color: var(--c-gold-soft); }
.footer-bottom {
  position: relative; z-index: 2; border-top: 1px solid rgba(255,255,255,0.12);
  padding-block: 1.4rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: 0.84rem; color: rgba(255,255,255,0.55);
}
.footer-bottom .latin { font-family: var(--font-display); letter-spacing: 0.16em; color: var(--c-gold-soft); }

/* ---------- 18b. Biography ---------- */
.bio { max-width: 780px; margin-inline: auto; }
.bio .lead { color: var(--c-ink-soft); }
.bio h3 {
  font-family: var(--font-display); color: var(--c-royal);
  font-size: 1.32rem; letter-spacing: 0.02em; line-height: 1.2;
  margin: 2.2rem 0 0.7rem; padding-left: 0.85rem;
  border-left: 3px solid var(--c-red);
}
.bio h3:first-of-type { margin-top: 0; }
.bio p { color: var(--c-ink-soft); margin-bottom: 1.05em; }
.bio p a { color: var(--c-royal); text-decoration: underline; text-underline-offset: 2px; }
.bio p a:hover { color: var(--c-red); }
.portrait {
  max-width: 460px; margin: 0 auto 2.6rem;
}
.portrait .frame { position: relative; }
.portrait figcaption {
  text-align: center; margin-top: 0.9rem; font-family: var(--font-serif);
  font-style: italic; font-size: 1.2rem; color: var(--c-red);
}

/* ---------- 19. Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }

/* ---------- 20. Responsive ---------- */
@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  :root { --header-h: 72px; }
  .nav, .header-actions .desktop-only { display: none; }
  .burger { display: block; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { margin-inline: auto; }
  .hero-cta { justify-content: center; }
  .hero-emblem { order: -1; margin-bottom: 1rem; }
  .hero-emblem .crest { width: 200px; }
  .split, .contact-grid { grid-template-columns: 1fr; }
  .split.reverse .split-media { order: 0; }
  .split-media { max-width: 540px; margin-inline: auto; }
  .structure { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .stat { padding: 1.2rem 0.4rem; }
  .stat span { overflow-wrap: anywhere; }

  /* Mobile nav drawer */
  .mobile-nav {
    position: fixed; inset: 0; z-index: 99;
    background: linear-gradient(160deg, var(--c-royal-700), var(--c-royal-900));
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0.4rem;
    opacity: 0; visibility: hidden; transition: opacity 0.35s var(--ease), visibility 0.35s;
  }
  body.nav-open .mobile-nav { opacity: 1; visibility: visible; }
  .mobile-nav::after {
    content: ""; position: absolute; inset: 0; opacity: 0.14; pointer-events: none;
    background-image: url("../assets/pattern-fleur-gold.svg"); background-size: 120px;
  }
  .mobile-nav a {
    font-family: var(--font-display); font-size: 1.5rem; color: #fff; letter-spacing: 0.04em;
    padding: 0.6rem 1rem; position: relative; z-index: 2;
    opacity: 0; transform: translateY(14px); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), color 0.2s;
  }
  body.nav-open .mobile-nav a { opacity: 1; transform: none; }
  body.nav-open .mobile-nav a:nth-child(1) { transition-delay: 0.08s; }
  body.nav-open .mobile-nav a:nth-child(2) { transition-delay: 0.13s; }
  body.nav-open .mobile-nav a:nth-child(3) { transition-delay: 0.18s; }
  body.nav-open .mobile-nav a:nth-child(4) { transition-delay: 0.23s; }
  body.nav-open .mobile-nav a:nth-child(5) { transition-delay: 0.28s; }
  .mobile-nav a:hover, .mobile-nav a[aria-current="page"] { color: var(--c-gold-soft); }
  .mobile-nav .lang-switch { margin-top: 1.5rem; z-index: 2; border-color: rgba(255,255,255,0.4); }
  .mobile-nav .lang-switch button { color: rgba(255,255,255,0.85); }
  .mobile-nav .lang-switch button.is-active { color: var(--c-royal-900); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .brand-text { display: none; }
  .gallery { grid-auto-rows: 170px; }
  .gallery figure.wide { grid-column: span 1; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .split-media .badge { right: 50%; transform: translateX(50%); }
}
.desktop-only { }

/* No-JS / reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
.no-js .reveal { opacity: 1; transform: none; }
