/* ==========================================================================
   Rehmat Educational Foundation — design system
   Bright, warm and human. Cream and white carry the page; navy is the ink and
   the punctuation; orange is the action colour. Palette, type and the sun-ray /
   open-book motifs come straight from Brand Guidelines v1.0.
   ========================================================================== */

@import url("../fonts/fonts.css");

:root {
  /* --- brand palette (Brand Guidelines p.03) --- */
  --navy: #081e3a;
  --navy-800: #0c2a50;
  --navy-700: #123566;
  --navy-600: #1b4480;
  --orange: #f58a34;
  --orange-bright: #ffa04f;
  /* WCAG AA. The bright orange above fails as text (2.4:1 under white, about
     3:1 on cream), so text never uses it:
       --orange-deep  large text and icons, 3:1+ on every light tint
       --orange-ink   small text, 4.5:1+ on every light tint */
  --orange-deep: #cf6a19;
  --orange-ink: #a94f10;
  --red: #e6393c;
  --red-deep: #c92a2d;
  --white: #ffffff;
  --gray: #f4f5f7;
  --gray-200: #e7e3db;
  --gray-400: #98a2b3;
  --gray-600: #5f6b7a;

  /* secondary / support tints, used as the page's warm bands */
  --sky: #e6ecf5;
  --sand: #fff3e0;
  --mint: #e7f3ec;
  --cream: #fdf6ea;
  --cream-deep: #f9ecd7;
  --blush: #fdeceb;

  /* --- semantic --- */
  --bg: #fffdf9;
  --ink: var(--navy);
  --ink-soft: #59646f;
  --line: var(--gray-200);
  --card: var(--white);
  --accent: var(--orange);

  /* --- type --- */
  --display: "Bebas Neue", "Arial Narrow", "Haettenschweiler", sans-serif;
  --body: "Montserrat", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --t-hero: clamp(3rem, 8.6vw, 8.4rem);
  --t-h1: clamp(2.5rem, 6vw, 5.2rem);
  --t-h2: clamp(2rem, 4.2vw, 3.5rem);
  --t-h3: clamp(1.35rem, 2.4vw, 2rem);
  --t-h4: clamp(1.1rem, 1.6vw, 1.4rem);
  --t-lead: clamp(1.03rem, 1.3vw, 1.24rem);
  --t-body: clamp(0.97rem, 1.02vw, 1.06rem);
  --t-small: 0.875rem;
  --t-eyebrow: 0.78rem;

  /* --- space & shape --- */
  --pad: clamp(1.25rem, 5vw, 5rem);
  --gap: clamp(1.5rem, 2.8vw, 2.6rem);
  --sec: clamp(4rem, 8vw, 8rem);
  --max: 1320px;
  --max-text: 66ch;
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 30px;
  --r-xl: 44px;
  --r-pill: 999px;

  --shadow-sm: 0 2px 12px rgba(20, 15, 5, 0.05);
  --shadow: 0 18px 44px -18px rgba(28, 22, 10, 0.22);
  --shadow-lg: 0 40px 90px -34px rgba(28, 22, 10, 0.32);
  --shadow-warm: 0 20px 48px -20px rgba(245, 138, 52, 0.4);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --nav-h: 76px;
  --bar-h: 38px;
}

@media (max-width: 1180px) { :root { --bar-h: 0px; } }
@media (max-width: 900px)  { :root { --nav-h: 66px; } }

/* --- tinted bands ------------------------------------------------------- */
.tint-cream { background: var(--cream); }
.tint-sand  { background: var(--sand); }
.tint-sky   { background: var(--sky); }
.tint-mint  { background: var(--mint); }
.tint-white { background: var(--white); }

/* --- the one place we still go dark: the cinematic film + CTA ----------- */
.on-dark {
  --bg: var(--navy);
  --ink: var(--white);
  --ink-soft: #b3c1d4;
  --line: rgba(255, 255, 255, 0.16);
  --card: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  background: var(--bg);
}

/* ==========================================================================
   reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--t-body);
  line-height: 1.68;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* The left/right reveals start their element translated 44px sideways, so a
   section below the fold leaves the page scrollable horizontally until it
   animates in. Clip it here rather than on html: overflow on the root
   propagates to the viewport and breaks the sticky header. */
main { overflow-x: clip; }

img, svg, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--orange); color: var(--navy); }

/* ==========================================================================
   typography
   ========================================================================== */
h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: 0.012em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--ink);
}
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }

h4, h5, .subhead {
  font-family: var(--body);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h4 { font-size: var(--t-h4); }

p { text-wrap: pretty; }
p + p { margin-top: 1em; }

/* Long unbreakable tokens (email addresses, IBANs, URLs) were forcing grid
   tracks wider than the viewport on phones. Let them break. */
p, li, dd, dt, td, .tile, .card, .feat, .approach__body, .legend .k, address {
  overflow-wrap: anywhere;
  min-width: 0;
}
a[href^="mailto:"], .tnum { overflow-wrap: anywhere; }

.lead { font-size: var(--t-lead); line-height: 1.62; color: var(--ink-soft); }
.measure { max-width: var(--max-text); }
.tnum { font-variant-numeric: tabular-nums; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: var(--t-eyebrow);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--orange-ink);
  line-height: 1;
}
.eyebrow::before { content: ""; width: 24px; height: 3px; border-radius: 2px; background: currentColor; flex: none; }
.eyebrow--plain::before { display: none; }
.on-dark .eyebrow { color: var(--orange-bright); }

.hl { color: var(--orange-deep); }
.hl-red { color: var(--red); }

/* a warm highlight that wipes in behind the words as they arrive */
.mark-text {
  background-image: linear-gradient(var(--sand), var(--sand));
  background-repeat: no-repeat;
  background-position: 0 90%;
  background-size: 0% 0.44em;
  transition: background-size 0.9s var(--ease);
  padding: 0 0.1em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.is-in .mark-text { background-size: 100% 0.44em; }
.on-dark .mark-text { background-image: linear-gradient(rgba(245,138,52,.32), rgba(245,138,52,.32)); }

/* ==========================================================================
   layout
   ========================================================================== */
.wrap { width: min(100% - (var(--pad) * 2), var(--max)); margin-inline: auto; }
.wrap--wide { width: min(100% - (var(--pad) * 2), 1600px); margin-inline: auto; }
.wrap--narrow { width: min(100% - (var(--pad) * 2), 880px); margin-inline: auto; }
.section { padding-block: var(--sec); position: relative; }
.section--tight { padding-block: clamp(2.75rem, 5vw, 4.5rem); }
.section--flush-t { padding-top: 0; }
.section--flush-b { padding-bottom: 0; }

.grid { display: grid; gap: var(--gap); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.split--wide-l { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
.split--wide-r { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
.stack { display: flex; flex-direction: column; gap: 1.1rem; align-items: flex-start; }
.row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.center { text-align: center; }
.center .eyebrow { justify-content: center; }
.center .stack { align-items: center; }

@media (max-width: 980px) {
  .split, .split--wide-l, .split--wide-r, .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .g-3.keep-2, .g-4.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.hdr { max-width: 48ch; }
.hdr--center { margin-inline: auto; text-align: center; }
.hdr--center .eyebrow { justify-content: center; }
.hdr > * + * { margin-top: 0.9rem; }

/* ==========================================================================
   buttons
   ========================================================================== */
.btn {
  --btn-bg: var(--orange);
  --btn-ink: var(--navy);
  --btn-line: transparent;
  --btn-flood: var(--navy);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65em;
  padding: 1.02em 1.9em;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-ink);
  border: 2px solid var(--btn-line);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
  overflow: hidden;
  isolation: isolate;
  min-height: 48px;              /* comfortable tap target on touch screens */
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
  will-change: transform;
}
.btn > * { position: relative; z-index: 2; }
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--btn-flood);
  transform: translateY(101%);
  transition: transform 0.55s var(--ease);
}
.btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-warm); color: #fff; }
.btn:hover::after { transform: translateY(0); }
.btn:active { transform: translateY(-1px); }

.btn--red { --btn-bg: var(--red-deep); --btn-ink: #fff; }
.btn--navy { --btn-bg: var(--navy); --btn-ink: #fff; --btn-flood: var(--orange); }
.btn--navy:hover { box-shadow: var(--shadow); }
.btn--white { --btn-bg: #fff; --btn-ink: var(--navy); --btn-flood: var(--orange); }
.btn--ghost { --btn-bg: transparent; --btn-ink: var(--navy); --btn-line: currentColor; --btn-flood: var(--navy); }
.btn--ghost:hover { border-color: var(--navy); }
.on-dark .btn--ghost { --btn-ink: #fff; --btn-flood: var(--orange); }
.btn--sm { padding: 0.7em 1.25em; font-size: 0.78rem; min-height: 44px; }
.btn--lg { padding: 1.18em 2.3em; font-size: 0.96rem; min-height: 56px; }
.btn--block { width: 100%; }
.btn .ico, .ico { width: 1.05em; height: 1.05em; flex: none; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--orange-ink);
  padding-bottom: 2px;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 2px;
  transition: background-size 0.45s var(--ease), color 0.3s;
}
.link:hover { background-size: 0% 2px; }
.link .ico { width: 1.05em; height: 1.05em; flex: none; transition: transform 0.4s var(--ease); }
.link:hover .ico { transform: translateX(4px); }
.on-dark .link { color: var(--orange-bright); }

/* ==========================================================================
   brand graphic elements
   ========================================================================== */
.rays { position: absolute; pointer-events: none; opacity: 0.5; color: var(--orange); }
.dots {
  position: absolute;
  pointer-events: none;
  width: 130px; height: 96px;
  background-image: radial-gradient(currentColor 1.8px, transparent 1.9px);
  background-size: 17px 17px;
  color: var(--orange);
  opacity: 0.35;
}
.rule { height: 1px; background: var(--line); border: 0; }
.rule--brand { height: 4px; width: 64px; border: 0; background: linear-gradient(90deg, var(--orange), var(--red)); border-radius: 3px; }

/* the signature open-book curve, used to separate bands */
.curve { display: block; width: 100%; height: clamp(34px, 4.5vw, 70px); fill: currentColor; }

/* ==========================================================================
   media
   ========================================================================== */
.media { position: relative; overflow: hidden; border-radius: var(--r); background: var(--cream-deep); }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--3x4 { aspect-ratio: 3 / 4; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--16x9 { aspect-ratio: 16 / 9; }
.media--soft { border-radius: var(--r-xl); }
.media--par img { height: 116%; position: absolute; inset: -8% 0 auto 0; will-change: transform; }
.media__cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2.6rem 1.25rem 1.1rem;
  font-size: var(--t-small);
  color: #fff;
  background: linear-gradient(transparent, rgba(8, 30, 58, 0.86));
}
figure figcaption { margin-top: 0.7rem; font-size: var(--t-small); color: var(--ink-soft); }

/* overlapping photo cluster, the theme's signature hero device */
.cluster { position: relative; display: grid; gap: clamp(0.6rem, 1.2vw, 1rem); }
.cluster--hero {
  grid-template-columns: 1fr 1.25fr;
  grid-template-rows: 1.2fr 1fr;
  aspect-ratio: 1 / 0.94;
}
.cluster figure { margin: 0; overflow: hidden; border-radius: var(--r-lg); background: var(--cream-deep); position: relative; }
.cluster figure img { width: 100%; height: 100%; object-fit: cover; }
.cluster--hero > :nth-child(1) { grid-column: 1; grid-row: 1 / span 2; border-radius: var(--r-xl) var(--r-lg) var(--r-lg) var(--r-xl); }
.cluster--hero > :nth-child(2) { grid-column: 2; grid-row: 1; border-radius: var(--r-lg) var(--r-xl) var(--r-lg) var(--r-lg); }
.cluster--hero > :nth-child(3) { grid-column: 2; grid-row: 2; border-radius: var(--r-lg) var(--r-lg) var(--r-xl) var(--r-lg); }

/* ==========================================================================
   cards
   ========================================================================== */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.card__body { padding: clamp(1.2rem, 2vw, 1.7rem); display: flex; flex-direction: column; gap: 0.65rem; flex: 1; }
.card__body > .link { margin-top: auto; padding-top: 0.4rem; align-self: flex-start; }
.card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--cream-deep); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.card:hover .card__media img { transform: scale(1.06); }
.card__date { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red-deep); }
.card__title { font-size: 1.06rem; font-weight: 700; line-height: 1.34; letter-spacing: -0.012em; }
.card p { font-size: 0.93rem; color: var(--ink-soft); }
.on-dark .card__date { color: var(--orange-bright); }

/* ==========================================================================
   utilities
   ========================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -100px; z-index: 999; background: var(--orange); color: var(--navy); padding: 0.8rem 1.2rem; border-radius: var(--r-sm); font-weight: 700; transition: top 0.25s; }
.skip:focus { top: 1rem; }

.pill {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.48em 1em; border-radius: var(--r-pill);
  background: var(--sand); color: var(--orange-ink);
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.pill--red { background: var(--blush); color: var(--red-deep); }
.pill--navy { background: var(--sky); color: var(--navy-700); }
.on-dark .pill { background: rgba(245, 138, 52, 0.18); color: var(--orange-bright); }

.mt-0 { margin-top: 0; } .mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.7rem; } .mt-4 { margin-top: 2.6rem; } .mt-5 { margin-top: 3.6rem; }
.mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.7rem; }
.op-70 { opacity: 0.7; } .nowrap { white-space: nowrap; }

@media print {
  .nav, .topbar, .footer, .dock, .cursor, .preloader, .scrollbar { display: none !important; }
}
