/* =========================================================
   Jerish Bovas — portfolio
   ========================================================= */

:root {
  --bg: #0a0b0e;
  --bg-2: #0f1115;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eceef2;
  --text-2: #a4a9b4;
  --text-3: #6c717c;
  --accent: #7aa2ff;
  --accent-2: #5ee6d0;
  --accent-ink: #0a0b0e;
  --glow: rgba(122, 162, 255, 0.16);
  --grad: linear-gradient(120deg, #7aa2ff 0%, #8e8bff 45%, #5ee6d0 100%);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --container: 1200px;
  --gutter: clamp(20px, 5vw, 48px);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f5f1;
  --bg-2: #efede7;
  --surface: rgba(20, 22, 30, 0.03);
  --surface-2: rgba(20, 22, 30, 0.055);
  --line: rgba(20, 22, 30, 0.09);
  --line-2: rgba(20, 22, 30, 0.18);
  --text: #121419;
  --text-2: #4d525e;
  --text-3: #858a95;
  --accent: #3559e0;
  --accent-2: #0b9c86;
  --accent-ink: #ffffff;
  --glow: rgba(53, 89, 224, 0.12);
  --grad: linear-gradient(120deg, #3559e0 0%, #6a4fe0 45%, #0b9c86 100%);
  --shadow: 0 30px 80px -40px rgba(30, 35, 60, 0.35);
  color-scheme: light;
}

/* ---------- base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

img, svg { display: block; max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
strong { color: var(--text); font-weight: 600; }
::selection { background: var(--accent); color: var(--accent-ink); }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.06em;
}

.skip {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 10px;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease);
}
.skip:focus { transform: none; }

/* ---------- ambient layers ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0;
  height: 2px; z-index: 120;
  pointer-events: none;
}
.progress span {
  display: block; height: 100%;
  background: var(--grad);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 560px; height: 560px;
  margin: -280px 0 0 -280px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  will-change: transform;
}
body.has-pointer .cursor-glow { opacity: 1; }

.grain {
  position: fixed; inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="light"] .grain { opacity: 0.05; }

main, .footer { position: relative; z-index: 2; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0;
  z-index: 100;
  padding: 16px 0;
  transition: padding 0.4s var(--ease), background-color 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.5s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  padding: 10px 0;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom-color: var(--line);
}
.nav.is-hidden { transform: translateY(-100%); }

.nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--accent-ink);
  background: var(--grad);
  background-size: 200% 200%;
  animation: gradShift 8s ease-in-out infinite;
  box-shadow: 0 6px 24px -8px var(--accent);
}
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }

.nav__links {
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.nav__links a {
  position: relative;
  padding: 7px 14px;
  font-size: 14px;
  color: var(--text-2);
  border-radius: 999px;
  transition: color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a.is-active { color: var(--text); background: var(--surface-2); }

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

.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.icon-btn:hover { border-color: var(--line-2); }
.icon-btn svg { width: 18px; height: 18px; }

.theme-toggle { position: relative; overflow: hidden; }
.theme-toggle svg { position: absolute; transition: transform 0.6s var(--ease), opacity 0.4s var(--ease); }
.theme-toggle .i-moon { transform: translateY(0) rotate(0); }
.theme-toggle .i-sun { transform: translateY(140%) rotate(90deg); opacity: 0; }
:root[data-theme="light"] .theme-toggle .i-moon { transform: translateY(-140%) rotate(-90deg); opacity: 0; }
:root[data-theme="light"] .theme-toggle .i-sun { transform: none; opacity: 1; }

.menu-toggle { display: none; gap: 5px; align-content: center; }
.menu-toggle span {
  display: block; width: 16px; height: 1.6px;
  background: currentColor; border-radius: 2px;
  transition: transform 0.4s var(--ease);
}
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.3px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.3px) rotate(-45deg); }

.mobile-menu {
  display: grid;
  gap: 4px;
  margin: 12px var(--gutter) 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  animation: menuIn 0.45s var(--ease);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a {
  padding: 12px 14px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
}
.mobile-menu a:hover { background: var(--surface-2); }

/* ---------- buttons ---------- */
.btn {
  --pad-y: 13px; --pad-x: 22px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform 0.35s var(--ease), background-color 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.4s var(--ease), color 0.3s var(--ease);
  will-change: transform;
}
.btn svg { width: 17px; height: 17px; transition: transform 0.4s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--sm { --pad-y: 8px; --pad-x: 15px; font-size: 13.5px; }
.btn--lg { --pad-y: 17px; --pad-x: 28px; font-size: 16px; }

.btn--primary {
  color: var(--accent-ink);
  background: var(--text);
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn--primary::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  z-index: -1;
}
.btn--primary { isolation: isolate; }
.btn--primary:hover { background: transparent; color: #0a0b0e; }
.btn--primary:hover::before { opacity: 1; }

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

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14.5px;
  color: var(--text-2);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 3px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.link-arrow svg { width: 15px; height: 15px; transition: transform 0.4s var(--ease); }
.link-arrow:hover { color: var(--text); border-color: var(--accent); }
.link-arrow:hover svg { transform: translate(2px, -2px); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 140px 0 110px;
  overflow: hidden;
}
.hero__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.9;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 60% 45%, #000 30%, transparent 85%);
  mask-image: radial-gradient(ellipse 85% 75% at 60% 45%, #000 30%, transparent 85%);
}
.hero__aura {
  position: absolute;
  width: 900px; height: 900px;
  right: -260px; top: -300px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
              radial-gradient(circle at 70% 70%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 55%);
  filter: blur(40px);
  animation: float 16s ease-in-out infinite;
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 2; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 30px;
  padding: 7px 14px 7px 12px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.pill__dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
}
.pill__dot::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent-2);
  animation: ping 2.4s var(--ease) infinite;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(44px, 8.2vw, 112px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.hero__title .line { display: block; overflow: hidden; padding: 0.04em 0 0.1em; margin-bottom: -0.08em; }
.hero__title .line > span { display: inline-block; }
.hero__title .serif { font-size: 1.08em; letter-spacing: -0.02em; }

.rotator { position: relative; display: inline-block; vertical-align: bottom; }
.rotator__word {
  display: inline-block;
  color: var(--text-2);
  transition: transform 0.7s var(--ease), opacity 0.5s var(--ease), filter 0.6s var(--ease);
}
.rotator__word.is-out { transform: translateY(-60%); opacity: 0; filter: blur(8px); }
.rotator__word.is-in { transform: translateY(60%); opacity: 0; filter: blur(8px); transition: none; }

.hero__lede {
  max-width: 600px;
  margin: 32px 0 0;
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.6;
  color: var(--text-2);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }

.hero__social { display: flex; gap: 8px; margin: 44px 0 0; padding: 0; list-style: none; }
.hero__social a {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  color: var(--text-2);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.4s var(--ease);
}
.hero__social a:hover { color: var(--text); border-color: var(--line-2); transform: translateY(-3px); }
.hero__social svg { width: 18px; height: 18px; }

.scroll-cue {
  position: absolute;
  left: 50%; bottom: 32px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  z-index: 2;
}
.scroll-cue i {
  position: relative;
  width: 1px; height: 44px;
  background: var(--line-2);
  overflow: hidden;
}
.scroll-cue i::after {
  content: "";
  position: absolute; left: 0; top: -40%;
  width: 100%; height: 40%;
  background: var(--text);
  animation: drip 2.2s var(--ease-in-out) infinite;
}

/* intro animation */
.intro {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(6px);
}
.hero__title .intro { transform: translateY(105%); filter: none; opacity: 1; }
body.is-loaded .intro {
  opacity: 1;
  transform: none;
  filter: none;
  transition: transform 1.2s var(--ease), opacity 1s var(--ease), filter 1s var(--ease);
  transition-delay: calc(var(--d, 0) * 0.09s + 0.1s);
}

/* ---------- stats ---------- */
.stats {
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 60%, transparent);
}
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  padding: 40px 28px;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: 0; padding-left: 0; }
.stat__num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 4.2vw, 52px);
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat__num span:not(.count):not(.stat__pre) { color: var(--accent); }
.stat__pre { color: var(--text-3); }
.stat p { margin: 12px 0 0; font-size: 14px; color: var(--text-2); line-height: 1.5; max-width: 22ch; }

/* ---------- sections ---------- */
.section { position: relative; padding: clamp(96px, 13vw, 170px) 0; }

.section__head { margin-bottom: clamp(48px, 6vw, 80px); }
.section__head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}
.eyebrow span {
  color: var(--accent);
  padding-right: 12px;
  border-right: 1px solid var(--line-2);
}

.section__title {
  margin: 0;
  max-width: 17ch;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 5.4vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.section__title .serif { font-size: 1.08em; }

/* reveal */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--rd, 0s);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- about ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.about .section__head { position: sticky; top: 120px; margin: 0; }
.about__body > p {
  margin: 0 0 22px;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.65;
  color: var(--text-2);
}
.focus {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 44px;
}
.focus__card {
  position: relative;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.4s var(--ease), background-color 0.4s var(--ease);
  transform-style: preserve-3d;
}
.focus__card:hover { border-color: var(--line-2); background: var(--surface-2); }
.focus__icon {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  margin-bottom: 20px;
  border-radius: 12px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.focus__icon svg { width: 20px; height: 20px; }
.focus__card h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.focus__card p { margin: 0; font-size: 14.5px; color: var(--text-2); line-height: 1.55; }

/* ---------- timeline ---------- */
.timeline {
  position: relative;
  list-style: none;
  margin: 0; padding: 0;
}
.timeline__line {
  position: absolute;
  left: 260px; top: 8px; bottom: 8px;
  width: 1px;
  background: var(--line);
}
.timeline__line span {
  position: absolute; inset: 0;
  background: var(--grad);
  transform-origin: top;
  transform: scaleY(var(--p, 0));
}
.role {
  position: relative;
  display: grid;
  grid-template-columns: 260px 1fr;
  padding-bottom: 72px;
}
.role:last-child { padding-bottom: 0; }
.role::before {
  content: "";
  position: absolute;
  left: 260px; top: 10px;
  width: 11px; height: 11px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 12%, transparent);
  z-index: 1;
}
.role__meta { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding-right: 32px; }
.role__dates { font-family: var(--font-mono); font-size: 13px; color: var(--text-2); letter-spacing: 0.02em; }
.role__badge {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent);
}
.role__body { padding-left: 48px; }
.role__body h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.role__org { margin: 6px 0 22px; color: var(--accent); font-weight: 500; }
.role__body ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.role__body li {
  position: relative;
  padding-left: 22px;
  color: var(--text-2);
  font-size: 15.5px;
}
.role__body li::before {
  content: "";
  position: absolute; left: 0; top: 0.72em;
  width: 10px; height: 1px;
  background: var(--text-3);
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.tags span {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* ---------- projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.project {
  --mx: 50%; --my: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  isolation: isolate;
  transition: border-color 0.4s var(--ease), transform 0.5s var(--ease);
  transform-style: preserve-3d;
}
.project::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.project::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(300px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 70%, transparent), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
}
.project:hover::before, .project:hover::after { opacity: 1; }
.project:hover { border-color: var(--line-2); }

.project__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 36px; }
.project__glyph {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  transition: transform 0.6s var(--ease), color 0.3s var(--ease);
}
.project:hover .project__glyph { transform: rotate(-8deg) scale(1.06); color: var(--accent); }
.project__glyph svg { width: 22px; height: 22px; }
.project__kind {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.project h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.project > p, .project__content > p:not(.project__kind) {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.6;
}
.project .tags { margin-top: 20px; }
.project__links {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  margin-top: auto;
  padding-top: 26px;
  font-size: 14px;
}
.project__links a:not(.btn) {
  color: var(--text);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 2px;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.project__links a:not(.btn):hover { color: var(--accent); border-color: var(--accent); }
.muted-note { color: var(--text-3); font-family: var(--font-mono); font-size: 12.5px; }

/* featured */
.project--feature {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 4vw, 56px);
  background:
    radial-gradient(600px 400px at 15% 50%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    var(--surface);
}
.project--feature h3 { font-size: clamp(32px, 4vw, 48px); letter-spacing: -0.04em; margin: 10px 0 16px; }
.project--feature .project__content > p:not(.project__kind) { font-size: 16.5px; }
.project--feature .project__kind { color: var(--accent); }
.project--feature .project__links { margin-top: 0; padding-top: 30px; gap: 10px; }

.project__visual { display: grid; place-items: center; perspective: 1200px; }
.phone {
  position: relative;
  width: min(250px, 70%);
  aspect-ratio: 9 / 19;
  border-radius: 38px;
  padding: 10px;
  background: linear-gradient(160deg, #2a2d35, #111318);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.8), inset 0 0 0 1px rgba(255,255,255,.08);
  transform: rotateY(-14deg) rotateX(6deg) rotateZ(2deg);
  transition: transform 1s var(--ease);
  animation: bob 7s ease-in-out infinite;
}
.project--feature:hover .phone { transform: rotateY(-4deg) rotateX(2deg) rotateZ(0deg); }
.phone__notch {
  position: absolute; top: 18px; left: 50%;
  width: 70px; height: 20px;
  transform: translateX(-50%);
  border-radius: 20px;
  background: #07080a;
  z-index: 3;
}
.phone__screen {
  position: relative;
  height: 100%;
  border-radius: 30px;
  overflow: hidden;
  background: #0d1a17;
}
.map {
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(94,230,208,.07) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(94,230,208,.07) 1px, transparent 1px) 0 0 / 22px 22px,
    radial-gradient(circle at 30% 30%, #1a3a33, transparent 60%),
    radial-gradient(circle at 80% 80%, #16263f, transparent 60%),
    #0c1512;
}
.map__route { position: absolute; inset: 0; width: 100%; height: 100%; }
.map__route path {
  stroke: #5ee6d0;
  stroke-width: 0.8;
  stroke-dasharray: 2 2.5;
  vector-effect: non-scaling-stroke;
  animation: dash 8s linear infinite;
  opacity: .8;
}
.map__pin {
  position: absolute;
  left: var(--x); top: var(--y);
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: #7aa2ff;
  box-shadow: 0 0 0 4px rgba(122,162,255,.2);
  z-index: 2;
}
.map__pin::after {
  content: ""; position: absolute; inset: -6px;
  border-radius: 50%;
  border: 1px solid #7aa2ff;
  animation: ping 2.6s var(--ease) infinite;
  animation-delay: var(--pd, 0s);
}
.map__pin.is-hot { background: #5ee6d0; box-shadow: 0 0 0 4px rgba(94,230,208,.25); }
.map__pin.is-hot::after { border-color: #5ee6d0; }
.phone__card {
  position: absolute; left: 10px; right: 10px; bottom: 12px;
  display: grid; gap: 4px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(15,17,22,.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.08);
  color: #eceef2;
  font-size: 11px;
  line-height: 1.35;
}
.phone__card b { font-family: var(--font-mono); font-weight: 500; font-size: 10px; color: #5ee6d0; letter-spacing: .06em; text-transform: uppercase; }
.phone__card i { display: block; height: 4px; margin-top: 6px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.phone__card i em { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, #7aa2ff, #5ee6d0); border-radius: inherit; animation: fillBar 3.5s var(--ease) infinite alternate; }

/* ---------- skills ---------- */
.marquee {
  position: relative;
  overflow: hidden;
  padding: 28px 0;
  margin-bottom: clamp(48px, 6vw, 72px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 48s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track span {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 44px);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text-3);
  white-space: nowrap;
  transition: color 0.3s var(--ease);
}
.marquee__track span:hover { color: var(--text); }
.marquee__track span::after {
  content: "✦";
  margin: 0 clamp(20px, 3vw, 40px);
  font-size: 0.45em;
  color: var(--accent);
  opacity: .7;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.skill-group {
  padding: 30px;
  background: var(--bg);
  transition: background-color 0.4s var(--ease);
}
.skill-group:hover { background: var(--bg-2); }
.skill-group h3 {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.skill-group h3 span {
  display: grid; place-items: center;
  min-width: 30px; height: 30px;
  padding: 0 6px;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.skill-group ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.skill-group li {
  font-size: 13.5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-2);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.skill-group li:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }

/* ---------- education ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.edu {
  position: relative;
  padding: 30px;
  min-height: 220px;
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.4s var(--ease);
  transform-style: preserve-3d;
}
.edu:hover { border-color: var(--line-2); }
.edu__tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: auto;
}
.edu h3 { margin: 40px 0 6px; font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.edu p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.edu__seal {
  position: absolute; right: -18px; top: -18px;
  width: 130px; height: 130px;
  color: var(--accent);
  opacity: .12;
  transition: transform 0.8s var(--ease), opacity 0.5s var(--ease);
}
.edu__seal svg { width: 100%; height: 100%; stroke-width: 1.4; }
.edu:hover .edu__seal { transform: rotate(-10deg) scale(1.08); opacity: .25; }

/* ---------- contact ---------- */
.contact { overflow: hidden; text-align: center; }
.contact__aura {
  position: absolute;
  left: 50%; top: 55%;
  width: 1100px; height: 700px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%);
  filter: blur(30px);
  pointer-events: none;
  animation: breathe 9s ease-in-out infinite;
}
.contact__inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.contact__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(46px, 8.5vw, 124px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}
.contact__title .serif { font-size: 1.06em; }
.contact__lede { max-width: 520px; margin: 30px auto 0; color: var(--text-2); font-size: clamp(16px, 1.6vw, 18px); }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }
.contact__links {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px 28px;
  margin: 56px 0 0; padding: 0;
  list-style: none;
}
.contact__links a {
  position: relative;
  font-size: 15px;
  color: var(--text-2);
  transition: color 0.3s var(--ease);
}
.contact__links a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.contact__links a:hover { color: var(--text); }
.contact__links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer__inner {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
  gap: 12px 24px;
  font-size: 13.5px;
  color: var(--text-3);
}
.footer p { margin: 0; }
.footer__time { font-family: var(--font-mono); font-size: 12.5px; }
.to-top { color: var(--text-2); transition: color .3s var(--ease); }
.to-top:hover { color: var(--text); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  z-index: 150;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--accent-ink);
  background: var(--text);
  box-shadow: var(--shadow);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform .6s var(--ease), opacity .4s var(--ease);
  pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- keyframes ---------- */
@keyframes gradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes ping { 0% { transform: scale(.6); opacity: 1; } 80%,100% { transform: scale(2.2); opacity: 0; } }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-60px, 50px) scale(1.08); } }
@keyframes breathe { 0%,100% { opacity: .7; transform: translate(-50%,-50%) scale(1); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.08); } }
@keyframes drip { 0% { top: -40%; } 100% { top: 100%; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes dash { to { stroke-dashoffset: -60; } }
@keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes fillBar { from { width: 35%; } to { width: 78%; } }
@keyframes menuIn { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .projects { grid-template-columns: repeat(2, 1fr); }
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
  .about__grid { grid-template-columns: 1fr; }
  .about .section__head { position: static; }
  .timeline__line, .role::before { left: 200px; }
  .role { grid-template-columns: 200px 1fr; }
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .menu-toggle { display: grid; }
  .nav__actions .btn { display: none; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 30px 20px; }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .project--feature { grid-template-columns: 1fr; }
  .project__visual { order: -1; padding: 10px 0 0; }
  .edu-grid { grid-template-columns: 1fr; }
  .edu { min-height: 0; }
  .edu h3 { margin-top: 28px; }
}

@media (max-width: 680px) {
  .projects { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: 1fr; }
  .focus { grid-template-columns: 1fr; }
  .timeline__line, .role::before { left: 5px; }
  .role { grid-template-columns: 1fr; padding-left: 30px; padding-bottom: 56px; }
  .role::before { top: 6px; }
  .role__meta { flex-direction: row; align-items: center; padding: 0 0 12px; }
  .role__body { padding-left: 0; }
  .hero { padding: 120px 0 110px; }
  .hero__cta .btn { flex: 1 1 auto; }
  .brand__name { display: none; }
  .project, .skill-group, .edu, .focus__card { padding: 24px; }
  .phone { width: min(210px, 62%); }
  .contact__actions .btn { width: 100%; }
  .btn--lg { --pad-x: 20px; font-size: 15px; }
  .footer__inner { flex-direction: column; text-align: center; }
}

@media (hover: none) {
  .cursor-glow { display: none; }
}

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

@media (max-width: 680px), (max-height: 760px) {
  .scroll-cue { display: none; }
}
