/* ============================================================================
   Thamer Al-Tuwaijri — Portfolio
   Faithful recreation of the design handoff. Tokens are the source of truth.
   Design rules (non-negotiable): no emoji, no gradient cards, no rounded
   shadowed cards, no left-border stripes, no em dashes, sharp corners (radius 0),
   structure drawn with 1px hairlines. Arabic leads; English follows, smaller.
   ========================================================================== */

/* ---- Fonts ---------------------------------------------------------------- */
@font-face { font-family: 'Thmanyah Display'; src: url('../fonts/thmanyahserifdisplay-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Thmanyah Display'; src: url('../fonts/thmanyahserifdisplay-Light.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Thmanyah Sans'; src: url('../fonts/thmanyahsans-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Thmanyah Sans'; src: url('../fonts/thmanyahsans-Light.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Thmanyah Sans'; src: url('../fonts/thmanyahsans-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }

/* ---- Tokens --------------------------------------------------------------- */
:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201f1d;
  --color-accent: #b68235;
  --color-divider: color-mix(in srgb, #201f1d 16%, transparent);

  --color-neutral-100: #f8f4f4;
  --color-neutral-200: #eae7e7;
  --color-neutral-300: #d7d3d3;
  --color-neutral-400: #bab6b6;
  --color-neutral-500: #9b9797;
  --color-neutral-600: #7d7979;
  --color-neutral-700: #605d5d;
  --color-neutral-800: #444141;
  --color-neutral-900: #2d2b2b;

  --color-accent-200: #ffe3bf;
  --color-accent-700: #8a6636; /* accent tuned for text use (handoff) */

  /* Fluid rhythm */
  --pad-x: clamp(24px, 5vw, 88px);
  --gap-section: clamp(88px, 12vw, 176px);

  /* Font stacks */
  --font-display: 'Thmanyah Display', 'Times New Roman', serif;      /* Arabic display */
  --font-sans: 'Thmanyah Sans', system-ui, sans-serif;               /* Arabic body/UI */
  --font-en-display: 'Instrument Serif', Georgia, serif;             /* English display */
  --font-en-body: 'Manrope', system-ui, sans-serif;                 /* English body */
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;             /* English labels */

  --brand-scale: 1.9; /* how large the name grows over the hero video */
}

/* ---- Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--color-bg); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-en-body), var(--font-sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--color-text); text-decoration: none; }
a:hover { color: var(--color-accent-700); }
img, video { display: block; max-width: 100%; }
::selection { background: var(--color-accent-200); color: var(--color-text); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
[dir='rtl'] { font-family: var(--font-sans); }

/* ---- Ambient background motion ------------------------------------------- */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient__disc { position: absolute; border-radius: 50%; }
.ambient__disc--gold {
  top: -20%; left: -10%; width: 70vw; height: 70vw;
  background: radial-gradient(circle, rgba(182,130,53,0.34) 0%, rgba(182,130,53,0) 65%);
  filter: blur(50px); animation: amb-a 26s ease-in-out infinite;
}
.ambient__disc--olive {
  bottom: -25%; right: -12%; width: 64vw; height: 64vw;
  background: radial-gradient(circle, rgba(168,164,128,0.4) 0%, rgba(168,164,128,0) 62%);
  filter: blur(56px); animation: amb-b 34s ease-in-out infinite;
}
@keyframes amb-a { 0% { transform: translate(-12%,-8%) scale(1); } 50% { transform: translate(10%,6%) scale(1.18); } 100% { transform: translate(-12%,-8%) scale(1); } }
@keyframes amb-b { 0% { transform: translate(14%,10%) scale(1.1); } 50% { transform: translate(-8%,-12%) scale(0.95); } 100% { transform: translate(14%,10%) scale(1.1); } }

/* ---- Header --------------------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 40px;
  padding: 30px var(--pad-x);
  background: linear-gradient(180deg, rgba(243,242,242,0.88) 0%, rgba(243,242,242,0.5) 55%, rgba(243,242,242,0) 100%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 60%, transparent 100%);
}
.brand { display: flex; flex-direction: column; gap: 4px; transform-origin: left top; transition: transform .5s cubic-bezier(.22,.61,.36,1); will-change: transform; }
.brand__en { font-family: var(--font-en-display); font-size: 22px; line-height: 1; }
.brand__ar { font-family: var(--font-display); font-weight: 300; font-size: 16px; line-height: 1; color: var(--color-neutral-500); }
.nav { display: flex; align-items: center; gap: 34px; padding-top: 4px; }
.nav__item { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--color-neutral-600); }
.nav__item:hover, .nav__item[aria-current='page'] { color: var(--color-text); }
.nav__item[aria-current='page'] .nav__en { color: var(--color-accent-700); }
.nav__en { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; }
.nav__ar { font-family: var(--font-sans); font-size: 12px; }

/* Smooth colour change when the header moves between video and light pages. */
.brand__en, .brand__ar, .nav__item, .nav__en, .nav-toggle span { transition: color .35s ease, background-color .35s ease; }

/* Over the full-screen hero video: drop the white fade, use light text.
   Legibility comes from the hero's own top scrim, so no white band needed. */
.header--over-hero {
  background: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  -webkit-mask-image: none; mask-image: none;
}
.header--over-hero .brand { transform: scale(var(--brand-scale, 1.9)); }
.header--over-hero .brand__en { color: #f3f2f2; }
.header--over-hero .brand__ar { color: rgba(243,242,242,0.72); }
.header--over-hero .nav__item { color: rgba(243,242,242,0.82); }
.header--over-hero .nav__item:hover,
.header--over-hero .nav__item[aria-current='page'] { color: #f3f2f2; }
.header--over-hero .nav__item[aria-current='page'] .nav__en { color: #f3f2f2; }
.header--over-hero .nav-toggle span { background: #f3f2f2; }

/* Hide the header while a project sheet is open (keeps the modal clean and
   stops the nav from being clickable behind it). */
.header { transition: opacity 0.35s ease, color 0.35s ease; }
body.is-sheet-open .header { opacity: 0; pointer-events: none; }

/* Hamburger (mobile only) */
.nav-toggle { display: none; }

/* ---- Layout primitives ---------------------------------------------------- */
main { position: relative; z-index: 1; }
.view { display: none; }
.view.is-active { display: block; }

.frame { position: relative; overflow: hidden; background: var(--color-neutral-200); }
.frame > img, .frame > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame--16-9 { aspect-ratio: 16 / 9; }
.frame--16-10 { aspect-ratio: 16 / 10; }
.frame--4-3 { aspect-ratio: 4 / 3; }
.frame--3-4 { aspect-ratio: 3 / 4; }
.frame--cinema { aspect-ratio: 2.39 / 1; }

/* Blurred-letterbox fit — for portrait/vertical media in landscape frames.
   Full media stays sharp and centered; a blurred, zoomed copy fills behind it.
   Wrapped in .media-fit so the object-fit:cover base rules don't apply to it. */
.media-fit { position: absolute; inset: 0; overflow: hidden; }
.media-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(26px) saturate(1.08); transform: scale(1.15); }
.media-scrim { position: absolute; inset: 0; background: rgba(32,31,29,0.16); }
.media-fg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* Reveal-on-scroll */
[data-reveal] { will-change: opacity, transform; }
[data-reveal].pre-reveal { opacity: 0; transform: translateY(20px); }
[data-reveal].revealed { opacity: 1; transform: none; transition: opacity .9s cubic-bezier(.22,.61,.36,1), transform .9s cubic-bezier(.22,.61,.36,1); }

/* ---- Home: full-screen video hero ----------------------------------------- */
.hero-full {
  position: relative;
  width: 100%;
  height: 100vh;         /* fallback */
  height: 100svh;        /* accounts for mobile browser chrome */
  margin-top: calc(-1 * var(--header-h, 96px)); /* pull up under the sticky header so the video is truly full-viewport */
  overflow: hidden;
  background: var(--color-neutral-900);
}
.hero-full > video, .hero-full > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.hero-full__scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(32,31,29,0.28) 0%, rgba(32,31,29,0) 34%, rgba(32,31,29,0) 55%, rgba(32,31,29,0.66) 100%);
}
.hero-full__inner {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: clamp(72px, 11vh, 132px);
  padding: 0 var(--pad-x);
  display: flex; align-items: flex-end; justify-content: flex-start;
}
.hero-full__head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 24ch; text-align: left; }
.hero-full .hero__ar { color: #f3f2f2; text-align: left; }
.hero-full .hero__en { color: rgba(243,242,242,0.82); text-align: left; }

/* Scroll cue */
.hero-scroll {
  position: absolute; z-index: 2; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: none; border: 0; cursor: pointer; padding: 8px;
}
.hero-scroll__label {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(243,242,242,0.72);
}
.hero-scroll__line { width: 1px; height: 34px; background: rgba(243,242,242,0.5); transform-origin: top; animation: scroll-cue 2.4s ease-in-out infinite; }
@keyframes scroll-cue { 0%, 100% { transform: scaleY(0.4); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }

/* Sponsor marquee (always-moving strip under the hero) */
.sponsors { padding: clamp(30px, 4.5vw, 56px) 0 clamp(18px, 2.5vw, 32px); border-bottom: 1px solid var(--color-divider); overflow: hidden; }
.sponsors__label { display: flex; align-items: baseline; justify-content: center; gap: 12px; margin-bottom: clamp(22px, 3vw, 34px); }
.sponsors__ar { font-family: var(--font-display); font-weight: 300; font-size: 17px; color: var(--color-neutral-500); }
.sponsors__en { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--color-neutral-500); }
.marquee { position: relative; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); }
.marquee__track { display: flex; align-items: center; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__logo {
  height: clamp(22px, 3vw, 32px); width: auto; display: block; object-fit: contain;
  margin-right: clamp(52px, 7vw, 112px);
  filter: brightness(0); opacity: 0.42; transition: opacity 0.3s ease;
}
.marquee__logo:hover { opacity: 0.85; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; } }

/* Intro band (first content after the hero) */
.hero-intro {
  display: flex; flex-direction: column; gap: 10px;
  padding: clamp(56px, 9vw, 128px) var(--pad-x) 0;
}
.hero-intro .hero__intro-ar { margin: 0; font-family: var(--font-sans); font-size: 18px; line-height: 1.9; color: var(--color-neutral-700); max-width: 40ch; }
.hero-intro .hero__intro-en { margin: 0; font-size: 15px; line-height: 1.75; color: var(--color-neutral-600); max-width: 46ch; text-wrap: pretty; }

/* ---- Home (legacy inline hero, retained for reference) -------------------- */
.hero { padding: clamp(56px, 9vw, 140px) var(--pad-x) clamp(40px, 5vw, 72px); display: flex; flex-direction: column; gap: 40px; }
.hero__head { display: flex; flex-direction: column; gap: 18px; }
.hero__ar { margin: 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(44px, 7.2vw, 118px); line-height: 1.28; max-width: 20ch; text-wrap: pretty; }
.hero__en { margin: 0; font-family: var(--font-en-display); font-size: clamp(24px, 3.2vw, 48px); line-height: 1.12; letter-spacing: -0.018em; max-width: 26ch; color: var(--color-neutral-700); text-wrap: pretty; }
.hero__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; flex-wrap: wrap; }
.hero__intro { display: flex; flex-direction: column; gap: 10px; }
.hero__intro-ar { margin: 0; font-family: var(--font-sans); font-size: 16px; line-height: 1.9; color: var(--color-neutral-600); max-width: 38ch; }
.hero__intro-en { margin: 0; font-size: 14px; line-height: 1.75; color: var(--color-neutral-600); max-width: 44ch; text-wrap: pretty; }
.reel { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--color-accent-700); }
.reel__ar { font-family: var(--font-sans); letter-spacing: 0; font-size: 12px; }

.hero-media { padding: 0 var(--pad-x); }

.statement { padding: var(--gap-section) var(--pad-x) 0; }
.statement__inner { display: flex; flex-direction: column; gap: 34px; }
/* Arabic sits at the right of the page (RTL); English stays left. */
.statement__ar { margin: 0; align-self: flex-end; text-align: right; font-family: var(--font-display); font-weight: 300; font-size: clamp(26px, 3.4vw, 52px); line-height: 1.6; color: var(--color-text); max-width: 30ch; }
.statement__en { margin: 0; font-family: var(--font-en-display); font-size: clamp(20px, 2.3vw, 34px); line-height: 1.3; letter-spacing: -0.012em; color: var(--color-neutral-600); max-width: 40ch; text-wrap: pretty; }

/* ---- Work grids ----------------------------------------------------------- */
.work-section { padding: var(--gap-section) var(--pad-x) 0; }
.grid { display: grid; }
.grid--home { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: clamp(48px, 6vw, 80px) clamp(24px, 3vw, 44px); }
.grid--work { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: clamp(48px, 6vw, 80px) clamp(24px, 3vw, 44px); padding-top: clamp(48px, 6vw, 88px); }

/* Uniform poster cards: same portrait shape everywhere, full poster always
   visible (contained over a blurred copy of itself). */
.card { display: flex; flex-direction: column; gap: 16px; }
.card__media { position: relative; overflow: hidden; background: var(--color-neutral-200); aspect-ratio: 2 / 3; }
.card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Hover clip fills the whole tile (cover) so it fully replaces the poster
   rather than floating as a letterboxed band. Landscape clips center-crop. */
.card__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.card:hover .card__video.has-src { opacity: 1; }
.card__overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  padding: 22px 24px; pointer-events: none; opacity: 0; transition: opacity .45s ease;
  background: linear-gradient(180deg, rgba(32,31,29,0) 40%, rgba(32,31,29,0.66) 100%);
}
.card:hover .card__overlay, .card:focus-visible .card__overlay { opacity: 1; }
.card--work .card__overlay { gap: 5px; padding: 20px 22px; }
.card__overlay-ar { align-self: flex-end; text-align: right; color: #f3f2f2; font-family: var(--font-sans); font-size: 15px; line-height: 1.7; max-width: 44ch; }
.card__overlay-en { color: rgba(243,242,242,0.82); font-size: 12.5px; line-height: 1.55; max-width: 48ch; text-wrap: pretty; }
.card--work .card__overlay-ar { font-size: 14px; max-width: 40ch; }
.card--work .card__overlay-en { font-size: 12px; max-width: 44ch; }

/* Card title line: English left (LTR), Arabic right (RTL), at opposite ends. */
.card__meta { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.card__title-en { text-align: left; }
.card__title-ar { text-align: right; }
.card__title-ar { font-family: var(--font-display); font-size: 24px; }
.card__title-en { font-family: var(--font-en-display); font-size: 23px; color: var(--color-neutral-600); }
.card--work .card__title-ar { font-size: 22px; }
.card--work .card__title-en { font-size: 21px; }
.card__role { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.card__progress { display: flex; flex-direction: column; gap: 7px; margin-top: 2px; }
.card__progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card__progress-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-neutral-500); }
.card__progress-pct { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; color: var(--color-accent-700); }
.card__progress-track { position: relative; height: 2px; background: var(--color-neutral-300); }
.card__progress-fill { position: absolute; inset: 0 auto 0 0; height: 100%; background: var(--color-accent); }

.card__role-ar { font-family: var(--font-sans); font-size: 12px; color: var(--color-neutral-500); }
.card__role-en { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--color-neutral-400); }

/* ---- Work index header + filters ------------------------------------------ */
.work { padding: clamp(40px, 6vw, 96px) var(--pad-x) 0; }
.work__head { display: flex; flex-direction: row-reverse; align-items: flex-end; justify-content: space-between; gap: 36px; flex-wrap: wrap; padding-bottom: 24px; border-bottom: 1px solid var(--color-divider); }
.work__title { display: flex; flex-direction: row-reverse; align-items: baseline; gap: 22px; }
.work__title-ar { margin: 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(44px, 6vw, 92px); line-height: 1.1; }
.work__title-en { font-family: var(--font-en-display); font-size: clamp(26px, 3.2vw, 46px); color: var(--color-neutral-500); letter-spacing: -0.02em; }
.filters { display: flex; gap: 24px; flex-wrap: wrap; padding-bottom: 10px; }
.filter { display: flex; align-items: baseline; gap: 7px; color: var(--color-neutral-500); background: none; border: 0; cursor: pointer; font: inherit; padding: 0; }
.filter:hover { color: var(--color-text); }
.filter.is-active { color: var(--color-accent-700); }
.filter__ar { font-family: var(--font-sans); font-size: 13px; }
.filter__en { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; }

/* ---- About ---------------------------------------------------------------- */
.about { padding: clamp(40px, 6vw, 96px) var(--pad-x) 0; }
/* Picture on the left, all text/content on the right. */
.about__grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.15fr); gap: clamp(48px, 7vw, 104px); align-items: start; }
.about__portrait { order: -1; }
.about__col { display: flex; flex-direction: column; gap: 28px; }
.about__ar { margin: 0; align-self: flex-end; text-align: right; font-family: var(--font-display); font-weight: 300; font-size: clamp(32px, 4.6vw, 66px); line-height: 1.45; max-width: 26ch; text-wrap: pretty; }
.about__en { margin: 0; font-family: var(--font-en-display); font-size: clamp(21px, 2.4vw, 32px); line-height: 1.25; letter-spacing: -0.016em; color: var(--color-neutral-600); max-width: 30ch; text-wrap: pretty; }
.about__body-ar { margin: 0; align-self: flex-end; text-align: right; font-family: var(--font-sans); font-size: 16px; line-height: 2; color: var(--color-neutral-700); max-width: 52ch; }
.about__body-en { margin: 0; font-size: 14.5px; line-height: 1.85; color: var(--color-neutral-600); max-width: 58ch; text-wrap: pretty; }

/* CV — a clearly noticeable row: serif label + accent-outlined buttons. */
.cv { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px 28px; margin-top: 28px; padding: 24px 0; border-top: 1px solid var(--color-divider); border-bottom: 1px solid var(--color-divider); }
.cv__label { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cv__en { align-self: flex-start; font-family: var(--font-en-display); font-size: clamp(20px, 2.2vw, 28px); line-height: 1; letter-spacing: -0.01em; color: var(--color-text); }
.cv__ar { align-self: flex-end; text-align: right; font-family: var(--font-display); font-weight: 300; font-size: 17px; color: var(--color-neutral-500); }
.cv__actions { display: flex; gap: 12px; }
.cv__actions a {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--color-accent-700); border: 1px solid var(--color-accent); padding: 12px 20px;
  transition: background 0.25s ease, color 0.25s ease;
}
.cv__actions a:first-child { background: var(--color-accent); color: #f3f2f2; } /* primary */
.cv__actions a:first-child:hover { background: var(--color-accent-700); }
.cv__actions a:last-child:hover { background: color-mix(in srgb, var(--color-accent) 14%, transparent); }
@media (max-width: 520px) { .cv__actions { width: 100%; } .cv__actions a { flex: 1; justify-content: center; } }

.listblock { display: flex; flex-direction: column; }
.listblock--selections { margin-top: 24px; }
.listblock--disciplines { margin-top: 28px; }
.listblock__head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 18px; border-bottom: 1px solid var(--color-divider); }
.listblock__head-en { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--color-neutral-600); }
.listblock__head-ar { font-family: var(--font-display); font-size: 18px; color: var(--color-neutral-500); }
.listrow { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--color-neutral-200); font-size: 15px; }
.listrow__ar-display { font-family: var(--font-display); font-size: 18px; color: var(--color-neutral-500); }
.disciplines { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(24px, 4vw, 56px); }
.disciplines .listrow { padding: 15px 0; gap: 12px; }
.disciplines .listrow__ar { font-family: var(--font-sans); font-size: 14px; color: var(--color-neutral-500); }
.about__portrait { position: relative; aspect-ratio: 3 / 4; background: var(--color-neutral-200); overflow: hidden; }
.about__portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---- Contact -------------------------------------------------------------- */
.contact { padding: clamp(56px, 9vw, 140px) var(--pad-x) 0; min-height: 52vh; }
.contact__inner { display: flex; flex-direction: column; gap: clamp(40px, 6vw, 72px); max-width: 1080px; }
.contact__head { display: flex; flex-direction: column; gap: 18px; }
.contact__ar { margin: 0; align-self: flex-end; text-align: right; font-family: var(--font-display); font-weight: 300; font-size: clamp(44px, 6.4vw, 100px); line-height: 1.3; max-width: 18ch; text-wrap: pretty; }
.contact__en { margin: 0; font-family: var(--font-en-display); font-size: clamp(22px, 2.8vw, 40px); line-height: 1.15; letter-spacing: -0.016em; color: var(--color-neutral-600); max-width: 24ch; }
.contact__rows { display: flex; flex-direction: column; }
.contact__row { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 22px 0; border-top: 1px solid var(--color-divider); }
.contact__row:last-child { border-bottom: 1px solid var(--color-divider); }
.contact__label { display: flex; align-items: baseline; gap: 10px; }
.contact__label-ar { font-family: var(--font-sans); font-size: 13px; color: var(--color-neutral-500); }
.contact__label-en { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--color-neutral-600); }
.contact__value { font-family: var(--font-en-display); font-size: clamp(19px, 2.6vw, 34px); }
.contact__value-pair { display: flex; align-items: baseline; gap: 14px; }
.contact__value-ar { font-family: var(--font-display); font-size: clamp(19px, 2.4vw, 30px); }
.contact__value-en { font-family: var(--font-en-display); font-size: clamp(17px, 2vw, 26px); color: var(--color-neutral-500); }

/* ---- Footer --------------------------------------------------------------- */
.footer { position: relative; z-index: 1; margin-top: clamp(96px, 13vw, 200px); padding: clamp(48px, 6vw, 88px) var(--pad-x) 40px; border-top: 1px solid var(--color-divider); display: flex; flex-direction: column; gap: clamp(48px, 7vw, 96px); }
.footer__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.footer__avail-wrap { display: flex; flex-direction: column; gap: 20px; }
.footer__avail { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.footer__avail-ar { font-family: var(--font-sans); font-size: 14px; color: var(--color-neutral-600); }
.footer__avail-en { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--color-neutral-600); }
.footer__email { font-family: var(--font-en-display); font-size: clamp(24px, 4.4vw, 64px); line-height: 1; letter-spacing: -0.022em; }
.footer__email:hover { color: var(--color-accent-700); }
.footer__links { display: flex; gap: 26px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--color-neutral-600); padding-bottom: 12px; }
.footer__links a { color: var(--color-neutral-600); display: inline-flex; align-items: center; gap: 7px; }
.footer__links a:hover { color: var(--color-text); }
.footer__links svg { display: block; }
.footer__legal { display: flex; justify-content: space-between; gap: 20px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--color-neutral-400); }
.footer__legal-ar { font-family: var(--font-sans); letter-spacing: 0; font-size: 12px; }

/* ---- Project detail sheet ------------------------------------------------- */
.backdrop { position: fixed; inset: 0; z-index: 99; background: rgba(32,31,29,0.18); -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); opacity: 0; pointer-events: none; transition: opacity .55s ease; }
.backdrop.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; top: 9vh; left: 0; right: 0; bottom: 0; z-index: 100;
  background: var(--color-bg); transform: translateY(104%);
  transition: transform .65s cubic-bezier(.32,.72,.28,1);
  overflow-y: auto; box-shadow: 0 -24px 64px rgba(32,31,29,0.28);
  border-top: 1px solid var(--color-neutral-200);
}
.sheet.is-open { transform: translateY(0); }
.sheet__inner { display: flex; flex-direction: column; padding: clamp(28px, 4vw, 56px) var(--pad-x) clamp(64px, 8vw, 120px); gap: clamp(40px, 5vw, 64px); }
.sheet__close-row { display: flex; justify-content: flex-end; }
.sheet__close { display: flex; align-items: baseline; gap: 10px; padding: 10px 0; color: var(--color-neutral-600); background: none; border: 0; cursor: pointer; font: inherit; }
.sheet__close:hover { color: var(--color-text); }
.sheet__close-ar { font-family: var(--font-sans); font-size: 13px; }
.sheet__close-en { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; }
.sheet__video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.sheet__video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
/* Vertical clips (e.g. WDS): center at a capped height instead of a wide frame. */
.sheet__video--portrait { aspect-ratio: auto; display: flex; justify-content: center; align-items: center; background: var(--color-neutral-200); }
.sheet__video--portrait video { position: static; width: auto; height: auto; max-width: 100%; max-height: 78vh; }
.sheet__head { display: flex; flex-direction: column; gap: 22px; }

/* Subtle project progress indicator (hairline track + accent fill). */
.progress { display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.progress__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.progress__label { display: flex; align-items: baseline; gap: 10px; }
.progress__ar { font-family: var(--font-sans); font-size: 13px; color: var(--color-neutral-500); }
.progress__en { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--color-neutral-600); }
.progress__pct { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--color-accent-700); }
.progress__track { position: relative; height: 2px; background: var(--color-neutral-300); }
.progress__fill { position: absolute; inset: 0 auto 0 0; height: 100%; width: 0; background: var(--color-accent); transition: width 1.1s cubic-bezier(.22,.61,.36,1); }
@media (prefers-reduced-motion: reduce) { .progress__fill { transition: none; } }
.sheet__titles { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: baseline; gap: 26px; flex-wrap: wrap; }
.sheet__title-ar { font-family: var(--font-display); font-weight: 300; font-size: clamp(48px, 7vw, 112px); line-height: 1.15; }
.sheet__title-en { font-family: var(--font-en-display); font-size: clamp(30px, 4.2vw, 64px); line-height: 1; letter-spacing: -0.024em; color: var(--color-neutral-500); }
.sheet__log-ar { margin: 0; align-self: flex-end; text-align: right; font-family: var(--font-sans); font-size: clamp(16px, 1.8vw, 22px); line-height: 1.9; max-width: 44ch; }
.sheet__log-en { margin: 0; font-family: var(--font-en-display); font-size: clamp(18px, 2vw, 27px); line-height: 1.36; letter-spacing: -0.008em; color: var(--color-neutral-600); max-width: 40ch; text-wrap: pretty; }
/* Focus carousel (ported from the Clacket BTS presentation): the centered item
   is highlighted (full opacity + scale + shadow), neighbours dim and scale back.
   Scroll or use the arrows to browse. Full-bleed across the sheet, with edge
   fades. Videos play one at a time; photos auto-advance and open in a lightbox. */
.rail { position: relative; margin-inline: calc(-1 * var(--pad-x)); }
.rail__scroll {
  display: flex; gap: 22px; align-items: center;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding-block: 20px; padding-inline: max(20px, calc(50% - 300px));
  -ms-overflow-style: none; scrollbar-width: none;
}
.rail__scroll::-webkit-scrollbar { display: none; }
.rail__item {
  flex: 0 0 auto; height: min(60vh, 540px);
  position: relative; overflow: hidden; background: #000;
  scroll-snap-align: center; scroll-snap-stop: always; cursor: pointer;
  opacity: .36; transform: scale(.92);
  box-shadow: 0 14px 36px rgba(32,31,29,.20);
  transition: opacity .55s cubic-bezier(.22,.61,.36,1), transform .55s cubic-bezier(.22,.61,.36,1), box-shadow .4s ease;
}
.rail__item.is-active { opacity: 1; transform: scale(1); box-shadow: 0 30px 80px rgba(32,31,29,.42); }
.rail__item > img, .rail__item > video { height: 100%; width: auto; max-width: 92vw; display: block; }
.rail__item--photo > img { filter: saturate(.8) brightness(.85); transition: filter .5s ease; }
.rail__item--photo.is-active > img { filter: none; }
.rail__badge, .rail__open {
  position: absolute; padding: 4px 10px; background: rgba(0,0,0,.5);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .22em;
  text-transform: uppercase; color: rgba(243,242,242,.85);
}
.rail__badge { left: 16px; bottom: 14px; }
.rail__open { right: 14px; bottom: 14px; opacity: 0; transition: opacity .4s ease; }
.rail__item.is-active .rail__open { opacity: 1; }
.rail__fade { position: absolute; top: 0; bottom: 0; width: clamp(40px, 8vw, 120px); pointer-events: none; z-index: 3; }
.rail__fade--l { left: 0; background: linear-gradient(to right, var(--color-bg), transparent); }
.rail__fade--r { right: 0; background: linear-gradient(to left, var(--color-bg), transparent); }
.rail__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 46px; height: 46px; border-radius: 999px; cursor: pointer;
  display: grid; place-items: center; font-size: 22px; line-height: 1;
  color: var(--color-text); border: 1px solid var(--color-divider);
  background: rgba(243,242,242,.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background .25s ease, border-color .25s ease;
}
.rail__arrow:hover { border-color: var(--color-accent); background: rgba(243,242,242,.9); }
.rail__arrow--prev { left: 16px; }
.rail__arrow--next { right: 16px; }
/* On phones, size each rail item to fit the viewport (full media, undistorted)
   rather than a fixed height that crops wide clips. Swipe to browse. */
@media (max-width: 640px) {
  .rail__scroll { padding-inline: max(16px, calc(50% - 43vw)); gap: 16px; }
  .rail__item { height: auto; }
  .rail__item > img, .rail__item > video { width: auto; height: auto; max-width: 86vw; max-height: 62vh; }
  .rail__arrow { display: none; }
}

/* Lightbox for enlarged photos */
.lightbox { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(20,19,18,.94); opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.lightbox__btn { position: absolute; background: none; border: 0; color: #f3f2f2; cursor: pointer; padding: 14px; line-height: 1; }
.lightbox__close { top: 16px; right: 20px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.lightbox__nav { top: 50%; transform: translateY(-50%); font-size: 40px; }
.lightbox__nav--prev { left: 2vw; }
.lightbox__nav--next { right: 2vw; }

.sheet__detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: clamp(48px, 7vw, 112px); align-items: start; }
.sheet__detail-text { margin: 0; font-size: 15px; line-height: 1.85; color: var(--color-neutral-700); max-width: 60ch; text-wrap: pretty; }
.sheet__table { margin: 0; display: flex; flex-direction: column; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.sheet__table-row { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid var(--color-divider); }
.sheet__table-row:last-child { border-bottom: 1px solid var(--color-divider); }
.sheet__table-row dt { margin: 0; color: var(--color-neutral-500); }
.sheet__table-row dd { margin: 0; }

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; gap: clamp(40px, 8vw, 72px); }
  .about__portrait { max-width: 460px; }
  .sheet__detail-grid { grid-template-columns: 1fr; gap: clamp(32px, 6vw, 48px); }
  .disciplines { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --brand-scale: 1.4; } /* smaller growth so it clears the menu button */
  .header { padding: 20px var(--pad-x); gap: 20px; align-items: center; }
  .nav {
    position: fixed; inset: 0; z-index: 70;
    flex-direction: column; align-items: center; justify-content: center; gap: 40px;
    background: var(--color-bg);
    transform: translateX(100%); transition: transform .4s cubic-bezier(.32,.72,.28,1);
    padding-top: 0;
  }
  .nav.is-open { transform: translateX(0); }
  .nav__item { flex-direction: row; gap: 12px; align-items: baseline; }
  .nav__en { font-size: 13px; }
  .nav__ar { font-size: 20px; font-family: var(--font-display); }
  /* Menu overlay is light, so force dark links even when the header is in its
     light "over-hero" mode (otherwise white-on-light = invisible). */
  .nav.is-open .nav__item { color: var(--color-neutral-700); }
  .nav.is-open .nav__en { color: var(--color-neutral-600); }
  .nav.is-open .nav__ar { color: var(--color-text); }
  .nav.is-open .nav__item[aria-current='page'] .nav__en { color: var(--color-accent-700); }
  .header--over-hero .nav-toggle.is-open span { background: var(--color-text); }
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 34px; height: 34px; z-index: 80; background: none; border: 0; cursor: pointer; padding: 6px;
  }
  .nav-toggle span { display: block; height: 1px; background: var(--color-text); transition: transform .3s ease, opacity .3s ease; }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .hero__foot { align-items: flex-start; }
  .sheet { top: 5vh; }
  .footer__top { flex-direction: column; align-items: flex-start; gap: 32px; }
}

/* ---- Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .ambient__disc { animation: none; }
  html { scroll-behavior: auto; }
  [data-reveal].pre-reveal { opacity: 1; transform: none; }
  .sheet, .backdrop, .card__video, .card__overlay { transition: none; }
}
