/* =========================================================
   Qatar National Commission for Education, Culture & Science
   Qatar Government color code: maroon #8A1538 (Pantone 1955C)
   Fluid type scale + fully responsive layout
   ========================================================= */

:root {
  --maroon: #8A1538;
  --maroon-deep: #5E0E26;
  --maroon-tint: #F4E7EC;
  --gold: #BD9B4A;
  --gold-soft: #F3ECDA;
  --paper: #FFFFFF;
  --sand: #F7F4EF;
  --ink: #26191E;
  --stone: #74666C;
  --line: #E5DCD3;

  --font-body: "IBM Plex Sans", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-display: "Marcellus", "Amiri", Georgia, serif;

  /* Fluid type scale — scales smoothly from mobile to desktop */
  --fs-xs:   clamp(11.5px, 0.66rem + 0.15vw, 13px);
  --fs-sm:   clamp(12.5px, 0.72rem + 0.2vw, 13.5px);
  --fs-md:   clamp(13.5px, 0.78rem + 0.25vw, 14.5px);
  --fs-base: clamp(14.5px, 0.84rem + 0.3vw, 16px);
  --fs-lg:   clamp(15.5px, 0.9rem + 0.35vw, 17.5px);
  --fs-xl:   clamp(17px, 0.95rem + 0.5vw, 19px);
  --fs-2xl:  clamp(19px, 1.05rem + 0.7vw, 23px);
  --fs-3xl:  clamp(22px, 1.15rem + 1vw, 27px);
  --fs-stat: clamp(24px, 1.3rem + 1.3vw, 32px);
  --fs-h2:   clamp(26px, 1.35rem + 1.9vw, 40px);
  --fs-h1:   clamp(30px, 1.5rem + 3vw, 56px);

  /* Fluid spacing */
  --space-section: clamp(52px, 4vw + 32px, 88px);
  --space-card: clamp(20px, 1.2rem + 1vw, 27px);

  --radius: 10px;
  --container: 1180px;
  --shadow: 0 8px 30px rgba(38, 25, 30, 0.08);
}

html[lang="ar"] {
  --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-display: "Amiri", "Traditional Arabic", Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  font-size: var(--fs-base);
}
/* Arabic script breathes better with taller lines */
html[lang="ar"] body { line-height: 1.85; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { overflow-wrap: break-word; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 24px);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  padding-block: 10px;
  min-height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 14px);
  color: var(--maroon);
  min-width: 0;
  flex: 1 1 auto;
}
.brand-emblem {
  width: clamp(38px, 3.6vw, 48px);
  height: clamp(38px, 3.6vw, 48px);
  flex: none;
  object-fit: contain;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong {
  font-family: var(--font-display);
  font-size: clamp(12px, 0.42rem + 0.5vw, 15.5px);
  line-height: 1.35;
  color: var(--maroon);
  white-space: nowrap;
}
.brand-text small {
  font-size: clamp(9.5px, 0.55rem + 0.2vw, 11px);
  color: var(--stone);
  letter-spacing: 0.04em;
}
.site-nav {
  display: flex;
  gap: clamp(14px, 1.8vw, 26px);
  margin-inline-start: auto;
  flex: none;
}
.site-nav a {
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--ink);
  padding-block: 6px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--maroon); border-color: var(--gold); }
.site-nav a.active { color: var(--maroon); border-color: var(--maroon); font-weight: 700; }

.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.btn-signin {
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #fff;
  background: var(--maroon);
  border-radius: 999px;
  padding: 8px 18px;
  transition: background 0.2s;
  white-space: nowrap;
}
.btn-signin:hover { background: var(--maroon-deep); }
.lang-toggle {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--maroon);
  background: var(--maroon-tint);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.lang-toggle:hover { background: var(--maroon); color: #fff; }

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-burger span {
  width: 22px; height: 2px;
  background: var(--maroon);
  transition: transform 0.2s;
}

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--maroon) 0%, var(--maroon-deep) 100%);
  color: #fff;
  overflow: hidden;
}
.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cpath d='M48 8 L58 38 L88 48 L58 58 L48 88 L38 58 L8 48 L38 38 Z' fill='none' stroke='white' stroke-width='1.5'/%3E%3Ccircle cx='48' cy='48' r='6' fill='none' stroke='white'/%3E%3C/svg%3E");
  background-size: 96px 96px;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  padding-block: clamp(52px, 8vw, 96px) clamp(36px, 5vw, 56px);
  max-width: 900px;
}
.hero-eyebrow {
  font-size: var(--fs-md);
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: clamp(12px, 1.6vw, 18px);
  font-weight: 600;
}
html[lang="ar"] .hero-eyebrow { letter-spacing: 0.04em; }
.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h1);
  line-height: 1.25;
  margin-bottom: clamp(14px, 2vw, 22px);
}
html[lang="ar"] .hero-title { line-height: 1.45; }
.hero-sub {
  font-size: var(--fs-lg);
  color: rgba(255, 255, 255, 0.88);
  max-width: 720px;
  margin-bottom: clamp(24px, 3vw, 34px);
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: clamp(11px, 1.2vw, 13px) clamp(22px, 2.6vw, 30px);
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--fs-base);
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-light { background: #fff; color: var(--maroon); box-shadow: 0 4px 18px rgba(0,0,0,0.18); }
.btn-ghost { border: 1.5px solid rgba(255,255,255,0.55); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,0.12); }

.hero-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.16);
  border-top: 1px solid rgba(255,255,255,0.16);
  max-width: var(--container);
}
.stat {
  background: transparent;
  padding: clamp(16px, 2.2vw, 26px) clamp(14px, 2vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-num {
  font-family: var(--font-display);
  font-size: var(--fs-stat);
  line-height: 1.15;
  color: #fff;
}
.stat-label { font-size: var(--fs-sm); color: rgba(255,255,255,0.75); }
.stat-gold .stat-num { color: var(--gold); }
.stat-gold .stat-label { color: #E8DCBE; }

/* ---------- Inner page hero ---------- */
.page-hero {
  position: relative;
  background: linear-gradient(160deg, var(--maroon) 0%, var(--maroon-deep) 100%);
  color: #fff;
  overflow: hidden;
}
.page-hero .container {
  position: relative;
  padding-block: clamp(36px, 5vw, 54px) clamp(32px, 4.4vw, 46px);
}
.page-hero .hero-eyebrow { margin-bottom: 10px; }
.page-hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h2);
  line-height: 1.3;
}
html[lang="ar"] .page-hero-title { line-height: 1.5; }

/* ---------- Sections ---------- */
.section { padding-block: var(--space-section); }
.section-sand { background: var(--sand); }
.section-eyebrow {
  color: var(--maroon);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
html[lang="ar"] .section-eyebrow { letter-spacing: 0.05em; }
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h2);
  color: var(--ink);
  margin-bottom: clamp(12px, 1.6vw, 18px);
  line-height: 1.3;
}
html[lang="ar"] .section-title { line-height: 1.5; }
.section-lead {
  color: var(--stone);
  font-size: var(--fs-lg);
  max-width: 680px;
  margin-bottom: clamp(30px, 3.6vw, 42px);
}

/* ---------- Patron section ---------- */
.patron-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.5fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.patron-photo {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 40px rgba(94, 14, 38, 0.18);
}
.patron-photo::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold), var(--maroon));
  z-index: 1;
}
.patron-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: top;
  display: block;
}
.patron-photo figcaption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 14px 18px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(46, 7, 18, 0.85));
  text-align: center;
}
.patron-role {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--gold);
  margin-bottom: clamp(14px, 2vw, 20px);
}
.patron-body p:not(.section-eyebrow):not(.patron-role) {
  font-size: var(--fs-lg);
  color: #3D3036;
  margin-bottom: 16px;
}
.patron-highlights {
  list-style: none;
  margin-top: clamp(16px, 2vw, 22px);
  display: grid;
  gap: 10px;
}
.patron-highlights li {
  position: relative;
  padding-inline-start: 28px;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--maroon);
}
.patron-highlights li::before {
  content: "";
  position: absolute;
  inset-inline-start: 4px;
  top: 0.5em;
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  background: var(--gold);
}
@media (max-width: 900px) {
  .patron-grid { grid-template-columns: 1fr; }
  .patron-photo { max-width: 420px; margin-inline: auto; }
}

/* ---------- Home section tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2vw, 22px);
  margin-top: clamp(28px, 3.4vw, 40px);
}
.tile {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-card);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--maroon);
}
.tile-num {
  font-family: "Marcellus", Georgia, serif;
  font-size: var(--fs-md);
  letter-spacing: 0.12em;
  color: var(--gold);
}
.tile h3 {
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--maroon);
  margin: 8px 0 6px;
  line-height: 1.4;
}
.tile p { font-size: var(--fs-md); color: var(--stone); }

/* ---------- Timeline ---------- */
.timeline {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 34px) clamp(20px, 2.4vw, 28px);
  margin-top: clamp(16px, 2vw, 24px);
}
.timeline-item {
  position: relative;
  padding-block-start: 20px;
  border-block-start: 2px solid var(--line);
}
.timeline-item::before {
  content: "";
  position: absolute;
  top: -6px;
  inset-inline-start: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--maroon);
}
.timeline-year {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  color: var(--maroon);
  display: block;
  margin-bottom: 6px;
  line-height: 1.2;
}
.timeline-item h3 {
  font-size: var(--fs-lg);
  margin-bottom: 6px;
  font-weight: 600;
  line-height: 1.45;
}
.timeline-item p { font-size: var(--fs-md); color: var(--stone); }
.timeline-gold { border-block-start-color: var(--gold); }
.timeline-gold::before { background: var(--gold); }
.timeline-gold .timeline-year { color: var(--gold); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(28px, 4vw, 48px);
  margin-bottom: clamp(36px, 5vw, 56px);
}
.about-body p {
  margin-bottom: 18px;
  color: #3D3036;
  font-size: var(--fs-lg);
}
.about-cards { display: flex; flex-direction: column; gap: clamp(14px, 1.8vw, 20px); }
.pillar-card {
  background: var(--sand);
  border-inline-start: 4px solid var(--maroon);
  border-radius: var(--radius);
  padding: var(--space-card);
}
.pillar-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-2xl);
  color: var(--maroon);
  margin-bottom: 8px;
}
.pillar-card p { font-size: var(--fs-base); color: #3D3036; }

.values-goals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 4vw, 48px);
}
.vg-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-3xl);
  color: var(--maroon);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.vg-list { list-style: none; }
.vg-list li {
  position: relative;
  padding-inline-start: 26px;
  padding-block: 7px;
  font-size: var(--fs-base);
  color: #3D3036;
}
.vg-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: 16px;
  width: 8px; height: 8px;
  transform: rotate(45deg);
  background: var(--gold);
}

/* ---------- Memberships ---------- */
.mem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2vw, 22px);
}
.mem-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.mem-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.mem-featured {
  grid-column: span 3;
  background: linear-gradient(150deg, var(--maroon) 0%, var(--maroon-deep) 100%);
  color: #fff;
  border: none;
}
.mem-featured h3 { color: #fff; font-size: var(--fs-3xl); }
.mem-featured p { color: rgba(255,255,255,0.88); max-width: 880px; }
.mem-featured .mem-tag { background: rgba(255,255,255,0.14); color: var(--gold); }
.mem-featured .mem-period { color: var(--gold); }
.mem-tag {
  align-self: flex-start;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--maroon);
  background: var(--maroon-tint);
  border-radius: 999px;
  padding: 4px 14px;
}
.mem-card h3 {
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1.5;
}
.mem-card p { font-size: var(--fs-md); color: var(--stone); flex: 1; }
.mem-featured p { color: rgba(255,255,255,0.88); }
.mem-period {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--maroon);
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}
.mem-featured .mem-period { border-top-color: rgba(255,255,255,0.25); }

/* ---------- News ---------- */
.news-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(16px, 2.2vw, 26px);
  margin-top: clamp(16px, 2vw, 24px);
}
.news-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.news-media {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2px;
  background: var(--line);
}
.news-media img { width: 100%; height: clamp(180px, 24vw, 260px); object-fit: cover; }
.news-body { padding: clamp(20px, 2.4vw, 28px); }
.news-date {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--maroon);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.news-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-3xl);
  line-height: 1.4;
  margin-bottom: 14px;
}
html[lang="ar"] .news-card h3 { line-height: 1.55; }
.news-card p { font-size: var(--fs-base); color: #3D3036; margin-bottom: 12px; }

/* ---------- Partners marquee ---------- */
.partners { padding-block: var(--space-section) clamp(44px, 5.4vw, 64px); background: var(--sand); }
.partners .section-title { margin-bottom: clamp(26px, 3.4vw, 40px); }
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-rtl 42s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group {
  display: flex;
  align-items: stretch;
  gap: clamp(12px, 1.8vw, 20px);
  padding-inline-end: clamp(12px, 1.8vw, 20px);
}
@keyframes marquee-rtl {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.partner-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: clamp(160px, 22vw, 210px);
  padding: clamp(16px, 2vw, 22px) clamp(18px, 2.6vw, 30px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.partner-badge em {
  font-style: normal;
  font-family: "Marcellus", Georgia, serif;
  font-size: var(--fs-xl);
  color: var(--maroon);
  letter-spacing: 0.05em;
  text-align: center;
}
.partner-badge small { font-size: var(--fs-xs); color: var(--stone); text-align: center; }
.partner-img img { height: clamp(34px, 4vw, 44px); width: auto; }
.partners-hint {
  margin-top: clamp(18px, 2.4vw, 26px);
  font-size: var(--fs-xs);
  color: var(--stone);
  opacity: 0.75;
}

/* ---------- Partners static grid ---------- */
.partner-grid {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 1.8vw, 18px);
  margin-top: clamp(28px, 3.6vw, 40px);
}
.partner-grid .partner-badge { flex: 1 1 220px; }

/* ---------- Contact page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 2vw, 22px);
  margin-top: clamp(28px, 3.6vw, 40px);
}
.contact-card {
  background: var(--sand);
  border-inline-start: 4px solid var(--maroon);
  border-radius: var(--radius);
  padding: var(--space-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contact-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-2xl);
  color: var(--maroon);
}
.contact-card a { color: var(--ink); font-weight: 600; font-size: var(--fs-base); overflow-wrap: anywhere; }
.contact-card a:hover { color: var(--maroon); text-decoration: underline; }
.contact-card p { font-size: var(--fs-md); color: #3D3036; }
.contact-card img { height: 40px; width: auto; object-fit: contain; align-self: flex-start; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--maroon-deep);
  color: rgba(255,255,255,0.85);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: clamp(28px, 4vw, 48px);
  padding-block: clamp(44px, 5.6vw, 64px) clamp(32px, 4.2vw, 48px);
}
.footer-brand strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-2xl);
  color: #fff;
  display: block;
  margin-bottom: 12px;
  line-height: 1.5;
}
.footer-brand p { font-size: var(--fs-md); color: rgba(255,255,255,0.65); max-width: 380px; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links h4 {
  color: var(--gold);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
html[lang="ar"] .footer-links h4 { letter-spacing: 0.04em; }
.footer-links a { font-size: var(--fs-md); color: rgba(255,255,255,0.75); transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
.footer-base {
  border-top: 1px solid rgba(255,255,255,0.14);
  padding-block: 18px;
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.55);
}
.footer-base .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.footer-rights {
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.04em;
  direction: ltr;
}

/* ---------- Login page ---------- */
.login-page { background: var(--sand); }
.login-wrap {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  min-height: 100vh;
  min-height: 100dvh;
}
.login-brandside {
  position: relative;
  background: linear-gradient(160deg, var(--maroon) 0%, var(--maroon-deep) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(36px, 5vw, 56px) clamp(24px, 3.4vw, 40px);
  overflow: hidden;
}
.login-brand-content {
  position: relative;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 1.8vw, 18px);
}
.login-emblem {
  width: clamp(84px, 10vw, 128px);
  height: clamp(84px, 10vw, 128px);
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.login-brand-ar {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 1.2rem + 1vw, 27px);
  line-height: 1.55;
}
.login-brand-en {
  font-size: var(--fs-sm);
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.75);
}
.login-divider {
  width: 56px;
  height: 2px;
  background: var(--gold);
  margin-block: 6px;
}
.login-state {
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--gold);
}
.login-formside {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px clamp(16px, 3vw, 24px);
  position: relative;
}
.login-topbar {
  position: absolute;
  top: 20px;
  inset-inline: clamp(16px, 3vw, 28px);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}
.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: clamp(26px, 3.4vw, 40px) clamp(22px, 3.2vw, 38px) clamp(24px, 3vw, 32px);
}
.login-card h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h2);
  color: var(--maroon);
  margin-bottom: 6px;
}
.login-sub {
  font-size: var(--fs-md);
  color: var(--stone);
  margin-bottom: 24px;
}
.login-error {
  background: #FBEAEA;
  border: 1px solid #E7B8B8;
  color: #8A1520;
  border-radius: 8px;
  font-size: var(--fs-sm);
  padding: 10px 14px;
  margin-bottom: 18px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--ink);
}
.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px; /* ≥16px prevents iOS auto-zoom on focus */
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  outline: none;
  border-color: var(--maroon);
  box-shadow: 0 0 0 3px rgba(138, 21, 56, 0.14);
}
.field input::placeholder { color: #B4A8AD; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-inline-end: 46px; }
.pw-toggle {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--stone);
  cursor: pointer;
  padding: 8px;
  border-radius: 7px;
  display: flex;
}
.pw-toggle:hover { color: var(--maroon); background: var(--maroon-tint); }
.pw-toggle[aria-pressed="true"] { color: var(--maroon); }
.login-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  font-size: var(--fs-sm);
}
.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--ink);
}
.remember input { accent-color: var(--maroon); width: 16px; height: 16px; }
.forgot { color: var(--maroon); font-weight: 600; }
.forgot:hover { text-decoration: underline; }
.btn-submit {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: #fff;
  background: var(--maroon);
  border: none;
  border-radius: 999px;
  padding: 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-submit:hover { background: var(--maroon-deep); transform: translateY(-1px); }
.btn-submit:disabled { opacity: 0.7; cursor: wait; transform: none; }
.login-or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-block: 20px;
  color: var(--stone);
  font-size: var(--fs-xs);
}
.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.btn-tawtheeq {
  width: 100%;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--maroon);
  background: var(--paper);
  border: 1.5px solid var(--maroon);
  border-radius: 999px;
  padding: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-tawtheeq:hover { background: var(--maroon); color: #fff; }
.btn-tawtheeq svg { flex: none; }
.login-help {
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--stone);
  margin-top: 22px;
}
.login-help a { color: var(--maroon); font-weight: 600; }
.login-help a:hover { text-decoration: underline; }
.login-copy {
  margin-top: 26px;
  font-size: var(--fs-xs);
  color: var(--stone);
  text-align: center;
  padding-inline: 16px;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .mem-card:hover, .tile:hover { transform: none; }
}

/* =========================================================
   Responsive breakpoints
   ========================================================= */

/* --- Large tablets / small laptops --- */
@media (max-width: 1020px) {
  .mem-grid { grid-template-columns: 1fr 1fr; }
  .mem-featured { grid-column: span 2; }
  .timeline { grid-template-columns: 1fr 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .news-grid { grid-template-columns: 1fr; }
}

/* --- Tablets / large phones (nav collapses so the full name fits on one line) --- */
@media (max-width: 1080px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 8px 20px 14px;
    box-shadow: 0 12px 24px rgba(38, 25, 30, 0.1);
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    padding-block: 13px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
  }
  .site-nav a.active { border-bottom-color: var(--line); }
  .nav-burger { display: flex; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .about-grid, .values-goals, .footer-grid, .contact-grid { grid-template-columns: 1fr; }
  .brand-text small { display: none; }

  /* Login stacks: brand banner on top, form below */
  .login-wrap { grid-template-columns: 1fr; min-height: auto; }
  .login-brandside { padding: 36px 20px 28px; }
  .login-brand-content { gap: 10px; }
  .login-emblem { width: 76px; height: 76px; }
  .login-brand-ar { font-size: 20px; }
  .login-formside { padding: 68px 16px 36px; }
}

/* --- Phones --- */
@media (max-width: 560px) {
  .mem-grid, .timeline, .tiles { grid-template-columns: 1fr; }
  .mem-featured { grid-column: span 1; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .news-media { grid-template-columns: 1fr; }
  .news-media img { height: 200px; }
  .btn-signin { padding: 7px 13px; }
  .lang-toggle { padding: 6px 12px; }
  .header-inner { gap: 8px; }
  .brand-text strong { white-space: normal; }
  .footer-brand p { max-width: none; }
  .login-row { justify-content: center; text-align: center; }
}

/* --- Small phones --- */
@media (max-width: 380px) {
  .hero-stats { grid-template-columns: 1fr; }
  .brand-text strong { font-size: 12.5px; }
}

/* =========================================================
   Glassmorphism layer - frosted-glass surfaces & buttons
   ========================================================= */

/* Ambient backdrop so the glass has something to refract */
body {
  background:
    radial-gradient(1000px 620px at 88% -8%, rgba(138, 21, 56, 0.10), transparent 62%),
    radial-gradient(820px 540px at -8% 28%, rgba(189, 155, 74, 0.13), transparent 60%),
    radial-gradient(920px 700px at 108% 82%, rgba(138, 21, 56, 0.08), transparent 62%),
    linear-gradient(180deg, #FBF9F6 0%, #F5F1EA 100%);
  background-attachment: fixed;
}
.section-sand,
.partners { background: rgba(247, 244, 239, 0.45); }
.login-page { background: transparent; }
.login-formside { background: transparent; }

/* Frosted header */
.site-header {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 4px 24px rgba(94, 14, 38, 0.06);
}

/* Glass cards */
.tile,
.mem-card,
.news-card,
.pillar-card,
.contact-card,
.partner-badge,
.login-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42));
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 32px rgba(94, 14, 38, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.pillar-card,
.contact-card { border-inline-start: 4px solid var(--maroon); }
.tile:hover,
.mem-card:hover {
  box-shadow: 0 16px 44px rgba(94, 14, 38, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: rgba(138, 21, 56, 0.35);
}

/* Featured membership: dark maroon glass */
.mem-featured {
  background: linear-gradient(150deg, rgba(138, 21, 56, 0.90), rgba(94, 14, 38, 0.88));
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 40px rgba(94, 14, 38, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Hero stats: frosted panels on the maroon hero */
.hero-stats { gap: 10px; background: transparent; border-top: none; padding-block: 14px; }
.stat {
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* Glass buttons */
.btn,
.btn-signin,
.btn-submit,
.btn-tawtheeq,
.lang-toggle,
.pw-toggle {
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
}
.btn-light {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 1);
}
.btn-light:hover { background: rgba(255, 255, 255, 0.96); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.20); }
.btn-signin,
.btn-submit {
  background: linear-gradient(135deg, rgba(138, 21, 56, 0.94), rgba(94, 14, 38, 0.90));
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 20px rgba(94, 14, 38, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn-signin:hover,
.btn-submit:hover {
  background: linear-gradient(135deg, rgba(114, 17, 46, 0.96), rgba(74, 11, 30, 0.94));
}
.lang-toggle {
  background: rgba(244, 231, 236, 0.55);
  border: 1px solid rgba(138, 21, 56, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.lang-toggle:hover { background: rgba(138, 21, 56, 0.92); color: #fff; }
.btn-tawtheeq {
  background: rgba(255, 255, 255, 0.55);
  border: 1.5px solid rgba(138, 21, 56, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.btn-tawtheeq:hover { background: rgba(138, 21, 56, 0.92); }

/* Form fields: light glass */
.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: rgba(138, 21, 56, 0.16);
}
.field input:focus { background: rgba(255, 255, 255, 0.85); }

/* Mobile nav dropdown: frosted */
@media (max-width: 1080px) {
  .site-nav {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  }
}

/* Timeline dots pop slightly on glass */
.timeline-item { border-block-start-color: rgba(138, 21, 56, 0.18); }

/* Fallback: browsers without backdrop-filter get solid surfaces */
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: rgba(255, 255, 255, 0.96); }
  .tile, .mem-card, .news-card, .pillar-card, .contact-card,
  .partner-badge, .login-card { background: rgba(255, 255, 255, 0.94); }
  .btn-signin, .btn-submit { background: var(--maroon); }
}
