/* ============================================================
   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: #f4f1e8;
  --bg-2: #edeae0;
  --card: #f0ece2;
  --card-2: #e7e2d6;
  --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: 0; font-family: "Fraunces", serif; font-size: 1.18rem; font-weight: 600; }
.brand-dr { color: var(--gold); }
.brand-name { color: inherit; }
.brand-cursor {
  color: var(--gold); font-weight: 300; margin-left: 1px;
  animation: cursorBlink 0.65s step-end infinite;
}
.brand-cursor.hidden { display: none; }
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
/* ---------- nav-links: floating index capsule ---------- */
.nav-links {
  position: relative;
  display: flex; align-items: center; gap: 1px;
  counter-reset: navidx;
  padding: 5px 6px 5px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 62%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 14px 36px -22px rgba(0,0,0,0.55);
  font-size: 0.78rem; letter-spacing: 0.01em;
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.nav-indicator {
  position: absolute; top: 5px; bottom: 5px; left: 0; z-index: 0;
  width: 0; border-radius: 999px; opacity: 0;
  background: linear-gradient(135deg, rgba(212,175,94,0.20), rgba(141,111,224,0.16));
  border: 1px solid var(--line);
  transition: transform 0.45s cubic-bezier(0.22,1,0.36,1), width 0.45s cubic-bezier(0.22,1,0.36,1), opacity 0.25s ease;
  pointer-events: none;
}
.nav-links a:not(.nav-cta) {
  position: relative; z-index: 1;
  display: inline-flex; align-items: baseline; gap: 7px;
  padding: 8px 13px; border-radius: 999px;
  color: var(--muted); transition: color 0.25s;
}
.nav-links a:not(.nav-cta)::before {
  counter-increment: navidx;
  content: counter(navidx, decimal-leading-zero);
  font-family: "Spline Sans Mono", monospace; font-size: 0.6rem;
  color: var(--gold); opacity: 0.6; letter-spacing: 0;
  transition: opacity 0.25s;
}
.nav-links a:not(.nav-cta):hover { color: var(--text); }
.nav-links a:not(.nav-cta):hover::before { opacity: 1; }
.nav-cta {
  position: relative; z-index: 1; margin-left: 8px;
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px; padding: 9px 17px 9px 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #14101e !important; font-weight: 600;
  box-shadow: 0 8px 20px -10px rgba(212,175,94,0.6);
  transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}
.nav-cta::after {
  content: "→"; display: inline-block; transition: transform 0.3s ease; line-height: 1;
}
.nav-cta:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 12px 26px -10px rgba(212,175,94,0.75); }
.nav-cta:hover::after { transform: translateX(3px); }

.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; }
.nav-links .theme-btn { position: relative; z-index: 1; margin-left: 6px; border-color: transparent; width: 34px; height: 34px; }
.nav-links .theme-btn:hover { border-color: var(--line); background: var(--line-soft); }
[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; }

.lang-btn, .lang-btn-mobile {
  font-family: "Spline Sans Mono", monospace; font-size: 0.72rem; letter-spacing: 0.14em;
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); transition: color 0.25s, border-color 0.25s; white-space: nowrap;
}
.lang-btn:hover, .lang-btn-mobile:hover { color: var(--gold); border-color: var(--gold); }
.lang-btn-mobile { display: none; }
.nav.over-dark .lang-btn { color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.3); }
.nav.over-dark .lang-btn:hover { color: var(--gold); border-color: var(--gold); }
@media (max-width: 940px) { .lang-btn { display: none; } .lang-btn-mobile { display: block; } }

.burger {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  transition: border-color 0.3s, background 0.3s;
}
.burger .bun {
  display: block; width: 17px; height: 1.5px; border-radius: 2px; background: currentColor;
  transition: transform 0.4s cubic-bezier(0.6,0.2,0,1), opacity 0.25s ease;
}
.burger.active { border-color: var(--gold); }
.burger.active .bun:first-child { transform: translateY(3.25px) rotate(45deg); }
.burger.active .bun:last-child { transform: translateY(-3.25px) rotate(-45deg); }
/* 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; } }
body.menu-open { overflow: hidden; }
.mobile-menu {
  position: fixed; inset: 0; z-index: 55; display: none;
  flex-direction: column; justify-content: center; justify-content: safe center; gap: 0;
  padding: calc(var(--nav-h) + 14px) 8vw 36px;
  counter-reset: mnavidx;
  background:
    radial-gradient(620px 460px at 8% -8%, var(--glow-violet), transparent 60%),
    radial-gradient(620px 460px at 100% 112%, var(--glow-gold), transparent 60%),
    color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu > a {
  position: relative; display: flex; align-items: baseline; gap: 16px;
  padding: 15px 2px; border-bottom: 1px solid var(--line-soft);
  color: var(--text); font-family: "Fraunces", serif; font-weight: 560;
  font-size: clamp(1.25rem, 6vw, 1.65rem);
  opacity: 0; transform: translateY(14px);
}
.mobile-menu > a::before {
  counter-increment: mnavidx; content: counter(mnavidx, decimal-leading-zero);
  font-family: "Spline Sans Mono", monospace; font-size: 0.74rem; color: var(--gold); opacity: 0.75;
}
.mobile-menu.open > a { animation: mnavIn 0.6s cubic-bezier(0.22,1,0.36,1) forwards; }
.mobile-menu.open > a:nth-child(1) { animation-delay: .05s; }
.mobile-menu.open > a:nth-child(2) { animation-delay: .10s; }
.mobile-menu.open > a:nth-child(3) { animation-delay: .15s; }
.mobile-menu.open > a:nth-child(4) { animation-delay: .20s; }
.mobile-menu.open > a:nth-child(5) { animation-delay: .25s; }
.mobile-menu.open > a:nth-child(6) { animation-delay: .30s; }
.mobile-menu.open > a:nth-child(7) { animation-delay: .35s; }
.mobile-menu.open > a:nth-child(8) { animation-delay: .40s; }
.mobile-menu.open > a:nth-child(9) { animation-delay: .45s; }
@keyframes mnavIn { to { opacity: 1; transform: translateY(0); } }
.mobile-menu-foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
  margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line-soft);
  opacity: 0; transform: translateY(14px);
}
.mobile-menu.open .mobile-menu-foot { animation: mnavIn 0.6s cubic-bezier(0.22,1,0.36,1) forwards; animation-delay: .5s; }
.mobile-menu-foot .mm-email {
  font-family: "Spline Sans Mono", monospace; font-size: 0.82rem; color: var(--muted);
}
.mobile-menu-foot .mm-email:hover { color: var(--gold); }
.mobile-menu-foot .mm-social { display: flex; gap: 16px; }
.mobile-menu-foot .mm-social a {
  font-family: "Spline Sans Mono", monospace; font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--muted); text-transform: uppercase;
}
.mobile-menu-foot .mm-social a:hover { color: var(--gold); }
.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%, var(--glow-violet), transparent 65%),
    radial-gradient(820px 620px at 96% 104%, var(--glow-gold), transparent 65%),
    var(--bg);
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden;
}
.hero-media {
  position: absolute; top: 0; left: 0; right: 0; height: 86%; z-index: 0;
  -webkit-mask-image: linear-gradient(180deg, #000 46%, transparent 98%);
  mask-image: linear-gradient(180deg, #000 46%, transparent 98%);
}
.hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 8%;
  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(2px, 0.5vh, 8px); }
.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(14px, 2vh, 24px); padding-top: 14px;
  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);
  /* illustration has dark bg — match the site's dark card background */
  background: var(--card);
}
.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; }
.cred-label {
  font-family: "Spline Sans Mono", monospace; font-size: 0.62rem;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold);
  opacity: 0.7; padding-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
  display: block !important;
}
.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); }

/* ---------- languages ---------- */
.num-sfx { font-family: "Spline Sans Mono", monospace; font-size: 0.52em; color: var(--violet); letter-spacing: 0.04em; vertical-align: super; }
.hero-stats .num .num-sfx { color: rgba(212,175,94,0.75); }
.languages { border-block: 1px solid var(--line-soft); background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.lang-grid {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 0; margin-top: 36px;
}
.lang-row {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 4px 22px;
}
.lang-row:first-child { padding-left: 0; }
.lang-row::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 0; background: var(--line-soft);
  transition: height 0.7s cubic-bezier(0.22,1,0.36,1);
}
.lang-grid.rv.in .lang-row::before { height: 70%; }
.lang-row:first-child::before { content: none; }
.lang-row .lang-name { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.1rem; color: var(--text); }
.lang-row .lv {
  font-family: "Spline Sans Mono", monospace; color: var(--violet); font-size: 0.7rem;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.lang-row .lv-native { color: var(--gold); }

/* ---------- 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-links { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.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); }
.v-link-ext { color: var(--muted); }
.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; }
.contact-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-whatsapp {
  background: #25D366; color: #fff; border: none;
  box-shadow: 0 10px 32px -10px rgba(37,211,102,0.35);
  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;
}
.btn-whatsapp:hover { transform: translateY(-3px); box-shadow: 0 16px 40px -10px rgba(37,211,102,0.45); color: #fff; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line-soft); padding: 40px 0 50px; }
.foot { display: flex; flex-direction: column; gap: 22px; color: var(--muted); font-size: 0.82rem; }
.foot-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot-ventures { display: flex; gap: 18px; flex-wrap: wrap; font-family: "Spline Sans Mono", monospace; font-size: 0.7rem; letter-spacing: 0.1em; }
/* Quran verses block */
.foot-quran {
  text-align: center; padding: 20px 0 18px;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.foot-quran-verses {
  font-family: "Noto Naskh Arabic", "Amiri", Georgia, serif;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  color: var(--gold); line-height: 2.1; letter-spacing: 0.01em;
}
.foot-quran-ref {
  display: block; margin-top: 6px;
  font-family: "Spline Sans Mono", monospace; font-size: 0.66rem;
  letter-spacing: 0.18em; color: var(--muted); text-transform: uppercase;
}
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 18px; }
.foot-nav { display: flex; gap: 20px; font-family: "Spline Sans Mono", monospace; font-size: 0.7rem; letter-spacing: 0.08em; }
.foot a:hover { color: var(--gold); }

/* social icons */
.foot-social { display: flex; align-items: center; gap: 14px; }
.foot-social a {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line-soft); color: var(--muted);
  transition: color 0.3s, border-color 0.3s, transform 0.3s;
}
.foot-social a:hover { color: var(--gold); border-color: var(--gold); transform: translateY(-3px); }

/* ---------- 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: flex; }
  .about-grid, .book-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 340px; margin-inline: auto; }
  .paper { grid-template-columns: 1fr; gap: 12px; }
  .paper .status { justify-self: start; }
  .book-stage { order: -1; justify-self: center; }
}
@media (max-width: 540px) {
  body { font-size: 15.5px; }
  /* 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) ---------- */
/* Force dark background in light mode so the photo stage never washes out */
[data-theme="light"] .hero {
  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.22), transparent 65%),
    #0a0911;
}
.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) .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: tighten capsule on narrower desktop widths --- */
@media (max-width: 1140px) {
  .nav-links { font-size: 0.74rem; padding-left: 12px; }
  .nav-links a:not(.nav-cta) { padding: 8px 10px; gap: 5px; }
  .nav-cta { padding: 9px 14px; }
}

/* --- 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; }
  .foot-top { flex-direction: column; align-items: flex-start; gap: 16px; }
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
  .contact-actions { flex-direction: column; align-items: center; }
}

/* --- 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"] .languages { background: color-mix(in srgb, var(--bg-2) 80%, transparent); }
[data-theme="light"] .cred-list li { color: var(--text); }
[data-theme="light"] .lang-row { 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 photo: much shorter on mobile so it doesn't swamp the content */
  .hero-media {
    height: 48%;
    -webkit-mask-image: linear-gradient(180deg, #000 36%, transparent 95%);
    mask-image: linear-gradient(180deg, #000 36%, transparent 95%);
  }
  .hero-media img { object-position: center 0%; }

  /* Hero stats: 4-column grid (4 under 4) */
  .hero-stats {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    overflow-x: visible;
    gap: 18px 8px !important;
    margin-top: 16px;
    padding-top: 14px;
  }
  .hero-stats .stat { flex: unset; min-width: unset; text-align: center; }
  .hero-stats .num { font-size: clamp(1rem, 3.4vw, 1.6rem); }
  .hero-stats .lbl { font-size: 0.46rem; letter-spacing: 0.06em; white-space: normal; line-height: 1.3; }

  .hero-content { padding-bottom: clamp(4px, 1vh, 12px); }

  /* Brand: no typewriter cursor on mobile */
  .brand-cursor { display: none !important; }

  /* Languages: 3-column grid, horizontal dividers instead of vertical */
  .lang-grid { grid-template-columns: repeat(3, 1fr); row-gap: 22px; }
  .lang-row { padding: 0 10px; }
  .lang-row:first-child { padding-left: 10px; }
  .lang-row::before { display: none; }
  .lang-row:nth-child(n+4) {
    border-top: 1px solid var(--line-soft);
    padding-top: 16px;
  }
  .lang-row .lang-name { font-size: 0.95rem; }
}

@media (max-width: 768px) {
  /* Footer ventures: 2-column grid */
  .foot-ventures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
  }
}

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

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

/* When over dark hero section: force white regardless of theme */
.nav.over-dark .brand { color: #ffffff !important; }
.nav.over-dark .nav-links { background: rgba(10,9,17,0.5); border-color: rgba(255,255,255,0.16); }
.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 .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) .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; }
[data-theme="light"] .nav.nav-static .nav-links a { color: var(--muted); }
[data-theme="light"] .nav.nav-static .nav-links a:hover { color: var(--text); }
[data-theme="light"] .nav.nav-static .burger { border-color: var(--line); color: var(--text); }
[data-theme="light"] .nav.nav-static .theme-btn { border-color: var(--line); color: var(--muted); }

/* ============================================================
   BLOG PREVIEW (homepage section)
   ============================================================ */
.blog-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
  gap: 16px;
  margin-top: 36px;
}
.blog-preview-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px 22px 18px;
  background: var(--card); border: 1px solid var(--line-soft);
  border-radius: 14px; text-decoration: none; color: inherit;
  transition: border-color 0.28s, transform 0.28s, box-shadow 0.28s;
}
.blog-preview-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.blog-preview-tag {
  font-family: "Spline Sans Mono", monospace; font-size: 0.67rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 2px;
}
.blog-preview-card strong {
  font-size: 0.95rem; line-height: 1.4; color: var(--text);
  font-family: "Fraunces", serif; font-weight: 560;
}
.blog-preview-read {
  font-family: "Spline Sans Mono", monospace; font-size: 0.7rem;
  color: var(--muted); margin-top: 4px;
}
