/* =========================================================
   Fahad Mahfoth Muhammed — portfolio
   Blueprint / heritage-stone theme
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

:root {
  /* dark (default) */
  --bg:            #07080a;
  --bg-2:          #0a0c10;
  --bg-3:          #0d1016;
  --surface:       rgba(255,255,255,.028);
  --surface-2:     rgba(255,255,255,.055);
  --line:          rgba(255,255,255,.085);
  --line-strong:   rgba(255,255,255,.16);
  --text:          #eef1f5;
  --text-2:        #b9c2ce;
  --muted:         #7d8896;
  --sand:          #e0b070;
  --sand-2:        #f4d9ac;
  --sand-dim:      rgba(224,176,112,.14);
  --blue:          #7aa7ff;
  --shadow:        0 24px 60px -30px rgba(0,0,0,.9);
  --grid-color:    rgba(255,255,255,.035);

  --shell: 1180px;
  --pad: clamp(20px, 5vw, 48px);
  --radius: 14px;
  --radius-sm: 9px;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(.22,.61,.36,1);
}

[data-theme="light"] {
  --bg:            #f6f4ef;
  --bg-2:          #efece5;
  --bg-3:          #e9e5dc;
  --surface:       rgba(20,24,32,.035);
  --surface-2:     rgba(20,24,32,.06);
  --line:          rgba(20,24,32,.12);
  --line-strong:   rgba(20,24,32,.24);
  --text:          #14181f;
  --text-2:        #39414d;
  --muted:         #6c7683;
  --sand:          #9d6b23;
  --sand-2:        #7a5218;
  --sand-dim:      rgba(157,107,35,.12);
  --blue:          #2f5fd0;
  --shadow:        0 20px 50px -32px rgba(20,24,32,.45);
  --grid-color:    rgba(20,24,32,.05);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
strong { color: var(--text); font-weight: 600; }

::selection { background: var(--sand); color: #0a0c10; }

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

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 200;
  background: var(--sand); color: #0a0c10; padding: 10px 18px;
  border-radius: 0 0 8px 8px; font-size: 14px; font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ================= header ================= */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.site-header.stuck {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}

.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px;
  color: var(--sand);
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--surface);
  transition: border-color .3s var(--ease), transform .4s var(--ease);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand:hover .brand-mark { border-color: var(--sand); transform: translateY(-1px); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.brand-text em {
  font-style: normal; font-family: var(--font-mono);
  font-size: 10.5px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase;
}

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  position: relative;
  font-size: 13.5px;
  color: var(--text-2);
  padding: 8px 12px;
  border-radius: 7px;
  transition: color .25s var(--ease), background .25s var(--ease);
}
.nav a::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 4px;
  height: 1px; background: var(--sand);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--text); }
.nav a.active::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
  border-radius: 9px;
  cursor: pointer;
  transition: color .25s, border-color .25s, background .25s, transform .25s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
#themeToggle .i-sun { display: none; }
#themeToggle .i-moon { display: block; }
[data-theme="light"] #themeToggle .i-sun { display: block; }
[data-theme="light"] #themeToggle .i-moon { display: none; }

.menu-btn { display: none; }

.scroll-progress {
  height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--sand), var(--sand-2));
  transition: width .1s linear;
}

/* ================= buttons ================= */

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 46px; padding: 0 22px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease), background .25s var(--ease),
              border-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--sand); color: #0a0c10; font-weight: 600;
  box-shadow: 0 10px 30px -14px color-mix(in srgb, var(--sand) 70%, transparent);
}
.btn-primary:hover { background: var(--sand-2); box-shadow: 0 16px 36px -14px color-mix(in srgb, var(--sand) 80%, transparent); }
[data-theme="light"] .btn-primary { color: #fbf9f5; }

.btn-ghost { border-color: var(--line-strong); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--sand); color: var(--sand); }

.btn-quiet { color: var(--muted); padding-inline: 8px; }
.btn-quiet:hover { color: var(--text); }

.btn-sm { height: 38px; padding: 0 16px; font-size: 13px; }

/* ================= hero ================= */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px 0 96px;
  overflow: hidden;
  isolation: isolate;
}

.hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  touch-action: pan-y;
  cursor: grab;
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}
.hero-canvas.ready { opacity: 1; }
.hero-canvas.dragging { cursor: grabbing; }

.hero-veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(115% 78% at 76% 42%, transparent 0%, color-mix(in srgb, var(--bg) 45%, transparent) 62%, var(--bg) 100%),
    linear-gradient(95deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 32%, color-mix(in srgb, var(--bg) 40%, transparent) 55%, transparent 72%);
}
.hero::after {
  content: '';
  position: absolute; inset: auto 0 0 0; height: 220px; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg));
}

/* fallback when WebGL is unavailable */
.hero.no-3d::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(52% 58% at 74% 44%, color-mix(in srgb, var(--sand) 16%, transparent), transparent 70%),
    radial-gradient(40% 46% at 20% 78%, color-mix(in srgb, var(--blue) 12%, transparent), transparent 70%),
    linear-gradient(var(--grid-color) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px) 0 0 / 44px 44px;
}

.hero-inner { position: relative; z-index: 2; max-width: 760px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--sand);
  border: 1px solid var(--sand-dim);
  background: color-mix(in srgb, var(--sand) 8%, transparent);
  padding: 7px 14px; border-radius: 100px;
  margin-bottom: 26px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--sand);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--sand) 60%, transparent);
  animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sand) 55%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(44px, 8.4vw, 96px);
  line-height: .98;
  letter-spacing: -.025em;
  margin-bottom: 22px;
}
.hero-title .line { display: block; }
.hero-title .accent {
  color: transparent;
  background: linear-gradient(100deg, var(--sand-2), var(--sand) 45%, color-mix(in srgb, var(--sand) 55%, var(--text)) 100%);
  -webkit-background-clip: text; background-clip: text;
  font-style: italic;
  padding-right: .08em;
}

.hero-role {
  font-size: clamp(15px, 2vw, 18.5px);
  color: var(--text);
  margin-bottom: 22px;
  font-weight: 500;
}
.hero-role .sep { color: var(--sand); margin: 0 10px; }
.hero-role .muted { color: var(--muted); font-weight: 400; }

.hero-lede {
  font-size: clamp(15px, 1.6vw, 17px);
  color: var(--text-2);
  max-width: 620px;
  margin-bottom: 34px;
}
.hero-lede strong { color: var(--sand); }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 44px; }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 12px 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  max-width: 620px;
}
.hero-meta li { display: flex; flex-direction: column; gap: 3px; }
.hero-meta .k {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.hero-meta .v { font-size: 14px; color: var(--text-2); }

/* 3D HUD */
.scene-hud {
  position: absolute;
  right: var(--pad); bottom: 42px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  z-index: 3;
  font-family: var(--font-mono);
  opacity: 0;
  transition: opacity .8s var(--ease) .6s;
}
.scene-hud.ready { opacity: 1; }
.scene-label { font-size: 12px; color: var(--text-2); letter-spacing: .1em; text-transform: uppercase; }
.scene-idx { color: var(--sand); }
.scene-dots { display: flex; gap: 8px; }
.scene-dots button {
  width: 26px; height: 3px; border: 0; padding: 0; cursor: pointer; border-radius: 2px;
  background: var(--line-strong);
  transition: background .3s var(--ease), transform .3s var(--ease);
}
.scene-dots button:hover { background: var(--text-2); }
.scene-dots button[aria-selected="true"] { background: var(--sand); transform: scaleY(1.6); }
.scene-hint { font-size: 10px; color: var(--muted); letter-spacing: .08em; }

.scroll-cue {
  position: absolute; left: var(--pad); bottom: 34px; z-index: 3;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  transition: color .3s var(--ease);
}
.scroll-cue:hover { color: var(--sand); }
.scroll-line { width: 54px; height: 1px; background: var(--line-strong); position: relative; overflow: hidden; }
.scroll-line::after {
  content: ''; position: absolute; inset: 0; width: 40%;
  background: var(--sand);
  animation: slide 2.4s var(--ease) infinite;
}
@keyframes slide { 0% { transform: translateX(-100%); } 60%,100% { transform: translateX(280%); } }

/* ================= sections ================= */

.section { padding: clamp(72px, 10vw, 128px) 0; position: relative; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--line); }

.section-head { margin-bottom: clamp(40px, 6vw, 64px); max-width: 640px; }
.section-index {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--sand);
  letter-spacing: .18em; display: block; margin-bottom: 12px;
}
.section-head h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(29px, 4.6vw, 46px); line-height: 1.1; letter-spacing: -.02em;
}
.section-sub { color: var(--muted); margin-top: 12px; font-size: 15.5px; }
.section-lead {
  font-size: clamp(15.5px, 1.8vw, 18px); color: var(--text-2);
  max-width: 820px; margin-bottom: 48px;
}

/* ================= stats ================= */

.stats-band {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to bottom, var(--bg-2), var(--bg));
  position: relative;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-inline: 1px solid var(--line);
}
.stat {
  background: var(--bg);
  padding: clamp(26px, 3.4vw, 40px) clamp(16px, 2.4vw, 28px);
  display: flex; flex-direction: column; gap: 8px;
  transition: background .35s var(--ease);
}
.stat:hover { background: var(--bg-3); }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1; color: var(--sand);
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* ================= about ================= */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.about-text p { color: var(--text-2); margin-bottom: 18px; }
.about-text .lead {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.6vw, 25px);
  line-height: 1.45; color: var(--text); margin-bottom: 24px;
}

.partners { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.partners-label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 16px;
}
.partners ul { display: flex; flex-wrap: wrap; gap: 10px; }
.partners li {
  font-size: 13px; color: var(--text-2);
  padding: 7px 14px; border: 1px solid var(--line);
  border-radius: 100px; background: var(--surface);
  transition: border-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.partners li:hover { border-color: var(--sand); color: var(--sand); transform: translateY(-2px); }

.profile-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 32px);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-grid-lines {
  position: absolute; inset: 0; pointer-events: none; opacity: .8;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 80% 0%, #000, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 80% 0%, #000, transparent 72%);
}
.card-title {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--sand); margin-bottom: 22px; position: relative;
}
.facts { display: flex; flex-direction: column; gap: 15px; position: relative; }
.facts > div { display: flex; flex-direction: column; gap: 3px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { font-size: 11.5px; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.facts dd { font-size: 15px; color: var(--text); }
.card-links { display: flex; gap: 18px; margin-top: 24px; position: relative; }
.card-links a {
  font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px; transition: color .25s, border-color .25s;
}
.card-links a:hover { color: var(--sand); border-color: var(--sand); }

/* ================= competencies ================= */

.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.comp {
  background: var(--bg-2);
  padding: clamp(22px, 2.8vw, 30px);
  display: flex; flex-direction: column; gap: 14px;
  min-height: 148px;
  position: relative;
  transition: background .35s var(--ease);
}
.comp:hover { background: var(--bg-3); }
.comp-n {
  font-family: var(--font-mono); font-size: 11px; color: var(--sand);
  letter-spacing: .14em;
}
.comp-note {
  grid-column: span 2;
  background: var(--bg-2);
  padding: clamp(22px, 2.8vw, 30px);
  display: flex; align-items: center;
  color: var(--muted); font-size: 14.5px; line-height: 1.55;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 26px 26px;
}
@media (max-width: 640px) { .comp-note { grid-column: span 1; } }
.comp h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 20px; line-height: 1.3; letter-spacing: -.01em;
}

/* ================= timeline ================= */

.timeline { position: relative; display: flex; flex-direction: column; gap: clamp(26px, 4vw, 44px); }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px;
  background: linear-gradient(to bottom, var(--sand), var(--line) 22%, var(--line) 78%, transparent);
}
.tl-item {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: clamp(18px, 3vw, 40px);
  padding-left: 40px;
  position: relative;
}
.tl-node {
  position: absolute; left: 0; top: 8px;
  width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  display: grid; place-items: center;
  transition: border-color .35s var(--ease);
}
.tl-node::after {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--muted); transition: background .35s var(--ease), box-shadow .35s var(--ease);
}
.tl-item:hover .tl-node { border-color: var(--sand); }
.tl-item:hover .tl-node::after { background: var(--sand); box-shadow: 0 0 12px var(--sand); }

.tl-when { display: flex; flex-direction: column; gap: 5px; padding-top: 2px; }
.tl-when .years {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--sand); letter-spacing: .06em;
}
.tl-when .place { font-size: 12.5px; color: var(--muted); }

.tl-body h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(21px, 2.8vw, 27px); line-height: 1.2; letter-spacing: -.015em;
}
.tl-body .org {
  font-size: 14px; color: var(--text-2); margin: 4px 0 14px;
  font-weight: 500;
}
.tl-body > p:not(.org) { color: var(--text-2); font-size: 15px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tags li {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em;
  color: var(--muted); padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 6px;
  transition: color .3s, border-color .3s;
}
.tags li:hover { color: var(--text-2); border-color: var(--line-strong); }

/* ================= skills ================= */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: clamp(16px, 2vw, 22px);
}
.skill-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  padding: clamp(22px, 2.8vw, 30px);
  transition: border-color .35s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease);
}
.skill-card:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: var(--shadow); }
.skill-card.wide { grid-column: 1 / -1; }
.skill-card h3 {
  display: flex; align-items: center; gap: 12px;
  font-size: 15px; font-weight: 600; letter-spacing: .01em;
  margin-bottom: 20px;
}
.skill-card h3 span {
  font-family: var(--font-mono); color: var(--sand); font-size: 14px;
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--sand-dim); border-radius: 8px;
  background: color-mix(in srgb, var(--sand) 7%, transparent);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: 13px; color: var(--text-2);
  padding: 7px 13px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line);
  transition: background .28s var(--ease), color .28s var(--ease), border-color .28s var(--ease), transform .28s var(--ease);
}
.chips li:hover { background: var(--surface-2); color: var(--text); transform: translateY(-2px); }
.chips li.primary { border-color: var(--sand-dim); color: var(--text); background: color-mix(in srgb, var(--sand) 8%, transparent); }
.chips li em {
  font-style: normal; font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--sand); margin-left: 7px;
}

/* ================= education & awards ================= */

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}
.badge {
  display: inline-block;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--sand);
  border: 1px solid var(--sand-dim); border-radius: 100px;
  padding: 5px 12px; margin-bottom: 18px;
  background: color-mix(in srgb, var(--sand) 7%, transparent);
}
.edu-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(24px, 3vw, 34px);
  background: var(--surface);
}
.edu-card h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(21px, 2.6vw, 27px); line-height: 1.25; letter-spacing: -.015em;
}
.edu-card .org { color: var(--sand); font-family: var(--font-mono); font-size: 13px; margin: 8px 0 16px; }
.edu-card p:not(.org) { color: var(--text-2); font-size: 15px; }

.award-list { display: flex; flex-direction: column; }
.award-list li {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px 0; border-bottom: 1px solid var(--line);
  color: var(--text-2); font-size: 14.5px;
  transition: padding-left .35s var(--ease);
}
.award-list li:first-child { padding-top: 4px; }
.award-list li:last-child { border-bottom: 0; }
.award-list li:hover { padding-left: 8px; }
.award-mark { color: var(--sand); font-size: 13px; line-height: 1.7; flex-shrink: 0; }

/* ================= pillars ================= */

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.pillar {
  background: var(--bg-2);
  padding: clamp(24px, 3vw, 32px);
  display: flex; flex-direction: column; gap: 12px;
  transition: background .35s var(--ease);
}
.pillar:hover { background: var(--bg-3); }
.pillar-n {
  font-family: var(--font-mono); font-size: 11px; color: var(--sand); letter-spacing: .14em;
}
.pillar h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.pillar p { font-size: 14px; color: var(--muted); }

/* ================= statement ================= */

.statement-section { position: relative; overflow: hidden; }
.statement-section::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 60% at 50% 0%, color-mix(in srgb, var(--sand) 9%, transparent), transparent 70%);
}
.statement {
  position: relative;
  max-width: 860px; margin-inline: auto; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(38px, 6vw, 64px) clamp(24px, 5vw, 60px);
  background: var(--surface);
  backdrop-filter: blur(6px);
}
.quote-mark {
  font-family: var(--font-display); font-size: 88px; line-height: .6;
  color: var(--sand); opacity: .5; display: block; margin-bottom: 14px;
}
.statement h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(24px, 3.6vw, 38px); line-height: 1.2; letter-spacing: -.02em;
  margin-bottom: 20px;
}
.statement p { color: var(--text-2); font-size: clamp(15.5px, 1.9vw, 18px); }

/* ================= contact ================= */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: clamp(14px, 2vw, 20px);
}
.contact-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(22px, 2.6vw, 28px);
  background: var(--surface);
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .3s var(--ease), transform .3s var(--ease), background .3s var(--ease);
  min-width: 0;
}
a.contact-card:hover { border-color: var(--sand); transform: translateY(-3px); }
.c-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; color: var(--sand);
  border: 1px solid var(--sand-dim);
  background: color-mix(in srgb, var(--sand) 7%, transparent);
  margin-bottom: 12px;
}
.c-icon svg { width: 18px; height: 18px; }
.c-label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}
.c-value { font-size: 15px; color: var(--text); word-break: break-word; }
.cta-card { background: color-mix(in srgb, var(--sand) 6%, transparent); border-color: var(--sand-dim); }
.cta-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.references {
  margin-top: 34px; font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}

/* ================= footer ================= */

.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 40px 0; }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 20px 32px;
  align-items: center; justify-content: space-between;
}
.footer-brand { display: flex; flex-direction: column; gap: 3px; }
.footer-brand strong { font-size: 14.5px; }
.footer-brand span { font-size: 12.5px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { font-size: 13px; color: var(--text-2); transition: color .25s; }
.footer-links a:hover { color: var(--sand); }
.copyright { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }

/* ================= reveal ================= */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-line::after, .eyebrow .dot { animation: none; }
  .btn:hover, a.contact-card:hover, .skill-card:hover { transform: none; }
}

/* ================= responsive ================= */

@media (max-width: 980px) {
  .about-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tl-item { grid-template-columns: 1fr; gap: 10px; }
  .tl-when { flex-direction: row; gap: 14px; align-items: center; }
}

@media (max-width: 780px) {
  .header-inner { height: 62px; }
  .menu-btn { display: grid; }
  .header-portfolio { display: none; }
  .nav {
    position: fixed; inset: 62px 0 auto 0;
    flex-direction: column; gap: 0;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--pad) 20px;
    transform: translateY(-12px);
    opacity: 0; pointer-events: none;
    transition: opacity .28s var(--ease), transform .28s var(--ease);
  }
  .nav.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav a { padding: 13px 4px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 15px; }
  .nav a::after { display: none; }

  .hero { padding: 104px 0 92px; min-height: 92svh; }
  .hero-veil {
    background:
      radial-gradient(130% 70% at 50% 30%, transparent 0%, color-mix(in srgb, var(--bg) 62%, transparent) 55%, var(--bg) 100%),
      linear-gradient(to bottom, color-mix(in srgb, var(--bg) 55%, transparent), var(--bg) 88%);
  }
  .scene-hud {
    left: var(--pad); right: auto; bottom: 26px;
    align-items: flex-start; flex-direction: row; gap: 14px;
  }
  .scene-hint { display: none; }
  .scroll-cue { display: none; }
  .hero-meta { gap: 14px 26px; }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   MOTION SYSTEM
   ========================================================= */

@view-transition { navigation: auto; }

:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
}

/* reveals only apply when JS can undo them */
html:not(.js) .reveal { opacity: 1 !important; transform: none !important; }

/* compositor-only: opacity + transform, no paint-heavy filters */
.reveal {
  transition:
    opacity .9s var(--ease-out),
    transform 1s var(--ease-out);
  transform: translate3d(0, 26px, 0) scale(.985);
}
.reveal.in { transform: none; }

/* ---------- 1. loader ---------- */

.loader {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  display: grid; place-items: center;
  animation: loader-fail 0.5s var(--ease-out) 3s forwards;
}
html:not(.js) .loader { display: none; }

.loader-inner {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  animation: loader-pop .8s var(--ease-out) both;
}
.loader-mark {
  width: 46px; height: 46px; color: var(--sand);
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 12px;
}
.loader-mark svg { width: 28px; height: 28px; }
.loader-mark svg path {
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
  animation: draw 1.1s var(--ease-out) forwards;
}
.loader-mark svg path:nth-child(2) { animation-delay: .12s; }
.loader-mark svg path:nth-child(3) { animation-delay: .22s; }
.loader-name {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .28em; text-transform: uppercase; color: var(--muted);
}
.loader-bar {
  width: 140px; height: 1px; background: var(--line-strong); overflow: hidden;
}
.loader-bar i {
  display: block; height: 100%; width: 100%;
  background: var(--sand);
  transform-origin: left;
  animation: loader-fill 1.5s var(--ease-soft) forwards;
}
.loader.loader-done {
  animation: loader-out .7s var(--ease-out) forwards;
  pointer-events: none;
}
.loader.loader-done .loader-inner { animation: loader-inner-out .4s var(--ease-out) forwards; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes loader-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes loader-pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes loader-inner-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes loader-out { to { opacity: 0; visibility: hidden; } }
@keyframes loader-fail { to { opacity: 0; visibility: hidden; } }

/* ---------- 2. kinetic type ---------- */

.js [data-split] .w { display: inline-block; overflow: hidden; vertical-align: bottom; }
.js [data-split] .w-i {
  display: inline-block;
  transform: translateY(105%) rotate(3deg);
  opacity: 0;
  transition:
    transform .95s var(--ease-out),
    opacity .7s var(--ease-out);
  transition-delay: calc(var(--wi, 0) * 55ms);
}
.js [data-split].type-in .w-i { transform: none; opacity: 1; }

/* hero headline: staged with the rest of the intro */
.js .hero-title .line.accent {
  display: block;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease-out) .34s, transform 1.1s var(--ease-out) .34s;
}
.js .hero-title.type-in .line.accent { opacity: 1; transform: none; }

/* ---------- 3. hero intro + scroll response ---------- */

.hero { --hero-p: 0; }

.js .hero .hero-inner > *:not(.hero-title) { opacity: 0; transform: translateY(24px); }
.js .hero.hero-in .hero-inner > *:not(.hero-title) {
  opacity: 1; transform: none;
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.js .hero.hero-in .eyebrow    { transition-delay: .05s; }
.js .hero.hero-in .hero-role  { transition-delay: .38s; }
.js .hero.hero-in .hero-lede  { transition-delay: .46s; }
.js .hero.hero-in .hero-cta   { transition-delay: .54s; }
.js .hero.hero-in .hero-meta  { transition-delay: .62s; }

/* the headline block drifts and softens as the hero scrolls away */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner {
    transform: translateY(calc(var(--hero-p) * -60px));
    opacity: calc(1 - var(--hero-p) * 1.15);
    will-change: transform, opacity;
  }
  .hero-canvas { transform: scale(calc(1 + var(--hero-p) * 0.12)); }
  .scroll-cue, .scene-hud { opacity: calc(1 - var(--hero-p) * 2.4); }
}

.js .scene-hud { opacity: 0; }
.js .scene-hud.ready { opacity: 1; }

/* ---------- 4. cursor ---------- */

.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 400;
  pointer-events: none;
  border-radius: 50%;
  will-change: transform;
  opacity: 0;
}
.cursor-dot.is-ready, .cursor-ring.is-ready { opacity: 1; }
.cursor-dot {
  width: 6px; height: 6px; background: var(--sand);
  transition: opacity .3s;
}
.cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid color-mix(in srgb, var(--sand) 60%, transparent);
  transition: width .35s var(--ease-out), height .35s var(--ease-out),
              border-color .35s, opacity .3s, background .35s;
}
.cursor-ring.is-active { width: 56px; height: 56px; border-color: var(--sand); }
.cursor-ring.is-scene  { width: 74px; height: 74px; background: color-mix(in srgb, var(--sand) 10%, transparent); }
.cursor-ring.is-down   { width: 26px; height: 26px; }
body.cursor-out .cursor-dot, body.cursor-out .cursor-ring { opacity: 0; }

@media (hover: hover) and (pointer: fine) {
  html.has-cursor, html.has-cursor a, html.has-cursor button { cursor: none; }
  html.has-cursor input { cursor: none; }
}

/* ---------- 5. magnetic + button shine ---------- */

[data-magnetic] {
  transform: translate3d(var(--mx, 0), var(--my, 0), 0);
  transition: background .25s var(--ease-soft), border-color .25s var(--ease-soft),
              color .25s var(--ease-soft), box-shadow .35s var(--ease-soft);
}
.btn:hover { transform: translate3d(var(--mx, 0), var(--my, 0), 0); }

.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 25%, rgba(255,255,255,.28) 48%, transparent 72%);
  transform: translateX(-130%);
  transition: transform .85s var(--ease-out);
}
.btn:hover::after { transform: translateX(130%); }
[data-theme="light"] .btn-primary::after { background: linear-gradient(115deg, transparent 25%, rgba(255,255,255,.45) 48%, transparent 72%); }

.btn-primary:hover {
  box-shadow: 0 18px 42px -16px color-mix(in srgb, var(--sand) 85%, transparent);
}

/* ---------- 6. spotlight cards ---------- */

.skill-card, .contact-card, .comp, .edu-card, .profile-card, .pillar, .statement {
  position: relative;
  --sx: 50%; --sy: 0%;
}
.skill-card::before, .contact-card::before, .comp::before,
.edu-card::before, .pillar::before, .statement::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--sx) var(--sy),
              color-mix(in srgb, var(--sand) 14%, transparent), transparent 62%);
  opacity: 0;
  transition: opacity .45s var(--ease-soft);
  pointer-events: none;
}
.skill-card:hover::before, .contact-card:hover::before,
.edu-card:hover::before, .pillar:hover::before, .statement:hover::before { opacity: 1; }

/* the competency cards keep their left-rule animation, so restyle the layer */
.comp::before {
  transform: none; background: radial-gradient(260px circle at var(--sx) var(--sy),
              color-mix(in srgb, var(--sand) 16%, transparent), transparent 60%);
  width: auto; z-index: 0;
}
.comp:hover::before { opacity: 1; }
.comp::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--sand); transform: scaleY(0); transform-origin: top;
  transition: transform .5s var(--ease-out);
  z-index: 1;
}
.comp:hover::after { transform: scaleY(1); }
.comp > * { position: relative; z-index: 1; }

/* ---------- 7. tilt ---------- */

[data-tilt] { transform-style: preserve-3d; will-change: transform; }

/* ---------- 8. parallax ---------- */

[data-parallax] { transform: translate3d(0, var(--py, 0), 0); }

/* ---------- 9. timeline fill ---------- */

.timeline { --fill: 0; }
.timeline::after {
  content: '';
  position: absolute; left: 7px; top: 8px; width: 1px;
  height: calc((100% - 16px) * var(--fill));
  background: linear-gradient(to bottom, var(--sand), color-mix(in srgb, var(--sand) 30%, transparent));
  box-shadow: 0 0 12px color-mix(in srgb, var(--sand) 55%, transparent);
}
.tl-item .tl-node { transition: border-color .5s var(--ease-soft), transform .5s var(--ease-out); }
.tl-item.is-live .tl-node { border-color: var(--sand); transform: scale(1.18); }
.tl-item.is-live .tl-node::after { background: var(--sand); box-shadow: 0 0 14px var(--sand); }
.tl-item .tl-body { transition: transform .6s var(--ease-out); }
.tl-item.is-live .tl-body { transform: translateX(3px); }

/* ---------- 10. partner marquee ---------- */

.marquee {
  display: flex; gap: 10px; overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee ul {
  display: flex; gap: 10px; flex-wrap: nowrap; flex-shrink: 0;
  padding-right: 10px;
}
.marquee.marquee-ready ul { animation: marquee 34s linear infinite; }
.marquee:hover ul { animation-play-state: paused; }
.marquee li { white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee.marquee-ready ul { animation: none; }
  .marquee { flex-wrap: wrap; }
  .marquee ul { flex-wrap: wrap; }
}

/* ---------- 11. section rail ---------- */

.rail {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%);
  z-index: 90;
  display: flex; flex-direction: column; gap: 4px;
  opacity: 1; transition: opacity .5s var(--ease-soft), transform .5s var(--ease-out);
}
.rail.is-hidden { opacity: 0; transform: translateY(-50%) translateX(18px); pointer-events: none; }

.rail-dot {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; height: 26px; padding-right: 2px;
}
.rail-i {
  width: 20px; height: 1px; background: var(--line-strong);
  transition: width .4s var(--ease-out), background .4s var(--ease-soft);
}
.rail-dot:hover .rail-i { width: 30px; background: var(--text-2); }
.rail-dot.is-live .rail-i { width: 34px; background: var(--sand); }
.rail-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  opacity: 0; transform: translateX(6px);
  transition: opacity .35s var(--ease-soft), transform .35s var(--ease-out);
  white-space: nowrap; order: -1;
}
.rail-dot:hover .rail-label, .rail-dot.is-live .rail-label { opacity: 1; transform: none; }
@media (max-width: 1080px) { .rail { display: none; } }

/* ---------- 12. contact arrows + link sweeps ---------- */

a.contact-card::after {
  content: '';
  position: absolute; top: 22px; right: 22px;
  width: 16px; height: 16px;
  background: currentColor;
  color: var(--muted);
  -webkit-mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M9 7h8v8'/%3E%3C/svg%3E");
  mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M9 7h8v8'/%3E%3C/svg%3E");
  opacity: .45;
  transition: transform .45s var(--ease-out), opacity .35s;
}
a.contact-card:hover::after { transform: translate(3px, -3px); opacity: 1; color: var(--sand); }

.footer-links a, .card-links a { position: relative; }
.footer-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px;
  background: var(--sand); transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease-out);
}
.footer-links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- 12b. lit words: the statement fills in as you scroll ---------- */

.lit-words .w-i {
  color: color-mix(in srgb, var(--text) 26%, transparent);
  transition: color .5s var(--ease-soft);
}
.lit-words .w-i.lit { color: var(--text-2); }
.lit-words strong .w-i.lit { color: var(--sand); }

/* ---------- 13. ambient light in the statement + section transitions ---------- */

.statement-section::after {
  content: ''; position: absolute; inset: -20% -10%; pointer-events: none;
  background:
    radial-gradient(38% 44% at 22% 30%, color-mix(in srgb, var(--sand) 13%, transparent), transparent 70%),
    radial-gradient(34% 40% at 78% 70%, color-mix(in srgb, var(--blue) 12%, transparent), transparent 70%);
  filter: blur(12px);
  animation: aurora 22s var(--ease-soft) infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1); }
  50%  { transform: translate3d(3%, 2%, 0) scale(1.08); }
  100% { transform: translate3d(-1%, 3%, 0) scale(1.03); }
}
.statement { z-index: 1; }

/* stat band: animated rules + hover lift */
.stat { position: relative; overflow: hidden; }
.stat::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--sand), transparent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .7s var(--ease-out);
}
.stat.in::after { transform: scaleX(1); }
.stat-num { transition: transform .5s var(--ease-out), color .4s; display: inline-block; }
.stat:hover .stat-num { transform: translateY(-3px); color: var(--sand-2); }

/* chips + tags ripple in */
.chips li, .tags li, .partners li {
  transition: background .3s var(--ease-soft), color .3s var(--ease-soft),
              border-color .3s var(--ease-soft), transform .45s var(--ease-out);
}
.skill-card:hover .chips li { border-color: var(--line-strong); }

/* headings get a soft gradient sheen on hover */
.section-head h2 { position: relative; }

/* ---------- 14. respect reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .loader { display: none; }
  .js [data-split] .w-i { transform: none; opacity: 1; }
  .js .hero .hero-inner > *,
  .js .hero-title .line.accent { opacity: 1; transform: none; }
  .reveal { filter: none; }
  .cursor-dot, .cursor-ring { display: none; }
  .statement-section::after { animation: none; }
  .btn::after { display: none; }
}

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--sand); }
