/* ==========================================================================
   Sabah Aldawsari: "First Light"
   Concept: صباح means "morning". The page is one day; each section is an
   hour with its own light. The navigation is a ruler of hours, and the sun
   that travels along it is the scroll progress.
   ========================================================================== */

/* ---- Light of the day: one palette per hour ----------------------------- */
:root {
  --f-ar: "IBM Plex Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
  --f-cal: "Aref Ruqaa", "Diwan Kufi", serif;
  --f-serif: "Instrument Serif", "Times New Roman", serif;
  --sun-1: #ffd98a;
  --sun-2: #f39a4f;
  --ember: #e0582c;
  --gutter: clamp(1rem, 4.2vw, 4rem);
  --max: 1320px;
  --bar-h: 64px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --radius: 4px;
}

[data-tone="night"] { --bg: #0b0e1c; --bg-2: #12162a; --fg: #ece6d8; --muted: #9097b2; --line: rgba(236, 230, 216, .14); --accent: #f3b04a; --on-accent: #1a1206; }
[data-tone="dawn"]  { --bg: #2a1f3a; --bg-2: #352646; --fg: #f6ebe3; --muted: #c3aebb; --line: rgba(246, 235, 227, .16); --accent: #f4935a; --on-accent: #1f1209; }
[data-tone="day"]   { --bg: #f3ede2; --bg-2: #ebe3d4; --fg: #1c1713; --muted: #675d53; --line: rgba(28, 23, 19, .14); --accent: #c94b22; --on-accent: #fff8f0; }
[data-tone="noon"]  { --bg: #faf7f1; --bg-2: #f0ebe1; --fg: #15120f; --muted: #655c53; --line: rgba(21, 18, 15, .13); --accent: #c94b22; --on-accent: #fff8f0; }
[data-tone="gold"]  { --bg: #e8c48b; --bg-2: #ddb576; --fg: #2a190b; --muted: #5e4127; --line: rgba(42, 25, 11, .2); --accent: #8f3412; --on-accent: #fff4e6; }
[data-tone="dusk"]  { --bg: #3a2236; --bg-2: #472a42; --fg: #f7e8e5; --muted: #cfaab8; --line: rgba(247, 232, 229, .16); --accent: #f59e6e; --on-accent: #22100c; }

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 8px); background: #0b0e1c; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  font-family: var(--f-ar); font-weight: 400; font-size: clamp(1rem, .95rem + .2vw, 1.08rem); line-height: 1.75;
  background: #0b0e1c; color: #ece6d8;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
:lang(en) body, html[lang="en"] body { line-height: 1.6; }
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent, #f3b04a); color: var(--on-accent, #111); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; inset-inline-start: 1rem; top: -100px; z-index: 100; padding: .6rem 1rem; background: #f3b04a; color: #111; text-decoration: none; border-radius: var(--radius); }
.skip:focus { top: 1rem; }
.noscript { padding: 2rem var(--gutter); background: #0b0e1c; color: #ece6d8; }

/* Film grain: one inline SVG noise, shared by every section */
main::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 60; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---- Sections own their light; the top edge blends from the hour before -- */
.sec, .hero { position: relative; background: var(--bg); color: var(--fg); }
.sec { padding: clamp(5rem, 12vw, 10rem) var(--gutter) clamp(4rem, 9vw, 8rem); }
.sec::before {
  content: ""; position: absolute; inset-inline: 0; top: -1px; height: clamp(80px, 16vw, 200px); pointer-events: none;
  background: linear-gradient(to bottom, var(--prev, var(--bg)), var(--bg));
}
.sec > * { position: relative; max-width: var(--max); margin-inline: auto; }

.sec-head { display: flex; align-items: baseline; gap: 1.25rem; margin-bottom: clamp(2rem, 5vw, 4rem); }
.sec-title { margin: 0; font-weight: 300; font-size: clamp(2.4rem, 1.6rem + 4vw, 5.2rem); line-height: 1.05; letter-spacing: -.01em; }
html[lang="en"] .sec-title { font-family: var(--f-serif); font-weight: 400; letter-spacing: -.02em; }
.sec-title-sm { font-size: .95rem; color: var(--muted); }
.sec-intro { color: var(--muted); max-width: 52ch; margin: -1.5rem 0 2.5rem; }

/* The hour stamp: a small sun + time. */
.hour {
  display: inline-flex; align-items: center; gap: .5rem; flex: none;
  font-size: .82rem; font-weight: 500; letter-spacing: .06em; font-variant-numeric: tabular-nums; color: var(--muted);
  direction: ltr;
}
.hour::before { content: ""; width: .62rem; height: .62rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 48px; padding: .7rem 1.35rem;
  border-radius: 999px; border: 1px solid transparent; text-decoration: none; font-weight: 500; font-size: .95rem; line-height: 1.2;
  cursor: pointer; transition: transform .35s var(--ease), background-color .3s, color .3s, border-color .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn-sun { background: var(--accent); color: var(--on-accent); }
.btn-ghost { border-color: var(--line); background: transparent; color: var(--fg); }
.btn-ghost:hover { border-color: var(--fg); }
.btn-ink { background: var(--fg); color: var(--bg); }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* ==========================================================================
   Top bar: the day ruler
   ========================================================================== */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--bar-h);
  display: flex; align-items: center; gap: clamp(.75rem, 2vw, 2rem); padding-inline: var(--gutter);
  color: var(--fg); transition: color .6s, background-color .6s;
}
.bar::before { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid var(--line); opacity: 0; transition: opacity .5s; }
.bar.is-scrolled::before { opacity: 1; }
.mark { flex: none; width: 40px; height: 40px; display: grid; place-items: center; }
.mark svg { width: 34px; height: 34px; }
.mark-sun { fill: var(--accent); transition: fill .6s; }
.mark-line { stroke: currentColor; stroke-width: 1.6; }

.ruler { position: relative; flex: 1; height: 100%; display: flex; align-items: center; }
.ruler ol { position: relative; list-style: none; margin: 0; padding: 0; width: 100%; height: 100%; }
.ruler ol::after { content: ""; position: absolute; inset-inline: 0; top: 50%; height: 1px; background: var(--line); }
.ruler li { position: absolute; top: 0; height: 100%; inset-inline-start: calc(var(--x) * 100%); transform: translateX(calc(var(--dirx, -1) * 50%)); }
[dir="rtl"] .ruler li { --dirx: 1; }
.ruler a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding-inline: .35rem;
  text-decoration: none; font-size: .74rem; line-height: 1.15; color: var(--muted); white-space: nowrap; transition: color .3s;
}
.ruler a .t { font-variant-numeric: tabular-nums; letter-spacing: .05em; direction: ltr; font-size: .68rem; opacity: .8; transform: translateY(-.55rem); }
.ruler a .l { transform: translateY(.55rem); }
.ruler a::after { content: ""; position: absolute; top: calc(50% - 4px); left: 50%; width: 1px; height: 8px; background: currentColor; opacity: .6; }
.ruler a:hover, .ruler a[aria-current="true"] { color: var(--fg); }
.ruler-sun {
  position: absolute; top: calc(50% - 7px); inset-inline-start: calc(var(--p, 0) * 100%); width: 14px; height: 14px; margin-inline-start: -7px;
  border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--sun-1), var(--sun-2)); box-shadow: 0 0 0 5px color-mix(in srgb, var(--sun-2) 25%, transparent), 0 0 24px 4px color-mix(in srgb, var(--sun-2) 45%, transparent);
  pointer-events: none; will-change: inset-inline-start;
}
.bar-end { flex: none; display: flex; align-items: center; gap: .5rem; }
.clock { font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--muted); min-width: 3.2em; direction: ltr; }
.lang, .btn-cv {
  min-height: 40px; padding: .4rem .95rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer;
  font-size: .85rem; text-decoration: none; display: inline-flex; align-items: center; transition: border-color .3s, background-color .3s, color .3s;
}
.lang:hover, .btn-cv:hover { border-color: var(--fg); }
.btn-cv { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.lang[lang="en"] { font-family: var(--f-serif); font-size: 1rem; font-style: italic; }
.menu-btn { display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; position: relative; }
.menu-btn span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: currentColor; transition: transform .4s var(--ease); }
.menu-btn span:first-child { top: 18px; } .menu-btn span:last-child { top: 25px; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 1080px) {
  .ruler a .l { display: none; }
  .ruler a .t { transform: none; }
}
@media (max-width: 820px) {
  :root { --bar-h: 58px; }
  .bar { gap: .5rem; }
  .clock { margin-inline-end: auto; }
  .bar-end { flex: 1; }
  .btn-cv { display: none; }
  .menu-btn { display: block; }
  /* the ruler becomes a progress line under the bar + a full-screen menu */
  .ruler { position: fixed; inset: var(--bar-h) 0 auto 0; height: 0; flex: none; }
  .ruler ol { display: none; }
  .ruler-sun { top: -7px; }
  .ruler::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 1px; background: var(--line); }
  .ruler.is-open { height: calc(100dvh - var(--bar-h)); background: var(--bg); align-items: stretch; overflow: auto; }
  .ruler.is-open ol { display: block; height: auto; padding: 1.5rem var(--gutter) 3rem; }
  .ruler.is-open ol::after { display: none; }
  .ruler.is-open li { position: static; transform: none; height: auto; border-bottom: 1px solid var(--line); }
  .ruler.is-open a { flex-direction: row; justify-content: space-between; align-items: baseline; padding: 1.1rem 0; font-size: 1.6rem; font-weight: 300; color: var(--fg); }
  .ruler.is-open a::after { display: none; }
  .ruler.is-open a .l { display: block; transform: none; }
  .ruler.is-open a .t { transform: none; font-size: .85rem; color: var(--muted); }
  .ruler.is-open .ruler-sun { display: none; }
}

/* ==========================================================================
   05:30 · Hero: the sun rises behind the name
   ========================================================================== */
.hero {
  min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; overflow: hidden; isolation: isolate;
  padding: calc(var(--bar-h) + 2rem) var(--gutter) clamp(1.5rem, 4vw, 3rem);
}
.sky { position: absolute; inset: 0 0 auto 0; height: var(--hz, 62%); overflow: hidden; z-index: -1;
  background:
    radial-gradient(120% 80% at 50% 115%, rgba(243, 154, 79, calc(.42 + var(--dawn, 0) * .5)) 0%, rgba(140, 70, 110, calc(.25 + var(--dawn, 0) * .3)) 38%, transparent 70%),
    linear-gradient(to bottom, #090b17, #141a33 60%, #2b2346);
}
.hero::after { /* the ground: a calmer, darker band below the horizon */
  content: ""; position: absolute; inset: var(--hz, 62%) 0 0 0; z-index: -2;
  background: radial-gradient(70% 55% at 50% 0%, rgba(243, 154, 79, calc(.16 + var(--dawn, 0) * .2)), transparent 70%), #0b0e1c;
}
.stars { position: absolute; inset: 0; opacity: calc(1 - var(--dawn, 0) * 1.6); }
.stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: var(--o); animation: twinkle var(--d) ease-in-out infinite alternate; }
@keyframes twinkle { to { opacity: calc(var(--o) * .25); } }
.sun {
  position: absolute; left: 50%; bottom: 0; width: clamp(220px, 34vw, 520px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #fff3d0 0%, var(--sun-1) 28%, var(--sun-2) 62%, #d9543a 100%);
  box-shadow: 0 0 120px 40px rgba(243, 154, 79, .35), 0 0 300px 120px rgba(217, 84, 58, .18);
  transform: translate(-50%, calc(48% - var(--rise, 0) * 26%));
  animation: rise 2.8s var(--ease) .2s both;
}
@keyframes rise { from { transform: translate(-50%, 100%); } }
.sky::after { /* haze on the horizon */
  content: ""; position: absolute; inset: auto 0 0 0; height: 30%;
  background: linear-gradient(to top, rgba(243, 154, 79, .22), transparent);
}

.hero-inner { position: relative; display: grid; justify-items: center; text-align: center; align-self: end; }
.hero-kicker { display: flex; align-items: center; gap: .9rem; margin: 0 0 1rem; color: #c9c3d8; font-size: .9rem; letter-spacing: .04em; }
.hero-kicker .hour { color: #c9c3d8; }
/* The name sits ON the horizon; its calligraphic tail dips below it like a reflection */
.hero { --ns: clamp(7rem, 24vw, 19rem); }
.hero-name { margin: 0; display: grid; justify-items: center; line-height: 1; position: relative; }
.hero-en { order: -1; font-family: var(--f-serif); font-style: italic; font-weight: 400; font-size: clamp(1.3rem, 1rem + 1.6vw, 2.3rem); color: #f3d9b4; letter-spacing: .01em; margin-bottom: clamp(-1.5rem, -2vw, -.5rem); position: relative; z-index: 1; }
.hero-ar {
  font-family: var(--f-cal); font-weight: 700; font-size: var(--ns); line-height: 1.25; color: #fbf3e4;
  text-shadow: 0 2px 40px rgba(11, 14, 28, .35);
  margin-bottom: -.12em;
}
.horizon { position: relative; z-index: 2; width: min(100%, var(--max)); height: 1px; margin: 0 0 calc(var(--ns) * .34); background: linear-gradient(90deg, transparent, rgba(243, 176, 74, .8), transparent); }
.hero-roles { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 0; color: #ece6d8; font-size: clamp(.95rem, .85rem + .4vw, 1.15rem); }
.hero-roles li { display: inline-flex; align-items: center; }
.hero-roles li + li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #f3b04a; margin-inline: 1.1rem; }
.hero-meaning { max-width: 46ch; margin: 1.2rem auto 0; color: #a7acc4; font-size: .95rem; }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1.8rem; }
.hero .btn-sun { background: #f3b04a; color: #1a1206; }
.hero .btn-ghost { color: #ece6d8; border-color: rgba(236, 230, 216, .25); }
.greeting { position: absolute; bottom: clamp(1rem, 3vw, 2rem); inset-inline-end: var(--gutter); margin: 0; font-size: .78rem; color: #7f86a3; letter-spacing: .03em; }
@media (max-width: 640px) {
  .greeting { display: none; }
  .hero-roles { flex-direction: column; gap: .2rem; }
  .hero-roles li + li::before { display: none; }
}

/* ==========================================================================
   07:00 · About
   ========================================================================== */
.about-lead {
  margin: 0 0 clamp(2.5rem, 6vw, 5rem); max-width: 22ch; font-weight: 300; line-height: 1.35;
  font-size: clamp(1.9rem, 1.1rem + 3.4vw, 4.2rem); text-wrap: balance;
}
html[lang="en"] .about-lead { font-family: var(--f-serif); max-width: 24ch; line-height: 1.12; }
.about-lead em { font-style: normal; color: var(--accent); }
html[lang="en"] .about-lead em { font-style: italic; }
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.about-body { margin: 0; color: color-mix(in srgb, var(--fg) 82%, var(--bg)); max-width: 60ch; }
.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.facts div { padding: 1.4rem 0 1.2rem; border-bottom: 1px solid var(--line); }
.facts div:nth-child(odd) { padding-inline-end: 1rem; border-inline-end: 1px solid var(--line); }
.facts div:nth-child(even) { padding-inline-start: 1.4rem; }
.facts dt { font-size: clamp(2.4rem, 1.8rem + 2.4vw, 3.8rem); font-weight: 300; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
html[lang="en"] .facts dt { font-family: var(--f-serif); }
.facts dd { margin: .55rem 0 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   09:00 · Work: case studies, each tinted with its own brand palette
   ========================================================================== */
.cases { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(1rem, 2.4vw, 2rem); }
.case { grid-column: span 6; position: relative; display: flex; flex-direction: column; background: var(--bg-2); border-radius: var(--radius); overflow: hidden; }
.case:nth-child(4) { grid-column: span 5; } .case:nth-child(5) { grid-column: span 7; }
.case-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--c, #ddd); }
.case-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.case-media.contain img { object-fit: contain; padding: 8%; }
.case:hover .case-media img { transform: scale(1.035); }
.case-body { display: grid; gap: .6rem; padding: 1.4rem 1.4rem 1.5rem; }
.case-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.case h3 { margin: 0; font-weight: 500; font-size: clamp(1.45rem, 1.1rem + 1vw, 2rem); line-height: 1.2; }
html[lang="en"] .case h3 { font-family: var(--f-serif); font-weight: 400; font-size: clamp(1.7rem, 1.3rem + 1.2vw, 2.4rem); }
.case .kind { margin: 0; color: var(--muted); font-size: .92rem; }
.case .open { position: static; justify-self: start; margin-top: .4rem; padding: 0; border: 0; background: none; cursor: pointer; font-weight: 500; font-size: .95rem; display: inline-flex; align-items: center; gap: .5rem; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.case .open::after { content: ""; position: absolute; inset: 0; } /* whole card is clickable */
.case .open:focus-visible { outline: none; }
.case:has(.open:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }
.swatches { display: flex; gap: 4px; flex: none; }
.swatches i { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--s); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); transition: width .5s var(--ease), border-radius .5s var(--ease); }
.case:hover .swatches i { width: 28px; border-radius: 7px; }

/* Featured case: Akeel takes the full width and its own orange */
.case.is-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.35fr 1fr; background: var(--c); color: #2a0f06; }
.case.is-featured .case-media { aspect-ratio: auto; min-height: 100%; background: #fff6ec; }
.case.is-featured .case-media img { object-fit: contain; padding: 4%; }
.case.is-featured .case-body { align-content: center; padding: clamp(1.6rem, 4vw, 3.5rem); gap: 1rem; }
.case.is-featured h3 { font-family: var(--f-cal); font-weight: 700; font-size: clamp(3.4rem, 2rem + 5vw, 6.5rem); line-height: 1; color: #fff8ef; }
html[lang="en"] .case.is-featured h3 { font-family: var(--f-serif); font-style: italic; }
.case.is-featured .kind { color: #3a1608; font-weight: 500; }
.case.is-featured .summary { margin: 0; color: #2a0f06; max-width: 46ch; }
.case.is-featured .open { color: #2a0f06; }
.case.is-featured .links { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }
.case.is-featured .links .btn { min-height: 44px; font-size: .9rem; }
.case.is-featured .btn-ink { background: #2a0f06; color: #fff6ec; }
.case.is-featured .btn-ghost { color: #2a0f06; border-color: rgba(42, 15, 6, .35); }
.case.is-featured .btn-ghost:hover { border-color: #2a0f06; }
.case .tagline { margin: 0; font-family: var(--f-cal); font-size: 1.5rem; color: #fff8ef; line-height: 1.3; }
html[lang="en"] .case .tagline { font-family: var(--f-serif); font-style: italic; }

@media (max-width: 900px) {
  .case, .case:nth-child(4), .case:nth-child(5) { grid-column: 1 / -1; }
  .case.is-featured { grid-template-columns: 1fr; }
  .case.is-featured .case-media { aspect-ratio: 4 / 3; }
}

/* ==========================================================================
   11:00 · The college feed: a living wall of posts
   ========================================================================== */
.feed-top { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-top: -1.5rem; margin-bottom: 2.5rem; flex-wrap: wrap; }
.feed-intro { margin: 0; max-width: 58ch; color: color-mix(in srgb, var(--fg) 80%, var(--bg)); }
.feed-ctrl { display: flex; gap: .6rem; flex-wrap: wrap; }
.feed-wall {
  --h: min(88vh, 920px);
  position: relative; height: var(--h); display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(.6rem, 1.4vw, 1.2rem); overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
}
.feed-col { position: relative; min-width: 0; }
.feed-track { display: grid; gap: clamp(.6rem, 1.4vw, 1.2rem); animation: drift var(--dur, 90s) linear infinite; animation-direction: var(--dir, normal); }
.feed-wall:hover .feed-track, .feed-wall:focus-within .feed-track, .feed-wall.is-paused .feed-track { animation-play-state: paused; }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(calc(-50% - clamp(.3rem, .7vw, .6rem))); } }
.post { display: block; padding: 0; border: 0; background: var(--bg-2); cursor: zoom-in; border-radius: 3px; overflow: hidden; box-shadow: 0 1px 0 var(--line); }
.post img { width: 100%; transition: transform .8s var(--ease), filter .5s; }
.post:hover img { transform: scale(1.03); }
.feed-note { margin: 2rem auto 0; color: var(--muted); font-size: .9rem; text-align: center; }
@media (max-width: 900px) { .feed-wall { grid-template-columns: repeat(3, 1fr); } .feed-col:nth-child(4) { display: none; } }
@media (max-width: 560px) { .feed-wall { grid-template-columns: repeat(2, 1fr); --h: 78vh; } .feed-col:nth-child(3) { display: none; } }

/* ==========================================================================
   14:00 · Motion: a film strip
   ========================================================================== */
.reel-wrap { position: relative; }
.reel {
  display: flex; gap: clamp(.8rem, 1.8vw, 1.4rem); overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  padding-bottom: 1.25rem; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  max-width: none !important; margin-inline: calc(var(--gutter) * -1) !important; padding-inline: var(--gutter);
  scroll-padding-inline: var(--gutter);
}
.clip { flex: none; scroll-snap-align: start; display: grid; gap: .8rem; height: auto; }
.clip-frame { position: relative; height: clamp(360px, 62vh, 560px); aspect-ratio: var(--r); background: #111; border-radius: var(--radius); overflow: hidden; }
.clip-frame img, .clip-frame video, .clip-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.clip-frame.is-yt img { object-fit: contain; background: #fff6ec; }
.clip-play {
  position: absolute; inset: 0; display: grid; place-items: center; border: 0; background: linear-gradient(to top, rgba(0, 0, 0, .45), transparent 45%); cursor: pointer; color: #fff;
}
.clip-play span { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: rgba(250, 247, 241, .92); color: #15120f; transition: transform .4s var(--ease), background-color .3s; }
.clip-play span svg { width: 26px; height: 26px; margin-inline-start: 4px; }
[dir="rtl"] .clip-play span svg { margin-inline-start: 0; margin-inline-end: 4px; }
.clip-play:hover span { transform: scale(1.08); background: var(--sun-1); }
.clip-dur { position: absolute; inset-block-end: .8rem; inset-inline-start: .8rem; font-size: .75rem; color: #fff; background: rgba(0, 0, 0, .5); padding: .15rem .5rem; border-radius: 99px; font-variant-numeric: tabular-nums; direction: ltr; }
.clip h3 { margin: 0; font-size: 1.1rem; font-weight: 500; line-height: 1.3; }
html[lang="en"] .clip h3 { font-family: var(--f-serif); font-size: 1.45rem; font-weight: 400; }
.clip p { margin: 0; color: var(--muted); font-size: .88rem; }
.reel-nav { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .5rem; }
.reel-nav button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; display: grid; place-items: center; }
.reel-nav button:hover { border-color: var(--fg); }
.reel-nav svg { width: 18px; height: 18px; }
@media (max-width: 640px) { .clip-frame { height: 62vh; max-height: 520px; } .clip { max-width: 86vw; } .clip-frame[style*="16/9"] { height: auto; width: 86vw; } }

/* ==========================================================================
   17:00 · Path: timeline with a sun for every milestone
   ========================================================================== */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; inset-block: .6rem 0; inset-inline-start: calc(14rem + 1px); width: 1px; background: var(--line); }
.tl { display: grid; grid-template-columns: 14rem 1fr; gap: 0 3rem; padding-bottom: clamp(2rem, 4vw, 3.2rem); position: relative; }
.tl::before { content: ""; position: absolute; inset-inline-start: calc(14rem - 6px); top: .55rem; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--bg); }
.tl-when { margin: 0; font-size: .9rem; font-weight: 500; color: var(--muted); padding-top: .2rem; font-variant-numeric: tabular-nums; }
.tl-what { margin: 0; font-size: clamp(1.2rem, 1rem + .7vw, 1.6rem); font-weight: 500; line-height: 1.35; }
html[lang="en"] .tl-what { font-family: var(--f-serif); font-weight: 400; font-size: clamp(1.4rem, 1.1rem + .9vw, 1.9rem); }
.tl-where { margin: .3rem 0 0; color: var(--muted); }
.tl ul { margin: .9rem 0 0; padding: 0; list-style: none; display: grid; gap: .35rem; max-width: 68ch; }
.tl ul li { position: relative; padding-inline-start: 1.2rem; }
.tl ul li::before { content: ""; position: absolute; inset-inline-start: 0; top: .78em; width: .5rem; height: 1px; background: var(--fg); }
.tl > div { padding-inline-start: 0; }
@media (max-width: 720px) {
  .timeline::before { inset-inline-start: 6px; }
  .tl { grid-template-columns: 1fr; padding-inline-start: 2rem; }
  .tl::before { inset-inline-start: 0; }
}

/* ==========================================================================
   19:00 · Skills & certificates
   ========================================================================== */
.skill-groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); }
.skill-groups h3 { margin: 0 0 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); font-size: 1rem; font-weight: 500; color: var(--accent); }
.skill-groups ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .55rem; font-size: .95rem; }
.tools-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: clamp(2.5rem, 5vw, 4rem); }
.chip { display: inline-flex; align-items: center; padding: .45rem .95rem; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; direction: ltr; }
.chip.lang-chip { direction: inherit; }
.certs-h { margin: clamp(3rem, 7vw, 5rem) 0 1.2rem; font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); font-weight: 300; }
html[lang="en"] .certs-h { font-family: var(--f-serif); font-weight: 400; }
.certs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); columns: 2; column-gap: 3rem; }
.certs li { break-inside: avoid; display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: .95rem 0; border-bottom: 1px solid var(--line); }
.certs .c-t { font-weight: 500; }
.certs .c-by { grid-column: 1; color: var(--muted); font-size: .88rem; }
.certs .c-d { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; direction: ltr; }
@media (max-width: 1000px) { .skill-groups { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .certs { columns: 1; } }
@media (max-width: 520px) { .skill-groups { grid-template-columns: 1fr; } }

/* ==========================================================================
   21:00 · Contact: the day ends where it began
   ========================================================================== */
.contact { overflow: hidden; padding-bottom: clamp(5rem, 10vw, 9rem); }
.contact-title { margin: 0; font-weight: 300; font-size: clamp(2.6rem, 1.4rem + 6vw, 7.5rem); line-height: 1.08; max-width: 14ch; text-wrap: balance; }
html[lang="en"] .contact-title { font-family: var(--f-serif); font-weight: 400; letter-spacing: -.02em; }
.contact-body { color: var(--muted); max-width: 48ch; margin: 1.5rem 0 3rem; }
.contact-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.contact-list li { display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); }
.contact-list a.row { flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1.3rem 0; text-decoration: none; min-width: 0; }
.contact-list .k { color: var(--muted); font-size: .9rem; flex: none; }
.contact-list .v { font-size: clamp(1.1rem, .8rem + 1.6vw, 2.1rem); font-weight: 300; overflow-wrap: anywhere; direction: ltr; text-align: end; transition: color .3s; }
.contact-list a.row:hover .v { color: var(--accent); }
.copy { flex: none; min-height: 40px; padding: .3rem .9rem; border: 1px solid var(--line); border-radius: 99px; background: transparent; cursor: pointer; font-size: .82rem; color: var(--muted); }
.copy:hover { color: var(--fg); border-color: var(--fg); }
.moon {
  position: absolute; top: clamp(4rem, 10vw, 8rem); inset-inline-end: calc(var(--gutter) + 2vw); width: clamp(70px, 9vw, 130px); aspect-ratio: 1; border-radius: 50%;
  box-shadow: inset clamp(-26px, -2.6vw, -14px) clamp(-10px, -1vw, -6px) 0 0 #efe6cf; transform: rotate(-20deg); opacity: .9; max-width: none !important; margin: 0 !important;
}
[dir="rtl"] .moon { transform: rotate(-20deg) scaleX(-1); }

.foot { background: #0b0e1c; color: #7f86a3; padding: 2rem var(--gutter) calc(2rem + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; font-size: .82rem; border-top: 1px solid rgba(236, 230, 216, .08); }
.foot p { margin: 0; }

/* ==========================================================================
   Case study sheet
   ========================================================================== */
dialog { border: 0; padding: 0; color: inherit; }
dialog::backdrop { background: rgba(8, 9, 16, .6); backdrop-filter: blur(6px); }
.sheet {
  --bg: #f6f1e7; --bg-2: #ece4d6; --fg: #1c1713; --muted: #675d53; --line: rgba(28, 23, 19, .14);
  width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; background: var(--bg); color: var(--fg); overflow: auto; overscroll-behavior: contain;
}
.sheet[open] { animation: sheet-in .7s var(--ease); }
@keyframes sheet-in { from { transform: translateY(6%); opacity: 0; } }
.sheet-inner { min-height: 100%; }
.sh-bar { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem var(--gutter); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.sh-bar .crumb { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .6rem; }
.sh-close { min-height: 44px; padding: .4rem 1.1rem; border-radius: 99px; border: 1px solid var(--line); background: transparent; cursor: pointer; display: inline-flex; gap: .5rem; align-items: center; }
.sh-close:hover { border-color: var(--fg); }
.sh-hero { padding: clamp(2.5rem, 7vw, 6rem) var(--gutter) clamp(2rem, 5vw, 4rem); background: var(--c); color: var(--cfg, #fff); }
.sh-hero > * { max-width: var(--max); margin-inline: auto; }
.sh-kind { margin: 0 0 .8rem; font-size: .95rem; opacity: .85; }
.sh-title { margin: 0; font-family: var(--f-cal); font-weight: 700; font-size: clamp(3.5rem, 2rem + 8vw, 9rem); line-height: 1; }
html[lang="en"] .sh-title { font-family: var(--f-serif); font-style: italic; font-weight: 400; }
.sh-title.latin { font-family: var(--f-serif); font-style: normal; letter-spacing: .02em; }
.sh-tag { margin: 1rem 0 0; font-family: var(--f-cal); font-size: clamp(1.3rem, 1rem + 1vw, 2rem); opacity: .95; }
html[lang="en"] .sh-tag { font-family: var(--f-serif); font-style: italic; }
.sh-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; margin-top: clamp(2rem, 5vw, 3.5rem) !important; padding-top: 1.5rem; border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
.sh-meta dt { font-size: .8rem; opacity: .75; margin-bottom: .35rem; }
.sh-meta dd { margin: 0; font-size: .98rem; }
.sh-meta .swatches i { width: 26px; height: 26px; box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 30%, transparent); }
.sh-meta .swatches { gap: 6px; flex-wrap: wrap; }
.sh-body { padding: clamp(2.5rem, 6vw, 5rem) var(--gutter); }
.sh-body > * { max-width: var(--max); margin-inline: auto; }
.sh-summary { margin-top: 0; margin-bottom: clamp(2rem, 5vw, 4rem); font-size: clamp(1.25rem, 1rem + 1.2vw, 2rem); font-weight: 300; line-height: 1.5; max-width: 40ch; margin-inline-start: 0; }
html[lang="en"] .sh-summary { font-family: var(--f-serif); line-height: 1.3; }
.sh-story { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2rem clamp(2rem, 4vw, 3.5rem); }
.sh-story h3 { margin: 0 0 .6rem; font-size: 1rem; font-weight: 600; color: var(--cc, var(--fg)); }
.sh-story p { margin: 0; color: color-mix(in srgb, var(--fg) 85%, var(--bg)); }
.sh-deliv { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: clamp(2rem, 5vw, 3rem) !important; }
.sh-deliv .chip { direction: inherit; }
.sh-links { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem !important; }
.sh-links .btn-sun { background: var(--c); color: var(--cfg, #fff); }
.sh-embed { margin-top: 2rem !important; }
.sh-embed .frame { position: relative; width: min(100%, 360px); aspect-ratio: 9 / 16; border-radius: var(--radius); overflow: hidden; background: #000; }
.sh-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sh-gallery { columns: 3 280px; column-gap: 1rem; margin-top: clamp(2.5rem, 6vw, 4.5rem) !important; }
.sh-gallery button { display: block; width: 100%; margin: 0 0 1rem; padding: 0; border: 0; background: var(--bg-2); cursor: zoom-in; break-inside: avoid; border-radius: 3px; overflow: hidden; }
.sh-gallery img { width: 100%; transition: transform .8s var(--ease); }
.sh-gallery button:hover img { transform: scale(1.02); }
.sh-next { display: flex; justify-content: space-between; gap: 1rem; padding: 2rem var(--gutter) 3rem; border-top: 1px solid var(--line); }
.sh-next button { border: 0; background: none; cursor: pointer; text-align: start; padding: .5rem 0; }
.sh-next small { display: block; color: var(--muted); font-size: .8rem; }
.sh-next span { font-size: 1.4rem; font-weight: 500; }
html[lang="en"] .sh-next span { font-family: var(--f-serif); font-weight: 400; font-size: 1.7rem; }

/* ==========================================================================
   Image viewer
   ========================================================================== */
.viewer { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; background: rgba(10, 10, 14, .94); color: #eee; display: none; }
.viewer[open] { display: grid; grid-template-columns: auto 1fr auto; align-items: center; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; } }
.v-fig { margin: 0; height: 100%; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 4.5rem 0 1rem; min-width: 0; }
.v-fig img { max-height: calc(100dvh - 8rem); max-width: 100%; width: auto; object-fit: contain; border-radius: 2px; }
.v-fig figcaption { padding: .8rem 1rem 0; font-size: .85rem; color: #aaa; text-align: center; }
.v-nav, .v-close { border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .04); color: #fff; cursor: pointer; border-radius: 50%; width: 52px; height: 52px; display: grid; place-items: center; margin: 0 clamp(.4rem, 2vw, 1.5rem); }
.v-nav:hover, .v-close:hover { background: rgba(255, 255, 255, .14); }
.v-nav svg, .v-close svg { width: 20px; height: 20px; }
.v-close { position: absolute; top: 1rem; inset-inline-end: 1rem; margin: 0; z-index: 2; }
@media (max-width: 640px) {
  .viewer[open] { grid-template-columns: 1fr; }
  .v-nav { position: absolute; bottom: 1rem; z-index: 2; }
  .v-prev { inset-inline-start: 1rem; } .v-next { inset-inline-end: 1rem; }
  .v-fig { padding-bottom: 5rem; }
}

/* ---- Reveal on scroll (only when JS is running and motion is allowed) ---- */
.js .rv { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--rd, 0s); }
.js .rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .feed-track { animation: none !important; }
  .feed-wall { height: auto; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .feed-track [aria-hidden="true"] { display: none; }
  .sun { animation: none; }
  .js .rv { opacity: 1; transform: none; }
}

@media print {
  .bar, .feed-wall, .reel, .sky, .moon, main::after { display: none !important; }
  .sec, .hero { background: #fff !important; color: #000 !important; }
}

/* Inline icons default to text size wherever they appear */
.open svg, .links svg, .sh-close svg, .sh-next svg, .sh-links svg, .feed-ctrl svg { width: 1.1em; height: 1.1em; flex: none; }
.case .open { white-space: nowrap; }
.case-media img { object-position: var(--focus, 50% 50%); }
html[lang="en"] .case.is-featured h3 { font-size: clamp(3.4rem, 2rem + 5vw, 6.5rem); line-height: .95; }
@media (max-width: 640px) { .hero-roles { align-items: center; } .sun { width: 300px; } }
@media (max-width: 640px) {
  .contact-list a.row { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .contact-list .v { font-size: 1.2rem; text-align: start; unicode-bidi: isolate; overflow-wrap: normal; word-break: break-all; }
  .moon { top: 6.5rem; opacity: .55; }
}

/* Original wordmark used as an Arabic project title (keeps the logo's kasra clear of the dots of ي) */
.wordmark { display: block; height: 1.9em; aspect-ratio: var(--ratio); max-width: 100%;
  background: var(--logo) no-repeat center / contain; }
html[dir="rtl"] .wordmark { margin-inline-start: -.04em; }
.brand-word { font-family: var(--f-ar); font-weight: 600; font-size: .9em; }
/* Arabic on phones: the one-line contact heading runs under the moon, so the moon sits in the open space above it. */
@media (max-width: 640px) { [dir="rtl"] .moon { top: 2.25rem; width: 64px; } }
