/* ============================================================
   khaledjassem.com — design system
   Display: Fraunces · Body: Sora · Utility: Spline Sans Mono
   ============================================================ */

:root {
  --bg: #0a0911;
  --bg-2: #100e1a;
  --card: #15121f;
  --card-2: #1b1729;
  --line: rgba(212, 175, 94, 0.16);
  --line-soft: rgba(237, 233, 243, 0.08);
  --text: #ede9f3;
  --muted: #9a93ab;
  --gold: #d4af5e;
  --gold-deep: #b8923f;
  --violet: #8d6fe0;
  --violet-deep: #4c2a85;
  --glow-violet: rgba(98, 58, 168, 0.35);
  --glow-gold: rgba(212, 175, 94, 0.22);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --r: 18px;
  --nav-h: 72px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f7f5ef;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-2: #f1ede3;
  --line: rgba(143, 110, 31, 0.22);
  --line-soft: rgba(27, 22, 38, 0.1);
  --text: #1b1626;
  --muted: #5d566c;
  --gold: #8f6e1f;
  --gold-deep: #6e5417;
  --violet: #5b3fa0;
  --violet-deep: #c9bbe8;
  --glow-violet: rgba(91, 63, 160, 0.14);
  --glow-gold: rgba(143, 110, 31, 0.12);
  --shadow: 0 20px 50px -28px rgba(27, 22, 38, 0.35);
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Sora", system-ui, -apple-system, sans-serif;
  font-size: 16.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.45s ease, color 0.45s ease;
}
::selection { background: var(--gold); color: #14101e; }

h1, h2, h3, .display {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.mono { font-family: "Spline Sans Mono", ui-monospace, monospace; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.wrap { width: min(1180px, 92vw); margin-inline: auto; }

/* ---------- ambient backdrop ---------- */
.aura {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(720px 540px at 8% -6%, var(--glow-violet), transparent 65%),
    radial-gradient(820px 620px at 96% 104%, var(--glow-gold), transparent 65%),
    var(--bg);
  transition: background 0.45s ease;
}
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; width: min(1180px, 92vw); margin-inline: auto; }
.brand { display: flex; align-items: baseline; gap: 10px; font-family: "Fraunces", serif; font-size: 1.18rem; font-weight: 600; }
.brand .sigil {
  font-family: "Spline Sans Mono", monospace; font-size: 0.78rem; color: var(--gold);
  border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; letter-spacing: 0.08em;
}
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 0.86rem; letter-spacing: 0.02em; }
.nav-links a { color: var(--muted); transition: color 0.25s; position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0;
  background: var(--gold); transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-cta {
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px;
  color: var(--text) !important; transition: background 0.3s, border-color 0.3s;
}
.nav-cta:hover { background: var(--gold); border-color: var(--gold); color: #14101e !important; }
.nav-cta::after { display: none; }

.theme-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--muted); transition: color 0.3s, transform 0.4s, border-color 0.3s;
}
.theme-btn:hover { color: var(--gold); border-color: var(--gold); transform: rotate(40deg); }
.theme-btn svg { width: 17px; height: 17px; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.burger { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; place-items: center; }
.burger svg { width: 18px; height: 18px; }
/* nav-end: theme btn + burger shown together on mobile */
.nav-end { display: none; align-items: center; gap: 8px; }
@media (max-width: 940px) { .nav-end { display: flex; } }
.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 55; display: none;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--line-soft);
  padding: 18px 5vw 26px; flex-direction: column; gap: 4px;
}
.mobile-menu a { padding: 12px 6px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 0.95rem; }
.mobile-menu.open { display: flex; }
.mobile-theme-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 6px; color: var(--muted); font-size: 0.88rem;
  letter-spacing: 0.04em;
}

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  background:
    radial-gradient(720px 540px at 8% -6%, rgba(98,58,168,0.35), transparent 65%),
    radial-gradient(820px 620px at 96% 104%, rgba(212,175,94,0.2), transparent 65%),
    #0a0911;
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden;
}
.hero-media {
  position: absolute; top: 0; left: 0; right: 0; height: 70%; z-index: 0;
  -webkit-mask-image: linear-gradient(180deg, #000 56%, transparent 99%);
  mask-image: linear-gradient(180deg, #000 56%, transparent 99%);
}
.hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 18%;
  opacity: 0; transform: scale(1.06);
  animation: heroImg 1.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}
@keyframes heroImg { to { opacity: 1; transform: scale(1); } }
.hero-veil {
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(58% 46% at 50% 30%, transparent 45%, rgba(10,9,17,0.4) 100%);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hero-content { position: relative; z-index: 2; text-align: center; padding-bottom: clamp(30px, 5vh, 56px); }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: "Spline Sans Mono", monospace; font-size: 0.74rem; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--gold);
  opacity: 0; animation: rise 0.9s ease 0.7s forwards;
}
.hero-eyebrow::before, .hero-eyebrow::after { content: ""; width: 42px; height: 1px; background: var(--line); }
.hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 4.7rem);
  margin: 10px 0 4px;
  font-weight: 600;
}
.hero h1 .word {
  display: inline-block; overflow: hidden; vertical-align: bottom;
}
.hero h1 .word > span {
  display: inline-block; transform: translateY(110%);
  animation: wordUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero h1 .gold {
  background: linear-gradient(100deg, var(--gold) 10%, #f2dca3 45%, var(--gold-deep) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@keyframes wordUp { to { transform: translateY(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.hero-roles {
  height: 1.9em; overflow: hidden; font-family: "Spline Sans Mono", monospace;
  font-size: clamp(0.82rem, 1.6vw, 1rem); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); opacity: 0; animation: rise 0.9s ease 1.1s forwards;
}
.hero-roles ul { list-style: none; animation: roleSpin 12s steps(4) 2.2s infinite; }
.hero-roles li { height: 1.9em; line-height: 1.9em; }
@keyframes roleSpin { to { transform: translateY(-7.6em); } }

.hero-ctas { display: flex; gap: 14px; justify-content: center; margin-top: 20px; flex-wrap: wrap; opacity: 0; animation: rise 0.9s ease 1.35s forwards; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 26px; border-radius: 999px; font-size: 0.9rem; font-weight: 500;
  letter-spacing: 0.02em; transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s, background 0.3s, color 0.3s, border-color 0.3s;
  border: 1px solid transparent;
}
.btn svg { width: 15px; height: 15px; transition: transform 0.3s; }
.btn:hover svg { transform: translateX(4px); }
.btn-gold { background: var(--gold); color: #161020; box-shadow: 0 10px 32px -10px var(--glow-gold); }
.btn-gold:hover { transform: translateY(-3px); box-shadow: 0 16px 40px -10px var(--glow-gold); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--gold); color: var(--gold); }

.hero-stats {
  display: flex; justify-content: center; gap: clamp(22px, 5vw, 64px);
  margin-top: clamp(22px, 3.5vh, 38px); padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  opacity: 0; animation: rise 0.9s ease 1.6s forwards;
  flex-wrap: wrap;
}
.hero-stats .stat { text-align: center; }
.hero-stats .num { font-family: "Fraunces", serif; font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 600; color: var(--gold); }
.hero-stats .lbl { font-family: "Spline Sans Mono", monospace; font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

.scroll-cue {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 24px; height: 38px; border: 1.5px solid var(--line); border-radius: 14px;
  opacity: 0; animation: rise 1s ease 2.2s forwards;
}
.scroll-cue::after {
  content: ""; position: absolute; top: 7px; left: 50%; width: 3px; height: 7px;
  background: var(--gold); border-radius: 3px; transform: translateX(-50%);
  animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue { 0%,100% { transform: translate(-50%, 0); opacity: 1; } 60% { transform: translate(-50%, 12px); opacity: 0.2; } }

/* ---------- sections ---------- */
section { padding: clamp(72px, 11vh, 130px) 0; position: relative; }
.eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-family: "Spline Sans Mono", monospace; font-size: 0.72rem;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 16px;
}
.eyebrow::after { content: ""; flex: 0 0 56px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
.sec-title { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 14px; }
.sec-lede { color: var(--muted); max-width: 640px; font-size: 1.02rem; }

/* scroll reveal */
.rv { opacity: 0; transform: translateY(28px); transition: opacity 0.85s cubic-bezier(0.22,1,0.36,1), transform 0.85s cubic-bezier(0.22,1,0.36,1); }
.rv.in { opacity: 1; transform: none; }
.rv-d1 { transition-delay: 0.08s; } .rv-d2 { transition-delay: 0.16s; }
.rv-d3 { transition-delay: 0.24s; } .rv-d4 { transition-delay: 0.32s; }
.rv-d5 { transition-delay: 0.40s; } .rv-d6 { transition-delay: 0.48s; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 340px 1fr; gap: clamp(34px, 5vw, 70px); align-items: start; }
.about-photo { position: relative; }
.about-photo img { border-radius: var(--r); box-shadow: var(--shadow); }
.about-photo::before {
  content: ""; position: absolute; inset: -14px auto auto -14px; width: 70%; height: 70%;
  border: 1px solid var(--line); border-radius: var(--r); z-index: -1;
}
.about-photo .badge {
  position: absolute; right: -12px; bottom: 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 16px; font-family: "Spline Sans Mono", monospace; font-size: 0.7rem;
  letter-spacing: 0.18em; color: var(--gold); box-shadow: var(--shadow);
}
.about-body p { color: var(--muted); margin-bottom: 16px; }
.about-body p strong { color: var(--text); font-weight: 600; }
.cred-list { list-style: none; margin: 22px 0; display: grid; gap: 10px; }
.cred-list li { display: flex; gap: 12px; align-items: baseline; font-size: 0.95rem; }
.cred-list .yr { font-family: "Spline Sans Mono", monospace; color: var(--gold); font-size: 0.78rem; min-width: 86px; letter-spacing: 0.06em; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.chip {
  font-family: "Spline Sans Mono", monospace; font-size: 0.7rem; letter-spacing: 0.1em;
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
  transition: color 0.3s, border-color 0.3s, transform 0.3s;
}
.chip:hover { color: var(--gold); border-color: var(--gold); transform: translateY(-2px); }

/* ---------- numbers ---------- */
.numbers { border-block: 1px solid var(--line-soft); background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.num-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 26px; text-align: center; }
.num-grid .num { font-family: "Fraunces", serif; font-size: clamp(2.2rem, 4.4vw, 3.4rem); font-weight: 600; color: var(--gold); line-height: 1; }
.num-grid .num sup { font-size: 0.5em; color: var(--violet); }
.num-grid .lbl { font-family: "Spline Sans Mono", monospace; font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }

/* ---------- ventures ---------- */
.venture-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; margin-top: 44px; }
.v-card {
  position: relative; background: var(--card); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 30px 28px; overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.22,1,0.36,1), border-color 0.45s, box-shadow 0.45s;
  display: flex; flex-direction: column; gap: 12px;
}
.v-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px 200px at var(--mx, 50%) var(--my, 0%), var(--glow-gold), transparent 70%);
  opacity: 0; transition: opacity 0.4s;
}
.v-card:hover { transform: translateY(-7px); border-color: var(--line); box-shadow: var(--shadow); }
.v-card:hover::before { opacity: 1; }
.v-card > * { position: relative; }
.v-head { display: flex; justify-content: space-between; align-items: center; }
.v-name { font-family: "Fraunces", serif; font-size: 1.35rem; font-weight: 600; }
.v-role { font-family: "Spline Sans Mono", monospace; font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--violet); }
.v-tag { color: var(--gold); font-size: 0.84rem; font-weight: 500; }
.v-desc { color: var(--muted); font-size: 0.92rem; flex: 1; }
.v-link { display: inline-flex; align-items: center; gap: 8px; font-family: "Spline Sans Mono", monospace; font-size: 0.74rem; letter-spacing: 0.12em; color: var(--gold); margin-top: 6px; }
.v-link svg { width: 13px; height: 13px; transition: transform 0.3s; }
.v-card:hover .v-link svg { transform: translate(3px, -3px); }

/* ---------- expertise ---------- */
.exp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; margin-top: 44px; }
.exp-cell { background: var(--card); padding: 30px 26px; transition: background 0.4s; }
.exp-cell:hover { background: var(--card-2); }
.exp-cell .ico { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 11px; display: grid; place-items: center; color: var(--gold); margin-bottom: 16px; }
.exp-cell .ico svg { width: 19px; height: 19px; }
.exp-cell h3 { font-size: 1.08rem; margin-bottom: 8px; }
.exp-cell p { color: var(--muted); font-size: 0.88rem; }

/* ---------- research ---------- */
.paper-list { margin-top: 44px; border-top: 1px solid var(--line-soft); }
.paper {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 26px; align-items: start;
  padding: 30px 10px; border-bottom: 1px solid var(--line-soft);
  transition: background 0.35s, padding-left 0.35s;
}
.paper:hover { background: color-mix(in srgb, var(--card) 60%, transparent); padding-left: 20px; }
.paper .meta { font-family: "Spline Sans Mono", monospace; font-size: 0.72rem; color: var(--gold); letter-spacing: 0.1em; line-height: 2; }
.paper .meta .type { color: var(--muted); display: block; font-size: 0.62rem; }
.paper h3 { font-size: 1.22rem; margin-bottom: 8px; }
.paper p { color: var(--muted); font-size: 0.9rem; max-width: 640px; }
.paper .kw { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.paper .kw span { font-family: "Spline Sans Mono", monospace; font-size: 0.62rem; letter-spacing: 0.08em; color: var(--violet); border: 1px solid var(--line-soft); padding: 4px 10px; border-radius: 999px; }
.status { font-family: "Spline Sans Mono", monospace; font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.status.published { color: #7fce8f; border-color: rgba(127,206,143,0.35); }
.status.in-review { color: var(--gold); }
.status.in-progress { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 40%, transparent); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.filter-bar .chip.active { color: #161020; background: var(--gold); border-color: var(--gold); }

/* ---------- book ---------- */
.book-grid { display: grid; grid-template-columns: 380px 1fr; gap: clamp(40px, 6vw, 90px); align-items: center; margin-top: 44px; }
.book-stage { perspective: 1400px; display: grid; place-items: center; padding: 30px 0; }
.book-3d {
  position: relative; width: 250px; height: 360px;
  transform-style: preserve-3d; transform: rotateY(-24deg) rotateX(4deg);
  transition: transform 0.8s cubic-bezier(0.22,1,0.36,1);
  animation: bookFloat 7s ease-in-out infinite;
}
.book-stage:hover .book-3d { transform: rotateY(-10deg) rotateX(2deg); }
@keyframes bookFloat { 0%,100% { translate: 0 0; } 50% { translate: 0 -12px; } }
.book-3d .face { position: absolute; border-radius: 4px 10px 10px 4px; }
.book-3d .front {
  inset: 0; background: linear-gradient(155deg, #241a38 0%, #16101f 55%, #1d1228 100%);
  border: 1px solid rgba(212,175,94,0.35);
  padding: 30px 24px; display: flex; flex-direction: column;
  box-shadow: -30px 30px 60px -20px rgba(0,0,0,0.6);
}
.book-3d .spine {
  width: 34px; height: 100%; left: -17px;
  transform: rotateY(-90deg) translateZ(17px);
  background: linear-gradient(180deg, #2a1f40, #14101e);
  border-radius: 4px 0 0 4px; border: 1px solid rgba(212,175,94,0.25);
}
.book-3d .pages {
  width: 30px; height: calc(100% - 8px); right: -15px; top: 4px;
  transform: rotateY(90deg) translateZ(15px);
  background: repeating-linear-gradient(180deg, #e8e2d2 0 2px, #cfc8b6 2px 3px);
  border-radius: 0 3px 3px 0;
}
.book-3d .front .b-rule { width: 44px; height: 2px; background: var(--gold); margin-bottom: 18px; }
.book-3d .front .b-title { font-family: "Fraunces", serif; font-size: 1.28rem; line-height: 1.25; color: #f0e9d8; font-weight: 600; }
.book-3d .front .b-sub { font-size: 0.62rem; color: #b9aed0; margin-top: 12px; line-height: 1.6; font-family: "Spline Sans Mono", monospace; letter-spacing: 0.04em; }
.book-3d .front .b-author { margin-top: auto; font-family: "Spline Sans Mono", monospace; font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: #d4af5e; }

.book-info h3 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.book-info .b-meta { display: flex; gap: 20px; flex-wrap: wrap; margin: 16px 0 18px; font-family: "Spline Sans Mono", monospace; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.book-info .b-meta b { color: var(--gold); font-weight: 500; }
.book-info p { color: var(--muted); margin-bottom: 24px; max-width: 560px; }
.book-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- services ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin-top: 44px; counter-reset: svc; }
.svc {
  border: 1px solid var(--line-soft); border-radius: var(--r); padding: 30px 26px;
  background: var(--card); transition: transform 0.4s, border-color 0.4s;
  counter-increment: svc;
}
.svc:hover { transform: translateY(-6px); border-color: var(--line); }
.svc::before {
  content: "§ " counter(svc, decimal-leading-zero);
  font-family: "Spline Sans Mono", monospace; font-size: 0.7rem; letter-spacing: 0.2em; color: var(--gold);
}
.svc h3 { font-size: 1.12rem; margin: 12px 0 8px; }
.svc p { color: var(--muted); font-size: 0.88rem; }

/* ---------- FAQ ---------- */
.faq { max-width: 800px; margin: 40px auto 0; }
.faq details { border-bottom: 1px solid var(--line-soft); }
.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
  padding: 22px 4px; font-family: "Fraunces", serif; font-size: 1.1rem; font-weight: 560;
  transition: color 0.3s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: "Spline Sans Mono", monospace; color: var(--gold); font-size: 1.2rem; transition: transform 0.35s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--gold); }
.faq .faq-a { padding: 0 4px 24px; color: var(--muted); font-size: 0.94rem; max-width: 680px; }

/* ---------- contact ---------- */
.contact-box {
  text-align: center; border: 1px solid var(--line); border-radius: 26px;
  padding: clamp(50px, 8vw, 90px) 24px; position: relative; overflow: hidden;
  background:
    radial-gradient(500px 260px at 50% -20%, var(--glow-violet), transparent 70%),
    var(--card);
}
.contact-box h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin-bottom: 14px; }
.contact-box p { color: var(--muted); max-width: 520px; margin: 0 auto 30px; }
.contact-mail { font-family: "Spline Sans Mono", monospace; letter-spacing: 0.06em; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line-soft); padding: 40px 0 50px; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 0.82rem; }
.foot .links { display: flex; gap: 20px; flex-wrap: wrap; font-family: "Spline Sans Mono", monospace; font-size: 0.7rem; letter-spacing: 0.1em; }
.foot a:hover { color: var(--gold); }

/* ---------- page hero (subpages) ---------- */
.page-hero { padding: calc(var(--nav-h) + clamp(50px, 9vh, 110px)) 0 clamp(30px, 5vh, 60px); }
.crumb { font-family: "Spline Sans Mono", monospace; font-size: 0.7rem; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 22px; display: flex; gap: 8px; }
.crumb a:hover { color: var(--gold); }

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .nav-links { display: none; }
  .nav-end .burger { display: grid; }
  .about-grid, .book-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 340px; }
  .paper { grid-template-columns: 1fr; gap: 12px; }
  .paper .status { justify-self: start; }
  .book-stage { order: -1; }
}
@media (max-width: 540px) {
  body { font-size: 15.5px; }
  .hero-stats { gap: 18px; }
  .hero-stats .stat { flex: 1 1 38%; }
  /* hero eyebrow: force single line on small screens */
  .hero-eyebrow { font-size: 0.54rem; letter-spacing: 0.12em; gap: 5px; white-space: nowrap; }
  .hero-eyebrow::before, .hero-eyebrow::after { width: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; }
  .hero-media img, .hero-eyebrow, .hero h1 .word > span, .hero-roles, .hero-ctas, .hero-stats, .scroll-cue { opacity: 1; transform: none; animation: none; }
}

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ---------- hero is always a dark stage (photo background) ---------- */
.hero-content { color: #ede9f3; }
.hero-roles { color: #b3abc4; }
.hero-stats { border-top-color: rgba(237,233,243,0.14); }
.hero-stats .lbl { color: #b3abc4; }
.hero .btn-ghost { border-color: rgba(212,175,94,0.4); color: #ede9f3; }
.hero .btn-ghost:hover { border-color: #d4af5e; color: #d4af5e; }
.hero-stats .num { color: #d4af5e; }
.hero-eyebrow { color: #d4af5e; }
.hero h1 .gold { background: linear-gradient(100deg, #d4af5e 10%, #f2dca3 45%, #b8923f 90%); -webkit-background-clip: text; background-clip: text; }
.scroll-cue { border-color: rgba(237,233,243,0.3); }
.scroll-cue::after { background: #d4af5e; }

[data-theme="light"] .nav:not(.scrolled) .nav-links a { color: rgba(237,233,243,0.78); }
[data-theme="light"] .nav:not(.scrolled) .nav-links a:hover { color: #fff; }
[data-theme="light"] .nav:not(.scrolled) .brand { color: #f2eff8; }
[data-theme="light"] .nav:not(.scrolled) .nav-cta { color: #f2eff8 !important; border-color: rgba(237,233,243,0.35); }
[data-theme="light"] .nav:not(.scrolled) .theme-btn { color: rgba(237,233,243,0.8); border-color: rgba(237,233,243,0.35); }
[data-theme="light"] .nav:not(.scrolled) .burger { color: #f2eff8; border-color: rgba(237,233,243,0.35); }

/* ---------- real book cover (image) ---------- */
.book-cover-link { display: block; perspective: 1400px; }
.book-cover-link img {
  width: 270px; max-width: 70vw; border-radius: 4px 8px 8px 4px;
  box-shadow: -22px 26px 56px -22px rgba(0,0,0,0.6), 0 2px 0 rgba(212,175,94,0.4);
  transform: rotateY(-20deg) rotateX(4deg); transition: transform 0.7s cubic-bezier(0.22,1,0.36,1);
  border: 1px solid rgba(212,175,94,0.25);
}
.book-stage:hover .book-cover-link img { transform: rotateY(-8deg) rotateX(2deg) translateY(-6px); }
.book-arabic-title { font-family: "Noto Naskh Arabic", "Fraunces", serif; font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 700; color: var(--gold); margin-bottom: 4px; line-height: 1.3; }
.book-arabic-sub { font-family: "Noto Naskh Arabic", serif; color: var(--muted); margin: 6px 0 4px; font-size: 1rem; }
.book-info h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--muted); font-weight: 500; letter-spacing: 0.01em; }

/* ============================================================
   ENHANCEMENTS: nav-8, faq-2col, light/dark fixes, animations
   ============================================================ */

/* --- nav: fit 8 items --- */
.nav-links { gap: 18px; font-size: 0.8rem; }
@media (max-width: 1140px) { .nav-links { gap: 12px; font-size: 0.76rem; } }

/* --- scroll progress bar --- */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; z-index: 200;
  background: linear-gradient(90deg, var(--violet), var(--gold));
  width: 0%; transition: width 0.1s linear;
  pointer-events: none;
}

/* --- cursor spotlight (desktop only) --- */
.cursor-glow {
  position: fixed; width: 380px; height: 380px;
  border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(212,175,94,0.07) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
  mix-blend-mode: screen;
}
@media (hover: none) { .cursor-glow { display: none; } }

/* --- FAQ: 2-column grid on desktop --- */
.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 40px;
  max-width: 1100px;
  margin: 40px auto 0;
}
.faq-grid details { border-bottom: 1px solid var(--line-soft); }
.faq-grid summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
  padding: 20px 4px; font-family: "Fraunces", serif; font-size: 1.02rem; font-weight: 560;
  transition: color 0.3s; gap: 12px;
}
.faq-grid summary::-webkit-details-marker { display: none; }
.faq-grid summary::after {
  content: "+"; font-family: "Spline Sans Mono", monospace; color: var(--gold);
  font-size: 1.2rem; transition: transform 0.35s; flex-shrink: 0;
}
.faq-grid details[open] summary::after { transform: rotate(45deg); }
.faq-grid summary:hover { color: var(--gold); }
.faq-grid .faq-a { padding: 0 4px 20px; color: var(--muted); font-size: 0.88rem; max-width: 100%; line-height: 1.65; }

@media (max-width: 768px) {
  .faq-grid { grid-template-columns: 1fr; gap: 0; }
}

/* --- light mode visibility fixes --- */
[data-theme="light"] .eyebrow { color: var(--gold); }
[data-theme="light"] .chip { color: var(--muted); border-color: var(--line); }
[data-theme="light"] .chip:hover { color: var(--gold); border-color: var(--gold); }
[data-theme="light"] .v-card { background: var(--card); border-color: var(--line-soft); }
[data-theme="light"] .v-role { color: var(--violet); }
[data-theme="light"] .exp-cell { background: var(--card); }
[data-theme="light"] .exp-cell:hover { background: var(--card-2); }
[data-theme="light"] .exp-cell .ico { border-color: var(--line); color: var(--gold); }
[data-theme="light"] .svc { background: var(--card); }
[data-theme="light"] .faq-grid summary { color: var(--text); }
[data-theme="light"] .faq-grid summary:hover { color: var(--gold); }
[data-theme="light"] .contact-box { background: var(--card); border-color: var(--line); }
[data-theme="light"] .numbers { background: color-mix(in srgb, var(--bg-2) 80%, transparent); }
[data-theme="light"] .cred-list li { color: var(--text); }
[data-theme="light"] .about-body p { color: var(--muted); }
[data-theme="light"] .status { color: var(--text); }
[data-theme="light"] .status.published { color: #2a7a3a; border-color: rgba(42,122,58,0.35); }
[data-theme="light"] .status.in-review { color: var(--gold); }

/* --- enhanced hover: section titles shimmer --- */
.sec-title {
  background-clip: text;
  -webkit-background-clip: text;
  transition: color 0.4s;
}
.sec-title:hover {
  background-image: linear-gradient(100deg, var(--text) 30%, var(--gold) 60%, var(--text) 80%);
  background-size: 200% auto;
  color: transparent;
  animation: shimmer 1.4s linear forwards;
}
@keyframes shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* --- enhanced card tilt + glow pulse --- */
.v-card, .svc, .exp-cell {
  transition: transform 0.45s cubic-bezier(0.22,1,0.36,1),
              border-color 0.45s, box-shadow 0.45s,
              background 0.4s;
}
.v-card:hover { transform: translateY(-8px) scale(1.012); }
.svc:hover    { transform: translateY(-6px) scale(1.010); }
.exp-cell:hover { transform: scale(1.018); }

/* --- btn pulse ring on hover --- */
.btn-gold { position: relative; overflow: hidden; }
.btn-gold::before {
  content: "";
  position: absolute; inset: 0; border-radius: inherit;
  background: rgba(255,255,255,0.15);
  transform: scale(0); opacity: 0;
  transition: transform 0.5s cubic-bezier(0.22,1,0.36,1), opacity 0.5s;
}
.btn-gold:hover::before { transform: scale(1.4); opacity: 0; }
.btn-gold:active::before { transform: scale(0); opacity: 0.3; transition: none; }

/* --- number counter: pop in --- */
@keyframes popIn {
  0%   { transform: scale(0.7); opacity: 0; }
  70%  { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
.rv.in .num [data-count] { animation: popIn 0.6s cubic-bezier(0.22,1,0.36,1) both; }

/* --- chip float on load --- */
@keyframes chipFloat {
  from { opacity: 0; transform: translateY(12px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.rv.in .chip {
  animation: chipFloat 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
.rv.in .chip:nth-child(1){ animation-delay:.05s }
.rv.in .chip:nth-child(2){ animation-delay:.1s }
.rv.in .chip:nth-child(3){ animation-delay:.15s }
.rv.in .chip:nth-child(4){ animation-delay:.2s }
.rv.in .chip:nth-child(5){ animation-delay:.25s }
.rv.in .chip:nth-child(6){ animation-delay:.3s }
.rv.in .chip:nth-child(7){ animation-delay:.35s }
.rv.in .chip:nth-child(8){ animation-delay:.4s }

/* --- venture card: staggered entry --- */
.venture-grid .v-card:nth-child(1) { transition-delay: 0s; }
.venture-grid .v-card:nth-child(2) { transition-delay: 0.07s; }
.venture-grid .v-card:nth-child(3) { transition-delay: 0.14s; }
.venture-grid .v-card:nth-child(4) { transition-delay: 0.21s; }
.venture-grid .v-card:nth-child(5) { transition-delay: 0.28s; }

/* --- hero eyebrow: golden line grow --- */
.hero-eyebrow::before,
.hero-eyebrow::after {
  animation: lineGrow 1.2s cubic-bezier(0.22,1,0.36,1) 1.6s both;
}
@keyframes lineGrow {
  from { width: 0; opacity: 0; }
  to   { width: 42px; opacity: 1; }
}

/* --- section divider pulse dot --- */
.eyebrow::after { animation: dotPulse 3s ease-in-out infinite; }
@keyframes dotPulse {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.4; }
}

/* ============================================================
   STATS: one row desktop / compact mobile
   ============================================================ */
.hero-stats {
  flex-wrap: nowrap !important;
  gap: clamp(10px, 2vw, 36px) !important;
  overflow-x: auto;
  scrollbar-width: none;
}
.hero-stats::-webkit-scrollbar { display: none; }
.hero-stats .stat { flex: 0 0 auto; }
.hero-stats .num { font-size: clamp(1.3rem, 2.4vw, 2.2rem); }
.hero-stats .lbl { font-size: 0.58rem; letter-spacing: 0.16em; white-space: nowrap; }

@media (max-width: 700px) {
  .hero-stats {
    flex-wrap: wrap !important;
    justify-content: center;
    gap: 10px 18px !important;
    margin-top: 12px;
    padding-top: 12px;
  }
  .hero-stats .stat { flex: 0 0 calc(33.33% - 18px); min-width: 70px; }
  .hero-stats .num { font-size: clamp(1.1rem, 3.5vw, 1.5rem); }
  .hero-stats .lbl { font-size: 0.52rem; letter-spacing: 0.1em; }
  /* reduce hero padding on mobile so stats don't push into the face */
  .hero-content { padding-bottom: clamp(16px, 3vh, 28px); }
}

/* ============================================================
   SMART NAV: color adapts to section background
   ============================================================ */

/* Default (scrolled, not over dark hero) — adapt to theme */
.nav-links a { transition: color 0.3s; }
.brand { transition: color 0.35s ease; }

/* When over dark hero section: force white regardless of theme */
.nav.over-dark .brand { color: #ffffff !important; }
.nav.over-dark .nav-links a { color: rgba(255,255,255,0.68); }
.nav.over-dark .nav-links a:hover { color: #ffffff; }
.nav.over-dark .nav-cta {
  color: #ffffff !important;
  border-color: rgba(255,255,255,0.3);
}
.nav.over-dark .nav-cta:hover { background: var(--gold); border-color: var(--gold); color: #14101e !important; }
.nav.over-dark .burger { border-color: rgba(255,255,255,0.3); color: #ffffff; }
.nav.over-dark .theme-btn { border-color: rgba(255,255,255,0.3); color: rgba(255,255,255,0.7); }

/* When NOT over dark hero in light mode: use dark text */
[data-theme="light"] .nav:not(.over-dark) .brand { color: var(--text) !important; }
[data-theme="light"] .nav:not(.over-dark) .nav-links a { color: var(--muted); }
[data-theme="light"] .nav:not(.over-dark) .nav-links a:hover { color: var(--text); }
[data-theme="light"] .nav:not(.over-dark) .nav-cta { color: var(--text) !important; border-color: var(--line); }
[data-theme="light"] .nav:not(.over-dark) .burger { border-color: var(--line); color: var(--text); }
[data-theme="light"] .nav:not(.over-dark) .theme-btn { border-color: var(--line); color: var(--muted); }

/* books.html / research.html: nav always scrolled, never over-dark → use theme colors */
[data-theme="light"] .nav.scrolled.nav-static .brand { color: var(--text) !important; }
