/* ------------------------------------------------------------------
   Wejdan Alharbi — bilingual version (EN / AR)
   Design tokens sampled from the 2026 portfolio deck.
   Layout uses logical properties so the Arabic version mirrors itself.
   ------------------------------------------------------------------ */
:root {
  --bg:        #001309;
  --panel:     #112b1f;
  --panel-2:   #0e1f16;
  --line:      #2a3931;
  --cream:     #e4e2df;
  --cream-2:   #d5d4d2;
  --sage:      #a1afaa;
  --sage-dim:  #74877e;
  --moss:      #456054;

  --font-display: "Playfair Display", "Times New Roman", serif;
  --font-thin:    "Bodoni Moda", "Didot", "Times New Roman", serif;
  --font-sans:    "Jost", "Helvetica Neue", Arial, sans-serif;
  --font-ar:      "Tajawal", "Segoe UI", Tahoma, sans-serif;

  --gutter: clamp(16px, 5vw, 96px);
  --max: 1440px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream-2);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--sage); outline-offset: 4px; }
::selection { background: var(--sage); color: var(--bg); }

.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--cream); color: var(--bg); padding: 8px 12px; z-index: 100; }
.skip:focus { inset-inline-start: 8px; }

/* ---------- language switching ----------
   Every piece of copy exists twice, tagged lang="en" / lang="ar".
   The html element's data-lang decides which one is shown. */
html[data-lang="en"] [lang="ar"] { display: none !important; }
html[data-lang="ar"] [lang="en"] { display: none !important; }

html[data-lang="ar"] body { font-family: var(--font-ar); font-weight: 400; line-height: 1.8; }

/* ---------- type system ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--cream);
  line-height: .98;
  letter-spacing: -.015em;
  margin: 0;
  text-wrap: balance;
}
.display .alt { color: var(--sage); }
.display .thin { font-family: var(--font-thin); font-weight: 400; letter-spacing: 0; }
.display-xl { font-size: clamp(3rem, 9vw, 8.5rem); }
.display-lg { font-size: clamp(2.6rem, 6.8vw, 6.4rem); }
.display-md { font-size: clamp(2.1rem, 4.6vw, 4.4rem); }
.display-sm { font-size: clamp(1.7rem, 3.2vw, 3rem); }

html[data-lang="ar"] .display { font-family: var(--font-ar); font-weight: 800; letter-spacing: 0; line-height: 1.2; }
html[data-lang="ar"] .display .thin { font-family: var(--font-ar); font-weight: 300; }
html[data-lang="ar"] .display-xl { font-size: clamp(2.6rem, 7.6vw, 7rem); }
html[data-lang="ar"] .display-lg { font-size: clamp(2.3rem, 5.8vw, 5.4rem); }
html[data-lang="ar"] .display-md { font-size: clamp(1.9rem, 4vw, 3.8rem); }
html[data-lang="ar"] .display-sm { font-size: clamp(1.5rem, 2.8vw, 2.6rem); }

.thin-title { font-family: var(--font-thin); font-weight: 400; color: var(--cream); line-height: 1.05; margin: 0; }
html[data-lang="ar"] .thin-title { font-family: var(--font-ar); font-weight: 300; line-height: 1.3; }

.label { font-family: var(--font-sans); font-weight: 400; font-size: .72rem; letter-spacing: .32em; text-transform: uppercase; color: var(--cream-2); }
.label--serif { font-family: var(--font-thin); font-size: .8rem; letter-spacing: .3em; }
html[data-lang="ar"] .label, html[data-lang="ar"] .label--serif { font-family: var(--font-ar); font-weight: 500; font-size: .88rem; letter-spacing: .06em; }

.sub { color: var(--sage); font-weight: 300; line-height: 1.7; margin: 0; }
.sub--lg { font-size: clamp(1.05rem, 1.6vw, 1.45rem); }
.sub--md { font-size: clamp(.95rem, 1.2vw, 1.1rem); }
.sub--sm { font-size: .9rem; }

.lead { font-size: clamp(.95rem, 1.15vw, 1.08rem); letter-spacing: .14em; line-height: 2; color: var(--cream-2); margin: 0; max-width: 60ch; }
.lead strong, .lead b { font-weight: 600; color: var(--cream); }
html[data-lang="ar"] .lead { letter-spacing: 0; font-size: clamp(1.02rem, 1.3vw, 1.2rem); line-height: 1.95; max-width: 52ch; }

/* ---------- layout ---------- */
.wrap { width: min(100% - 2*var(--gutter), var(--max)); margin-inline: auto; }
.section { position: relative; padding-block: clamp(88px, 12vw, 160px); overflow: hidden; }
.section--tight { padding-block: clamp(56px, 8vw, 104px); }

.panel { position: absolute; background: var(--panel); z-index: 0; pointer-events: none; }
.rel { position: relative; z-index: 1; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.nav__in { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--cream); }
.brand__mark { width: 34px; height: 31px; color: var(--cream-2); flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-display); font-weight: 900; font-size: .95rem; letter-spacing: .06em; }
.brand__role { font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: var(--sage); }
html[data-lang="ar"] .brand__role { font-family: var(--font-ar); font-size: .78rem; letter-spacing: .04em; }

.brand__name { white-space: nowrap; }
@media (max-width: 560px) { .brand__role { display: none; } }

.nav__links { display: none; gap: clamp(18px, 2.2vw, 36px); list-style: none; margin: 0; padding: 0; }
.nav__links a { font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; color: var(--cream-2); padding: 8px 0; position: relative; white-space: nowrap; }
html[data-lang="ar"] .nav__links a { font-size: .95rem; letter-spacing: .02em; }
.nav__links a::after { content: ""; position: absolute; inset-inline-start: 0; inset-inline-end: 100%; bottom: 2px; height: 1px; background: var(--sage); transition: inset-inline-end .35s var(--ease); }
.nav__links a:hover::after, .nav__links a[aria-current="true"]::after { inset-inline-end: 0; }
.nav__right { display: flex; align-items: center; gap: 18px; }
.nav__year { font-family: var(--font-thin); letter-spacing: .3em; font-size: .8rem; color: var(--sage); display: none; }
@media (min-width: 900px) { .nav__links, .nav__year { display: flex; } .nav__burger { display: none; } }

.lang-toggle {
  background: none; border: 1px solid var(--line); color: var(--cream);
  height: 38px; padding: 0 14px; border-radius: 2px; cursor: pointer;
  font-family: var(--font-ar); font-size: .95rem; font-weight: 500; letter-spacing: .02em;
  transition: border-color .3s, background .3s;
}
.lang-toggle:hover { border-color: var(--sage); background: var(--panel-2); }
html[data-lang="ar"] .lang-toggle { font-family: var(--font-sans); font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; font-weight: 400; }

.nav__burger { background: none; border: 1px solid var(--line); color: var(--cream); width: 44px; height: 44px; border-radius: 2px; cursor: pointer; display: grid; place-items: center; }
.nav__burger span { display: block; width: 18px; height: 1px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }

.drawer { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: grid; align-content: center; padding: var(--gutter); transform: translateY(-100%); transition: transform .5s var(--ease); }
.drawer[data-open="true"] { transform: none; }
.drawer a { display: block; font-family: var(--font-thin); font-size: clamp(2rem, 9vw, 3rem); color: var(--cream); padding: 10px 0; border-bottom: 1px solid var(--line); }
html[data-lang="ar"] .drawer a { font-family: var(--font-ar); font-weight: 300; }
.drawer__close { position: absolute; top: 14px; inset-inline-end: var(--gutter); background: none; border: 1px solid var(--line); color: var(--cream); width: 44px; height: 44px; cursor: pointer; font-size: 1.2rem; }
.drawer .lang-toggle { justify-self: start; margin-top: 28px; height: 48px; padding: 0 22px; font-size: 1.1rem; }

/* ---------- hero ---------- */
.hero { min-height: calc(90svh - 72px); padding-bottom: clamp(40px, 6vw, 72px); display: grid; align-items: center; }
.hero .panel { inset-inline-end: 0; top: 24%; bottom: 14%; width: min(34vw, 480px); }
.hero__year { position: absolute; top: clamp(24px, 6vw, 72px); right: 0; } /* physical right in both languages: the lockup is left-to-right */
.hero__lockup { width: min(100%, 1060px); margin-bottom: clamp(16px, 2vw, 28px); }
.hero__lockup img { width: 100%; height: auto; }
.hero__role { font-size: clamp(1.6rem, 4.2vw, 3.9rem); margin-top: .2em; }
.hero__role small { font-size: .55em; }
html[data-lang="ar"] .hero__role { font-size: clamp(1.6rem, 4vw, 3.4rem); font-weight: 300; }
.hero__foot { display: flex; align-items: center; gap: 24px; margin-top: clamp(48px, 9vh, 120px); }
.hero__foot .rule { flex: 0 0 clamp(80px, 18vw, 260px); }
.hero__scroll { position: absolute; bottom: 24px; right: 0; display: none; align-items: center; gap: 12px; color: var(--sage); }
.hero__scroll i { display: block; width: 1px; height: 48px; background: var(--sage); animation: drop 2.2s infinite var(--ease); transform-origin: top; }
@media (min-width: 900px) { .hero__scroll { display: flex; } }
@keyframes drop { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- about ---------- */
.about { padding-top: clamp(48px, 7vw, 96px); }
.about .panel { inset-inline-start: 0; top: 8%; width: min(44vw, 640px); height: 60%; }
@media (max-width: 899px) { .about .panel { width: 78vw; height: 46%; } }
.about__meta { list-style: none; padding: 0; margin: clamp(28px, 4vw, 48px) 0 0; border-inline-start: 1px solid var(--sage); padding-inline-start: 18px; display: grid; gap: 8px; }
.about__meta li { letter-spacing: .3em; text-transform: uppercase; font-size: .78rem; color: var(--cream-2); }
html[data-lang="ar"] .about__meta li { letter-spacing: .02em; font-size: 1rem; }
.about__meta b { font-weight: 600; color: var(--cream); }

/* ---------- process ---------- */
.process__head { position: relative; padding: clamp(32px, 5vw, 64px) 0; }
.process__head .panel { inset-inline-start: -6%; inset-inline-end: -100vw; top: 0; bottom: 0; }
.steps { display: grid; grid-template-columns: 1fr; gap: 28px; margin-top: clamp(40px, 6vw, 80px); list-style: none; padding: 0; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); align-items: start; gap: 16px; } }
.step { text-align: center; position: relative; }
.step__t { font-family: var(--font-thin); font-size: clamp(1.6rem, 3vw, 2.6rem); color: var(--cream); letter-spacing: .02em; line-height: 1.1; }
html[data-lang="ar"] .step__t { font-family: var(--font-ar); font-weight: 300; }
.step__t > span:first-child { color: var(--sage); }
.step__sub { margin-top: 8px; text-align: center; }
@media (min-width: 760px) {
  .step:not(:last-child)::after { content: "⟶"; position: absolute; inset-inline-end: -14px; top: .45em; color: var(--sage); font-size: 1.4rem; }
  html[dir="rtl"] .step:not(:last-child)::after { content: "⟵"; }
}

/* ---------- credentials ---------- */
.cred .panel { inset-inline-start: 0; top: 0; width: 66%; height: 32%; }
.cred__row { display: grid; gap: 40px; margin-top: clamp(40px, 7vw, 96px); }
@media (min-width: 900px) { .cred__row { grid-template-columns: 1.4fr 1fr; align-items: end; } }
.badge { display: inline-block; position: relative; padding: .1em .5em .1em 0; }
.badge::before { content: ""; position: absolute; inset-inline-start: -.5em; inset-inline-end: 2.2em; top: 0; bottom: 0; background: var(--moss); z-index: -1; }
.badge--num::before { inset-inline-end: .6em; }
.cred__sub { margin-top: 10px; }
.ticker { margin-top: clamp(48px, 8vw, 96px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; overflow: hidden; white-space: nowrap; }
.ticker__track { display: inline-flex; gap: 64px; animation: ticker 40s linear infinite; }
.ticker__track span { font-family: var(--font-thin); letter-spacing: .34em; font-size: .78rem; text-transform: uppercase; color: var(--cream-2); }
html[data-lang="ar"] .ticker__track span { font-family: var(--font-ar); letter-spacing: .04em; font-size: .95rem; }
@keyframes ticker { to { transform: translateX(-50%); } }
html[dir="rtl"] .ticker__track { animation-name: ticker-rtl; }
@keyframes ticker-rtl { to { transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) { .ticker__track { animation: none; } }

/* ---------- work ---------- */
.work__intro { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: clamp(56px, 8vw, 120px); }
.project { position: relative; padding-block: clamp(40px, 6vw, 96px); }
.project__text { position: relative; }
.project__text .panel { inset-inline-start: -12%; top: -12%; width: 70%; height: 110%; }
.project__eyebrow { display: flex; gap: 18px; align-items: center; margin-bottom: 20px; }
.project__eyebrow .num { font-family: var(--font-thin); color: var(--sage); letter-spacing: .2em; }
.project__desc { margin-top: clamp(16px, 2vw, 28px); }
.project__media { position: relative; margin: 0; }
.project__media img { width: 100%; height: auto; }
@media (min-width: 900px) {
  .project--flip .grid-2 > .project__text { order: 2; }
  .project--flip .project__text .panel { inset-inline-start: auto; inset-inline-end: -12%; }
}

/* ---------- skills ---------- */
.skills__head { position: relative; display: inline-block; margin-bottom: clamp(32px, 5vw, 64px); }
.skills__head .panel { inset-inline-start: 40%; top: 38%; width: 160%; height: 95%; }
.skills__list { display: grid; grid-template-columns: 1fr; gap: 0 clamp(40px, 8vw, 140px); list-style: none; padding: 0; margin: 0; }
@media (min-width: 820px) { .skills__list { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, auto); grid-auto-flow: column; } }
.skill { border-bottom: 1px solid var(--line); padding: 26px 0 22px; display: grid; gap: 6px; transition: background .3s; }
.skill:hover { background: linear-gradient(90deg, transparent, var(--panel-2) 50%, transparent); }
.skill__n { font-family: var(--font-thin); font-weight: 500; color: var(--cream); letter-spacing: .3em; font-size: .85rem; }
.skill__t { font-family: var(--font-sans); font-weight: 400; letter-spacing: .2em; font-size: clamp(.95rem, 1.3vw, 1.2rem); color: var(--cream); }
html[data-lang="ar"] .skill__t { font-family: var(--font-ar); font-weight: 500; letter-spacing: 0; font-size: clamp(1.05rem, 1.4vw, 1.3rem); }

/* ---------- case study ---------- */
.case .panel { inset-inline-start: -100vw; inset-inline-end: 50%; top: 14%; height: 22%; }
.case__sub-title { margin-top: 18px; }
.case__block + .case__block { margin-top: clamp(28px, 4vw, 44px); }
.case__dur { display: inline-block; position: relative; font-family: var(--font-display); font-weight: 900; font-size: clamp(2rem, 4vw, 3.6rem); color: var(--sage); margin-top: 8px; padding: .05em .5em .05em 0; }
html[data-lang="ar"] .case__dur { font-family: var(--font-ar); font-weight: 800; }
.case__dur::before { content: ""; position: absolute; inset: 0 -.3em 0 -.25em; background: var(--panel); z-index: -1; transform: translate(.2em, -.2em); }
.case__dur { animation: dur-pulse 3.2s ease-in-out infinite; }
@keyframes dur-pulse { 0%, 100% { color: var(--cream); } 50% { color: var(--sage); } }
@media (prefers-reduced-motion: reduce) { .case__dur { animation: none; } }

/* ---------- contact ---------- */
/* panel is sized by the headline + sub-line block: bleeds off the start edge, ends a little below the sub-line */
.contact__intro { position: relative; z-index: 0; }
.contact__intro .panel { z-index: -1; inset-inline-start: -50vw; inset-inline-end: 55%; top: calc(-1 * clamp(28px, 4vw, 56px)); bottom: -18px; }
.contact__links { display: grid; gap: 10px; margin-top: 16px; }
.link-arrow { display: inline-flex; align-items: center; gap: 10px; letter-spacing: .28em; text-transform: uppercase; font-size: .78rem; color: var(--cream-2); width: fit-content; }
html[data-lang="ar"] .link-arrow { letter-spacing: .02em; font-size: .95rem; }
.link-arrow svg { width: 14px; height: 14px; transition: transform .3s var(--ease); flex: none; }
html[dir="rtl"] .link-arrow svg { transform: scaleX(-1); }
.link-arrow:hover svg { transform: translate(3px, -3px); }
html[dir="rtl"] .link-arrow:hover svg { transform: scaleX(-1) translate(3px, -3px); }
.link-arrow:hover { color: var(--cream); }
.link-arrow .ltr { direction: ltr; unicode-bidi: isolate; }
.contact__more { margin-top: clamp(40px, 5vw, 72px); }
.contact__more .thin-title { display: inline-flex; align-items: center; gap: 18px; }
.contact__more .thin-title svg { width: .6em; height: .6em; }
html[dir="rtl"] .contact__more .thin-title svg { transform: scaleX(-1); }
.contact__more ul { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.contact__more li { letter-spacing: .22em; font-size: .78rem; text-transform: capitalize; color: var(--cream-2); }
html[data-lang="ar"] .contact__more li { letter-spacing: .02em; font-size: .95rem; }
.contact__more li + li::before { content: "·"; margin-inline-end: 14px; color: var(--sage); }

.footer { padding: 28px 0; }
.footer__in { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.footer .brand__mark { width: 26px; height: 24px; }

/* ---------- more-work page ---------- */
/* Chapter heads follow the deck: centred one-line title on a band that runs from the previous image
   down to the title baseline, labels row just under the band. Band side per chapter via data-band
   ("start end" as fractions of the page width); vertical geometry is measured in site.js. */
.chapter { position: relative; padding-block: clamp(48px, 6vw, 90px) clamp(40px, 5vw, 64px); overflow: visible; }
.chapter__panel { position: absolute; left: 0; right: 0; top: 0; height: 0; background: var(--panel); z-index: 0; }
.chapter__title { font-size: clamp(2.8rem, 10vw, 9.5rem); letter-spacing: .01em; line-height: .95; white-space: nowrap; text-align: center; } /* one line, as in the deck; site.js shrinks long titles to fit */
html[data-lang="ar"] .chapter__title { font-size: clamp(2.4rem, 8vw, 7.5rem); line-height: 1.2; }
.chapter__title .probe { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.chapter__labels { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; margin: 14px 0 0; padding: 0; list-style: none; }
.chapter__labels li { font-family: var(--font-thin); font-size: .78rem; letter-spacing: .32em; text-transform: uppercase; color: var(--cream-2); }
.chapter__labels li.etc { text-transform: none; letter-spacing: .2em; color: var(--sage); }
/* phones: a centred stack, one label per line, so nothing breaks mid-phrase */
@media (max-width: 600px) {
  .chapter__labels { flex-direction: column; align-items: center; gap: 6px; }
  .chapter__labels li { white-space: nowrap; letter-spacing: .22em; font-size: .7rem; }
  html[data-lang="ar"] .chapter__labels li { letter-spacing: .02em; font-size: .9rem; }
}
html[data-lang="ar"] .chapter__labels li { font-family: var(--font-ar); font-size: .95rem; letter-spacing: .04em; }
.spread { padding-block: clamp(24px, 4vw, 64px); margin: 0 auto; }
.spread--left { margin-left: 0; } /* hugs the left screen edge in both languages (the hand emerges from the edge) */
.spread img { width: 100%; height: auto; }
.spread + .spread { padding-top: 0; }
.prints img { width: 100%; height: auto; display: block; }
.beige { background: var(--cream); color: var(--bg); }
.embed { padding: clamp(10px, 1.6vw, 22px); }
.embed__frame { position: relative; width: 100%; aspect-ratio: 16 / 10; background: var(--cream); }
.embed__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--cream); }
.embed__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 18px; }
@media (max-width: 600px) { .embed__frame { aspect-ratio: 4 / 3; } }
.touch__title { display: inline-block; position: relative; }
.touch__title::before { content: ""; position: absolute; inset-inline-start: -12%; inset-inline-end: -4%; bottom: .05em; height: .55em; background: var(--panel); z-index: -1; }
.touch__links { display: grid; gap: 14px; margin-top: 26px; }
.touch__links .link-arrow { font-size: clamp(.95rem, 1.8vw, 1.5rem); letter-spacing: .24em; }
html[data-lang="ar"] .touch__links .link-arrow { letter-spacing: .02em; }
.back { display: inline-flex; align-items: center; gap: 10px; letter-spacing: .28em; text-transform: uppercase; font-size: .72rem; color: var(--sage); }
html[data-lang="ar"] .back { letter-spacing: .02em; font-size: .95rem; }
html[dir="rtl"] .back svg { transform: scaleX(-1); }
.back:hover { color: var(--cream); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .12s; }
.reveal[data-delay="2"] { transition-delay: .24s; }
.reveal[data-delay="3"] { transition-delay: .36s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
