/* =====================================================
   Ghulam Ali Doulat · Portfolio v5
   Two-page, simplified, 3D-touch
   Fonts: Fraunces (display) + Inter (body/UI)
   ===================================================== */

:root {
  /* Deep space */
  --void:      #05060f;
  --space-900: #07091a;
  --space-800: #0b0e22;
  --space-700: #13162d;
  --space-600: #1b1f3d;
  --space-500: #2a2f55;

  /* Nebula accents */
  --violet-700: #5b3ba8;
  --violet-500: #7c4dff;
  --violet-400: #9a6bff;
  --violet-300: #b69bff;
  --indigo-500: #4c6fff;
  --cyan-300:   #77e9ff;

  /* Warm — hand-drawn / human accent */
  --amber-500:  #f0a152;
  --amber-400:  #f5b672;
  --amber-300:  #f7c98d;
  --paper:      #f3e3c7;
  --ink-warm:   #f7c98d;

  /* Ink */
  --ink-100: #f4f4f8;
  --ink-200: #e4e6ef;
  --ink-300: #c3c6d6;
  --ink-400: #9499b0;
  --ink-500: #6e7393;
  --ink-700: #3d415e;

  --border:         rgba(255,255,255,0.08);
  --border-strong:  rgba(255,255,255,0.14);
  --card-bg:        rgba(255,255,255,0.035);
  --card-bg-hover:  rgba(255,255,255,0.06);

  --accent: var(--violet-400);
  --accent-strong: var(--violet-500);
  --accent-glow: rgba(124,77,255,0.35);

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;

  /* Typography — two fonts, no mono */
  --font-sans:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;

  --container-max: 1080px;

  --t-fast: 160ms cubic-bezier(.2,.6,.2,1);
  --t-med:  320ms cubic-bezier(.2,.6,.2,1);
  --t-tilt: 180ms cubic-bezier(.2,.6,.2,1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-200);
  background: var(--space-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  /* Base perspective so child 3D transforms feel real */
  perspective: 1400px;
  perspective-origin: 50% 40%;
}
img { max-width: 100%; height: auto; display: block; }
a  { color: var(--accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--violet-300); }
ul { padding: 0; margin: 0; list-style: none; }
p  { margin: 0 0 1rem; }

h1, h2, h3 {
  color: var(--ink-100);
  margin: 0 0 .5rem;
  line-height: 1.1;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 {
  font-family: var(--font-sans);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent-strong); color: #fff;
  padding: .6rem 1rem; z-index: 1000;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection { background: var(--violet-700); color: #fff; }

/* =====================================================
   COSMIC BACKGROUND
   ===================================================== */
.cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(124,77,255,0.18), transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 110%, rgba(76,111,255,0.18), transparent 60%),
    linear-gradient(180deg, #07091a 0%, #0a0d22 50%, #07091a 100%);
}
.cosmos canvas[id^="stars"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#stars-far  { opacity: 0.75; }
#stars-mid  { opacity: 0.95; }
#stars-near { opacity: 1;    }

.parallax {
  will-change: transform;
  transform: translate3d(0, var(--py, 0), 0);
}

/* Nebulae — static glows */
.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  mix-blend-mode: screen;
}
.nebula-1 {
  width: 55vw; height: 55vw;
  top: -10vw; right: -12vw;
  background: radial-gradient(circle, rgba(124,77,255,0.32), transparent 65%);
  opacity: .7;
}
.nebula-2 {
  width: 50vw; height: 50vw;
  bottom: -14vw; left: -14vw;
  background: radial-gradient(circle, rgba(77,147,255,0.26), transparent 65%);
  opacity: .65;
}

/* Planets */
.planet {
  position: absolute;
  pointer-events: none;
}
.planet-main {
  width: 480px; height: 480px;
  top: 8vh;
  right: -200px;
}
.planet-atmosphere {
  position: absolute; inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, rgba(154,107,255,0.35) 0%, rgba(124,77,255,0.12) 40%, transparent 65%);
  filter: blur(18px);
}
.planet-body {
  position: absolute; inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 35% 30%, #6b4cc9 0%, #3f2a82 30%, #1c1443 70%, #0b0822 100%),
    linear-gradient(135deg, #5b3ba8, #1b1f3d);
  box-shadow:
    inset -40px -30px 90px rgba(0,0,0,0.7),
    inset 30px 20px 80px rgba(154,107,255,0.15),
    0 0 80px rgba(124,77,255,0.25);
}
.planet-body::before {
  content: "";
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 20% 35%, rgba(255,255,255,0.06) 0 18%, transparent 22%),
    radial-gradient(circle at 65% 55%, rgba(0,0,0,0.22) 0 10%, transparent 14%),
    radial-gradient(circle at 45% 70%, rgba(255,255,255,0.04) 0 14%, transparent 18%),
    radial-gradient(circle at 80% 28%, rgba(0,0,0,0.18) 0 8%, transparent 12%),
    radial-gradient(circle at 15% 70%, rgba(255,255,255,0.03) 0 10%, transparent 14%);
  mix-blend-mode: overlay;
  transform-origin: 50% 50%;
  transform: rotate(var(--spin, 0deg));
  will-change: transform;
}
.planet-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 140%; height: 22%;
  transform: translate(-50%,-50%) rotate(-18deg);
  border-radius: 50%;
  border: 2px solid rgba(183,155,255,0.35);
  box-shadow:
    inset 0 0 30px rgba(183,155,255,0.15),
    0 0 20px rgba(183,155,255,0.08);
  clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
  opacity: .85;
}
.planet-shadow {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: linear-gradient(110deg, transparent 40%, rgba(5,6,15,0.55) 65%, rgba(5,6,15,0.85) 100%);
  pointer-events: none;
}

.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 100% 85% at 50% 45%, transparent 55%, rgba(5,6,15,0.55) 100%);
  pointer-events: none;
}

/* =====================================================
   SCROLL PROGRESS
   ===================================================== */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--violet-500), var(--cyan-300));
  z-index: 100;
  transition: width 50ms linear;
  box-shadow: 0 0 10px rgba(124,77,255,0.6);
}

/* =====================================================
   NAV
   ===================================================== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,9,26,0.55);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med), background var(--t-med);
}
.nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(7,9,26,0.8);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
}
.brand {
  color: var(--ink-100);
  font-weight: 600;
  letter-spacing: -0.005em;
  font-size: .98rem;
  font-family: var(--font-sans);
}
.brand:hover { color: var(--ink-100); }
.nav-list { display: flex; gap: 1.6rem; align-items: center; }
.nav-list a {
  color: var(--ink-300); font-size: .92rem; font-weight: 500;
  padding: .3rem 0; position: relative;
}
.nav-list a[data-nav]::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--amber-400), transparent 80%);
  transform: skewX(-12deg);
  transition: width var(--t-med);
}
.nav-list a[data-nav]:hover,
.nav-list a[data-nav].active { color: var(--ink-100); }
.nav-list a[data-nav]:hover::after,
.nav-list a[data-nav].active::after { width: 100%; }
/* .nav-cta styled below in finishing-touches block */

.nav-toggle {
  display: none;
  background: transparent; border: none; cursor: pointer;
  padding: 8px; gap: 5px; flex-direction: column;
}
.nav-toggle span {
  width: 22px; height: 2px; background: var(--ink-200);
  display: block; border-radius: 2px;
}

/* =====================================================
   BUTTONS
   ===================================================== */
/* Common inline-flex + padding; no default visual so each variant owns its look */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .75rem 1.15rem;
  font-weight: 500;
  font-size: .95rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--ink-100);
  border-radius: 2px;
  position: relative;
  transition: transform var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

/* ---- PRIMARY — hand-drawn underline treatment ---- */
.btn-primary {
  color: var(--ink-100);
  padding-left: 0; padding-right: .35rem;
  border-radius: 0;
  background: transparent;
}
.btn-primary::before {
  content: "";
  position: absolute;
  left: -2px; right: -2px; bottom: -2px;
  height: 10px;
  background:
    radial-gradient(1px 1px at 10% 50%, var(--amber-400) 60%, transparent 61%) 0 50% / 6px 2px repeat-x,
    linear-gradient(90deg, transparent 0, var(--amber-400) 8%, var(--amber-400) 92%, transparent 100%) 0 100% / 100% 2px no-repeat;
  transform: skewX(-8deg) translateY(2px);
  opacity: .9;
  transition: transform var(--t-med), opacity var(--t-fast);
  pointer-events: none;
}
.btn-primary:hover { color: var(--amber-300); transform: translateY(-1px); }
.btn-primary:hover::before { transform: skewX(-14deg) translateY(4px) scaleY(1.8); opacity: 1; }
.btn-primary svg { transition: transform var(--t-med); stroke: currentColor; }
.btn-primary:hover svg { transform: translateX(4px) rotate(-4deg); }

/* ---- GHOST — subtle bracket marks, not outlined pill ---- */
.btn-ghost {
  color: var(--ink-200);
  padding: .75rem 1.1rem;
  border-radius: 2px;
}
.btn-ghost::before,
.btn-ghost::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border: 1.5px solid var(--ink-400);
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.btn-ghost::before { top: -3px; left: -3px;  border-right: none; border-bottom: none; }
.btn-ghost::after  { bottom: -3px; right: -3px; border-left: none; border-top: none; }
.btn-ghost:hover { color: var(--ink-100); transform: translateY(-1px); }
.btn-ghost:hover::before { border-color: var(--amber-400); transform: translate(-2px, -2px); }
.btn-ghost:hover::after  { border-color: var(--amber-400); transform: translate(2px, 2px); }

/* ---- MAIL — looks typed, with at-sign mark ---- */
.btn-mail {
  color: var(--paper);
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: .01em;
  padding: .7rem .9rem .7rem 1rem;
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(247,201,141,0.06), rgba(247,201,141,0.02)),
    rgba(255,255,255,0.01);
  border: 1px dashed rgba(245,182,114,0.5);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), 0 1px 0 rgba(0,0,0,0.3);
}
.btn-mail .at-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border: 1px solid rgba(245,182,114,0.5);
  border-radius: 50%;
  color: var(--amber-400);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  line-height: 1;
  transform: translateY(-1px);
  transition: transform var(--t-med), border-color var(--t-fast), color var(--t-fast);
}
.btn-mail:hover {
  color: #fff;
  border-color: var(--amber-400);
  transform: translateY(-1px) rotate(-0.4deg);
}
.btn-mail:hover .at-mark {
  transform: translateY(-1px) rotate(-12deg);
  color: var(--paper);
  border-color: var(--amber-400);
}

/* =====================================================
   HERO
   ===================================================== */
.hero {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  padding: 3rem 0 4rem;
}
.hero-inner {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 3.25rem;
  align-items: center;
  width: 100%;
}

/* Photo with 3D tilt */
.hero-photo { display: flex; justify-content: center; }
.photo-tilt {
  position: relative;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 4 / 5;
  transform-style: preserve-3d;
  transition: transform var(--t-tilt);
  cursor: pointer;
}
.photo-frame {
  position: absolute; inset: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow:
    0 20px 60px -15px rgba(0,0,0,0.6),
    0 0 0 6px rgba(124,77,255,0.08),
    0 0 40px -5px rgba(124,77,255,0.25);
  background: linear-gradient(135deg, rgba(124,77,255,0.12), rgba(76,111,255,0.08));
  transform: translateZ(0);
  transition: box-shadow var(--t-med);
}
.photo-tilt:hover .photo-frame {
  box-shadow:
    0 30px 70px -15px rgba(0,0,0,0.7),
    0 0 0 6px rgba(124,77,255,0.12),
    0 0 60px -5px rgba(124,77,255,0.4);
}
.photo-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(1.02) contrast(1.02);
}

/* Hero text */
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--ink-300);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  padding: .35rem .8rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.eyebrow-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #5ef3b8;
  box-shadow: 0 0 0 3px rgba(94,243,184,0.2), 0 0 12px rgba(94,243,184,0.6);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(94,243,184,.5), 0 0 12px rgba(94,243,184,0.6); }
  50%      { box-shadow: 0 0 0 8px rgba(94,243,184,0), 0 0 12px rgba(94,243,184,0.6); }
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0 0 1.25rem;
  color: var(--ink-100);
}
.hero-name .name-line { display: block; }
.hero-name .name-line.accent {
  font-style: italic;
  background: linear-gradient(110deg, #f7c98d 0%, #f5b672 30%, #b69bff 70%, #d9c7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
}
/* hand-drawn underline beneath “Doulat.” */
.hero-name .name-line.accent::after {
  content: "";
  position: absolute;
  left: 6%; right: 20%;
  bottom: 2px;
  height: 6px;
  background:
    radial-gradient(2px 1px at 6% 50%, var(--amber-400) 60%, transparent 62%) 0 50%/12px 2px repeat-x;
  transform: skewX(-12deg);
  opacity: .7;
}
.hero-tag {
  font-size: 1.08rem;
  color: var(--ink-300);
  max-width: 54ch;
  line-height: 1.6;
}
.hero-ctas { display: flex; gap: .7rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* Hero / About stats */
.hero-stats {
  display: flex; gap: 2rem; margin-top: 2rem;
  flex-wrap: wrap;
}
.hero-stats li {
  display: flex; flex-direction: column; gap: .2rem;
  padding-right: 2rem;
  border-right: 1px solid var(--border);
}
.hero-stats li:last-child { border-right: none; padding-right: 0; }
.stat-num {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 500;
  color: var(--ink-100);
  line-height: 1;
  letter-spacing: -0.01em;
}
.stat-label {
  font-size: .78rem;
  color: var(--ink-400);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 500;
}

/* =====================================================
   SECTIONS
   ===================================================== */
.section      { padding: 4.5rem 0; position: relative; }
.section-head { margin-bottom: 2rem; }

.kicker {
  font-size: .72rem;
  letter-spacing: .18em;
  color: var(--amber-400);
  text-transform: uppercase;
  font-weight: 600;
  margin: 0 0 .5rem;
  display: inline-flex; align-items: center; gap: .5rem;
}
.kicker::before {
  content: "";
  width: 18px; height: 1.5px;
  background: var(--amber-400);
  opacity: .7;
  transform: skewX(-20deg);
}

/* Handwritten-feel heading variant — used on contact/CTA/projects */
.hand-h {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.01em;
  position: relative;
  display: inline-block;
}
.hand-h .ink {
  background: linear-gradient(110deg, #f7c98d 0%, #f5b672 50%, #b69bff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
/* small asterisk mark — like a note in a margin */
.hand-h .star {
  font-family: var(--font-display);
  color: var(--amber-400);
  font-size: .6em;
  transform: translateY(-.5em) rotate(-8deg);
  display: inline-block;
  margin-left: .15em;
}

/* Tiny handwritten aside — sits near section heads */
.aside-note {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--amber-300);
  font-size: .95rem;
  opacity: .75;
  margin: .35rem 0 0;
  transform: rotate(-0.6deg);
  letter-spacing: .01em;
}
.aside-note::before { content: "— "; color: var(--amber-400); }

/* Page head (on /work.html) */
.page-head {
  padding: 3rem 0 1rem;
}
.page-head h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  margin-bottom: .75rem;
}
.lede {
  color: var(--ink-300);
  max-width: 56ch;
  font-size: 1.05rem;
}

/* =====================================================
   WORK LIST
   ===================================================== */
.worklist {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: .75rem;
}
.work-item {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  transition: background var(--t-med), border-color var(--t-med);
}
.work-item:hover {
  background: var(--card-bg-hover);
  border-color: var(--border);
}
.work-meta {
  display: flex; flex-direction: column;
  padding-top: 3px;
  border-left: 2px solid var(--space-500);
  padding-left: 1rem;
  position: relative;
}
.work-meta::before {
  content: "";
  position: absolute;
  left: -5px; top: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,77,255,0.15), 0 0 10px rgba(124,77,255,0.5);
}
.work-dates { font-size: .82rem; color: var(--ink-300); letter-spacing: .02em; font-weight: 500; }
.work-loc   { font-size: .8rem; color: var(--ink-500); margin-top: .15rem; }
.work-body h3 { color: var(--ink-100); font-size: 1.12rem; margin-bottom: .5rem; }
.work-org { color: var(--ink-400); font-weight: 400; font-size: .96rem; }
.work-body p { color: var(--ink-300); font-size: .96rem; margin-bottom: .85rem; }
.work-body strong { color: var(--ink-100); font-weight: 600; }

/* Chips (reused) */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips li {
  font-size: .78rem;
  letter-spacing: .01em;
  padding: .3rem .6rem .3rem .5rem;
  background: rgba(124,77,255,0.07);
  border: 1px solid rgba(124,77,255,0.18);
  color: var(--violet-300);
  border-radius: 4px;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: .35rem;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.chips li:hover { transform: translateY(-1px); border-color: rgba(245,182,114,0.45); }
.chips li .chip-icon {
  width: 14px; height: 14px;
  color: var(--violet-300);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chips li:nth-child(3n+1) { transform: rotate(-0.4deg); }
.chips li:nth-child(3n+2) { transform: rotate(0.3deg); }
.chips li:hover .chip-icon { color: var(--amber-400); }

/* Stack (the about side card) — larger, warmer chips with bigger icons */
.stack-list { gap: .5rem; }
.stack-list li {
  padding: .4rem .7rem .4rem .55rem;
  font-size: .82rem;
}
.stack-list li .chip-icon { width: 16px; height: 16px; }

/* =====================================================
   PROJECTS
   ===================================================== */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.proj {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.35rem;
  display: flex; flex-direction: column;
  gap: .25rem;
  position: relative;
  overflow: hidden;
  transition: background var(--t-med), border-color var(--t-med), box-shadow var(--t-med);
}
.proj::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 0%; height: 2px;
  background: linear-gradient(90deg, var(--violet-500), var(--cyan-300));
  transition: width var(--t-med);
  box-shadow: 0 0 8px var(--accent-glow);
}
.proj:hover {
  background: var(--card-bg-hover);
  border-color: rgba(154,107,255,0.35);
  box-shadow: 0 18px 40px -18px rgba(124,77,255,0.35);
}
.proj:hover::before { width: 100%; }

.proj-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .4rem;
}
.proj-tag {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-400);
  font-weight: 600;
}
.proj-link {
  color: var(--ink-400);
  display: inline-flex; align-items: center;
  transition: color var(--t-fast), transform var(--t-fast);
}
.proj:hover .proj-link { color: var(--violet-300); transform: translate(2px,-2px); }
.proj-private {
  font-size: .72rem;
  color: var(--ink-500);
  letter-spacing: .06em;
  text-transform: lowercase;
  padding: .15rem .5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.proj h3 { color: var(--ink-100); font-size: 1.18rem; margin: 0 0 .15rem; font-weight: 600; }
.proj-sub {
  font-size: .85rem;
  color: var(--ink-400);
  margin: 0 0 .8rem;
  font-style: italic;
}
.proj p { color: var(--ink-300); font-size: .92rem; margin-bottom: .9rem; }
.projects-foot {
  text-align: center;
  color: var(--ink-400);
  margin-top: 1.5rem;
  font-size: .92rem;
}
.projects-foot a { color: var(--accent); font-weight: 600; }

/* =====================================================
   ABOUT
   ===================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about-col p { color: var(--ink-300); font-size: 1rem; max-width: 60ch; }
.about-col p + p { margin-top: 1rem; }
.about-side { display: flex; flex-direction: column; gap: 1rem; }
.side-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  transition: border-color var(--t-med), background var(--t-med);
}
.side-card:hover { border-color: rgba(154,107,255,0.25); background: var(--card-bg-hover); }
.side-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--accent);
  margin: 0 0 .75rem;
  font-weight: 600;
}
.card-line { color: var(--ink-200); font-size: .96rem; margin: 0 0 .4rem; line-height: 1.5; }
.card-line:last-child { margin-bottom: 0; }
.card-line.muted { color: var(--ink-400); }
.card-line strong { color: var(--ink-100); font-weight: 600; }

/* Education grid (on work page) */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* =====================================================
   CONTACT
   ===================================================== */
.section-contact { padding: 5rem 0 6rem; }
.contact-inner   { max-width: 720px; margin: 0 auto; text-align: center; }
.contact-inner h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); margin-bottom: 1rem; }
.contact-sub {
  color: var(--ink-300);
  margin-bottom: 1.75rem;
  max-width: 50ch;
  margin-left: auto; margin-right: auto;
}
.contact-ctas   { display: flex; justify-content: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.contact-social { display: flex; justify-content: center; gap: 2rem; }
.contact-social a { color: var(--ink-300); font-size: .92rem; font-weight: 500; }
.contact-social a:hover { color: var(--ink-100); }

/* CTA on work page */
.section-cta .cta-inner { text-align: center; }
.section-cta h2 { margin-bottom: 1.25rem; }
.section-cta .hero-ctas { justify-content: center; }

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  font-size: .85rem;
  color: var(--ink-500);
  position: relative; z-index: 2;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-inner p { margin: 0; }
.footer-hand {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-400);
  letter-spacing: .005em;
}
.footer-hand .hand-mark {
  color: var(--amber-400);
  display: inline-block;
  transform: rotate(-8deg);
  margin: 0 .1rem;
}
.footer-hand .heart { color: var(--amber-400); }
.footer-hand .dot { color: var(--ink-500); margin: 0 .35rem; }
.footer-hand em { font-style: italic; color: var(--ink-300); }
.to-top { color: var(--ink-400); font-weight: 500; }
.to-top:hover { color: var(--accent); }

/* =====================================================
   3D TILT SYSTEM
   JS writes --rx / --ry / --lift; CSS composes the transform.
   ===================================================== */
.tilt,
.photo-tilt {
  transform-style: preserve-3d;
  transition: transform var(--t-tilt);
  transform:
    perspective(900px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    translateZ(var(--lift, 0px));
}
.tilt > *,
.photo-tilt > * {
  transform-style: preserve-3d;
}
/* Lift inner content slightly on hover for pseudo-3D depth */
.tilt:hover {
  --lift: 6px;
}
.photo-tilt:hover {
  --lift: 14px;
}
/* A faint highlight layer that moves with the tilt for glass feel */
.tilt::after,
.photo-tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(
    600px circle at var(--mx, 50%) var(--my, 30%),
    rgba(255,255,255,0.08),
    transparent 45%);
  opacity: 0;
  transition: opacity var(--t-med);
  transform: translateZ(1px);
}
.tilt:hover::after,
.photo-tilt:hover::after {
  opacity: 1;
}

/* =====================================================
   REVEAL ANIMATIONS
   ===================================================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms cubic-bezier(.2,.6,.2,1), transform 700ms cubic-bezier(.2,.6,.2,1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 880px) {
  .hero { min-height: auto; padding: 2.5rem 0 3.5rem; }
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-photo { order: -1; }
  .photo-tilt { max-width: 220px; }
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: 1.75rem;
  }
  .hero-stats li {
    padding: 0 .9rem;
    border-right: 1px solid var(--border);
  }
  .hero-stats li:first-child { padding-left: 0; }
  .hero-stats li:last-child  { padding-right: 0; border-right: none; }
  .stat-num { font-size: 1.45rem; }
  .stat-label { font-size: .68rem; letter-spacing: .06em; }

  .section { padding: 3.5rem 0; }

  .work-item { grid-template-columns: 1fr; gap: .6rem; padding: 1.25rem 1rem; }
  .work-meta { flex-direction: row; align-items: center; gap: .75rem; border-left: none; padding-left: 0; }
  .work-meta::before { display: none; }

  .projects    { grid-template-columns: 1fr; }
  .edu-grid    { grid-template-columns: 1fr; }
  .about-grid  { grid-template-columns: 1fr; gap: 1.75rem; }

  .planet-main { width: 320px; height: 320px; right: -140px; top: 16vh; }

  /* Disable 3D tilt on touch devices — tap lift is enough */
  .tilt, .photo-tilt { transform: none; }
  .tilt:hover, .photo-tilt:hover { transform: translateY(-2px); --lift: 0; }
  .tilt::after, .photo-tilt::after { display: none; }
}

@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }
  .nav-list {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    gap: 0;
    background: rgba(7,9,26,0.96);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    padding: .5rem 1.5rem 1rem;
    transform: translateY(-8px);
    opacity: 0; pointer-events: none;
    transition: opacity var(--t-fast), transform var(--t-fast);
  }
  .nav-list.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .nav-list li { border-bottom: 1px solid var(--border); }
  .nav-list li:last-child { border-bottom: none; }
  .nav-list a { padding: .9rem 0; display: block; }
  .nav-list a.nav-cta { text-align: center; margin-top: .5rem; }
  .nav-list a[data-nav]::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .cosmos canvas[id^="stars"] { display: none; }
  .parallax { transform: none !important; }
  .tilt, .photo-tilt { transform: none !important; }
}

/* =====================================================
   PAGE TRANSITIONS — fade + lift on nav between pages
   ===================================================== */
main {
  animation: page-in 520ms cubic-bezier(.2,.6,.2,1) both;
}
@keyframes page-in {
  0%   { opacity: 0; transform: translateY(14px) scale(0.995); filter: blur(1px); }
  60%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
/* Leaving state — JS adds .leaving to <body> before navigating */
body.leaving main {
  animation: page-out 220ms cubic-bezier(.4,0,.9,.3) forwards;
}
@keyframes page-out {
  to { opacity: 0; transform: translateY(-10px); filter: blur(2px); }
}

/* Warm comet — occasional cross-screen streak to feel "alive" */
.comet-layer {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* Cursor-follow warm glow (desktop only) */
@media (pointer: fine) {
  .cursor-glow {
    position: fixed;
    top: 0; left: 0;
    width: 360px; height: 360px;
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at center,
      rgba(247,201,141,0.08) 0%,
      rgba(247,201,141,0.03) 35%,
      transparent 70%);
    opacity: 0;
    transition: opacity 400ms ease;
    mix-blend-mode: screen;
  }
  .cursor-glow.on { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
  body.leaving main { animation: none; opacity: 1; }
}

/* =====================================================
   FINISHING TOUCHES (v6 warmth pass)
   ===================================================== */

/* Side-card sub label next to "Stack" / "Currently" */
.side-sub {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-500);
  font-size: .85em;
  letter-spacing: 0;
  font-weight: 400;
  margin-left: .35em;
  text-transform: none;
}

/* Hero stat unit for "11→1 min" */
.stat-unit {
  font-family: var(--font-sans);
  font-size: 0.55em;
  font-weight: 500;
  color: var(--ink-400);
  letter-spacing: 0;
  margin-left: .1em;
  vertical-align: .1em;
}

/* CTA subtext on work page bottom */
.cta-sub {
  color: var(--ink-300);
  margin: .5rem 0 1.5rem;
  max-width: 44ch;
  margin-left: auto; margin-right: auto;
}

/* hand-h headings: inherit the underlying heading size, just style */
h1.hand-h, h2.hand-h, h3.hand-h { display: inline-block; }

/* Tilted note attached to contact section */
.section-contact .hand-h { margin-bottom: .6rem; }
.section-contact .aside-note { margin-top: 1.25rem; }

/* Ghost button tweak — lower-case reads more personal */
.btn-ghost { font-weight: 500; }

/* Chip SVG stroke thinner on the smaller chips */
.chip-svg { width: 100%; height: 100%; display: block; }

/* Reduce chip rotation on mobile to avoid wrap artifacts */
@media (max-width: 640px) {
  .chips li { transform: none !important; }
}

/* Occasional warm note dots on the background — appear as stuck-in-space details */
.cosmos::after {
  content: "";
  position: absolute;
  top: 18%; right: 8%;
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--amber-400);
  box-shadow:
    0 0 8px 2px rgba(245,182,114,0.3),
     300px 180px 0 0 var(--amber-300),
    -240px 420px 0 0 var(--amber-400),
     120px 680px 0 0 var(--amber-300);
  opacity: .55;
  pointer-events: none;
}

/* Nav active — warm underline */
.nav-list a.active {
  color: var(--ink-100);
  position: relative;
}
.nav-list a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: linear-gradient(90deg, var(--amber-400), transparent 80%);
  transform: skewX(-12deg);
}

/* Nav-cta (Resume) uses the warm scheme instead of generic pill */
.nav-cta {
  color: var(--ink-100) !important;
  padding: .45rem .85rem;
  border: 1px dashed rgba(245,182,114,0.5);
  border-radius: 3px;
  font-size: .88rem;
  font-weight: 500;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.nav-cta:hover {
  border-color: var(--amber-400);
  background: rgba(245,182,114,0.05);
  transform: translateY(-1px) rotate(-0.6deg);
}
