/* ============================================================
   Rohit Raj — portfolio
   Premium static site. Dark-mode-first. Zero deps.
   ============================================================ */

:root {
  --bg:           #07070a;
  --bg-2:         #0b0b10;
  --surface:      rgba(255, 255, 255, 0.035);
  --surface-2:    rgba(255, 255, 255, 0.06);
  --border:       rgba(255, 255, 255, 0.08);
  --border-2:     rgba(255, 255, 255, 0.14);

  --fg:           #f5f5f7;
  --fg-soft:      #d4d4d8;
  --muted:        #8a8a93;
  --muted-2:      #6b6b75;

  --accent:       #a78bfa;
  --accent-2:     #f472b6;
  --accent-3:     #60a5fa;

  --grad:         linear-gradient(120deg, #a78bfa 0%, #f0abfc 35%, #fb7185 70%, #fbbf24 100%);
  --grad-2:       linear-gradient(120deg, #60a5fa 0%, #a78bfa 50%, #f472b6 100%);

  --radius-sm:    10px;
  --radius:       16px;
  --radius-lg:    22px;

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

  --container:    1140px;
  --pad-x:        clamp(20px, 4vw, 40px);

  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:    ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
*::selection { background: rgba(167, 139, 250, .32); color: #fff; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
html, body {
  /* Belt-and-braces: iOS Safari sometimes lets horizontal panning happen
     even with overflow-x:hidden on body alone. overflow-x:clip is the
     modern fix; we keep hidden as a fallback for older WebKit. */
  overflow-x: hidden;
  overflow-x: clip;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 100vw;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute; top: -100px; left: 16px;
  background: var(--fg); color: var(--bg);
  padding: 10px 14px; border-radius: 10px;
  font-weight: 600; font-size: 14px;
  z-index: 1000; transition: top .2s var(--ease);
}
.skip-link:focus { top: 16px; outline: 2px solid var(--accent); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

/* =====================================================
   Background — animated grid + blobs
   ===================================================== */
/* Subtle film grain for depth */
.grain {
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bg-grid {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
  z-index: -2;
  pointer-events: none;
  animation: grid-pan 60s linear infinite;
}
@keyframes grid-pan {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 640px 0, 0 640px; }
}

.bg-blobs {
  position: fixed; inset: 0;
  z-index: -3;
  pointer-events: none;
  overflow: hidden;
  /* Defensive: ensure the blob layer never participates in horizontal scroll. */
  width: 100vw;
  max-width: 100%;
}
.blob {
  position: absolute;
  width: 60vw; height: 60vw;
  max-width: 800px; max-height: 800px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .35;
  will-change: transform;
}
.blob-a { top: -20%; left: -10%; background: radial-gradient(circle, #6d28d9, transparent 60%); animation: float-a 18s ease-in-out infinite; }
.blob-b { top:  10%; right: -15%; background: radial-gradient(circle, #db2777, transparent 60%); animation: float-b 22s ease-in-out infinite; }
.blob-c { bottom: -25%; left: 20%; background: radial-gradient(circle, #2563eb, transparent 60%); animation: float-c 26s ease-in-out infinite; }

@keyframes float-a { 0%,100% { transform: translate(0,0); } 50% { transform: translate(60px, 40px); } }
@keyframes float-b { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-40px, 80px); } }
@keyframes float-c { 0%,100% { transform: translate(0,0); } 50% { transform: translate(80px, -60px); } }

/* =====================================================
   Cursor glow + scroll progress
   ===================================================== */
.cursor-glow {
  position: fixed;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167,139,250,.18), rgba(244,114,182,.08) 35%, transparent 65%);
  pointer-events: none;
  z-index: -1;
  transform: translate3d(-50%, -50%, 0);
  left: 50%; top: 30%;
  transition: opacity .3s var(--ease);
  mix-blend-mode: screen;
  will-change: transform;
}
@media (hover: none) { .cursor-glow { display: none; } }

.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0%;
  background: var(--grad);
  z-index: 100;
  transition: width .1s linear;
}

/* =====================================================
   Nav
   ===================================================== */
.nav {
  position: sticky; top: 0;
  z-index: 70;
  padding: 14px 0;
  transition: padding .3s var(--ease), background .3s var(--ease), backdrop-filter .3s var(--ease);
}
.nav.is-scrolled {
  padding: 8px 0;
  background: rgba(7, 7, 10, 0.6);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.brand:hover .brand-mark { background: var(--surface-2); border-color: var(--border-2); color: var(--accent); }
.brand-mark svg { display: block; }
.brand-name { font-size: 15px; }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-links a:hover { color: var(--fg); background: var(--surface); }
.nav-links a.is-active { color: var(--fg); }
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 3px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--grad);
}
.nav-links a:not(.nav-cta) { position: relative; }
.nav-links .nav-cta {
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-left: 8px;
}
.nav-links .nav-cta:hover { background: var(--surface-2); border-color: var(--border-2); }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  margin-left: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), transform .25s var(--ease);
}
.theme-toggle:hover {
  color: var(--fg);
  background: var(--surface-2);
  border-color: var(--border-2);
}
.theme-toggle:active { transform: scale(.92) rotate(-12deg); }
.theme-toggle.is-spinning svg { animation: theme-spin .9s var(--ease-out); }
@keyframes theme-spin {
  0%   { transform: rotate(0)   scale(1); }
  40%  { transform: rotate(220deg) scale(.85); }
  100% { transform: rotate(360deg) scale(1); }
}

@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* =====================================================
   Typography
   ===================================================== */
.display {
  font-size: clamp(36px, 6.8vw, 84px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 18px 0 22px;
  color: var(--fg);
  text-wrap: balance;
}
.h2 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 8px 0 12px;
  text-wrap: balance;
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section-sub {
  color: var(--muted);
  max-width: 56ch;
  font-size: 16px;
  margin-top: 14px;
}
.lead {
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--fg-soft);
  max-width: 56ch;
  margin: 0 0 32px;
}
.lead strong { color: var(--fg); font-weight: 600; }
.lead em { font-style: normal; color: var(--accent); }

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.grad-2 {
  background: var(--grad-2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.link {
  color: var(--fg-soft);
  border-bottom: 1px solid rgba(255,255,255,.18);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.link:hover { color: var(--accent); border-color: var(--accent); }

/* =====================================================
   Buttons & pills
   ===================================================== */
.pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 14px 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--fg-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.pill-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22d3a3;
  box-shadow: 0 0 0 4px rgba(34, 211, 163, .15);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(34, 211, 163, .15); }
  50%     { box-shadow: 0 0 0 6px rgba(34, 211, 163, .05); }
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 36px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px -10px rgba(245, 245, 247, .25);
}
.btn-ghost {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  transform: translateY(-1px);
}

/* =====================================================
   Hero
   ===================================================== */
.hero {
  position: relative;
  padding: clamp(56px, 10vh, 120px) 0 clamp(64px, 12vh, 140px);
  min-height: 92svh;
  display: flex;
  align-items: center;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.hero-content { max-width: 720px; }

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.hero-meta div { min-width: 0; }
.hero-meta dt {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  margin-bottom: 6px;
}
.hero-meta dd {
  margin: 0;
  font-size: 14px;
  color: var(--fg-soft);
}
@media (max-width: 520px) {
  .hero-meta { grid-template-columns: 1fr; gap: 12px; }
}

/* Portrait card — sized to the photo's native ratio (671×973 ≈ 0.69 ≈ 2/2.9)
   so the full image shows with zero cropping. Narrower than before so the
   composition still feels balanced next to the headline. */
.hero-portrait { perspective: 1600px; display: flex; justify-content: center; }
.portrait-frame {
  position: relative;
  width: min(300px, 88%);
  /* Match natural photo aspect ratio so nothing is cropped. */
  aspect-ratio: 671 / 973;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #14121c, #0c0b12);
  box-shadow:
    0 40px 100px -30px rgba(0,0,0,.75),
    0 0 0 1px rgba(255,255,255,.03) inset;
  transform: rotateY(-3deg) rotateX(1.5deg);
  transition: transform .9s var(--ease-out);
}
.hero-portrait:hover .portrait-frame { transform: rotateY(-1deg) rotateX(.5deg) translateY(-3px); }

.portrait-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}
.portrait-media img {
  width: 100%; height: 100%;
  /* Show the entire photo — no crop. Frame is already matched to ratio. */
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
  filter: saturate(1.05) contrast(1.04) brightness(1.03);
}
.portrait-scrim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(7,7,10,.18) 0%, transparent 22%, transparent 58%, rgba(7,7,10,.78) 100%);
  pointer-events: none;
}
/* .portrait-halo {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.4px;
  background:
    conic-gradient(from 130deg,
      rgba(167,139,250,.7), rgba(96,165,250,.5), rgba(244,114,182,.6),
      rgba(167,139,250,.7));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: .55;
  pointer-events: none;
  z-index: 2;
  animation: halo-rotate 16s linear infinite;
} */
@keyframes halo-rotate { to { transform: rotate(360deg); } }
.portrait-badge {
  position: absolute;
  left: 14px; bottom: 14px;
  z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px 7px 11px;
  background: rgba(10,10,11,.6);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg);
}
.badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22d3a3;
  box-shadow: 0 0 8px 0 #22d3a3;
  animation: pulse 2.4s var(--ease) infinite;
}

/* Legacy terminal card (kept for safety if referenced) */
.hero-card { perspective: 1500px; }
.card-window {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 24px 80px -28px rgba(0,0,0,.7),
    0 0 0 1px rgba(255,255,255,.02) inset;
  transform: rotateY(-4deg) rotateX(2deg);
  transition: transform .8s var(--ease-out);
}
.hero-card:hover .card-window { transform: rotateY(-2deg) rotateX(1deg); }
.window-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.2);
}
.window-bar span:not(.window-title) {
  width: 11px; height: 11px; border-radius: 50%;
}
.window-bar span:nth-child(1) { background: #ff5f57; }
.window-bar span:nth-child(2) { background: #febc2e; }
.window-bar span:nth-child(3) { background: #28c840; }
.window-title {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.window-body { padding: 20px 22px 24px; }
.term {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--fg-soft);
  white-space: pre-wrap;
}
.t-prompt { color: var(--accent); }
.t-out    { color: var(--fg); }
.t-cursor {
  color: var(--accent);
  animation: blink 1s steps(2) infinite;
  margin-left: 2px;
}
@keyframes blink { to { opacity: 0; } }

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 32px;
  border: 1.5px solid var(--border-2);
  border-radius: 12px;
  opacity: .6;
}
.scroll-hint span {
  position: absolute; top: 6px; left: 50%;
  width: 2px; height: 6px;
  background: var(--fg);
  border-radius: 1px;
  transform: translateX(-50%);
  animation: scroll-dot 1.8s var(--ease) infinite;
}
@keyframes scroll-dot {
  0% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, 12px); opacity: 0; }
}
@media (max-width: 900px) { .scroll-hint { display: none; } }

/* =====================================================
   Section base
   ===================================================== */
.section {
  padding: clamp(80px, 14vh, 140px) 0;
  position: relative;
}
.section-head { margin-bottom: clamp(40px, 6vh, 64px); max-width: 700px; }

/* =====================================================
   Glass cards (shared)
   ===================================================== */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.glass-card:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}
.card-title {
  margin: 0 0 14px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}
.dot-list { margin: 0; padding: 0; list-style: none; }
.dot-list li {
  position: relative; padding: 6px 0 6px 18px;
  color: var(--fg-soft); font-size: 15px;
}
.dot-list li::before {
  content: ""; position: absolute; left: 0; top: 14px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
}

.tag-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0; padding: 0; list-style: none;
}
.tag-row li {
  font-size: 13px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--fg-soft);
}

/* =====================================================
   About
   ===================================================== */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; }
}
.about-copy p {
  font-size: clamp(15.5px, 1.2vw, 18px);
  color: var(--fg-soft);
  margin: 0 0 18px;
  line-height: 1.7;
  max-width: 60ch;
}
.about-copy p strong { color: var(--fg); font-weight: 600; }
.about-side { display: grid; gap: 16px; }

/* =====================================================
   Skills grid
   ===================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 900px) { .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .skills-grid { grid-template-columns: 1fr; } }

.skill-card header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.skill-card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.skill-ico {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(167,139,250,.12);
  color: var(--accent);
  font-size: 13px;
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.chips li {
  font-size: 12.5px;
  padding: 5px 10px;
  border-radius: 7px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--fg-soft);
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.chips li:hover { color: var(--fg); border-color: var(--border-2); background: var(--surface-2); }

/* =====================================================
   Projects
   ===================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 820px) { .projects-grid { grid-template-columns: 1fr; } }

.project {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  overflow: hidden;
  transition: transform .4s var(--ease-out), border-color .4s var(--ease-out), background .4s var(--ease-out);
}
.project:hover {
  transform: translateY(-4px);
  border-color: var(--border-2);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
}
.project-glow {
  position: absolute;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167,139,250,.18), transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s var(--ease);
  left: var(--mx, 50%); top: var(--my, 50%);
  transform: translate(-50%, -50%);
  z-index: 0;
}
.project:hover .project-glow { opacity: 1; }

.project > *:not(.project-glow) { position: relative; z-index: 1; }

.project-top {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.project-lang { display: inline-flex; align-items: center; gap: 7px; }
.lang-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--c, var(--accent));
  box-shadow: 0 0 8px 0 var(--c, var(--accent));
}
.project-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.project-desc {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 18px;
}
.project-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 20px; padding: 0; list-style: none;
}
.project-tags li {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--fg-soft);
}
.project-links {
  display: flex; flex-wrap: wrap; gap: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.link-arrow {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13.5px;
  color: var(--fg);
  font-weight: 500;
  transition: color .2s var(--ease), gap .2s var(--ease);
}
.link-arrow:hover { color: var(--accent); gap: 8px; }
.link-arrow.muted { color: var(--muted); }
.link-arrow.muted:hover { color: var(--fg); }

.more-cta { display: flex; justify-content: center; margin-top: 40px; }

/* =====================================================
   Timeline / Journey
   ===================================================== */
.timeline {
  position: relative;
  list-style: none;
  margin: 0; padding: 0 0 0 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border-2), transparent);
}
.t-item { position: relative; margin-bottom: 18px; }
.t-dot {
  position: absolute;
  left: -28px; top: 22px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(167,139,250,.15);
}
.t-card { padding: 18px 22px; }
.t-year {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}
.t-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.t-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}
.t-card p em { color: var(--fg-soft); font-style: normal; }

/* =====================================================
   Contact
   ===================================================== */
.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  padding: 32px;
  align-items: center;
}
@media (max-width: 760px) { .contact-card { grid-template-columns: 1fr; } }

.contact-left h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.contact-left p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
}
.contact-left .btn {
  font-family: var(--font-mono);
  font-size: 13.5px;
}

.contact-links {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 8px;
}
.contact-links a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  transition: background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.contact-links a:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  transform: translateX(2px);
}
.contact-links a div { display: grid; }
.contact-links a strong { font-size: 14.5px; font-weight: 600; }
.contact-links a span { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); }
.contact-links .link-arrow {
  font-size: 16px;
  color: var(--muted);
}
.contact-links a:hover .link-arrow { color: var(--accent); }

/* =====================================================
   Footer
   ===================================================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  font-size: 13px;
  color: var(--muted);
}
.footer-inner p { margin: 0; }
.footer-right {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 18px;
}
.footer-right a {
  color: var(--muted);
  transition: color .2s var(--ease);
}
.footer-right a:hover { color: var(--fg); }
.footer-top { color: var(--fg-soft); }
.muted { color: var(--muted-2); }

/* =====================================================
   Toast (used by the fake light-mode toggle)
   ===================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 24px);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: rgba(15, 15, 18, 0.92);
  color: var(--fg);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  font-size: 14px;
  letter-spacing: -0.005em;
  box-shadow: 0 18px 50px -20px rgba(0,0,0,.6);
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  transition: transform .45s var(--ease-out), opacity .35s var(--ease);
  max-width: calc(100vw - 32px);
  text-align: left;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.toast-icon {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(167,139,250,.18);
  color: var(--accent);
}
.toast-text { white-space: normal; }

/* =====================================================
   Reveal-on-scroll
   ===================================================== */
.reveal-up {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity .8s var(--ease-out) var(--delay, 0s),
    transform .8s var(--ease-out) var(--delay, 0s);
  will-change: opacity, transform;
}
.reveal-up.in {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   Reduced motion
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-up { opacity: 1; transform: none; }
  .blob { display: none; }
  .cursor-glow { display: none; }
  .card-window { transform: none; }
  .portrait-frame { transform: none; }
  .portrait-halo { animation: none; }
  .pill-dot, .badge-dot { animation: none; }
}

/* =====================================================
   Mobile-specific polish (added in the senior designer pass)
   ===================================================== */

/* Screen-reader-only utility for the mobile-sheet label */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Hamburger button — desktop hidden, mobile shown */
.nav-toggle {
  display: none;
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--fg);
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.nav-toggle:hover { background: var(--surface-2); border-color: var(--border-2); }
.nav-toggle:active { transform: scale(.96); }
.nav-toggle-bars {
  position: relative;
  display: inline-block;
  width: 20px; height: 14px;
}
.nav-toggle-bars span {
  position: absolute;
  left: 0; right: 0;
  height: 1.6px;
  background: currentColor;
  border-radius: 1px;
  transition: transform .35s var(--ease-out), top .35s var(--ease-out), opacity .25s var(--ease);
}
.nav-toggle-bars span:nth-child(1) { top: 3px; }
.nav-toggle-bars span:nth-child(2) { top: 10px; }
.nav-toggle.is-open .nav-toggle-bars span:nth-child(1) { top: 7px; transform: rotate(45deg); }
.nav-toggle.is-open .nav-toggle-bars span:nth-child(2) { top: 7px; transform: rotate(-45deg); }
.nav-toggle.is-open {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

/* Mobile sheet overlay */
.mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(7,7,10,0.86);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
          backdrop-filter: blur(20px) saturate(160%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease-out);
  display: flex; flex-direction: column;
  padding: 84px clamp(24px, 6vw, 32px) 32px;
}
.mobile-sheet.is-open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-sheet-inner {
  display: flex; flex-direction: column;
  gap: 32px;
  height: 100%;
  max-width: 520px;
  margin-inline: auto;
  width: 100%;
}
.mobile-sheet-nav {
  display: flex; flex-direction: column;
  gap: 4px;
}
.mobile-sheet-nav a {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 4px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s var(--ease-out), transform .4s var(--ease-out), color .25s var(--ease);
}
.mobile-sheet-nav a:hover,
.mobile-sheet-nav a:focus-visible { color: var(--accent); }
.mobile-sheet.is-open .mobile-sheet-nav a {
  opacity: 1;
  transform: translateY(0);
}
.mobile-sheet.is-open .mobile-sheet-nav a:nth-child(1) { transition-delay: .08s; }
.mobile-sheet.is-open .mobile-sheet-nav a:nth-child(2) { transition-delay: .12s; }
.mobile-sheet.is-open .mobile-sheet-nav a:nth-child(3) { transition-delay: .16s; }
.mobile-sheet.is-open .mobile-sheet-nav a:nth-child(4) { transition-delay: .20s; }
.mobile-sheet.is-open .mobile-sheet-nav a:nth-child(5) { transition-delay: .24s; }
.mobile-sheet-nav .m-eb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
}
.mobile-sheet-nav .m-l { display: block; }
.mobile-sheet-nav .m-a {
  color: var(--fg-soft);
  font-size: 22px;
  font-weight: 400;
  transition: transform .25s var(--ease), color .25s var(--ease);
  line-height: 1;
}
.mobile-sheet-nav a:hover .m-a,
.mobile-sheet-nav a:focus-visible .m-a {
  color: var(--accent);
  transform: translateX(3px);
}
.mobile-sheet-foot {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.mobile-sheet-foot > a {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg-soft);
  padding: 6px 0;
}
.mobile-sheet-social {
  display: flex; gap: 20px;
}
.mobile-sheet-social a {
  font-size: 14px;
  color: var(--muted);
  padding: 12px 0;
  min-height: 44px;
  display: inline-flex; align-items: center;
}

body.sheet-open { overflow: hidden; }

/* ----- Premium portrait ambient halo (mobile-first, scales up) ----- */
.hero-portrait { position: relative; }
.hero-portrait::before {
  content: "";
  position: absolute;
  /* Soft radial glow behind the portrait — acts as ambient lighting. */
  inset: -20% -10% -10% -10%;
  z-index: -1;
  background:
    radial-gradient(60% 60% at 50% 50%,
      rgba(167,139,250,0.22) 0%,
      rgba(244,114,182,0.12) 40%,
      transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  opacity: .9;
}
.portrait-frame {
  /* Layered shadow — long soft + nearer rim, both subtle. */
  box-shadow:
    0 30px 70px -28px rgba(0,0,0,.55),
    0 60px 120px -40px rgba(120, 90, 200, .22),
    0 0 0 1px rgba(255,255,255,.04) inset;
}

/* =====================================================
   ≤640px overrides — mobile composition
   ===================================================== */
@media (max-width: 640px) {

  :root { --pad-x: 22px; }

  /* Show hamburger, hide desktop nav links + theme toggle + Contact CTA */
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav { padding: 10px 0; }
  .nav.is-scrolled { padding: 8px 0; }
  .brand-name { font-size: 14.5px; }

  /* Hero stack: headline first, portrait below it */
  .hero {
    padding: 24px 0 56px;
    min-height: 0;
  }
  /* Hero stack on phones: headline first, portrait slots in right
     under it, then the lead/CTA/meta flow below the image. We flatten
     .hero-content with display:contents so the portrait (a sibling)
     can be reordered between the headline and the rest of the copy. */
  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }
  .hero-content { display: contents; }
  .hero-portrait { order: 1; margin: 8px 0 24px; }
  .hero-content > .lead,
  .hero-content > .cta-row,
  .hero-content > .hero-meta { order: 2; }

  /* Portrait — 25% smaller and tightly framed */
  .portrait-frame {
    width: min(220px, 70%);
    /* Slight tilt removed on mobile so the right edge doesn't clip */
    transform: none;
    margin-inline: auto;
  }
  .hero-portrait:hover .portrait-frame { transform: none; }
  .portrait-badge {
    left: 10px; bottom: 10px;
    padding: 5px 10px 5px 9px;
    font-size: 10px;
    letter-spacing: 0.06em;
  }
  /* Stronger ambient halo on mobile so the photo reads as the anchor */
  .hero-portrait::before {
    inset: -25% -25% -15% -25%;
    background:
      radial-gradient(50% 55% at 50% 40%,
        rgba(167,139,250,0.32) 0%,
        rgba(244,114,182,0.18) 40%,
        transparent 75%);
    filter: blur(48px);
  }

  /* Headline tighter, lead a bit tighter */
  .display { font-size: clamp(34px, 9.2vw, 44px); margin: 16px 0 16px; }
  .lead { font-size: 16px; margin-bottom: 24px; line-height: 1.55; }
  .pill { font-size: 12.5px; padding: 5px 12px 5px 10px; }

  /* CTA row — bigger tap targets */
  .cta-row { gap: 10px; margin: 4px 0 28px; }
  .btn {
    padding: 14px 22px;
    font-size: 15px;
    min-height: 48px;
    flex: 1 1 auto;
    justify-content: center;
  }
  .btn-primary:active { transform: scale(.985); }
  .btn-ghost:active { transform: scale(.985); }

  /* Meta — keep, but tighter padding */
  .hero-meta { padding-top: 22px; gap: 14px; }
  .hero-meta dt { font-size: 10.5px; }
  .hero-meta dd { font-size: 13.5px; }

  /* Section rhythm — much tighter on phones */
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 36px; }
  .eyebrow { font-size: 11.5px; margin-bottom: 10px; }

  /* About — single column, tighter gap */
  .about-grid { gap: 24px; }
  .about-copy p { font-size: 16px; line-height: 1.65; margin-bottom: 16px; }

  /* Skills — already single col below 560, force from 640 */
  .skills-grid { grid-template-columns: 1fr; gap: 12px; }
  .skill-card { padding: 20px; }

  /* Projects */
  .project { padding: 22px 22px 20px; }
  .project-title { font-size: 20px; }
  .project-desc { font-size: 14px; }

  /* Journey timeline tighter */
  .timeline { padding-left: 24px; }
  .t-dot { left: -24px; }

  /* Contact card stacks */
  .contact-card { padding: 24px; gap: 22px; }

  /* Footer — vertical, larger tap targets */
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .footer-right {
    width: 100%;
    gap: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: 4px;
  }
  .footer-right a {
    padding: 12px 0;
    min-height: 44px;
    display: inline-flex; align-items: center;
  }

  /* Background — re-anchor blobs into the visible viewport on mobile */
  .blob-a { top: -8%; left: -40%; }
  .blob-b { top:  18%; right: -45%; }
  .blob-c { bottom: 0%; left: -30%; }
  .blob { filter: blur(80px); opacity: .42; }

  /* Reduce backdrop-filter cost across the page on phones */
  .glass-card,
  .portrait-badge,
  .toast {
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
  }
  .nav.is-scrolled {
    -webkit-backdrop-filter: blur(12px) saturate(160%);
            backdrop-filter: blur(12px) saturate(160%);
  }
  .mobile-sheet {
    -webkit-backdrop-filter: blur(16px) saturate(160%);
            backdrop-filter: blur(16px) saturate(160%);
  }
}

/* Image entrance — subtle scale-up under reveal, no extra JS */
.hero-portrait.reveal-up .portrait-frame {
  transition: transform .9s var(--ease-out), opacity .8s var(--ease-out);
  transform: scale(.985);
}
.hero-portrait.reveal-up.in .portrait-frame {
  transform: scale(1);
}
@media (max-width: 640px) {
  .hero-portrait.reveal-up.in .portrait-frame { transform: none; }
}

/* Slightly larger theme-toggle tap target */
.theme-toggle { width: 38px; height: 38px; }
