/* ============================================================
   Ahmed Al-Riyami — Portfolio
   Design system: Portfolio Grid pattern · Motion-Driven style
   Monochrome + blue accent (#2563EB) · bilingual AR/EN
   ============================================================ */

:root {
  /* ── Brand palette (ui_ux_search result) ── */
  --color-primary: #18181b;
  --color-secondary: #3f3f46;
  --color-accent: #2563eb;
  --color-accent-soft: #60a5fa;
  --color-destructive: #dc2626;
  --color-success: #16a34a;
  --color-warning: #d97706;

  /* ── Surfaces (dark = default) ── */
  --bg: #0a0a0f;
  --bg-elevated: #0f0f14;
  --surface: #131318;
  --surface-2: #1a1a21;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-hover: rgba(255, 255, 255, 0.08);
  --overlay: rgba(5, 5, 8, 0.72);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.6);
  --accent-tint: rgba(37, 99, 235, 0.14);
  --accent-tint-2: rgba(96, 165, 250, 0.16);

  /* ── Shape ── */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* ── Space (4/8 rhythm) ── */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --container: 1180px;

  /* ── Icons ── */
  --icon-sm: 16px; --icon-md: 20px; --icon-lg: 24px;

  /* ── Motion ── */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 150ms;
  --t-base: 240ms;
  --t-slow: 400ms;

  /* ── Type ── */
  --font-display: "Almarai", "Segoe UI", system-ui, sans-serif;
  --font-body: "Almarai", "Segoe UI", system-ui, sans-serif;
  --font-latin: "Space Grotesk", ui-monospace, monospace;
  --font-en-display: "Archivo", system-ui, sans-serif;
}
/* ── Light theme ── */
html[data-theme="light"] {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #09090b;
  --text-muted: #52525b;
  --text-dim: #71717a;
  --glass: rgba(9, 9, 11, 0.035);
  --glass-hover: rgba(9, 9, 11, 0.06);
  --overlay: rgba(9, 9, 11, 0.45);
  --shadow-sm: 0 2px 10px rgba(9, 9, 11, 0.06);
  --shadow: 0 10px 34px rgba(9, 9, 11, 0.09);
  --shadow-lg: 0 26px 70px rgba(9, 9, 11, 0.14);
}

/* ── English mode: swap to latin display faces ── */
html[data-lang="en"] {
  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "Space Grotesk", system-ui, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.12; letter-spacing: -0.02em; }
html[dir="ltr"] h1, html[dir="ltr"] h2, html[dir="ltr"] h3 { letter-spacing: -0.035em; }
::selection { background: var(--color-accent); color: #fff; }
:focus-visible { outline: 2px solid var(--color-accent-soft); outline-offset: 3px; border-radius: 4px; }

/* ── Lucide icon sizing ── */
[data-lucide] { width: var(--icon-md); height: var(--icon-md); stroke-width: 1.75; }
/* ── Ambient background ── */
.bg-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(90px);
  opacity: 0.5; will-change: transform;
  animation: float 22s var(--ease) infinite alternate;
}
.orb-1 { width: 46vw; height: 46vw; top: -14vw; inset-inline-start: -8vw; background: radial-gradient(circle, rgba(37, 99, 235, 0.5), transparent 68%); }
.orb-2 { width: 38vw; height: 38vw; top: 32vh; inset-inline-end: -10vw; background: radial-gradient(circle, rgba(96, 165, 250, 0.32), transparent 70%); animation-delay: -8s; }
html[data-theme="light"] .orb { opacity: 0.34; }
.grid-lines {
  position: absolute; inset: 0; opacity: 0.5;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 80%);
}
@keyframes float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4vw, 6vh, 0) scale(1.14); }
}

/* ── Scroll progress + back to top ── */
.scroll-progress {
  position: fixed; inset-block-start: 0; inset-inline-start: 0;
  height: 2px; width: 0; z-index: 60;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-soft));
  transition: width 90ms linear;
}
.back-top { position: fixed; inset-block-end: 24px; inset-inline-end: 24px; z-index: 40; }
.back-top[hidden] { display: none; }

/* ── Skip link + noscript ── */
.skip-link {
  position: absolute; inset-block-start: -60px; inset-inline-start: 16px; z-index: 80;
  background: var(--color-accent); color: #fff; padding: 10px 18px; border-radius: var(--r-md);
  font-weight: 700; transition: inset-block-start var(--t-base) var(--ease);
}
.skip-link:focus { inset-block-start: 12px; }
.noscript { max-width: var(--container); margin: 0 auto; padding: var(--s-8) var(--s-5); }
.noscript a { color: var(--color-accent-soft); text-decoration: underline; }

/* ── Layout utilities ── */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: var(--s-5); }
.section { padding-block: var(--s-9); position: relative; z-index: 1; }
.section--tight { padding-block: var(--s-7); }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-latin); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-accent-soft);
  margin-block-end: var(--s-4);
}
html[dir="rtl"] .eyebrow { letter-spacing: 0.06em; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; opacity: 0.6; }
.section-title { font-size: clamp(1.65rem, 3.6vw, 2.6rem); margin-block-end: var(--s-4); }
.section-lead { color: var(--text-muted); max-width: 62ch; font-size: 1.02rem; }
/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 46px; padding: 12px 24px; border: 1px solid transparent;
  border-radius: var(--r-pill); font-size: 0.93rem; font-weight: 700;
  cursor: pointer; background: none;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-base) var(--ease),
              background var(--t-base) var(--ease), border-color var(--t-base) var(--ease), opacity var(--t-fast);
}
.btn [data-lucide] { width: 18px; height: 18px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none !important; }
.btn-primary { background: var(--color-accent); color: #fff; box-shadow: 0 8px 26px rgba(37, 99, 235, 0.32); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(37, 99, 235, 0.45); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--glass-hover); transform: translateY(-2px); }
.btn-quiet { color: var(--text-muted); padding-inline: 14px; }
.btn-quiet:hover { color: var(--text); background: var(--glass-hover); }

/* ── Icon button ── */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--glass);
  color: var(--text-muted); cursor: pointer;
  transition: color var(--t-base), background var(--t-base), border-color var(--t-base), transform var(--t-fast) var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--glass-hover); border-color: var(--border-strong); transform: translateY(-2px); }
.icon-btn .lang-label { font-family: var(--font-latin); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; }

/* ── Cards ── */
.card {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s-5);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform var(--t-slow) var(--ease), border-color var(--t-base), box-shadow var(--t-slow) var(--ease), background var(--t-base);
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); background: var(--glass-hover); }

/* ── Tags / badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; font-weight: 700; padding: 5px 12px;
  border-radius: var(--r-pill); background: var(--accent-tint); color: var(--color-accent-soft);
  border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--live { background: rgba(22, 163, 74, 0.13); color: #4ade80; }
.badge--neutral { background: var(--glass); color: var(--text-muted); border-color: var(--border); }
html[data-theme="light"] .badge--live { color: var(--color-success); }
.tag-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
/* ── Navbar ── */
.navbar {
  position: sticky; inset-block-start: 0; z-index: 50;
  border-block-end: 1px solid transparent;
  transition: background var(--t-base) var(--ease), border-color var(--t-base), box-shadow var(--t-base);
}
.navbar.is-stuck {
  background: var(--bg-elevated);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-block-end-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: var(--container); margin: 0 auto; padding-inline: var(--s-5);
  height: 68px; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
}
.nav-logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.logo-mark { display: grid; place-items: center; transition: transform var(--t-slow) var(--ease); }
.nav-logo:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }
.logo-dot { color: var(--color-accent); }
.nav-links { display: flex; align-items: center; gap: var(--s-2); }
.nav-link {
  position: relative; padding: 8px 14px; border-radius: var(--r-pill);
  font-size: 0.92rem; font-weight: 600; color: var(--text-muted);
  transition: color var(--t-base), background var(--t-base);
}
.nav-link:hover { color: var(--text); background: var(--glass); }
.nav-link.is-active { color: var(--text); }
.nav-link.is-active::after {
  content: ""; position: absolute; inset-block-end: 2px; inset-inline: 14px;
  height: 2px; border-radius: 2px; background: var(--color-accent);
}
.nav-actions { display: flex; align-items: center; gap: var(--s-2); }
.nav-burger { display: none; }

/* ── Mobile menu ── */
@media (max-width: 820px) {
  .nav-burger { display: inline-flex; }
  .nav-links {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch;
    gap: var(--s-1); padding: var(--s-4) var(--s-5) var(--s-6);
    background: var(--bg-elevated);
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-block-end: 1px solid var(--border);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform var(--t-base) var(--ease), opacity var(--t-base);
  }
  .nav-links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-link { padding: 14px 16px; font-size: 1rem; }
  .nav-link.is-active::after { display: none; }
  .nav-link.is-active { background: var(--accent-tint); color: var(--color-accent-soft); }
}
@media (max-width: 480px) {
  #paletteBtn { display: none; }
  .nav-inner { padding-inline: var(--s-4); }
}
/* ── Hero ── */
.hero { position: relative; z-index: 1; padding-block: var(--s-9) var(--s-8); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: var(--s-8); align-items: center; }
.hero-copy h1 { font-size: clamp(2.1rem, 5.6vw, 4rem); margin-block: var(--s-3) var(--s-4); }
.hero-name { color: var(--text); display: block; }
.hero-role-line { display: block; margin-block-start: 6px; font-size: clamp(1.1rem, 2.6vw, 1.75rem); font-weight: 700; color: var(--text-dim); }
.hero-role { color: var(--color-accent-soft); position: relative; }
.hero-role::after {
  content: ""; display: inline-block; width: 2px; height: 1em; margin-inline-start: 4px;
  background: var(--color-accent-soft); vertical-align: -0.12em; animation: caret 1.1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.hero-lead { color: var(--text-muted); font-size: clamp(1rem, 1.6vw, 1.12rem); max-width: 54ch; margin-block-end: var(--s-6); }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-block-end: var(--s-6); }

/* ── Hero visual ── */
.hero-visual { position: relative; }
.portrait-card {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-xl);
  border: 1px solid var(--border-strong); overflow: hidden;
  background: linear-gradient(150deg, var(--surface-2), var(--surface) 55%, var(--bg-elevated));
  box-shadow: var(--shadow-lg);
}
.portrait-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 18%, var(--accent-tint-2), transparent 58%),
              radial-gradient(circle at 78% 88%, rgba(37, 99, 235, 0.22), transparent 55%);
}
.portrait-inner { position: absolute; inset: 0; display: grid; place-items: center; }
.initials-avatar {
  width: 44%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800;
  color: var(--text); letter-spacing: 0.02em;
  background: var(--surface-2);
  background: color-mix(in srgb, var(--color-accent) 22%, var(--surface));
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 0 40px rgba(37, 99, 235, 0.28);
}
.portrait-badge {
  position: absolute; inset-block-end: var(--s-4); inset-inline-start: var(--s-4);
  display: flex; align-items: center; gap: var(--s-2);
  padding: 9px 14px; border-radius: var(--r-pill);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border: 1px solid var(--border); backdrop-filter: blur(12px);
  font-size: 0.8rem; font-weight: 700;
}
.floating-chip {
  position: absolute; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--r-md);
  background: var(--bg-elevated);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  font-size: 0.78rem; font-weight: 700; backdrop-filter: blur(10px);
  animation: bob 6s var(--ease) infinite alternate;
}
.floating-chip [data-lucide] { width: 16px; height: 16px; color: var(--color-accent-soft); }
.chip-1 { inset-block-start: 12%; inset-inline-end: -18px; }
.chip-2 { inset-block-end: 20%; inset-inline-end: -26px; animation-delay: -3s; }
@keyframes bob { from { transform: translateY(-6px); } to { transform: translateY(8px); } }
/* ── Stats ── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.stat { padding: var(--s-5) var(--s-4); border-radius: var(--r-md); border: 1px solid var(--border); background: var(--glass); }
.stat-num { font-family: var(--font-latin); font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 700; color: var(--text); line-height: 1; }
.stat-num .suffix { color: var(--color-accent-soft); }
.stat-label { margin-block-start: var(--s-2); font-size: 0.83rem; color: var(--text-muted); }

/* ── Marquee (tech strip) ── */
.marquee {
  position: relative; overflow: hidden; padding-block: var(--s-5);
  border-block: 1px solid var(--border);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; gap: var(--s-7); width: max-content; animation: slide 34s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  font-family: var(--font-latin); font-size: 0.95rem; font-weight: 500;
  color: var(--text-dim); transition: color var(--t-base);
}
.marquee-item:hover { color: var(--text); }
.marquee-item [data-lucide] { width: 18px; height: 18px; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
html[dir="rtl"] .marquee-track { animation-name: slide-rtl; }
@keyframes slide-rtl { from { transform: translateX(0); } to { transform: translateX(50%); } }

/* ── Section head ── */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-5); margin-block-end: var(--s-7); flex-wrap: wrap; }
.section-head__text { max-width: 60ch; }
/* ── Filters ── */
.filters { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-block-end: var(--s-6); }
.filter {
  padding: 8px 16px; border-radius: var(--r-pill); border: 1px solid var(--border);
  background: var(--glass); color: var(--text-muted); font-size: 0.86rem; font-weight: 600;
  cursor: pointer; transition: all var(--t-base) var(--ease);
}
.filter:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-2px); }
.filter.is-active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }

/* ── Project grid ── */
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--s-5); }
.project-card {
  display: flex; flex-direction: column; overflow: hidden; padding: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  cursor: pointer; text-align: start;
  transition: transform var(--t-slow) var(--ease), border-color var(--t-base), box-shadow var(--t-slow) var(--ease);
}
.project-card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.project-card__body { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); flex: 1; }
.project-card__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.project-card__title { font-size: 1.16rem; }
.project-card__desc { color: var(--text-muted); font-size: 0.92rem; }
.project-card__meta { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-block-start: auto; padding-block-start: var(--s-2); border-block-start: 1px solid var(--border); font-size: 0.8rem; color: var(--text-dim); }
.project-card__arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--color-accent-soft); font-weight: 700; transition: gap var(--t-base) var(--ease); }
.project-card:hover .project-card__arrow { gap: 12px; }

/* ── Project cover art (pure CSS) ── */
.cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-block-end: 1px solid var(--border); }
.cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.16), transparent 55%); }
.cover--1 { background: linear-gradient(140deg, #1e3a8a, #3b82f6 55%, #93c5fd); }
.cover--2 { background: linear-gradient(140deg, #4c1d95, #7c3aed 50%, #c4b5fd); }
.cover--3 { background: linear-gradient(140deg, #064e3b, #059669 55%, #6ee7b7); }
.cover--4 { background: linear-gradient(140deg, #7c2d12, #ea580c 55%, #fdba74); }
.cover--5 { background: linear-gradient(140deg, #155e75, #0891b2 55%, #67e8f9); }
.cover--6 { background: linear-gradient(140deg, #831843, #db2777 55%, #f9a8d4); }
.cover__mock {
  position: absolute; inset: 14% 12%; z-index: 2;
  background: rgba(10, 10, 15, 0.5); border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px; backdrop-filter: blur(6px); padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.cover__bar { display: flex; gap: 5px; }
.cover__bar span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); }
.cover__line { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.35); }
.cover__line.w70 { width: 70%; } .cover__line.w45 { width: 45%; } .cover__line.w88 { width: 88%; }
.cover__blocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-block-start: auto; }
.cover__blocks span { height: 26px; border-radius: 6px; background: rgba(255, 255, 255, 0.26); }
/* ── Project detail ── */
.detail-hero { padding-block: var(--s-8) var(--s-6); position: relative; z-index: 1; }
.detail-hero h1 { font-size: clamp(1.9rem, 5vw, 3.2rem); }
.detail-hero__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-4); margin-block-start: var(--s-6); }
.meta-item { padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--glass); }
.meta-item dt { font-family: var(--font-latin); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.meta-item dd { margin-block-start: 6px; font-weight: 700; font-size: 0.94rem; }
.detail-cover { border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.detail-cover .cover { aspect-ratio: 21 / 9; border-block-end: none; }
.detail-body { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--s-7); }
.detail-body h2 { font-size: 1.3rem; margin-block: var(--s-6) var(--s-3); }
.detail-body h2:first-child { margin-block-start: 0; }
.detail-body p { color: var(--text-muted); margin-block-end: var(--s-4); }
.detail-body ul.bullets { display: flex; flex-direction: column; gap: var(--s-3); }
.detail-body ul.bullets li { display: flex; gap: var(--s-3); color: var(--text-muted); }
.detail-body ul.bullets [data-lucide] { width: 18px; height: 18px; color: var(--color-accent-soft); flex-shrink: 0; margin-block-start: 4px; }
.detail-aside { display: flex; flex-direction: column; gap: var(--s-4); align-self: start; position: sticky; inset-block-start: 92px; }
.next-project { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-6); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--glass); transition: background var(--t-base), transform var(--t-base) var(--ease); }
.next-project:hover { background: var(--glass-hover); transform: translateY(-3px); }
/* ── About ── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); align-items: start; }
.about-grid p { color: var(--text-muted); margin-block-end: var(--s-4); }
.pull-quote {
  padding: var(--s-5); border-inline-start: 3px solid var(--color-accent);
  background: var(--accent-tint); border-radius: 0 var(--r-md) var(--r-md) 0;
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 700;
}
html[dir="rtl"] .pull-quote { border-radius: var(--r-md) 0 0 var(--r-md); }
html[dir="rtl"] .pull-quote { border-inline-start: 3px solid var(--color-accent); }

/* ── Timeline ── */
.timeline { position: relative; padding-inline-start: var(--s-5); }
.timeline::before { content: ""; position: absolute; inset-block: 6px; inset-inline-start: 5px; width: 1px; background: var(--border-strong); }
.tl-item { position: relative; padding-block-end: var(--s-6); }
.tl-item::before {
  content: ""; position: absolute; inset-inline-start: calc(-1 * var(--s-5) + 1px); inset-block-start: 7px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--color-accent);
  box-shadow: 0 0 0 4px var(--accent-tint);
}
.tl-year { font-family: var(--font-latin); font-size: 0.76rem; font-weight: 700; color: var(--color-accent-soft); letter-spacing: 0.08em; }
.tl-title { font-size: 1.05rem; margin-block: 4px 2px; }
.tl-org { font-size: 0.87rem; color: var(--text-dim); }
.tl-desc { font-size: 0.9rem; color: var(--text-muted); margin-block-start: var(--s-2); }

/* ── Skills ── */
.skill-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--glass); margin-block-end: var(--s-5); }
.skill-tab { padding: 8px 18px; border-radius: var(--r-pill); border: none; background: none; color: var(--text-muted); font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: all var(--t-base) var(--ease); }
.skill-tab:hover { color: var(--text); }
.skill-tab.is-active { background: var(--color-accent); color: #fff; }
.skill-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s-4) var(--s-6); }
.skill { display: flex; flex-direction: column; gap: 8px; }
.skill__head { display: flex; justify-content: space-between; font-size: 0.88rem; font-weight: 600; }
.skill__pct { font-family: var(--font-latin); color: var(--text-dim); }
.skill__track { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.skill__bar { height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--color-accent), var(--color-accent-soft)); transition: width 1s var(--ease); }
/* ── Services ── */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--s-4); }
.service { display: flex; flex-direction: column; gap: var(--s-3); }
.service__icon {
  width: 46px; height: 46px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--accent-tint); color: var(--color-accent-soft); border: 1px solid var(--border);
}
.service__icon [data-lucide] { width: var(--icon-lg); height: var(--icon-lg); }
.service h3 { font-size: 1.05rem; }
.service p { color: var(--text-muted); font-size: 0.9rem; }

/* ── Testimonials ── */
.quote-card { position: relative; }
.quote-card blockquote { font-size: 1.02rem; color: var(--text); margin-block-end: var(--s-5); }
.quote-author { display: flex; align-items: center; gap: var(--s-3); }
.quote-avatar {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2);
  background: color-mix(in srgb, var(--color-accent) 20%, var(--surface));
  border: 1px solid var(--border); font-weight: 800; font-size: 0.86rem; flex-shrink: 0;
}
.quote-name { font-weight: 700; font-size: 0.92rem; }
.quote-role { font-size: 0.8rem; color: var(--text-dim); }
.carousel-nav { display: flex; gap: var(--s-2); align-items: center; }
.dots { display: flex; gap: 6px; }
.dot-btn { width: 8px; height: 8px; border-radius: 50%; border: none; background: var(--border-strong); cursor: pointer; padding: 0; transition: all var(--t-base); }
.dot-btn.is-active { background: var(--color-accent); width: 22px; border-radius: 4px; }

/* ── Contact ── */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); align-items: start; }
.field { display: flex; flex-direction: column; gap: 8px; margin-block-end: var(--s-4); }
.field label { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.04em; }
.field input, .field textarea {
  width: 100%; padding: 13px 16px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-size: 0.95rem; outline: none; transition: border-color var(--t-base), box-shadow var(--t-base);
}
.field textarea { resize: vertical; min-height: 132px; }
.field input:focus, .field textarea:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.field.has-error input, .field.has-error textarea { border-color: var(--color-destructive); }
.field-error { font-size: 0.78rem; color: var(--color-destructive); display: flex; align-items: center; gap: 5px; min-height: 0; }
.field-error:empty { display: none; }
.field-error [data-lucide] { width: 14px; height: 14px; }
.contact-info { display: flex; flex-direction: column; gap: var(--s-3); }
.contact-row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--glass); transition: border-color var(--t-base), transform var(--t-base) var(--ease); }
.contact-row:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.contact-row [data-lucide] { color: var(--color-accent-soft); flex-shrink: 0; }
.contact-row__label { font-size: 0.74rem; color: var(--text-dim); font-family: var(--font-latin); letter-spacing: 0.08em; text-transform: uppercase; }
.contact-row__value { font-weight: 700; font-size: 0.92rem; }
.social-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* ── Footer ── */
.footer { position: relative; z-index: 1; border-block-start: 1px solid var(--border); padding-block: var(--s-7) var(--s-6); margin-block-start: var(--s-8); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s-6); margin-block-end: var(--s-6); }
.footer h4 { font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); font-family: var(--font-latin); margin-block-end: var(--s-3); }
.footer-links { display: flex; flex-direction: column; gap: var(--s-2); }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; transition: color var(--t-base); width: fit-content; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding-block-start: var(--s-5); border-block-start: 1px solid var(--border); font-size: 0.83rem; color: var(--text-dim); flex-wrap: wrap; }

/* ── Toast ── */
.toast-wrap { position: fixed; inset-block-end: 24px; inset-inline-start: 24px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 13px 18px;
  border-radius: var(--r-md); font-size: 0.9rem; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  animation: toastIn var(--t-base) var(--ease);
}
.toast [data-lucide] { width: 18px; height: 18px; flex-shrink: 0; }
.toast--success { border-color: rgba(22, 163, 74, 0.45); }
.toast--success [data-lucide] { color: #4ade80; }
.toast--error { border-color: rgba(220, 38, 38, 0.45); }
.toast--error [data-lucide] { color: var(--color-destructive); }
.toast--info [data-lucide] { color: var(--color-accent-soft); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
/* ── Command palette ── */
.command-overlay { position: fixed; inset: 0; z-index: 95; background: var(--overlay); backdrop-filter: blur(6px); display: grid; place-items: start center; padding: 12vh var(--s-4) var(--s-4); animation: fade var(--t-fast) ease; }
.command-overlay[hidden] { display: none; }
.command-box { width: min(560px, 100%); border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--bg-elevated); box-shadow: var(--shadow-lg); overflow: hidden; animation: toastIn var(--t-base) var(--ease); }
.command-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4); border-block-end: 1px solid var(--border); }
.command-head [data-lucide] { color: var(--text-dim); flex-shrink: 0; }
.command-head input { flex: 1; background: none; border: none; outline: none; font-size: 1rem; }
.command-head kbd { font-family: var(--font-latin); font-size: 0.68rem; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--border); color: var(--text-dim); }
.command-list { max-height: 46vh; overflow-y: auto; padding: var(--s-2); }
.command-item { display: flex; align-items: center; gap: var(--s-3); width: 100%; padding: 11px 14px; border-radius: var(--r-sm); border: none; background: none; color: var(--text-muted); cursor: pointer; text-align: start; font-size: 0.92rem; transition: background var(--t-fast), color var(--t-fast); }
.command-item:hover, .command-item.is-active { background: var(--glass-hover); color: var(--text); }
.command-item small { margin-inline-start: auto; color: var(--text-dim); font-size: 0.76rem; }
.command-empty { padding: var(--s-5); text-align: center; color: var(--text-dim); font-size: 0.9rem; }

/* ── Skeleton ── */
.skeleton { border-radius: var(--r-md); background: linear-gradient(90deg, var(--glass) 25%, var(--glass-hover) 50%, var(--glass) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton-card { height: 320px; }
.spin { animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Reveal on scroll ── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Page transition ── */
.page { animation: pageIn 420ms var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* ── Responsive ── */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--s-7); }
  .hero-visual { max-width: 420px; }
  .about-grid, .contact-grid, .detail-body { grid-template-columns: 1fr; gap: var(--s-6); }
  .detail-aside { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .section { padding-block: var(--s-8); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .work-grid { grid-template-columns: 1fr; }
  .chip-1, .chip-2 { display: none; }
  .section-head { align-items: flex-start; }
}
@media (max-width: 480px) {
  :root { --s-9: 64px; --s-8: 48px; }
  .container, .nav-inner { padding-inline: var(--s-4); }
  .hero-cta .btn { flex: 1 1 100%; }
  .stats { grid-template-columns: 1fr 1fr; gap: var(--s-3); }
  .footer-grid { grid-template-columns: 1fr; }
  .toast-wrap { inset-inline: var(--s-4); inset-block-end: var(--s-4); }
  .detail-hero__meta { grid-template-columns: 1fr 1fr; }
}

/* ── Motion preferences ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
