/* Muthl — shared design tokens & base styles */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@400&display=swap');

/* Ya Modren Pro — brand Arabic font (loads locally if installed) */
@font-face {
  font-family: 'Ya Modren Pro';
  src: local('Ya Modren Pro'), local('YaModrenPro'), local('Ya Modern Pro');
  font-display: swap;
}

/* Force Western digits — when Ya Modren Pro displays Arabic-Indic glyphs, swap them */
@font-face {
  font-family: 'WesternDigits';
  src: local('Helvetica Neue'), local('Arial'), local('Segoe UI');
  unicode-range: U+0660-0669, U+06F0-06F9, U+0030-0039;
}

:root {
  /* Brand palette — refined, more elegant tones */
  --cream:       #FAF7F0;
  --cream-soft:  #FDFBF5;
  --cream-deep:  #ECE4D2;
  --navy:        #1B2A4A;
  --navy-soft:   #2A3A5C;
  --gold:        #A6824A;
  --gold-soft:   #C09865;
  --blue-grey:   #4A5066;
  --beige-warm:  #D8BE93;
  --beige-mid:   #C4AE8E;
  --slate:       #5C6B80;
  --ink:         #1B2A4A;
  --line:        rgba(27, 42, 74, 0.10);
  --line-strong: rgba(27, 42, 74, 0.20);

  /* Type — Ya Modren Pro is the brand Arabic font */
  --f-ar: 'WesternDigits', 'Ya Modren Pro', 'Tajawal', system-ui, sans-serif;
  --f-en: 'Cormorant Garamond', 'Tex Gyre Bonum', Georgia, serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing */
  --maxw: 1280px;
  --pad: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--f-ar);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

html[dir="rtl"] body { font-family: var(--f-ar); }
html[dir="ltr"] body { font-family: var(--f-en); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Type scale */
.h-display {
  font-family: var(--f-ar);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.h-display-en {
  font-family: var(--f-en);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(28px, 4vw, 56px);
  line-height: 1.15;
  color: var(--navy);
}
.h-section {
  font-family: var(--f-ar);
  font-weight: 500;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.2;
  color: var(--navy);
  letter-spacing: -0.005em;
}
.eyebrow {
  font-family: var(--f-en);
  font-style: italic;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: lowercase;
}
.eyebrow-ar {
  font-family: var(--f-ar);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--gold);
}
.body-lg { font-size: 18px; line-height: 1.75; color: var(--blue-grey); }
.body { font-size: 16px; line-height: 1.7; color: var(--blue-grey); }
.caption {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--slate);
  text-transform: uppercase;
}

/* Container */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

/* Header / Nav */
.site-header {
  position: absolute;
  top: 18px; left: 18px; right: 18px;
  z-index: 50;
  background: rgba(27, 42, 74, 0.62);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(237, 230, 217, 0.18);
  border-radius: 0;
  /* allow dropdowns to escape */
}
/* Pages without a hero image need top padding so floating header doesn't overlap content */
main { padding-top: 120px; }
body:has(.hero-frame) main,
body:has(.project-hero) main,
body[data-screen-label="01 Home"] main,
body[data-screen-label="03 Muthl 2 — Al-Safwah"] main,
body[data-screen-label="02 Muthl 3 — Al-Fayhaa"] main { padding-top: 0; }
/* Light text on dark glass */
.site-header,
.site-header a,
.site-header button,
.site-header .nav-links,
.site-header .nav-links a {
  color: var(--cream);
}
.site-header .nav-links a:hover,
.site-header .nav-links a.active { color: var(--gold); }
.site-header .nav-links a.active::after { background: var(--gold); }
/* Body needs to allow header to overlay first section */
body { position: relative; }
/* Pages without a dark hero get a contrasting backdrop band so header reads */
body[data-header-mode="solid"] .site-header {
  position: sticky;
  top: 0; left: 0; right: 0;
  background: rgba(27, 42, 74, 0.92);
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid rgba(237, 230, 217, 0.1);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.brand {
  display: flex; align-items: center; gap: 14px;
}
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--f-ar);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.brand-name {
  font-family: var(--f-ar);
  font-weight: 500;
  font-size: 22px;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.brand-sub {
  font-family: var(--f-en);
  font-style: italic;
  font-size: 12px;
  color: var(--slate);
  letter-spacing: 0.04em;
}
.nav-links {
  display: flex; gap: clamp(16px, 2.4vw, 36px);
  align-items: center;
  font-size: 15px;
  color: var(--blue-grey);
}
.nav-links a {
  position: relative;
  padding: 6px 0;
  transition: color .25s ease;
}
.nav-links a:hover { color: var(--navy); }
.nav-links a.active { color: var(--navy); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--gold);
}
.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: var(--navy);
  color: var(--cream);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: background .25s ease;
}
.nav-cta:hover { background: var(--navy-soft); }
.nav-lang {
  font-family: var(--f-en);
  font-style: italic;
  font-size: 14px;
  color: var(--slate);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  transition: all .25s ease;
}
.nav-lang:hover { border-color: var(--gold); color: var(--gold); }

@media (max-width: 880px) {
  .nav-links { display: none; }
}

/* Brand logo */
.brand { display: inline-flex; align-items: center; }
.brand-logo {
  height: 60px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: transform .3s ease;
  filter: brightness(0) invert(1) opacity(0.95);
}
.brand-logo.ripple {
  animation: brand-ripple 700ms cubic-bezier(.25,.6,.25,1);
}
@keyframes brand-ripple {
  0%   { transform: translateY(0)     scale(1);    }
  30%  { transform: translateY(-2px)  scale(1.04); }
  60%  { transform: translateY(0)     scale(0.98); }
  100% { transform: translateY(0)     scale(1);    }
}
.brand-logo-footer {
  height: 110px;
  filter: brightness(0) invert(1) opacity(0.95);
}

/* Splash screen */
body.splash-active { overflow: hidden; }

#muthl-splash {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--cream);
  display: grid; place-items: center;
  transition: transform .8s cubic-bezier(.65,.05,.36,1), opacity .8s;
  will-change: transform;
}
#muthl-splash.out {
  transform: translateY(-100%);
  opacity: 1;
}
.splash-inner {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.splash-logo-wrap {
  position: relative;
  width: clamp(280px, 44vw, 540px);
  aspect-ratio: 800 / 459;
  overflow: hidden;
}
.splash-logo {
  display: block;
  width: 100%; height: auto;
  opacity: 0;
  animation: splash-logo-in 1.4s cubic-bezier(.25,.6,.25,1) 0.2s forwards;
}
.splash-mask {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 100%;
  background: var(--cream);
  transform-origin: right center;
  animation: splash-reveal 1.6s cubic-bezier(.65,.05,.36,1) 0.1s forwards;
  pointer-events: none;
  z-index: 2;
}

/* Animated logo video used as splash (transparent — WebM provides alpha channel) */
.splash-video {
  display: block;
  width: clamp(320px, 60vw, 720px);
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  background: transparent;
  mix-blend-mode: multiply;
}

@keyframes splash-logo-in {
  0%   { opacity: 0; }
  30%  { opacity: 1; }
  100% { opacity: 1; }
}
@keyframes splash-reveal {
  0%   { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
  #muthl-splash { display: none !important; }
}

/* Quick splash on internal navigation (faster + simpler than first-visit splash) */
#muthl-splash.splash-quick .splash-logo {
  animation: splash-logo-quick 0.6s cubic-bezier(.25,.6,.25,1) 0s forwards;
}
#muthl-splash.splash-quick .splash-mask {
  animation: splash-reveal-quick 0.7s cubic-bezier(.65,.05,.36,1) 0s forwards;
}
@keyframes splash-logo-quick {
  0%   { opacity: 0; }
  40%  { opacity: 1; }
  100% { opacity: 1; }
}
@keyframes splash-reveal-quick {
  0%   { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}

/* Outgoing transition overlay (shows briefly before page navigation) */
.muthl-splash-outgoing {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--cream);
  display: grid; place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s cubic-bezier(.4,0,.2,1);
}
.muthl-splash-outgoing.in {
  opacity: 1;
  pointer-events: auto;
}
.muthl-splash-outgoing .splash-logo--out {
  opacity: 0;
  animation: splash-out-fadein .35s cubic-bezier(.25,.6,.25,1) .05s forwards;
}
@keyframes splash-out-fadein {
  0%   { opacity: 0; transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .muthl-splash-outgoing { display: none !important; }
}

/* Nav dropdown */
/* Nav dropdown */
.nav-dd { position: relative; }
.nav-dd-trigger {
  display: inline-flex; align-items: center;
  cursor: pointer;
}
.nav-dd-menu {
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-start: 0;
  min-width: 220px;
  background: var(--navy);
  border: 1px solid rgba(237,230,217,0.18);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
  z-index: 60;
  pointer-events: none;
}
.nav-dd:hover .nav-dd-menu,
.nav-dd:focus-within .nav-dd-menu,
.nav-dd.open .nav-dd-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity .2s ease, transform .2s ease, visibility 0s;
}
.nav-dd-menu a {
  display: block;
  padding: 10px 18px;
  font-size: 14px;
  color: var(--cream) !important;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.nav-dd-menu a:hover { background: rgba(166,130,74,0.18); color: var(--gold) !important; }
.nav-dd-menu a.active { color: var(--gold) !important; }
.nav-dd-menu a::after { display: none !important; }

/* Footer */
.site-footer {
  background: var(--navy);
  color: var(--cream);
  padding: 80px 0 40px;
  margin-top: 120px;
}
.site-footer .h-section { color: var(--cream); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.footer-grid h4 {
  font-family: var(--f-ar); font-weight: 500;
  font-size: 13px; letter-spacing: 0.16em;
  color: var(--beige-warm);
  margin: 0 0 20px;
  text-transform: uppercase;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 12px; font-size: 14px; color: rgba(237,230,217,0.75); }
.footer-grid li a:hover { color: var(--beige-warm); }
.footer-tag {
  font-family: var(--f-en);
  font-style: italic;
  font-size: 22px;
  color: var(--beige-warm);
  margin-top: 18px;
  line-height: 1.4;
}
.footer-bot {
  margin-top: 60px; padding-top: 28px;
  border-top: 1px solid rgba(237,230,217,0.14);
  display: flex; justify-content: space-between; gap: 20px;
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: 0.12em;
  color: rgba(237,230,217,0.55);
  text-transform: uppercase;
}
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-bot { flex-direction: column; }
}

/* Wave divider — fluid wave inspired by the logo */
.wave {
  display: block; width: 100%; height: 28px;
  color: var(--gold);
  opacity: 0.5;
  margin: clamp(40px, 6vw, 80px) 0;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 15px;
  letter-spacing: 0.01em;
  transition: all .3s cubic-bezier(.2,.7,.2,1);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--navy);
  color: var(--cream);
}
.btn-primary:hover { background: var(--gold); color: var(--cream); }
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-gold {
  background: var(--gold);
  color: var(--cream);
}
.btn-gold:hover { background: var(--navy); }

/* Image placeholder — striped warm-tone, with monospace label */
.ph {
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg,
      rgba(150,113,57,0.04) 0 14px,
      rgba(150,113,57,0.10) 14px 28px),
    linear-gradient(180deg, var(--cream-deep), var(--beige-mid));
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid; place-items: center;
  color: var(--navy);
}
.ph::after {
  content: attr(data-label);
  position: absolute;
  inset: auto 0 14px 0;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(31,46,80,0.55);
  text-transform: uppercase;
  pointer-events: none;
}
.ph .ph-icon {
  width: 56px; height: 56px;
  border: 1px solid rgba(31,46,80,0.25);
  border-radius: 50%;
  display: grid; place-items: center;
  color: rgba(31,46,80,0.45);
  font-family: var(--f-en);
  font-style: italic;
  font-size: 18px;
}
.ph-photo > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: transform .8s cubic-bezier(.2,.7,.2,1);
}
.proj-card:hover .ph-photo > img { transform: scale(1.03); }
.ph-photo::after { z-index: 2; color: rgba(237,230,217,0.85); }

/* Section spacing */
section { padding: clamp(60px, 9vw, 120px) 0; }

/* Subtle reveal on scroll */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 1s ease, transform 1s cubic-bezier(.2,.7,.2,1);
}
.reveal.in { opacity: 1; transform: none; }

/* Tag chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 12px;
  color: var(--blue-grey);
  background: rgba(255,255,255,0.4);
}
.chip-status-live { color: var(--gold); border-color: rgba(150,113,57,0.4); }
.chip-status-soon { color: var(--slate); }
.chip-status-done { color: #4a7c59; border-color: rgba(74,124,89,0.35); }

/* Dot */
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* Hairline divider */
.hr {
  height: 1px; background: var(--line);
  border: 0; margin: 0;
}

/* Number glyph (en) */
.num {
  font-family: var(--f-en);
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
}

/* Marquee tag for status */
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: rgba(150,113,57,0.10);
  border-radius: 999px;
  font-size: 12px;
  color: var(--gold);
}
