/* =========================================================
   Harsha Vardhan — Portfolio
   Dark premium · aurora · glassmorphism
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #08080d;
  --bg-2: #0c0c14;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #ececf1;
  --text-dim: #b6b7c5;
  --text-mute: #797b8d;

  --blue: #3b82f6;          /* primary */
  --blue-bright: #60a5fa;   /* highlight */
  --blue-deep: #1e3a8a;     /* depth */
  --accent: var(--blue);

  --grad-aurora: linear-gradient(135deg, #1e3a8a 0%, #2563eb 40%, #3b82f6 75%, #60a5fa 100%);
  --grad-text: linear-gradient(120deg, #fff 0%, #dbeafe 40%, #93c5fd 80%, #60a5fa 100%);

  --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
  --shadow-md: 0 12px 40px rgba(0,0,0,.45);
  --shadow-glow: 0 0 60px rgba(59,130,246,.25);

  --f-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --container: 1240px;
  --gutter: clamp(20px, 4vw, 56px);

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,.84,.44,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; color-scheme: dark; }
html, body { height: 100%; }
section[id] { scroll-margin-top: 90px; }

/* Accessible focus ring (only for keyboard nav) */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid rgba(59,130,246,.7);
  outline-offset: 3px;
  border-radius: 8px;
}
.field input:focus-visible,
.field textarea:focus-visible,
.floating input:focus-visible,
.floating textarea:focus-visible { outline: none; } /* already styled via box-shadow */
body {
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  min-height: 100vh;
}
.brand { transition: opacity .2s var(--ease); }
.brand:hover { opacity: .85; }
img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
input, textarea { font: inherit; color: inherit; }
::selection { background: rgba(59,130,246,.5); color: #fff; }

/* ---------- Aurora background ---------- */
.bg-layer {
  position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(37,99,235,.18), transparent 60%),
    radial-gradient(900px 600px at -10% 100%, rgba(96,165,250,.12), transparent 60%),
    var(--bg);
}
.aurora {
  position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%;
  filter: blur(130px); opacity: .38; mix-blend-mode: screen;
  animation: drift 32s linear infinite;
}
.aurora-1 { top: -20%; left: -10%; background: radial-gradient(circle at 30% 30%, #2563eb, transparent 60%); }
.aurora-2 { bottom: -25%; right: -15%; background: radial-gradient(circle at 70% 70%, #1e3a8a, transparent 60%); animation-delay: -10s; animation-duration: 42s; opacity: .32; }
.aurora-3 { display: none; }
@keyframes drift {
  0%   { transform: translate(0,0) rotate(0); }
  50%  { transform: translate(6%, -4%) rotate(180deg); }
  100% { transform: translate(0,0) rotate(360deg); }
}
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.noise {
  position: absolute; inset: 0; opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/></svg>");
}

/* Top-of-page solid-dark fade. Sits above the fixed aurora layer but scrolls
   with the page, so the hero opens on a clean black canvas and the aurora
   only emerges as the user scrolls into the body of the site. */
.top-shade {
  position: absolute; top: 0; left: 0; right: 0;
  height: 130vh; z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom,
    #08080d 0%,
    #08080d 45%,
    rgba(8, 8, 13, .82) 70%,
    rgba(8, 8, 13, 0) 100%);
}

/* ---------- Cursor glow ---------- */
.cursor-glow {
  position: fixed; pointer-events: none; z-index: -1; width: 520px; height: 520px;
  border-radius: 50%; left: 0; top: 0;
  background: radial-gradient(circle, rgba(59,130,246,.12) 0%, rgba(96,165,250,.05) 40%, transparent 70%);
  filter: blur(20px);
  transform: translate3d(var(--mx,-300px), var(--my,-300px), 0);
  transition: opacity .3s var(--ease);
  will-change: transform;
  mix-blend-mode: screen;
}
@media (hover: none) { .cursor-glow { display: none; } }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--grad-aurora); z-index: 100;
  box-shadow: 0 0 12px rgba(59,130,246,.55);
  transition: width .08s linear;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px var(--gutter);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: linear-gradient(180deg, rgba(8,8,13,.65), rgba(8,8,13,.25));
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease), padding .3s var(--ease);
}
.site-header.is-scrolled {
  background: linear-gradient(180deg, rgba(8,8,13,.85), rgba(8,8,13,.55));
  border-bottom-color: var(--border);
  padding-top: 12px; padding-bottom: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--f-display); font-weight: 600; letter-spacing: -.01em;
}
.brand-mark {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: 10px; font-size: 13px; font-weight: 700;
  background: var(--grad-aurora); color: #0a0a0f;
  box-shadow: 0 8px 30px rgba(59,130,246,.35);
}
.brand-text { font-size: 16px; }
.brand-text span { color: var(--blue-bright); }

.nav { position: relative; }
.nav-list {
  display: flex; align-items: center; gap: 4px;
  padding: 6px; border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
}
.nav-link {
  position: relative; display: inline-block;
  padding: 9px 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--text-dim);
  transition: color .25s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link.is-active { color: #fff; }
.nav-indicator {
  position: absolute; top: 6px; height: calc(100% - 12px);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(59,130,246,.35), rgba(96,165,250,.25));
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 0 30px rgba(59,130,246,.35);
  transition: transform .45s var(--ease), width .45s var(--ease), opacity .25s var(--ease);
  pointer-events: none; opacity: 0; left: 0;
}

.cta-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(96,165,250,.14));
  border: 1px solid var(--border-strong);
  transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.cta-pill ion-icon { font-size: 14px; }
.cta-pill:hover { transform: translateY(-1px); background: linear-gradient(135deg, rgba(59,130,246,.3), rgba(96,165,250,.22)); box-shadow: 0 10px 30px rgba(59,130,246,.25); }

.menu-btn { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); position: relative; }
.menu-btn span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s var(--ease); }
.menu-btn span:nth-child(1) { top: 13px; }
.menu-btn span:nth-child(2) { top: 19px; }
.menu-btn span:nth-child(3) { top: 25px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 14px;
  font-family: var(--f-body); font-size: 14.5px; font-weight: 600; letter-spacing: -.005em;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
  position: relative; isolation: isolate;
}
.btn ion-icon { font-size: 17px; }
.btn--primary {
  color: #08080d;
  background: linear-gradient(135deg, #fff 0%, #c7c8ff 100%);
  box-shadow: 0 12px 40px rgba(255,255,255,.1), inset 0 0 0 1px rgba(255,255,255,.4);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 50px rgba(199,200,255,.3), inset 0 0 0 1px rgba(255,255,255,.5); }
.btn--ghost {
  color: var(--text);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover { background: rgba(255,255,255,.08); transform: translateY(-2px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---------- Section primitives ---------- */
main { padding-top: 88px; }
.section {
  max-width: var(--container); margin: 0 auto;
  padding: clamp(80px, 12vw, 140px) var(--gutter);
}
.section-head { max-width: 780px; margin-bottom: 64px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-mute);
}
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 12px var(--blue); }
.section-title {
  font-family: var(--f-display); font-weight: 600; letter-spacing: -.02em;
  font-size: clamp(28px, 4.4vw, 52px); line-height: 1.08;
  margin: 18px 0 18px; color: #fff;
}
.section-lead {
  font-size: clamp(15px, 1.4vw, 17.5px); color: var(--text-dim); max-width: 60ch;
}

.resume-download-group {
  display: inline-flex; flex-wrap: wrap; gap: 10px; margin-top: 18px;
}
.resume-download-group .resume-download { margin-top: 0; }
.resume-download {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em;
  color: var(--text);
  padding: 9px 16px; border-radius: 999px;
  background: rgba(59, 130, 246, .08);
  border: 1px solid rgba(59, 130, 246, .28);
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.resume-download:hover {
  background: rgba(59, 130, 246, .16);
  border-color: rgba(59, 130, 246, .45);
  transform: translateY(-1px);
}
.resume-download ion-icon { font-size: 15px; color: var(--blue-bright); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - 88px);
  display: flex; align-items: center;
  max-width: var(--container); margin: 0 auto;
  padding: clamp(40px, 8vw, 80px) var(--gutter) clamp(80px, 12vw, 140px);
}
.hero-inner {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(40px, 6vw, 80px);
  align-items: center; width: 100%;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(96,165,250,.08); border: 1px solid rgba(96,165,250,.2);
  color: #b8f0fa; font-family: var(--f-mono); font-size: 12px;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #60a5fa; box-shadow: 0 0 0 0 rgba(96,165,250,.6); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(96,165,250,.6); }
  70% { box-shadow: 0 0 0 12px rgba(96,165,250,0); }
  100% { box-shadow: 0 0 0 0 rgba(96,165,250,0); }
}

.hero-title {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(40px, 7.5vw, 92px); line-height: 1; letter-spacing: -.035em;
  margin: 22px 0 24px;
}
.hero-label { display: block; font-size: clamp(14px, 1.6vw, 18px); font-weight: 400; color: var(--text-mute); letter-spacing: -.005em; font-family: var(--f-body); margin-bottom: 10px; }
.hero-gradient {
  display: block;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  background-size: 200% 100%;
  animation: shimmer 8s linear infinite;
}
.hero-gradient-soft {
  display: block; color: var(--text-dim); font-weight: 400;
  font-size: clamp(18px, 2.2vw, 28px); line-height: 1.25;
  margin-top: 18px; letter-spacing: -.015em;
  max-width: 32ch;
}
@keyframes shimmer { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }

.hero-sub { color: var(--text-dim); font-size: clamp(15px, 1.4vw, 17px); max-width: 56ch; margin-bottom: 32px; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 36px; }

.hero-socials { display: flex; gap: 12px; }
.hero-socials a {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 12px; background: rgba(255,255,255,.04);
  border: 1px solid var(--border); color: var(--text-dim); font-size: 19px;
  transition: all .25s var(--ease);
}
.hero-socials a:hover {
  color: #fff; transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(59,130,246,.2), rgba(96,165,250,.15));
  border-color: rgba(59,130,246,.4);
  box-shadow: 0 10px 30px rgba(59,130,246,.25);
}

/* Avatar stage */
.hero-right { display: flex; justify-content: center; }
.avatar-stage {
  position: relative; width: clamp(280px, 32vw, 420px); aspect-ratio: 1;
  display: grid; place-items: center;
  transform-style: preserve-3d; transition: transform .4s var(--ease);
}
.avatar-frame {
  position: relative; z-index: 3;
  width: 78%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 30px 80px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.05), var(--shadow-glow);
}
.avatar-frame img { width: 100%; height: 100%; object-fit: cover; }
.avatar-glow {
  position: absolute; inset: 10%; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.28), transparent 65%);
  filter: blur(40px); z-index: 1;
}
.avatar-rings { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.12);
  animation: spin 30s linear infinite;
}
.ring-2 { inset: 6%; border-style: solid; border-color: rgba(96,165,250,.18); animation-duration: 45s; animation-direction: reverse; }
.ring-3 { inset: -6%; border-color: rgba(30,58,138,.16); animation-duration: 60s; }
@keyframes spin { to { transform: rotate(360deg); } }

.avatar-chip {
  position: absolute; z-index: 4; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px;
  background: rgba(15,15,25,.85); backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  font-family: var(--f-mono); font-size: 12px; color: var(--text);
  box-shadow: var(--shadow-md);
  animation: floaty 6s ease-in-out infinite;
}
.avatar-chip ion-icon { color: var(--blue-bright); font-size: 14px; }
.avatar-chip--top { top: 8%; right: -4%; }
.avatar-chip--bottom { bottom: 10%; left: -6%; animation-delay: -3s; }
@keyframes floaty { 50% { transform: translateY(-8px); } }

.scroll-cue {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--text-mute); font-family: var(--f-mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
}
.scroll-line {
  width: 1px; height: 44px; background: linear-gradient(to bottom, transparent, var(--text-mute), transparent);
  position: relative; overflow: hidden;
}
.scroll-line::after { content: ""; position: absolute; top: -50%; left: 0; width: 100%; height: 50%; background: linear-gradient(to bottom, transparent, #fff); animation: scrollDot 2s var(--ease) infinite; }
@keyframes scrollDot { to { top: 100%; } }

/* ---------- ABOUT — bento ---------- */
.bento {
  display: grid; gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}
.bento-card {
  position: relative;
  padding: clamp(22px, 2.4vw, 32px);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px) saturate(140%);
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease);
}
.bento-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(600px circle at var(--sx,50%) var(--sy,50%), rgba(59,130,246,.12), transparent 40%);
  opacity: 0; transition: opacity .3s var(--ease);
}
.bento-card:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--surface-2); }
.bento-card:hover::before { opacity: 1; }
.bento-card--lg { grid-column: span 2; grid-row: span 2; }

.bento-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.bento-head h3 { font-family: var(--f-display); font-size: 19px; font-weight: 600; color: #fff; letter-spacing: -.01em; }
.bento-icon {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(59,130,246,.25), rgba(96,165,250,.15));
  border: 1px solid var(--border-strong); color: #fff;
}
.bento-icon ion-icon { font-size: 20px; }
.bento-body { color: var(--text-dim); margin-bottom: 18px; }

.work-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.work-list li { display: flex; gap: 14px; align-items: flex-start; }
.work-list h4 { font-family: var(--f-display); font-size: 15.5px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.work-list p { font-size: 13.5px; color: var(--text-dim); line-height: 1.55; }
.work-icon {
  flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--border);
}
.work-icon img { width: 22px; height: 22px; filter: brightness(0) invert(1) opacity(.85); }

.work-footnote {
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-mute); font-style: italic; line-height: 1.55;
}
.work-footnote::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue-bright); box-shadow: 0 0 8px var(--blue);
  margin-right: 10px; vertical-align: middle;
}

.kv-list { display: grid; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.kv-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13.5px; }
.kv-list span { color: var(--text-mute); font-family: var(--f-mono); font-size: 12px; }
.kv-list b { color: var(--text); font-weight: 500; }

.stat-list { display: grid; gap: 14px; }
.stat-list li {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px; border-radius: 14px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
}
.stat-list b { font-family: var(--f-display); font-size: 26px; font-weight: 600;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-list span { color: var(--text-mute); font-size: 12.5px; font-family: var(--f-mono); }

/* Live CF badge — same card surface as siblings, link fills the li */
li.stat-cf {
  padding: 0; /* link provides padding so we don't double-stack a card */
  transition: transform .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
li.stat-cf:hover {
  transform: translateY(-2px); border-color: var(--border-strong);
  background: rgba(255,255,255,.05);
}
.stat-cf-link {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px; border-radius: inherit;
}
.stat-cf b {
  font-family: var(--f-display); font-size: 26px; font-weight: 600;
  /* Override the gradient text-clip so we can color by rank */
  background: none !important;
  -webkit-background-clip: initial !important; background-clip: initial !important;
  -webkit-text-fill-color: currentColor !important;
  color: var(--cf-color, #fff);
  text-shadow: 0 0 24px color-mix(in srgb, var(--cf-color, transparent) 35%, transparent);
  transition: color .4s var(--ease), text-shadow .4s var(--ease);
}
.stat-cf[data-state="loading"] b { opacity: .5; }
.stat-cf[data-state="error"] b,
.stat-cf[data-state="unrated"] b { color: var(--text-dim); text-shadow: none; }

/* Marquee */
.marquee {
  margin-top: 56px; padding: 22px 0; border-radius: var(--r-lg);
  border: 1px solid var(--border); background: rgba(255,255,255,.025);
  overflow: hidden; position: relative;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; gap: 18px; width: max-content; animation: scroll-x 30s linear infinite; }
.marquee-row { display: flex; gap: 18px; padding-right: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: 999px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  font-family: var(--f-mono); font-size: 13px; color: var(--text-dim); white-space: nowrap;
}
.chip img { width: 18px; height: 18px; filter: brightness(0) invert(1) opacity(.85); }
.chip ion-icon { font-size: 16px; color: var(--blue-bright); }
@keyframes scroll-x { to { transform: translateX(-50%); } }
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---------- PROJECTS ---------- */
.filter-list {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px;
  padding: 6px; border-radius: 999px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); width: max-content; max-width: 100%;
}
.filter-btn {
  padding: 9px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  color: var(--text-dim); transition: all .25s var(--ease);
}
.filter-btn:hover { color: var(--text); }
.filter-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(59,130,246,.3), rgba(96,165,250,.2));
  box-shadow: 0 8px 24px rgba(59,130,246,.25), inset 0 0 0 1px rgba(255,255,255,.1);
}

.project-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
.project-card {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform .45s var(--ease), border-color .35s var(--ease), opacity .3s var(--ease);
}
.project-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  background: radial-gradient(420px circle at var(--sx,50%) var(--sy,50%), rgba(59,130,246,.18), transparent 45%);
  opacity: 0; transition: opacity .35s var(--ease);
}
.project-card:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.project-card:hover::before { opacity: 1; }
.project-card a { display: block; }
.project-media {
  position: relative; aspect-ratio: 16 / 11; overflow: hidden; background: #111;
}
.project-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease), filter .4s var(--ease);
  filter: saturate(.92) brightness(.9);
}
.project-card:hover .project-media img { transform: scale(1.06); filter: saturate(1.05) brightness(1); }
.project-action {
  position: absolute; top: 14px; right: 14px;
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; background: rgba(10,10,15,.7); backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong); color: #fff; font-size: 17px;
  transform: translateY(-6px); opacity: 0; transition: all .35s var(--ease);
}
.project-card:hover .project-action { transform: translateY(0); opacity: 1; }
.project-body { padding: 20px 22px 24px; position: relative; z-index: 1; }
.project-meta-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.project-tag {
  display: inline-block; font-family: var(--f-mono); font-size: 11px;
  color: var(--blue-bright); letter-spacing: .12em; text-transform: uppercase;
}
.project-metric {
  display: inline-flex; align-items: center;
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .04em;
  color: rgba(226, 232, 240, .82);
  padding: 3px 8px; border-radius: 999px;
  background: rgba(59, 130, 246, .08);
  border: 1px solid rgba(59, 130, 246, .22);
  white-space: nowrap;
}
.project-body h3 { font-family: var(--f-display); font-size: 18px; font-weight: 600; color: #fff; letter-spacing: -.01em; margin-bottom: 6px; }
.project-body p { font-size: 13.5px; color: var(--text-dim); }

.project-card.is-hidden { display: none; }

/* ---------- RESUME ---------- */
.resume-shell {
  padding: clamp(22px, 2.4vw, 32px);
  border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(14px);
  margin-bottom: 24px;
}
.resume-col-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.resume-col-head h3 { font-family: var(--f-display); font-size: 19px; font-weight: 600; color: #fff; }

.resume-tabs {
  position: relative; display: inline-flex; gap: 4px;
  padding: 6px; border-radius: 999px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  margin-bottom: 28px;
}
.resume-tab {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--text-dim);
  transition: color .25s var(--ease);
}
.resume-tab ion-icon { font-size: 16px; }
.resume-tab:hover { color: var(--text); }
.resume-tab.is-active { color: #fff; }
.resume-tab-indicator {
  position: absolute; top: 6px; left: 6px; height: calc(100% - 12px);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(59,130,246,.35), rgba(96,165,250,.25));
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 0 30px rgba(59,130,246,.3);
  transition: transform .45s var(--ease), width .45s var(--ease);
  pointer-events: none;
}

.resume-panels { position: relative; }
.resume-panel {
  display: none;
  animation: panel-in .5s var(--ease-out) both;
}
.resume-panel.is-active { display: block; }
.resume-col-title { display: none; }

@media (min-width: 1024px) {
  .resume-tabs { display: none; }
  .resume-panels {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: clamp(28px, 3vw, 44px);
  }
  .resume-panel,
  .resume-panel.is-active { display: block; animation: none; }
  .resume-col-title {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--f-display); font-size: 17px; font-weight: 600;
    color: #fff; margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }
  .resume-col-title ion-icon { font-size: 18px; color: var(--blue-bright); }
  .resume-panels .tline { padding-left: 108px; }
  .resume-panels .tline::before { left: 88px; }
  .resume-panels .tline-year { left: -108px; width: 80px; font-size: 11px; line-height: 1.35; }
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Vertical timeline (Phase 2 upgrade) */
.tline { display: grid; gap: 22px; position: relative; padding-left: 130px; }
.tline::before {
  content: ""; position: absolute; left: 110px; top: 14px; bottom: 14px; width: 1px;
  background: linear-gradient(to bottom, var(--blue), rgba(59,130,246,0));
  opacity: .5;
}
.tline li { position: relative; }
.tline li::before {
  content: ""; position: absolute; left: -25px; top: 22px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--bg);
  border: 2px solid var(--blue); box-shadow: 0 0 12px var(--blue);
}
.tline-year {
  position: absolute; left: -130px; top: 18px; width: 96px; text-align: right;
  font-family: var(--f-mono); font-size: 11.5px; color: var(--blue-bright);
  letter-spacing: .06em; text-transform: uppercase;
}
.tline-card {
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border);
  transition: transform .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.tline-card:hover { transform: translateX(4px); border-color: var(--border-strong); background: rgba(255,255,255,.04); }
.tline-card h4 { font-family: var(--f-display); font-size: 16px; font-weight: 600; color: #fff; letter-spacing: -.01em; }
.tline-badge {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase;
  color: #f5c05a; background: rgba(245,192,90,.10); border: 1px solid rgba(245,192,90,.28);
  vertical-align: middle;
}
.tline-org { display: block; font-family: var(--f-mono); font-size: 12px; color: var(--text-mute); margin: 4px 0 10px; }
.tline-card p { font-size: 14px; color: var(--text-dim); }
.tline-card p b { color: var(--text); font-weight: 600; }
.tline-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tline-tags span {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 11px; color: var(--text-dim);
  background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.18);
}

/* Skills (Phase 2 — grouped tag cloud) */
.skills-block {
  padding: clamp(22px, 2.4vw, 32px); border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(14px);
}
.skill-groups { display: grid; gap: 18px; }
.skill-group {
  display: grid; grid-template-columns: 160px 1fr; gap: 22px; align-items: baseline;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.skill-group:last-child { border-bottom: 0; padding-bottom: 0; }
.skill-group-label {
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-mute); font-weight: 500;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tags li {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; color: var(--text);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.skill-tags li:hover {
  transform: translateY(-1px); border-color: var(--border-strong);
  background: rgba(255,255,255,.07);
}

.learning-strip {
  margin-top: 22px; padding-top: 18px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border-top: 1px dashed var(--border);
}
.learning-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-mute);
}
.learning-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue-bright);
  box-shadow: 0 0 0 0 rgba(96,165,250,.5);
  animation: pulse 2s infinite;
}
.skill-tags--accent li {
  color: #dbeafe;
  background: rgba(59,130,246,.1);
  border-color: rgba(59,130,246,.25);
}
.skill-tags--accent li:hover {
  background: rgba(59,130,246,.16);
  border-color: rgba(59,130,246,.4);
}

/* ---------- REPORTS (Phase 2) ---------- */
.report-feature {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 0;
  border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--border);
  overflow: hidden; margin-bottom: 22px;
  position: relative; isolation: isolate;
  transition: transform .35s var(--ease), border-color .35s var(--ease);
}
.report-feature::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
  background: radial-gradient(700px circle at var(--sx,50%) var(--sy,50%), rgba(59,130,246,.16), transparent 45%);
  opacity: 0; transition: opacity .35s var(--ease);
}
.report-feature:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.report-feature:hover::before { opacity: 1; }
.report-feature-media { position: relative; min-height: 340px; overflow: hidden; }
.report-feature-media img {
  width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0;
  transition: transform .8s var(--ease), filter .4s var(--ease);
  filter: saturate(.9) brightness(.85);
}
.report-feature:hover .report-feature-media img { transform: scale(1.05); filter: saturate(1.05) brightness(1); }
.report-feature-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 40%, rgba(8,8,13,.85));
}
.report-feature-badge {
  position: absolute; top: 18px; left: 18px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(255,255,255,.95); color: #08080d; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.report-feature-body { padding: clamp(28px, 4vw, 44px); position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.report-feature-body h3 { font-family: var(--f-display); font-size: clamp(22px, 2.6vw, 30px); font-weight: 600; color: #fff; letter-spacing: -.015em; line-height: 1.15; margin: 6px 0 12px; }
.report-feature-body p { color: var(--text-dim); font-size: 15px; margin-bottom: 18px; }

.report-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px;
}
.report-tile {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .35s var(--ease), border-color .35s var(--ease);
}
.report-tile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
  background: radial-gradient(500px circle at var(--sx,50%) var(--sy,50%), rgba(59,130,246,.14), transparent 45%);
  opacity: 0; transition: opacity .3s var(--ease);
}
.report-tile:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.report-tile:hover::before { opacity: 1; }
.report-tile a { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: center; padding: 16px; position: relative; z-index: 2; }
.report-tile figure { width: 180px; aspect-ratio: 4/3; border-radius: 14px; overflow: hidden; background: #111; }
.report-tile figure img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); filter: saturate(.92) brightness(.9); }
.report-tile:hover figure img { transform: scale(1.06); filter: saturate(1.05) brightness(1); }
.report-tile-body { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.report-tile h3 { font-family: var(--f-display); font-size: 17px; font-weight: 600; color: #fff; letter-spacing: -.01em; margin: 6px 0; }
.report-tile p { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }

.report-meta { display: flex; align-items: center; gap: 10px; font-family: var(--f-mono); font-size: 11px; color: var(--text-mute); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.report-meta i { width: 4px; height: 4px; border-radius: 50%; background: var(--text-mute); }
.report-meta span { color: var(--blue-bright); }

.report-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--blue-bright); font-weight: 500; }
.report-link ion-icon { transition: transform .3s var(--ease); }
.report-tile:hover .report-link ion-icon,
.report-feature:hover .report-link ion-icon { transform: translateX(5px); }
.report-link--lg { font-size: 14.5px; align-self: flex-start; padding: 12px 18px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(96,165,250,.12));
  border: 1px solid var(--border-strong); margin-top: 4px;
}
.report-link--lg:hover { background: linear-gradient(135deg, rgba(59,130,246,.28), rgba(96,165,250,.18)); }

/* ---------- CONTACT (Phase 2) ---------- */
.contact-shell {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 0;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--surface); backdrop-filter: blur(16px);
  overflow: hidden;
}
.contact-panel {
  position: relative; padding: clamp(28px, 4vw, 44px);
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.contact-panel-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(59,130,246,.35), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(96,165,250,.25), transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(30,58,138,.15), transparent 70%);
  filter: blur(40px);
  animation: drift 30s ease-in-out infinite;
  opacity: .9;
}
.contact-panel-inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 22px; height: 100%; }
.contact-headline {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(26px, 3vw, 36px); line-height: 1.15; letter-spacing: -.02em;
  color: #fff; margin-top: 6px;
}
.contact-headline em {
  font-style: normal;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.contact-sub { color: var(--text-dim); font-size: 15px; max-width: 38ch; }

.contact-list { display: grid; gap: 16px; margin-top: 4px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-ic {
  flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59,130,246,.25), rgba(96,165,250,.15));
  border: 1px solid var(--border-strong); color: #fff; font-size: 19px;
}
.contact-list span { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--text-mute); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; }
.contact-list a, .contact-list p { color: var(--text); font-size: 14.5px; }
.contact-list a { transition: color .2s var(--ease); }
.contact-list a:hover { color: var(--blue-bright); }

.panel-socials { display: flex; gap: 10px; margin-top: auto; }
.panel-socials a {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border-strong);
  color: var(--text); font-size: 17px;
  transition: transform .25s var(--ease), background .25s var(--ease);
}
.panel-socials a:hover { transform: translateY(-2px); background: rgba(255,255,255,.12); color: #fff; }

/* Form */
.contact-form {
  padding: clamp(28px, 4vw, 44px);
  display: grid; gap: 18px; align-content: start;
}
.floating { position: relative; }
.floating input, .floating textarea {
  width: 100%;
  padding: 22px 16px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  color: var(--text); font-size: 14.5px;
  transition: border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
  resize: vertical; outline: none;
}
.floating textarea { padding-top: 26px; min-height: 130px; }
.floating label {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--text-mute); pointer-events: none;
  transition: transform .25s var(--ease), font-size .25s var(--ease), color .25s var(--ease);
}
.floating textarea ~ label { top: 22px; transform: none; }
.floating input:focus, .floating textarea:focus {
  border-color: rgba(59,130,246,.5); background: rgba(255,255,255,.05);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.floating input:not(:placeholder-shown) ~ label,
.floating textarea:not(:placeholder-shown) ~ label,
.floating input:focus ~ label,
.floating textarea:focus ~ label {
  transform: translateY(0); top: 8px; font-size: 11px;
  font-family: var(--f-mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--blue-bright);
}
.floating textarea:not(:placeholder-shown) ~ label,
.floating textarea:focus ~ label { top: 8px; }

.form-submit { justify-self: start; margin-top: 6px; }

.form-success {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: 12px;
  background: rgba(102,242,194,.08); border: 1px solid rgba(102,242,194,.25);
  color: #b7f4d8;
  animation: success-in .5s var(--ease-out) both;
}
@keyframes success-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.success-tick {
  flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(102,242,194,.2); color: #6df1be; font-size: 20px;
  animation: tick-pop .5s var(--ease-out) both .1s;
}
@keyframes tick-pop { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); } }
.form-success b { display: block; font-size: 14px; color: #d6fbe9; }
.form-success span { font-size: 12.5px; color: #a7ddc4; font-family: var(--f-mono); }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  display: grid; place-items: center; width: 46px; height: 46px;
  border-radius: 14px;
  background: rgba(15,15,25,.85); backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong); color: var(--text);
  box-shadow: var(--shadow-md);
  transform: translateY(20px) scale(.9); opacity: 0; pointer-events: none;
  transition: all .35s var(--ease);
}
.to-top.is-visible { transform: none; opacity: 1; pointer-events: auto; }
.to-top:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, rgba(59,130,246,.25), rgba(96,165,250,.18));
  border-color: rgba(59,130,246,.4);
  box-shadow: 0 16px 40px rgba(59,130,246,.3);
}
.to-top ion-icon { font-size: 20px; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative; margin-top: 80px;
  padding: clamp(56px, 8vw, 96px) var(--gutter) 32px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.015));
}

.footer-grid {
  max-width: var(--container); margin: 0 auto;
  display: grid; gap: clamp(32px, 5vw, 64px);
  grid-template-columns: 1.1fr 1.6fr;
  align-items: start;
}
.footer-brand-col { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.footer-tagline { color: var(--text-dim); font-size: 14px; max-width: 30ch; }

.footer-socials { display: flex; gap: 10px; margin-top: 4px; }
.footer-socials a {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 17px;
  transition: all .25s var(--ease);
}
.footer-socials a:hover {
  color: #fff; transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(96,165,250,.12));
  border-color: rgba(59,130,246,.35);
}

.footer-meta {
  display: grid; gap: 22px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.footer-meta-item dt {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-mute); margin-bottom: 8px;
}
.footer-meta-item dd {
  font-size: 14px; color: var(--text); line-height: 1.5;
}
.footer-source {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--blue-bright); font-family: var(--f-mono); font-size: 13px;
  transition: color .2s var(--ease);
}
.footer-source ion-icon { font-size: 14px; transition: transform .25s var(--ease); }
.footer-source:hover { color: #fff; }
.footer-source:hover ion-icon { transform: translateX(3px); }

.footer-bottom {
  max-width: var(--container); margin: 56px auto 0; padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  color: var(--text-mute); font-size: 13px; font-family: var(--f-mono);
}
.footer-fineprint a { color: var(--text-mute); transition: color .2s var(--ease); border-bottom: 1px solid transparent; }
.footer-fineprint a:hover { color: var(--text); }

/* ---------- Reveal animations ---------- */
/* No-FOUC pattern: hide only when JS is ready. Without JS, content stays visible. */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.js .reveal.in-view { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-right { order: -1; margin-bottom: 20px; }
  .avatar-stage { width: 260px; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-card--lg { grid-column: span 2; grid-row: auto; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .work-list { grid-template-columns: 1fr; }
  .report-feature { grid-template-columns: 1fr; }
  .report-feature-media { min-height: 240px; }
  .report-grid { grid-template-columns: 1fr; }
  .contact-shell { grid-template-columns: 1fr; }
  .contact-panel { border-right: 0; border-bottom: 1px solid var(--border); }
  .tline { padding-left: 110px; }
  .tline::before { left: 90px; }
  .tline-year { left: -110px; width: 80px; }
}

@media (max-width: 760px) {
  main { padding-top: 76px; }
  .nav { position: fixed; top: 68px; right: var(--gutter); left: var(--gutter);
    transform: translateY(-10px) scale(.98); opacity: 0; pointer-events: none;
    transition: all .3s var(--ease);
  }
  .nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-list { flex-direction: column; padding: 14px; border-radius: 18px; background: rgba(15,15,25,.92); backdrop-filter: blur(20px); }
  .nav-link { width: 100%; padding: 12px 16px; }
  .nav-indicator { display: none; }
  .menu-btn { display: block; }
  .cta-pill--sm { display: none; }
  .hero { min-height: auto; padding-top: 24px; padding-bottom: 80px; }
  .hero-title { font-size: clamp(36px, 11vw, 60px); }
  .avatar-stage { width: 220px; }
  .avatar-chip { font-size: 11px; padding: 8px 12px; }
  .bento { grid-template-columns: 1fr; }
  .bento-card--lg { grid-column: auto; }
  .project-grid { grid-template-columns: 1fr; }
  .report-tile a { grid-template-columns: 1fr; }
  .report-tile figure { width: 100%; aspect-ratio: 16/9; }
  .scroll-cue { display: none; }
  .filter-list { padding: 4px; }
  .filter-btn { padding: 8px 12px; font-size: 12.5px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-meta { grid-template-columns: 1fr; gap: 18px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .skill-group { grid-template-columns: 1fr; gap: 10px; }
  .resume-tab span { display: none; }
  .resume-tab { padding: 9px 14px; }
  .tline { padding-left: 22px; }
  .tline::before { left: 5px; }
  .tline li::before { left: -22px; }
  .tline-year { position: static; width: auto; text-align: left; margin-bottom: 4px; }
  .to-top { right: 16px; bottom: 16px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .aurora, .ring, .marquee-track { animation: none !important; }
  .cursor-glow { display: none; }
}

/* ============================================================
   Project preview popover (anchored, Linear/Raycast style)
   ============================================================ */
.preview-pop {
  /* Reset UA dialog/popover defaults */
  position: fixed; margin: 0; padding: 22px 22px 20px;
  border: 0; background: transparent; color: var(--text);
  width: 380px; max-width: calc(100vw - 32px);

  /* Glass surface */
  background: linear-gradient(165deg, rgba(22, 26, 40, .82), rgba(12, 14, 22, .92));
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 18px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, .45),
    0 2px 8px rgba(0, 0, 0, .35),
    0 0 0 1px rgba(59, 130, 246, .06) inset,
    0 0 80px rgba(59, 130, 246, .08);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  overflow: visible;

  /* Animation state — exit (and idle) */
  opacity: 0;
  transform: scale(.92) translateY(-6px);
  transform-origin: 50% 0%;
  transition:
    opacity .18s ease,
    transform .26s cubic-bezier(.16, 1, .3, 1),
    overlay .26s ease allow-discrete,
    display .26s ease allow-discrete;
  pointer-events: none;
}
.preview-pop:popover-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
@starting-style {
  .preview-pop:popover-open {
    opacity: 0;
    transform: scale(.92) translateY(-6px);
  }
}
.preview-pop::backdrop { background: transparent; }

/* Glow halo following blue brand */
.preview-pop::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: radial-gradient(140% 90% at 100% 0%, rgba(59, 130, 246, .12), transparent 50%);
}

/* Little arrow that points back at the anchor card */
.preview-arrow {
  position: absolute;
  width: 12px; height: 12px;
  background: linear-gradient(135deg, rgba(22, 26, 40, .9), rgba(22, 26, 40, .9));
  border: 1px solid rgba(255, 255, 255, .09);
  transform: rotate(45deg);
  pointer-events: none;
  /* Default position when popover sits below the anchor */
  top: -7px; left: 50%; margin-left: -6px;
  border-right: 0; border-bottom: 0;
  border-top-left-radius: 3px;
}
/* Above the anchor: arrow points down from the bottom of the popover */
.preview-pop[data-placement="top"] .preview-arrow {
  top: auto; bottom: -7px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-left: 0; border-top: 0;
  border-bottom-right-radius: 3px;
  border-top-left-radius: 0;
}

.preview-pop[data-placement="top"] { transform-origin: 50% 100%; }
.preview-pop[data-placement="bottom"] { transform-origin: 50% 0%; }

.preview-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
  position: relative;
}

.preview-tag {
  display: inline-block; padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, .1); border: 1px solid rgba(59, 130, 246, .22);
  color: var(--blue-bright); font-family: var(--f-mono); font-size: 10.5px;
  font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
}

.preview-close {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--border);
  color: var(--text-mute); cursor: pointer; flex-shrink: 0;
  transition: background .18s ease, color .18s ease, transform .25s cubic-bezier(.16,1,.3,1), border-color .18s ease;
}
.preview-close:hover {
  background: rgba(255, 255, 255, .08); color: #fff;
  border-color: var(--border-strong); transform: rotate(90deg);
}
.preview-close ion-icon { font-size: 15px; }

.preview-title {
  font-family: var(--f-display); font-size: 19px; font-weight: 600;
  letter-spacing: -.01em; line-height: 1.25; color: #fff;
  margin-bottom: 10px;
  position: relative;
}
.preview-summary {
  font-size: 13.5px; line-height: 1.6; color: var(--text-dim);
  margin-bottom: 18px;
  position: relative;
}

.preview-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  position: relative;
}
.preview-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 500; letter-spacing: -.005em;
  flex: 1; min-width: 0;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, color .18s ease, box-shadow .18s ease;
  cursor: pointer;
}
.preview-btn ion-icon { font-size: 14px; flex-shrink: 0; }
.preview-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-btn--primary {
  background: var(--blue); color: #fff;
  border: 1px solid var(--blue);
  box-shadow: 0 4px 14px rgba(59, 130, 246, .35);
}
.preview-btn--primary:hover {
  background: var(--blue-bright); border-color: var(--blue-bright);
  transform: translateY(-1px); box-shadow: 0 6px 20px rgba(96, 165, 250, .45);
}
.preview-btn--ghost {
  background: rgba(255, 255, 255, .04); color: var(--text);
  border: 1px solid var(--border);
}
.preview-btn--ghost:hover {
  background: rgba(255, 255, 255, .09); border-color: var(--border-strong);
  color: #fff; transform: translateY(-1px);
}
.preview-btn:focus-visible {
  outline: 2px solid rgba(59, 130, 246, .7); outline-offset: 2px;
}

@media (max-width: 520px) {
  .preview-pop { width: calc(100vw - 24px); padding: 20px 18px 18px; border-radius: 16px; }
  .preview-title { font-size: 17px; }
  .preview-actions { flex-direction: column; }
  .preview-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .preview-pop { transition: opacity .1s ease; transform: none !important; }
  @starting-style { .preview-pop:popover-open { transform: none; opacity: 0; } }
}

/* ============================================================
   Smooth scroll-restore on back-nav from writeup pages
   The inline <head> script sets .restoring-scroll on <html> if
   sessionStorage has a pending scroll position. We hide the body
   instantly (no transition on entry), restore scroll in JS, then
   fade the body back in by removing the class.
   ============================================================ */
.restoring-scroll body {
  opacity: 0;
  pointer-events: none;
}
.restoring-scroll .reveal {
  /* Force-reveal so the page has its real final height during scroll restore */
  opacity: 1 !important;
  transform: none !important;
}
body {
  transition: opacity .26s cubic-bezier(.16, 1, .3, 1);
}
@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
}
