/* ============================================================
   EDITORIAL REDESIGN — editorial.css
   Framer-inspired: cream card, massive type, floating glyphs
   Fonts are loaded via <link> in each HTML <head> (not @import,
   which is render-blocking and would duplicate the request).
   ============================================================ */

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
a { text-decoration: none; }

body { -webkit-tap-highlight-color: transparent; }

/* Design tokens (--black/--red/--cream/--ink/--muted/--border/--soft)
   live in css/base.css, loaded before this file in every page <head>. */

/* ── Body / outer frame ──────────────────────────────────── */
html, body { min-height: 100vh; }
html {
  /* Reserve scrollbar gutter on BOTH sides so the centered sheet
     stays truly centered with or without a scrollbar. Fixes
     Center Bias rule — visual center must equal viewport center. */
  scrollbar-gutter: stable both-edges;
  /* Smooth anchor-link scrolling instead of instant snap */
  scroll-behavior: smooth;
  /* Offset for the sticky nav so anchors don't hide behind it */
  scroll-padding-top: 80px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  padding: clamp(10px, 1.5vw, 20px);
  background:
    radial-gradient(ellipse 55% 50% at 92% 6%, rgba(192,22,12,0.92) 0%, transparent 68%),
    var(--black);
}

/* ── Card ────────────────────────────────────────────────── */
.sheet {
  max-width: 100%;
  margin: 0 auto;
  background: var(--cream);
  min-height: calc(100vh - clamp(20px, 3vw, 40px));
  display: flex;
  flex-direction: column;
  position: relative;
  /* Was overflow:hidden — that broke position:sticky on .nav.
     Each child that needs clipping (.hero, .marquee-wrap) handles
     it locally, so the page wrapper stays scroll-friendly. */
  overflow: visible;
}
/* Local clipping where decorations could spill out */
.hero { overflow: hidden; }

/* ── NAV ─────────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--cream);
  transition: background 0.3s, backdrop-filter 0.3s, border-color 0.3s;
}
.nav--scrolled {
  /* Cream tint at low opacity + heavy blur — the bar becomes a
     translucent frosted strip that lets the page show through
     while remaining fully interactive (pointer-events stay on). */
  background: rgba(245, 241, 235, 0.45);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: rgba(0,0,0,0.06);
}
/* Keep nav layout fixed regardless of page language */
html[dir="rtl"] .nav { direction: ltr; }
html[dir="rtl"] .nav-links a { direction: rtl; }

.nav-logo {
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}

.nav-links {
  display: flex;
  gap: 28px;
  /* True horizontal centering inside the bar, independent of how wide the
     logo (left) or the account/lang buttons (right) are. */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-links a {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--ink); }

.nav-side {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-toggle {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  width: 34px; height: 34px;
  padding: 0;
  /* inline-flex so BOTH the <button> (lang) and the <a> (account icon)
     center their content identically — SVG or text. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.2s;
}
.lang-toggle:hover { border-color: var(--ink); }
.lang-toggle svg { display: block; }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 96vh;
  padding: 40px;
  padding-top: clamp(80px, 18vh, 220px);
  /* Decorations / layout stay LTR-anchored regardless of page language;
     the Arabic title still renders RTL internally via its own dir attribute below. */
  direction: ltr;
  text-align: center;
  overflow: hidden;
}

/* floating glyphs — absolutely positioned */
/* ── Reusable 3D glyph system ─────────────────────────────────
   Use anywhere you want a chunky, extruded emoji-style symbol.
   <span class="glyph-3d glyph-3d--dark">✦</span>
   Variants: --dark (default), --orange, --gold, --red
   Sizes: --sm, --md (default), --lg
   ────────────────────────────────────────────────────────────── */
.glyph-3d {
  display: inline-block;
  line-height: 1;
  font-style: normal;
  font-weight: 400;
  pointer-events: none;
  user-select: none;
  font-size: clamp(36px, 5vw, 64px); /* default md */
  color: #1a1a1a;
  text-shadow:
    2px 2px 0 #555,
    4px 4px 0 #333,
    6px 6px 8px rgba(0,0,0,0.35);
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.2));
  transition: transform 0.18s ease;
}
.glyph-3d:hover { transform: translateY(-2px) rotate(-3deg); }

.glyph-3d--sm { font-size: clamp(24px, 3vw, 36px); }
.glyph-3d--md { font-size: clamp(36px, 5vw, 64px); }
.glyph-3d--lg { font-size: clamp(48px, 7vw, 90px); }

.glyph-3d--orange {
  color: #E8500A;
  text-shadow:
    1px 1px 0 #c43800,
    3px 3px 0 #a02d00,
    5px 5px 8px rgba(180,60,0,0.4);
  filter: drop-shadow(0 4px 10px rgba(200,80,0,0.4));
}
.glyph-3d--gold {
  color: #D4A437;
  text-shadow:
    1px 1px 0 #b08925,
    3px 3px 0 #8e6e1c,
    5px 5px 8px rgba(140,108,30,0.4);
  filter: drop-shadow(0 4px 10px rgba(180,140,40,0.35));
}
.glyph-3d--red {
  color: #C0160C;
  text-shadow:
    1px 1px 0 #8e1009,
    3px 3px 0 #6b0c07,
    5px 5px 8px rgba(110,15,10,0.4);
  filter: drop-shadow(0 4px 10px rgba(192,22,12,0.35));
}

/* Legacy hero positioning (uses the same 3D treatment) */
.glyph-tl {
  position: absolute;
  top: 10%;
  left: 6%;
}
.glyph-tl:not(.glyph-3d) {
  font-size: clamp(48px, 7vw, 90px);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  color: #1a1a1a;
  text-shadow:
    2px 2px 0 #555,
    4px 4px 0 #333,
    6px 6px 8px rgba(0,0,0,0.35);
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.2));
}

.glyph-br {
  position: absolute;
  bottom: 16%;
  right: 6%;
}
.glyph-br:not(.glyph-3d) {
  font-size: clamp(36px, 5.5vw, 72px);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  color: #E8500A;
  text-shadow:
    1px 1px 0 #c43800,
    3px 3px 0 #a02d00,
    5px 5px 8px rgba(180,60,0,0.4);
  filter: drop-shadow(0 4px 10px rgba(200,80,0,0.4));
}

/* name pill — below title */
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  background: var(--ink);
  color: rgba(255,255,255,0.9);
  font-size: clamp(0.85rem, 1.3vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 28px 7px 9px;
  border-radius: 999px;
  margin-top: 32px;
  min-height: 56px;          /* lock pill height so it stays the same in both languages */
}

.hero-pill-avatar {
  width: clamp(42px, 5vw, 60px);
  height: clamp(42px, 5vw, 60px);
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}

/* BIG title */
.hero-title {
  font-family: 'Anton', sans-serif;
  font-size: clamp(60px, 12vw, 160px);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-transform: uppercase;
  position: relative;
  z-index: 2;
}

html[lang="ar"] .hero-title {
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
}

/* bottom meta strip */
.hero-meta {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;   /* equal columns → middle truly centered */
  align-items: end;
  padding: 24px 0 28px;
  margin-top: auto;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-meta > :nth-child(1) { text-align: left; }
.hero-meta > :nth-child(2) { text-align: center; }
.hero-meta > :nth-child(3) { text-align: right; }

/* ── HERO DECORATIONS (desk-flatlay style) ─────────────────────
   Four absolutely-positioned decoration zones (TL, TR, BL, BR)
   plus an inline code snippet on the left. All non-interactive
   and aria-hidden — pure visual texture. Drops out cleanly on
   tablet/mobile so the title stays the hero.
   ────────────────────────────────────────────────────────────── */
.hero-deco {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  /* Decorations are language-neutral — lock to LTR so flex-end / right anchors
     stay in the same physical corner whether the page is EN or AR. */
  direction: ltr;
}
/* Decoration positions pinned in PIXELS (not %) so they anchor to the same
   physical corner regardless of hero content height, viewport size, or language.
   Widths use clamp(px,vw,px) to scale gracefully without depending on hero
   height. Result: identical layout in EN and AR. */
.hero-deco--tl { top: 36px;    left: 4%;  width: clamp(180px, 22vw, 360px); }
.hero-deco--tr { top: 20px;    right: 3%; width: clamp(160px, 18vw, 305px); }
.hero-deco--bl { bottom: 100px; left: 2%; width: clamp(160px, 18vw, 280px); }
.hero-deco--br {
  bottom: 120px;
  right: 5%;
  width: clamp(180px, 20vw, 300px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  opacity: 0.55;
}

/* Halftone dot pattern — repeating radial gradient */
.halftone {
  width: 100%;
  height: 110px;
  background-image: radial-gradient(circle, rgba(0,0,0,0.22) 1px, transparent 1.4px);
  background-size: 10px 10px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 75%);
  opacity: 0.6;
}
.halftone--tl { margin-bottom: -40px; }

/* Photo slots — drop assets/hero/keyboard.png, cubes.png into place.
   Auto-removed by inline onerror if the file is missing. */
.hero-photo {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,0.12));
}
/* Keyboard slot — auto-crops to a top-left corner half-section
   of whatever PNG you drop in (so a full keyboard photo becomes
   a tight desk-corner crop). Slight tilt + soft shadow. */
.hero-photo--keyboard {
  aspect-ratio: 4 / 3;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: 18% 28%;   /* shows the top-left keys cluster */
  transform: rotate(-4deg);
  border-radius: 6px;
}
.hero-photo--cubes { transform: rotate(3deg); }

/* SVG fallback keyboard (used if assets/hero/keyboard.png is absent) */
.hero-keyboard {
  width: 100%;
  height: auto;
  display: block;
}
/* If the real photo loads, hide the SVG fallback */
.hero-deco--tr .hero-photo + .hero-keyboard { display: none; }

/* Bottom-right circuit traces */
.hero-circuit {
  width: 100%;
  height: 180px;
  opacity: 0.6;
}
/* Bottom-right binary code text */
.hero-binary {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  line-height: 1.45;
  letter-spacing: 0.05em;
  color: rgba(0,0,0,0.18);
  margin: 0;
  text-align: right;
  white-space: pre;
}

/* Override base glyph positioning so they sit inside their deco zones */
.hero-deco--tl .glyph-tl {
  position: static;
  display: block;
  margin-top: -10px;
  font-size: clamp(40px, 5vw, 64px);
}
.hero-deco--br .glyph-br {
  position: static;
  display: block;
  font-size: clamp(36px, 4.4vw, 56px);
  margin-top: -4px;
  align-self: flex-end;
}

/* Left-side code snippet — IDE-style, faded so it never competes with the title */
.hero-code {
  position: absolute;
  left: 4%;
  top: 38%;
  transform: translateY(-50%);
  max-width: 22%;
  margin: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: clamp(10px, 0.85vw, 13px);
  line-height: 1.65;
  color: rgba(0,0,0,0.30);
  white-space: pre;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  opacity: 0.7;          /* extra fade so it sits clearly behind the title */
}
.hero-code .hc-c { color: rgba(120, 70, 30, 0.32); font-style: italic; }
.hero-code .hc-k { color: rgba(0,0,0,0.40); font-weight: 600; }
.hero-code .hc-f { color: rgba(0, 60, 110, 0.35); }
.hero-code .hc-b { color: rgba(160, 40, 30, 0.4); }

/* Push the centered title above the decorations */
.hero-title, .hero-pill, .hero-meta { position: relative; z-index: 2; }

/* Mobile: drop the decorations so the title doesn't fight for space */
@media (max-width: 900px) {
  .hero-deco--tl, .hero-deco--tr, .hero-deco--bl, .hero-deco--br,
  .hero-code { display: none; }
}

/* ── SECTIONS ────────────────────────────────────────────── */
.section {
  padding: clamp(44px, 6vw, 88px) clamp(24px, 4vw, 56px);
  text-align: center;
}

/* Kicker — used above every section title, above the prompts h1,
   and inside the eid page head. Unified scale across all pages. */
.section-label,
.prompts-head .kicker,
.eid-page-head .kicker {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.section-title {
  font-family: 'Anton', sans-serif;
  font-size: clamp(36px, 5.5vw, 72px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 36px;
}

/* ── SERVICES (numbered icon-card grid) ──────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(20px, 2.5vw, 36px);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.service-item {
  position: relative;
  padding: 28px 18px 8px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent;
  transition: transform 0.25s ease;
}
.service-item:hover { transform: translateY(-3px); }

/* Subtle vertical separator between cards (cream cards on cream bg need a line) */
.service-item + .service-item::before {
  content: '';
  position: absolute;
  top: 24px;
  bottom: 24px;
  inset-inline-start: calc(-1 * clamp(10px, 1.25vw, 18px));
  width: 1px;
  background: var(--border);
}

/* Orange number with short underline (top-right of each card) */
.service-num {
  position: absolute;
  top: 14px;
  inset-inline-end: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--red);
  line-height: 1;
}
.service-num::after {
  content: '';
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--red);
  margin-top: 6px;
  margin-inline-start: auto;
}
/* RTL: put the counter at the reading-start (top-right in Arabic), not at the end */
html[lang="ar"] .service-num {
  inset-inline-end: auto;
  inset-inline-start: 12px;
}
html[lang="ar"] .service-num::after {
  margin-inline-start: 0;
  margin-inline-end: auto;
}

/* Icon mini-card — bigger, no harsh border, soft shadow only */
.service-icon-card {
  width: 110px;
  height: 110px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  transition: transform 0.25s ease;
}
.service-icon-card svg,
.service-icon-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
/* If the PNG render loads, hide the SVG fallback */
.service-icon-card .service-icon-img + .service-icon-svg { display: none; }
.service-icon-img {
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.12));
}
.service-item:hover .service-icon-card { transform: translateY(-2px) rotate(-1deg); }

.service-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0;
}
.service-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 4px 0 0;
  max-width: 28ch;
}

/* ── Road Timeline ───────────────────────────────────────── */
.road-timeline {
  position: relative;
  margin: 48px auto 0;
  padding: 0 0 24px;
  max-width: 920px;     /* cap so labels stay near the dots, not at viewport edges */
  /* Lock layout direction so the S-curve and dot-side relationships
     stay identical in EN and AR; per-line text still respects its own dir. */
  direction: ltr;
}
.road-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}
.road-line {
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-dasharray: 10 16;
  stroke-linecap: round;
  fill: none;
  opacity: 0.18;
}

.road-stop {
  display: flex;
  align-items: center;
  margin-bottom: 80px;
  position: relative;
}
.road-stop:last-child { margin-bottom: 0; }

.road-side { min-width: 0; }

/* Restore the S-curve via offset flex ratios — dot sits at ~30% from one
   edge, content sits on the OPPOSITE side close to the dot, empty year-
   column makes up the gap that lets the curve breathe. With the 920px cap
   on the timeline, even the wider empty side stays compact. */
.road-stop--right .road-side--year    { flex: 2.2; text-align: right; padding-right: 24px; }
.road-stop--right .road-side--content { flex: 1; padding-left: 24px; text-align: left; }

.road-stop--left .road-side--content  { flex: 1; padding-right: 24px; text-align: right; }
.road-stop--left .road-side--year     { flex: 2.2; text-align: left; padding-left: 24px; }

/* Arabic: re-enable RTL inside the content text so Arabic flows naturally,
   but keep the dot/side layout unchanged. */
html[lang="ar"] .road-side--content { direction: rtl; }

.road-node {
  flex-shrink: 0;
  z-index: 2;
}
.road-dot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: 'Anton', sans-serif;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.road-stop:hover .road-dot {
  transform: scale(1.12);
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
}

.road-year {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.road-role {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.road-place {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Subsection divider ──────────────────────────────────── */
.subsection-divider {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 56px 0 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
}
.subsection-divider::before,
.subsection-divider::after {
  content: '';
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: var(--border);
}

/* ── PROJECTS (numbered image cards with chips + arrow button) ── */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.work-card {
  position: relative;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s;
}
.work-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,0,0,0.18);
  box-shadow: 0 16px 28px rgba(0,0,0,0.08);
}

/* Number badge (top-left, over the preview) */
.work-num {
  position: absolute;
  top: 26px;
  inset-inline-start: 26px;
  z-index: 2;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--red);
  line-height: 1;
}

/* Top-right corner arrow over the preview */
.work-corner-arrow {
  position: absolute;
  top: 22px;
  inset-inline-end: 22px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.work-corner-arrow svg { width: 14px; height: 14px; }

/* Preview area — keeps the per-project visual */
.work-preview {
  position: relative;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s;
}
.work-preview--prompts { background: #0f0f0f; }
.work-preview--prompts::before {
  content: 'Ask anything...';
  color: rgba(255,255,255,0.32);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  position: absolute; left: 22px; right: 60px; top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 10px 16px;
  border-radius: 22px;
}
.work-preview--prompts::after {
  content: '→';
  position: absolute; right: 24px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.45);
  font-size: 0.95rem;
}
.work-preview--eid {
  background:
    radial-gradient(ellipse at 50% 70%, rgba(232,180,90,0.5), transparent 60%),
    linear-gradient(135deg, #c89b56 0%, #8b6428 100%);
}
.work-preview--eid::after {
  content: 'عيد مبارك';
  color: rgba(255,255,255,0.92);
  font-family: 'Cairo', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.work-preview--3d {
  background:
    linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}
.work-preview--3d::after {
  content: '';
  width: 90px; height: 90px;
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 12px;
  transform: rotate(28deg) skewX(-12deg);
  box-shadow:
    inset 0 0 30px rgba(255,255,255,0.05),
    0 0 40px rgba(255,255,255,0.08);
}
.work-preview--ai { background: #0a0a0a; overflow: hidden; }
.work-preview--ai::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 30% 60%, rgba(99,102,241,0.28) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 75% 35%, rgba(139,92,246,0.22) 0%, transparent 70%);
}
.work-preview--ai::after {
  content: 'KW · AI';
  font-family: 'Anton', sans-serif;
  font-size: 2.2rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.18);
  position: relative; z-index: 1;
}
.work-card:hover .work-preview { opacity: 0.92; }

/* Project image — when present, sits on TOP of the CSS fallback
   ::before/::after pseudo-elements so it visually replaces them.
   If the file is missing, the inline <img> is removed via onerror
   and the CSS fallback shows through. */
.work-preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 2;
  display: block;
}
/* When an image is actually present, hide the CSS fallback completely
   (background tint + pseudo-element placeholders) so they don't bleed
   through the image. Uses :has() — supported in all current browsers. */
.work-preview:has(.work-preview-img) {
  background: transparent !important;
}
.work-preview:has(.work-preview-img)::before,
.work-preview:has(.work-preview-img)::after {
  display: none !important;
}

/* Category tag (LIVE, ORKAKWT, etc.) */
.work-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  margin: 6px 4px 0;
}

.work-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin: 0 4px;
}
.work-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 4px;
}

/* Chip row (AI, Prompts, Arabic …) */
.work-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 4px 0;
  padding-right: 46px;        /* don't collide with the round go-button */
}
html[dir="rtl"] .work-chips { padding-right: 4px; padding-left: 46px; }
.work-chip {
  display: inline-flex;
  align-items: center;
  background: var(--cream);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Round arrow "go" button (bottom-right of the card) */
.work-go {
  position: absolute;
  bottom: 14px;
  inset-inline-end: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cream);
  border: 1px solid var(--border);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}
.work-go svg { width: 16px; height: 16px; }
html[dir="rtl"] .work-go svg { transform: scaleX(-1); }
.work-card:hover .work-go {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  transform: translateY(-2px);
}

/* ── Skills marquee ──────────────────────────────────────── */
.marquee-wrap {
  overflow: hidden;
  margin-top: 28px;
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}
.marquee-track {
  display: flex;
  width: max-content;
  /* Translation distance pinned to the exact width of ONE set of items
     (measured + set by JS as --marquee-shift). Falls back to -50% before
     JS runs. Using translate3d to force GPU compositing so the loop
     boundary is rendered seamlessly without sub-pixel snapping. */
  animation: marquee-scroll 28s linear infinite;
  will-change: transform;
  --marquee-shift: -50%;
}
/* Marquee keeps moving even when the cursor is over a chip */
@keyframes marquee-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(var(--marquee-shift), 0, 0); }
}
.skill-card {
  flex-shrink: 0;
  padding: 20px 32px;
  margin-inline-end: 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--cream);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: default;
}
.skill-card:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ── Prompt Library page ─────────────────────────────────── */
.prompts-page {
  padding: clamp(48px, 7vw, 96px) clamp(24px, 4vw, 56px);
  background: var(--cream);
}
.prompts-head {
  text-align: center;
  margin-bottom: clamp(48px, 7vw, 80px);
}
.prompts-head .kicker {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.prompts-head h1 {
  font-family: 'Anton', sans-serif;
  font-size: clamp(48px, 9vw, 112px);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 0.95;
}
.prompts-head p {
  margin: 22px auto 0;
  color: var(--muted);
  max-width: 560px;
  font-size: 0.95rem;
  line-height: 1.7;
}
html[lang="ar"] .prompts-head h1 {
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  letter-spacing: 0;
}

.prompts-cat {
  margin-bottom: clamp(40px, 6vw, 64px);
}
.prompts-cat-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.prompts-cat-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 6px;
}
.prompts-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.pcard {
  display: flex;
  flex-direction: column;
  background: var(--cream);
  text-decoration: none;
  overflow: hidden;
  position: relative;
  transition: background 0.2s;
}
.pcard:hover { background: var(--ink); }
.pcard:hover .pcard-title,
.pcard:hover .pcard-desc,
.pcard:hover .pcard-open { color: rgba(255,255,255,0.92); }
.pcard:hover .pcard-img { opacity: 0.7; }

.pcard-img {
  aspect-ratio: 16/10;
  background: #1a1a1a;
  overflow: hidden;
  transition: opacity 0.2s;
}
.pcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pcard-body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.pcard-title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.pcard-desc {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
  flex: 1;
  transition: color 0.2s;
}
.pcard-open {
  margin-top: 10px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.prompts-empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
  font-size: 0.9rem;
}

/* Focus view (single prompt detail) */
.prompts-focus { max-width: 820px; margin: 0 auto; }
.pfocus-back {
  background: none;
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  margin-bottom: 28px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pfocus-back:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.pfocus-card {
  background: var(--cream);
  border: 1px solid var(--border);
  overflow: hidden;
}
.pfocus-img {
  background: #1a1a1a;
  max-height: 440px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pfocus-img img { width: 100%; max-height: 440px; object-fit: contain; }
.pfocus-body { padding: clamp(28px, 5vw, 48px); }
.pfocus-cat {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.pfocus-title {
  font-family: 'Anton', sans-serif;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1;
}
html[lang="ar"] .pfocus-title {
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  letter-spacing: 0;
}
.pfocus-desc {
  color: var(--muted);
  margin: 14px 0 26px;
  font-size: 0.95rem;
  line-height: 1.7;
}
.pfocus-text-wrap {
  border: 1px solid var(--border);
  background: #fafaf7;
}
.pfocus-text {
  margin: 0;
  padding: 22px 24px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 480px;
  overflow-y: auto;
  user-select: text;
}
.pfocus-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.pfocus-copy {
  flex: 1;
  min-width: 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  padding: 14px 26px;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.pfocus-copy:hover { background: var(--red); border-color: var(--red); }
.pfocus-copy:active { transform: scale(0.98); }
.pfocus-copy.copied { background: #1a8c4a; border-color: #1a8c4a; }
.pfocus-share {
  background: none;
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 14px 26px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pfocus-share:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.pfocus-hint {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 16px;
  text-align: center;
}

.prompt-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 14px 30px;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
}
.prompt-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Contact ─────────────────────────────────────────────── */
.contact-section {
  text-align: center;
  padding: clamp(56px, 8vw, 96px) clamp(24px, 4vw, 56px);
  border-top: 1px solid var(--border);
}
.contact-title {
  font-family: 'Anton', sans-serif;
  font-size: clamp(40px, 7.5vw, 96px);
  text-transform: uppercase;
  color: var(--ink);
  line-height: 0.92;
  margin-bottom: 32px;
}
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 14px 30px;
  border-radius: 999px;
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
}
.contact-email:hover {
  background: var(--red);
  border-color: var(--red);
  transform: translateY(-2px);
}

/* ── Floating buttons ────────────────────────────────────── */
.float-insta,
.float-linkedin {
  position: fixed;
  right: 28px;
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
}
.float-insta {
  bottom: 24px;
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  box-shadow: 0 4px 16px rgba(188,24,136,0.4);
}
.float-insta:hover {
  transform: translateY(-3px) scale(1.07);
  box-shadow: 0 8px 24px rgba(188,24,136,0.55);
}
.float-linkedin {
  bottom: 84px;
  background: #0A66C2;
  box-shadow: 0 4px 16px rgba(10,102,194,0.4);
}
/* Hidden when footer enters viewport (no overlap with footer text) */
.float-insta.floats--hidden,
.float-linkedin.floats--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}
.float-insta, .float-linkedin {
  transition: transform 0.25s, box-shadow 0.25s, opacity 0.25s;
}
.float-linkedin:hover {
  transform: translateY(-3px) scale(1.07);
  box-shadow: 0 8px 24px rgba(10,102,194,0.55);
}

/* ── Footer ──────────────────────────────────────────────── */
.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  min-height: 60px;
  border-top: 1px solid var(--border);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-logo {
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}
.footer-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color 0.15s;
}
.footer-link:hover { color: var(--ink); }

/* ── Arabic ──────────────────────────────────────────────── */
/* RULE: layout never shifts between languages. Only TEXT translates.
   The page scaffolding always uses LTR direction so all flex orders,
   physical positions, padding, and grids stay pixel-identical in EN and
   AR. Individual TEXT-bearing elements opt into RTL below so Arabic
   still reads right-to-left within its own box. */
html[lang="ar"] body,
html[lang="ar"] .sheet,
html[lang="ar"] .nav,
html[lang="ar"] .nav-links,
html[lang="ar"] .nav-side,
html[lang="ar"] .hero,
html[lang="ar"] .hero-deco,
html[lang="ar"] .section,
html[lang="ar"] .services-grid,
html[lang="ar"] .works-grid,
html[lang="ar"] .service-item,
html[lang="ar"] .work-card,
html[lang="ar"] .road-timeline,
html[lang="ar"] .road-stop,
html[lang="ar"] .marquee-wrap,
html[lang="ar"] .marquee-track,
html[lang="ar"] .contact-section,
html[lang="ar"] .footer-bar,
html[lang="ar"] .eid-flow,
html[lang="ar"] .step,
html[lang="ar"] .step-head,
html[lang="ar"] .prompts-page,
html[lang="ar"] .prompts-head,
html[lang="ar"] .prompts-grid,
html[lang="ar"] .work-chips,
html[lang="ar"] .work-go,
html[lang="ar"] .hero-pill,
html[lang="ar"] .hero-meta,
html[lang="ar"] .work-preview,
html[lang="ar"] .preview-area,
html[lang="ar"] .final-actions,
html[lang="ar"] .share-buttons,
html[lang="ar"] .size-control,
html[lang="ar"] .greeting-tabs {
  direction: ltr;
}

/* Each TEXT-bearing element opts back into RTL when in Arabic so the
   Arabic text within shapes its own glyph order correctly, without
   the surrounding layout flipping. */
html[lang="ar"] .nav-links a,
html[lang="ar"] .hero-title,
html[lang="ar"] .hero-pill span,
html[lang="ar"] .hero-meta span,
html[lang="ar"] .section-label,
html[lang="ar"] .section-title,
html[lang="ar"] .service-name,
html[lang="ar"] .service-desc,
html[lang="ar"] .subsection-divider,
html[lang="ar"] .work-name,
html[lang="ar"] .work-desc,
html[lang="ar"] .work-tag,
html[lang="ar"] .work-chip,
html[lang="ar"] .road-role,
html[lang="ar"] .road-place,
html[lang="ar"] .contact-title,
html[lang="ar"] .contact-section .section-label,
html[lang="ar"] .footer-bar span,
html[lang="ar"] .step-title,
html[lang="ar"] .eid-page-head h1,
html[lang="ar"] .eid-page-head .kicker,
html[lang="ar"] .eid-page-head .subtitle,
html[lang="ar"] .prompts-head h1,
html[lang="ar"] .prompts-head .kicker,
html[lang="ar"] .prompts-head > p,
html[lang="ar"] .greeting-chip,
html[lang="ar"] .input-label,
html[lang="ar"] .input-helper,
html[lang="ar"] .wmt-label,
html[lang="ar"] .drag-tip,
html[lang="ar"] .flow-banner span,
html[lang="ar"] .eid-credit,
html[lang="ar"] .eid-disclaimer {
  direction: rtl;
  unicode-bidi: isolate;
}
html[lang="ar"] .hero-title,
html[lang="ar"] .section-title,
html[lang="ar"] .contact-title {
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  /* Cairo glyphs (hamza أ, diacritics) need more room than Anton — bump line-height
     so ascenders don't clip the top edge of the bounding box. */
  line-height: 1.15;
  letter-spacing: 0;
}
/* Hero/contact titles & pill must explicitly opt back into RTL when in Arabic
   (since their parent .hero is forced to LTR for decoration consistency).
   NOTE: .hero-meta is a 3-column GRID — it must stay LTR so the columns
   never reverse. Only the text inside each meta span flows RTL (handled
   separately below) so ©2026 / role / since-year keep identical positions. */
html[lang="ar"] .hero-title,
html[lang="ar"] .hero-pill { direction: rtl; }
html[lang="ar"] .hero-meta { direction: ltr; }
html[lang="ar"] .hero-meta span { direction: rtl; unicode-bidi: isolate; }
/* First meta cell is pure Latin/symbol (©2026) — keep it LTR so it reads
   identically (©2026, not 2026©) in both languages. */
html[lang="ar"] .hero-meta > :nth-child(1) { direction: ltr; }
/* Arabic is a connected script — letter-spacing forcibly disconnects the
   letters, which breaks legibility. Strip it on every small-cap label,
   chip, tag, kicker, nav item, and meta line when the page is in Arabic. */
html[lang="ar"] .section-label,
html[lang="ar"] .subsection-divider,
html[lang="ar"] .work-chip,
html[lang="ar"] .work-tag,
html[lang="ar"] .nav-links a,
html[lang="ar"] .hero-pill,
html[lang="ar"] .hero-meta,
html[lang="ar"] .footer-bar,
html[lang="ar"] .footer-bar span,
html[lang="ar"] .skill-card,
html[lang="ar"] .pcard-open,
html[lang="ar"] .pcard-title,
html[lang="ar"] .pfocus-back,
html[lang="ar"] .pfocus-copy,
html[lang="ar"] .pfocus-share,
html[lang="ar"] .pfocus-cat {
  letter-spacing: 0;
}
html[lang="ar"] .nav-logo,
html[lang="ar"] .footer-logo { font-family: 'Caveat', cursive; }

/* Cairo letters at the same px size as uppercase Inter look ~20% smaller.
   Bump the name pill so the Arabic version reads with the same visual weight
   as the English "SALEH ALMUKHAIZEEM" pill. Also use symmetric padding
   since the avatar swaps sides via flex reversal in RTL. */
html[lang="ar"] .hero-pill {
  font-size: clamp(1.05rem, 1.6vw, 1.4rem);
  font-weight: 700;
  padding: 7px 18px;
}

/* RTL bidi isolation — keep Latin tokens (skills, years, handles, URLs)
   reading LEFT→RIGHT regardless of the surrounding Arabic context. */
.skill-card,
.road-year,
.contact-email,
.work-tag,
.work-name,
.hero-pill,
.hero-meta span:first-child,
.footer-bar span:nth-child(2) {
  unicode-bidi: isolate;
}
html[lang="ar"] .skill-card,
html[lang="ar"] .road-year,
html[lang="ar"] .contact-email,
html[lang="ar"] .work-tag {
  direction: ltr;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { min-height: 70vh; }
  .glyph-tl { font-size: 42px; left: 4%; top: 8%; }
  .glyph-br { font-size: 32px; right: 4%; }
  .hero-meta { flex-direction: column; align-items: center; gap: 6px; }
  .timeline-item { grid-template-columns: 1fr; gap: 3px; }
  .footer-bar { flex-direction: column; gap: 7px; text-align: center; }
}
