/* MFC Modern Foundations — shared styles (tokens, type, header, buttons, footer, motion) */

@font-face { font-family: "Google Sans Flex"; src: url("../fonts/GoogleSansFlex-Latin.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; }

/* ───────── Tokens ───────── */
:root {
  /* Colour */
  --navy: #011e53;
  --navy-700: #193668;
  --navy-soft: #99a5ba;
  --bg: #ffffff;
  --surface: #f4f4f5;
  --ink: #000000;          /* headings, links, key text: pure black */
  --title: var(--navy);    /* every title: MFC navy */
  --body: #3d3f44;         /* paragraphs */
  --muted: #65676b;        /* meta, labels, captions */
  --line: #e6e6e8;         /* hairlines */
  --accent: var(--navy);   /* eyebrows, active marks */

  /* Type */
  --font: "Google Sans Flex", system-ui, -apple-system, "Segoe UI", sans-serif;
  --track-display: -0.04em;
  --track-h2: -0.03em;
  --track-h3: -0.012em;
  --track-label: 0.14em;

  /* Layout: 4 cols phone, 12 cols laptop */
  --margin: 16px;
  --gutter: 16px;
  --section: 64px;      /* space above and below each section: 64 phone, 96 laptop, 112 wide */
  --hdr-row: 64px;
  --logo-h: 24px;

  /* Motion */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --dur: .42s;

  /* Glass */
  --glass-light-bg: rgba(237, 239, 242, .42);
  --glass-light-filter: blur(36px) saturate(220%) brightness(1.03);
  --glass-light-shadow: 0 8px 28px rgba(5, 5, 5, .06);
  --glass-dark-bg: rgba(1, 18, 52, .4);
  --glass-dark-filter: blur(32px) saturate(140%);
  --glass-dark-shadow: 0 8px 28px rgba(0, 0, 0, .16);
}
:root[data-theme="dark"] {
  --bg: #000;
  --surface: #00112e;      /* dark mode alternates pure black with deep navy, never grey-black */
  --ink: #ffffff;
  --title: #ffffff;
  --body: #c9cbd0;
  --muted: #a6a8ad;
  --line: #26282c;
  --accent: #ffffff;
}
:root[dir="rtl"] {
  --font: "Thmanyah Sans", system-ui, sans-serif;
  --track-display: 0; --track-h2: 0; --track-h3: 0; --track-label: 0;
}
@media (min-width: 840px) {
  :root { --margin: 48px; --gutter: 24px; --section: 96px; --hdr-row: 76px; --logo-h: 28px; }
}
@media (min-width: 1440px) {
  :root { --margin: 72px; --gutter: 32px; --section: 112px; --logo-h: 30px; }
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.6; font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 0; }
svg { display: block; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
::selection { background: var(--navy); color: #fff; }
.container { width: calc(100% - 2 * var(--margin)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── Type scale ─────────
   Fluid sizes (min at 375px, max at 1920px). Large type is light and tight; small type is regular and open. */
.t-display { font-size: clamp(48px, 6.4vw, 120px); line-height: .96; letter-spacing: var(--track-display); font-weight: 300; margin: 0; }
.t-h2      { font-size: clamp(34px, 3.8vw, 68px);  line-height: 1.02; letter-spacing: var(--track-h2); font-weight: 300; margin: 0; }
.t-h3      { font-size: clamp(20px, 1.45vw, 26px); line-height: 1.2;  letter-spacing: var(--track-h3); font-weight: 400; margin: 0; }

/* Titles in MFC navy; on photos and navy sections they stay white */
h1, h2, h3 { color: var(--title); }
:is([data-tone="dark"], .feat, .lightbox) :is(h1, h2, h3) { color: inherit; }
.t-lead    { font-size: clamp(17px, 1.2vw, 21px);  line-height: 1.5;  font-weight: 300; color: var(--body); margin: 0; }
.t-body    { font-size: 16px; line-height: 1.65; color: var(--body); margin: 0; }
.t-label   { font-size: 12px; line-height: 1; letter-spacing: var(--track-label); text-transform: uppercase; font-weight: 500; color: var(--accent); margin: 0; }
.t-meta    { font-size: 14px; line-height: 1.4; color: var(--muted); margin: 0; font-variant-numeric: tabular-nums; }
.t-num     { font-variant-numeric: tabular-nums; }
:root[dir="rtl"] .t-display { line-height: 1.15; }
:root[dir="rtl"] .t-h2 { line-height: 1.25; }
:root[dir="rtl"] .t-label { font-size: 14px; }

/* ───────── Buttons (sharp) ───────── */
/* One size for every button: 264px wide on laptop, full width on phone; label at the start, arrow at the end */
.btn {
  --btn-h: 52px;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 264px; max-width: 100%; height: var(--btn-h); padding: 0 8px 0 24px;
  font-size: 15px; line-height: 1; font-weight: 500; letter-spacing: .01em; text-decoration: none; white-space: nowrap;
  transition: background-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
:root[dir="rtl"] .btn { padding: 0 24px 0 8px; }
.btn__icon { width: 36px; height: 36px; display: inline-grid; place-items: center; transition: transform .45s var(--ease), background-color .3s var(--ease); }
.btn__icon svg { width: 18px; height: 18px; }
/* Keep the arrow inside the button: the label shortens instead of pushing it out */
.btn__icon { flex: none; }
.btn > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.btn:hover .btn__icon { transform: translate(2px, -2px); }
:root[dir="rtl"] .btn__icon svg { transform: scaleX(-1); }
:root[dir="rtl"] .btn:hover .btn__icon { transform: translate(-2px, -2px); }
.btn:active { transform: scale(.98); }
/* One button style everywhere: glass. It reads the background it sits on:
   light areas get a navy-tinted glass with ink text, dark areas (photos, navy, dark mode) a white-tinted glass with white text. */
.btn, .icon-btn {
  --g-bg: rgba(1, 30, 83, .05); --g-bg-hover: rgba(1, 30, 83, .1); --g-edge: rgba(1, 30, 83, .16); --g-ink: var(--ink);
  background: var(--g-bg); color: var(--g-ink); box-shadow: inset 0 0 0 1px var(--g-edge);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
}
[data-tone="dark"] .btn, [data-tone="dark"] .icon-btn, :root[data-theme="dark"] .btn, :root[data-theme="dark"] .icon-btn {
  --g-bg: rgba(255, 255, 255, .16); --g-bg-hover: rgba(255, 255, 255, .26); --g-edge: rgba(255, 255, 255, .34); --g-ink: #fff;
  -webkit-backdrop-filter: blur(20px) saturate(100%); backdrop-filter: blur(20px) saturate(100%);
}
.btn:hover, .icon-btn:hover { background: var(--g-bg-hover); }
.btn__icon { background: color-mix(in srgb, currentColor 10%, transparent); }

.icon-btn { width: 52px; height: 52px; display: inline-grid; place-items: center; transition: background-color .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease), opacity .3s; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:disabled { opacity: .3; pointer-events: none; }
/* Phone: smaller, lighter buttons everywhere */
@media (max-width: 839px) {
  .btn { --btn-h: 44px; width: 100%; gap: 10px; padding: 0 6px 0 16px; font-size: 14px; }
  :root[dir="rtl"] .btn { padding: 0 16px 0 6px; }
  .btn__icon { width: 32px; height: 32px; }
  .btn__icon svg { width: 16px; height: 16px; }
  .icon-btn { width: 44px; height: 44px; }
  .icon-btn svg { width: 18px; height: 18px; }
}
:root[dir="rtl"] .icon-btn svg { transform: scaleX(-1); }

/* ───────── Header ───────── */
.mfc-header { position: fixed; inset: 0 0 auto 0; z-index: 100; pointer-events: none; }
.mfc-header__bar {
  pointer-events: auto; width: 100%;
  padding: env(safe-area-inset-top) max(var(--margin), env(safe-area-inset-right)) 0 max(var(--margin), env(safe-area-inset-left));
  color: var(--ink); background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; overflow: hidden;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), -webkit-backdrop-filter var(--dur) var(--ease), backdrop-filter var(--dur) var(--ease), color var(--dur) var(--ease);
}
.mfc-header.is-scrolled .mfc-header__bar, .mfc-header.is-open .mfc-header__bar {
  background: var(--glass-light-bg); -webkit-backdrop-filter: var(--glass-light-filter); backdrop-filter: var(--glass-light-filter); box-shadow: var(--glass-light-shadow);
}
.mfc-header.is-over-dark.is-scrolled .mfc-header__bar, .mfc-header.is-over-dark.is-open .mfc-header__bar {
  background: var(--glass-dark-bg); -webkit-backdrop-filter: var(--glass-dark-filter); backdrop-filter: var(--glass-dark-filter); box-shadow: var(--glass-dark-shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .mfc-header.is-scrolled .mfc-header__bar, .mfc-header.is-open .mfc-header__bar { background: rgba(244, 244, 245, .96); }
  .mfc-header.is-over-dark.is-scrolled .mfc-header__bar, .mfc-header.is-over-dark.is-open .mfc-header__bar { background: rgba(1, 30, 83, .94); }
}
.mfc-header.is-over-dark .mfc-header__bar { color: #fff; }
.mfc-header__row { height: var(--hdr-row); display: flex; align-items: center; gap: 24px; }
.mfc-logo { display: inline-flex; align-items: center; height: 44px; margin-inline-end: auto; color: var(--navy); text-decoration: none; transition: color var(--dur) var(--ease); }
:root[data-theme="dark"] .mfc-logo { color: #fff; }
.mfc-logo svg { height: var(--logo-h); width: auto; }
.mfc-header.is-over-dark .mfc-logo { color: #fff; }
.mfc-nav { display: none; }
.mfc-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.mfc-nav a { position: relative; display: inline-flex; align-items: center; height: 44px; padding: 0 14px; font-size: 15px; line-height: 20px; text-decoration: none; color: var(--ink); transition: opacity .2s var(--ease); }
.mfc-nav a:hover { opacity: .6; }
/* Current page: a small square mark under the word */
.mfc-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; background: currentColor; }
.mfc-header.is-over-dark .mfc-nav a { color: #fff; }
.mfc-tools { display: none; align-items: center; gap: 4px; margin-inline-start: 8px; padding-inline-start: 12px; border-inline-start: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.mfc-icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: inherit; transition: opacity .2s; }
.mfc-icon-btn:hover { opacity: .6; }
.mfc-icon-btn svg { width: 22px; height: 22px; }
.mfc-menu-btn { margin-inline-end: -10px; }
.mfc-menu-btn .i-x { display: none; }
.mfc-header.is-open .mfc-menu-btn .i-x { display: block; }
.mfc-header.is-open .mfc-menu-btn .i-list { display: none; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
.mfc-panel { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows var(--dur) var(--ease), opacity .28s var(--ease), visibility 0s linear var(--dur); }
.mfc-header.is-open .mfc-panel { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows var(--dur) var(--ease), opacity .28s var(--ease), visibility 0s; }
.mfc-panel__inner { min-height: 0; overflow: hidden; }
.mfc-panel ul { list-style: none; margin: 0; padding: 8px 0 0; }
.mfc-panel__link { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 28px; line-height: 40px; font-weight: 300; letter-spacing: -.02em; text-decoration: none; color: var(--ink); }
.mfc-panel__link[aria-current="page"]::after { content: ""; width: 6px; height: 6px; background: currentColor; }
.mfc-header.is-over-dark .mfc-panel__link { color: #fff; }
/* Phone menu foot, full width: language + theme share one row, the main button takes the row below */
.mfc-panel__foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 24px 0 24px; }
.mfc-pill { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 12px; font-size: 14px; line-height: 1; text-decoration: none; color: var(--ink);
  background: rgba(1, 30, 83, .05); box-shadow: inset 0 0 0 1px rgba(1, 30, 83, .14); transition: background-color .2s; }
.mfc-pill:hover { background: rgba(1, 30, 83, .1); }
.mfc-pill svg { width: 18px; height: 18px; flex: none; }
.mfc-header.is-over-dark .mfc-pill, :root[data-theme="dark"] .mfc-pill { color: #fff; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.mfc-header.is-over-dark .mfc-pill:hover, :root[data-theme="dark"] .mfc-pill:hover { background: rgba(255, 255, 255, .18); }
.mfc-panel__foot .btn { grid-column: 1 / -1; width: 100%; }
.mfc-header.is-over-dark .mfc-panel__foot .btn { --g-bg: rgba(255, 255, 255, .12); --g-bg-hover: rgba(255, 255, 255, .2); --g-edge: rgba(255, 255, 255, .24); --g-ink: #fff; }
@media (min-width: 840px) {
  .mfc-header__row { display: grid; grid-template-columns: 1fr auto 1fr; }
  .mfc-logo { justify-self: start; margin: 0; }
  .mfc-nav { display: block; }
  .mfc-tools { display: flex; justify-self: end; }
  .mfc-menu-btn, .mfc-panel { display: none; }
}

/* ───────── Footer ─────────
   Navy gradient with a soft white light, and the content inside one glass box.
   To use a photo or pattern behind it later, set --footer-image on .mfc-footer (e.g. url(assets/patterns/footer.jpg)). */
.mfc-footer {
  position: relative; color: #fff; overflow: hidden; isolation: isolate;
  padding: clamp(40px, 6vw, 96px) 0 calc(clamp(24px, 3vw, 48px) + env(safe-area-inset-bottom));
  background:
    var(--footer-image, none) center / cover no-repeat,
    radial-gradient(70% 90% at 12% 0%, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 60%),
    radial-gradient(60% 80% at 92% 100%, rgba(120, 141, 176, .38), rgba(120, 141, 176, 0) 62%),
    linear-gradient(165deg, #0a2a63 0%, var(--navy) 45%, #000c24 100%);
}
.mfc-footer a { color: inherit; text-decoration: none; transition: opacity .2s var(--ease); }
.mfc-footer a:hover { opacity: .6; }
.mfc-footer ul { list-style: none; margin: 0; padding: 0; }

.f-glass {
  display: grid; gap: 32px; padding: clamp(24px, 3.5vw, 56px);
  background: rgba(255, 255, 255, .07);
  -webkit-backdrop-filter: blur(28px) saturate(120%); backdrop-filter: blur(28px) saturate(120%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), inset 0 1px 0 rgba(255, 255, 255, .28), 0 30px 80px rgba(0, 8, 30, .35);
}
.f-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.f-logo svg { height: 32px; width: auto; color: #fff; }
.f-social { display: flex; gap: 22px; }
.f-social__a { display: inline-grid; place-items: center; width: 24px; height: 32px; }
.f-social__a svg { width: 22px; height: 22px; }
.f-row--links { align-items: flex-start; padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, .16); }
.f-pages { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.f-pages a { font-size: 15px; line-height: 1.3; }
.f-docs { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.f-docs a { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.3; color: rgba(255, 255, 255, .72); }
.f-docs svg { width: 18px; height: 18px; flex: none; color: #fff; }
.f-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .62); font-size: 13px; line-height: 1.4; }
.f-bottom ul { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.f-bottom a { font-size: 13px; }
/* Copyright: the very last line, very small */
.f-copy { margin: 16px 0 0; font-size: 11px; line-height: 1.4; letter-spacing: .01em; color: rgba(255, 255, 255, .5); }
@media (max-width: 639px) {
  .f-glass { gap: 24px; }
  .f-logo svg { height: 26px; }
  .f-social { gap: 18px; }
  .f-row--links { flex-direction: column; gap: 20px; padding-top: 24px; }
  .f-pages { gap: 12px 24px; }
  .f-bottom { flex-direction: column; }
}
@media (min-width: 840px) { .f-logo svg { height: 38px; } }

/* ───────── Motion ───────── */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0ms); }
[data-reveal].is-in { opacity: 1; transform: none; }
/* Photo reveal: a curtain lifts while the photo settles */
.reveal-img { overflow: hidden; clip-path: inset(100% 0 0 0); transition: clip-path 1.25s var(--ease-io); transition-delay: var(--d, 0ms); }
.reveal-img img { transform: scale(1.14); transition: transform 1.8s var(--ease); transition-delay: var(--d, 0ms); }
.reveal-img.is-in { clip-path: inset(0 0 0 0); }
.reveal-img.is-in img { transform: scale(1); }
/* Headline lines rise from a mask */
.lines .line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.lines .line > span { display: block; transform: translateY(105%); transition: transform 1.2s var(--ease); transition-delay: var(--d, 0ms); }
.lines.is-in .line > span { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; transition-delay: 0s !important; }
  [data-reveal], .reveal-img, .reveal-img img, .lines .line > span { opacity: 1; transform: none; clip-path: none; }
}
