/* =========================================================
   J.C. Sanchez Portfolio — 3D modern system
   ========================================================= */

@font-face {
  font-family: "Filson Soft";
  src: url("../assets/fonts/filson-soft-bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ═══════════════════════════════════════════════════════════
     TUNE ME — motion, depth, and feel (edit only these)
     JS tilt + CSS wobble both read from here.
     ═══════════════════════════════════════════════════════════ */

  /* Pointer tilt (degrees / px). Set to 0 to disable a group. */
  --tilt-perspective: 1100px;
  --tilt-project-max: 1.25;      /* “Products with a pulse” cards — keep subtle */
  --tilt-project-lift: 1px;
  --tilt-timeline-max: 4;
  --tilt-timeline-lift: 2px;
  --tilt-skills-max: 4;
  --tilt-skills-lift: 2px;
  --tilt-edu-max: 3;
  --tilt-edu-lift: 2px;
  --tilt-ambition-max: 3.5;
  --tilt-ambition-lift: 2px;
  --tilt-contact-max: 3;
  --tilt-contact-lift: 2px;
  --tilt-meta-max: 3;
  --tilt-meta-lift: 1px;
  --tilt-reset-ms: 480ms;
  --tilt-active-ms: 70ms;

  /* Hero kind365 + CitSci idle wobble (no tilt) */
  --wobble-duration-kind: 6.5s;
  --wobble-duration-citsci: 7.8s;
  --wobble-delay-citsci: -2.2s;
  --wobble-x: 3px;
  --wobble-y: 6px;
  --wobble-rotate: 0.55deg;

  /* Hero stack depth (desktop) */
  --hero-stack-rotate-x: 3deg;
  --hero-stack-rotate-y: -5deg;

  /* ═══════════════════════════════════════════════════════════
     Theme tokens
     ═══════════════════════════════════════════════════════════ */
  --bg: #07090f;
  --bg-elevated: #0d111c;
  --ink: #f2f4f8;
  --muted: #8b93a7;
  --line: rgba(255, 255, 255, 0.08);
  --glass: rgba(16, 22, 36, 0.55);
  --glass-border: rgba(255, 255, 255, 0.12);

  --cyan: #3de0d0;
  --violet: #7c6cff;
  --magenta: #ff5cad;
  --amber: #ffc857;
  --blue: #4f8cff;
  --kind-teal: #007a72;
  --kind-teal-bright: #0e9a8f;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-kind: "Filson Soft", "Bricolage Grotesque", system-ui, sans-serif;

  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

strong {
  font-weight: 600;
  color: #fff;
}

/* ---------- Ambient stage ---------- */
.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  perspective: 1200px;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: drift 18s var(--ease) infinite alternate;
  will-change: transform;
}

.orb-a {
  width: 42vw;
  height: 42vw;
  max-width: 520px;
  max-height: 520px;
  top: -8%;
  left: -6%;
  background: radial-gradient(circle at 30% 30%, var(--violet), transparent 70%);
  animation-duration: 22s;
}

.orb-b {
  width: 36vw;
  height: 36vw;
  max-width: 440px;
  max-height: 440px;
  top: 35%;
  right: -8%;
  background: radial-gradient(circle at 40% 40%, var(--cyan), transparent 70%);
  animation-duration: 26s;
  animation-delay: -4s;
}

.orb-c {
  width: 28vw;
  height: 28vw;
  max-width: 360px;
  max-height: 360px;
  bottom: -5%;
  left: 30%;
  background: radial-gradient(circle at 50% 50%, var(--magenta), transparent 70%);
  opacity: 0.35;
  animation-duration: 20s;
  animation-delay: -8s;
}

.grid-floor {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -30%;
  height: 70%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: rotateX(68deg) translateZ(-80px);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 75%);
  animation: grid-pulse 8s ease-in-out infinite;
}

.noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(40px, 50px, 40px) scale(1.12);
  }
}

@keyframes grid-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.85;
  }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px);
  backdrop-filter: blur(18px) saturate(140%);
  background: rgba(7, 9, 15, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.nav.scrolled {
  border-bottom-color: var(--line);
  background: rgba(7, 9, 15, 0.78);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #061018;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(124, 108, 255, 0.35);
}

.logo-text {
  font-size: 17px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.nav-links a.is-active {
  color: var(--cyan);
}

.nav-cta {
  color: #061018 !important;
  background: linear-gradient(135deg, var(--cyan), var(--blue)) !important;
  font-weight: 600 !important;
}

.nav-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s var(--ease);
}

/* ---------- Layout ---------- */
main {
  position: relative;
  z-index: 1;
  padding-top: var(--nav-h);
}

.section {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(72px, 10vw, 120px) 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section-head h2,
.hero h1,
.edu-card h2,
.contact-panel h2 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0 0 14px;
}

.section-head h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.section-sub {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}

/* ---------- Hero ---------- */
.hero {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  padding: clamp(40px, 6vw, 80px) 0;
  perspective: 1400px;
}

.hero-copy,
.hero-stage {
  min-width: 0;
  max-width: 100%;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  margin: 0 0 20px;
  overflow-wrap: anywhere;
  word-break: normal;
  max-width: 100%;
}

.hero h1 .line {
  display: block;
}

.accent-gradient {
  background: linear-gradient(120deg, var(--cyan) 0%, var(--violet) 45%, var(--magenta) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hue-shift 10s linear infinite;
}

@keyframes hue-shift {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(25deg);
  }
}

.lede {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 34em;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.lede a {
  color: var(--cyan);
  border-bottom: 1px solid rgba(61, 224, 208, 0.35);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lede a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  color: #061018;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 12px 40px rgba(61, 224, 208, 0.22);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(61, 224, 208, 0.32);
}

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--glass-border);
  backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-chip {
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  display: grid;
  gap: 2px;
  min-width: 0;
}

.meta-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.meta-value {
  font-size: 13.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---------- kind365 brand ---------- */
.kind-wordmark {
  font-family: var(--font-kind) !important;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
}

.kind-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(0, 122, 114, 0.45);
  flex-shrink: 0;
}

.kind-logo-lg {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 14px 40px rgba(0, 122, 114, 0.5);
}

.kind-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.kind-brand .kind-wordmark {
  margin: 0;
  font-size: 1.85rem;
  line-height: 1;
}

.kind-visual-brand {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 2;
}

.kind-visual-brand .visual-logo {
  position: static;
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

/* ---------- Hero card stack ---------- */
.hero-stage {
  position: relative;
  height: min(520px, 68vh);
  min-height: 440px;
  overflow: visible;
}

.device-stack {
  position: relative;
  width: 100%;
  height: 100%;
  /* Static mild depth — no live JS parallax (that caused hover flicker) */
  transform: rotateX(var(--hero-stack-rotate-x)) rotateY(var(--hero-stack-rotate-y));
  transform-style: preserve-3d;
}

.float-card {
  position: absolute;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--glass-border);
  background-color: rgba(12, 18, 30, 0.92);
  box-shadow: var(--shadow);
  padding: 22px;
  overflow: hidden;
}

.float-card .card-glow {
  position: absolute;
  inset: auto auto -40% -20%;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(124, 108, 255, 0.35), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.card-kind {
  width: min(320px, 82%);
  top: 4%;
  left: 0;
  z-index: 3;
  background:
    linear-gradient(160deg, rgba(0, 122, 114, 0.32), rgba(12, 18, 30, 0.95) 55%);
  border-color: rgba(0, 122, 114, 0.45);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  display: block;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

a.card-kind:hover {
  border-color: rgba(14, 154, 143, 0.8);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 122, 114, 0.35);
}

a.card-kind:hover .card-glow {
  opacity: 1;
}

a.card-kind:focus-visible {
  outline: 2px solid var(--kind-teal-bright);
  outline-offset: 3px;
}

.card-kind .card-glow {
  background: radial-gradient(circle, rgba(0, 122, 114, 0.5), transparent 70%);
}

.card-kind .card-bar span {
  background: linear-gradient(90deg, var(--kind-teal), var(--kind-teal-bright), var(--cyan));
}

.card-citsci {
  width: min(300px, 78%);
  top: auto;
  bottom: 2%;
  right: 0;
  left: auto;
  z-index: 2;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  display: block;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

a.card-citsci:hover {
  border-color: rgba(79, 140, 255, 0.6);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(79, 140, 255, 0.3);
}

a.card-citsci:hover .card-glow {
  opacity: 1;
}

a.card-citsci:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
}

.pill.live {
  color: #fff;
  background: var(--kind-teal);
  border-color: transparent;
  box-shadow: 0 0 20px rgba(0, 122, 114, 0.55);
}

.card-url {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.float-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.float-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  position: relative;
  z-index: 1;
}

.card-bar {
  margin-top: 18px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.card-bar span {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  animation: grow-bar 2.4s var(--ease) both;
}

@keyframes grow-bar {
  from {
    width: 0;
  }
}

/* ---------- Ambition ---------- */
.ambition-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}

.ambition-copy {
  margin-bottom: 0;
  max-width: none;
}

.ambition-body {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 40em;
  line-height: 1.65;
}

.ambition-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* 5 chips: 2×2 + full-width last row, or 2×3 with last alone — keep 2-col and let last wrap naturally */
.ambition-highlights .ambition-chip:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.ambition-chip {
  padding: 18px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--glass-border);
  display: grid;
  gap: 4px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ambition-chip:hover {
  border-color: rgba(61, 224, 208, 0.35);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}

.ambition-chip-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}

.ambition-chip strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.ambition-chip span:last-child {
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---------- Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  perspective: 1400px;
}

/* kind365 spans full width on first row; Chore + CitSci share second row */
.project-lg {
  grid-column: 1 / -1;
}

.project {
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--glass-border);
  overflow: hidden;
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.project:hover {
  border-color: rgba(124, 108, 255, 0.35);
}

.project-visual {
  position: relative;
  height: 220px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  transform: translateZ(30px);
}

.kind-visual {
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 122, 114, 0.55), transparent 48%),
    radial-gradient(circle at 80% 70%, rgba(14, 154, 143, 0.35), transparent 52%),
    #062420;
}

.citsci-visual {
  background:
    radial-gradient(circle at 70% 30%, rgba(79, 140, 255, 0.4), transparent 45%),
    radial-gradient(circle at 20% 80%, rgba(61, 224, 208, 0.25), transparent 50%),
    #09141a;
}

.chore-visual {
  background:
    radial-gradient(circle at 25% 25%, rgba(255, 200, 87, 0.35), transparent 48%),
    radial-gradient(circle at 80% 70%, rgba(255, 92, 173, 0.28), transparent 50%),
    #1a1210;
}

.chore-logo {
  line-height: 1.05;
  text-align: center;
  font-size: clamp(1.55rem, 3.2vw, 2.1rem) !important;
}

.mesh {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 75%);
  animation: mesh-move 14s linear infinite;
}

@keyframes mesh-move {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(28px, 28px, 0);
  }
}

.visual-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
}

.visual-logo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  letter-spacing: -0.04em;
  color: #fff;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.visual-logo span {
  color: var(--cyan);
}

.visual-logo.sm {
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  animation: spin 18s linear infinite;
}

.orbit-1 {
  width: 160px;
  height: 160px;
}

.orbit-2 {
  width: 230px;
  height: 230px;
  animation-direction: reverse;
  animation-duration: 28s;
  border-style: dashed;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.nodes span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px var(--cyan);
  animation: pulse-node 2.4s ease-in-out infinite;
}

.nodes span:nth-child(1) {
  top: 28%;
  left: 30%;
}
.nodes span:nth-child(2) {
  top: 42%;
  right: 28%;
  animation-delay: 0.4s;
  background: var(--blue);
  box-shadow: 0 0 18px var(--blue);
}
.nodes span:nth-child(3) {
  bottom: 28%;
  left: 40%;
  animation-delay: 0.8s;
  background: var(--violet);
  box-shadow: 0 0 18px var(--violet);
}
.nodes span:nth-child(4) {
  top: 55%;
  left: 58%;
  animation-delay: 1.2s;
}

@keyframes pulse-node {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.4);
    opacity: 1;
  }
}

.project-body {
  padding: 26px 26px 28px;
  transform: translateZ(20px);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.project-tags span {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
}

.project-body h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.project-body p {
  margin: 0 0 18px;
  color: var(--muted);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--cyan);
  transition: gap 0.25s var(--ease), color 0.2s ease;
}

.text-link svg {
  width: 16px;
  height: 16px;
}

.text-link:hover {
  gap: 12px;
  color: #fff;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  display: grid;
  gap: 18px;
  padding-left: 18px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--violet), var(--cyan), transparent);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-left: 28px;
}

.timeline-marker {
  position: absolute;
  left: -18px;
  top: 28px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 0 6px rgba(61, 224, 208, 0.12), 0 0 24px rgba(61, 224, 208, 0.35);
  z-index: 1;
}

.timeline-card {
  padding: 24px 26px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  transition: border-color 0.3s ease, transform 0.35s var(--ease);
}

.timeline-card:hover {
  border-color: rgba(61, 224, 208, 0.3);
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.timeline-top h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.timeline-top h3 span {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9em;
}

.when {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.role {
  margin: 0 0 10px;
  color: var(--cyan);
  font-weight: 600;
  font-size: 0.95rem;
}

.timeline-card > p:not(.role) {
  margin: 0;
  color: var(--muted);
}

.award {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #061018;
  background: linear-gradient(135deg, var(--amber), #ff9f43);
  box-shadow: 0 8px 24px rgba(255, 200, 87, 0.25);
}

.award-icon {
  font-size: 14px;
}

/* ---------- Skills ---------- */
.skills-3d {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  perspective: 1400px;
}

.skill-panel {
  position: relative;
  padding: 26px 24px;
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  transform-style: preserve-3d;
  transition: transform 0.4s var(--ease), border-color 0.3s ease;
  overflow: hidden;
}

.skill-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(124, 108, 255, 0.18), transparent 55%);
  pointer-events: none;
}

.skill-panel:hover {
  border-color: rgba(124, 108, 255, 0.35);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.skill-panel h3 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  position: relative;
}

.skill-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  position: relative;
}

.skill-panel li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.25s var(--ease), background 0.2s ease;
}

.skill-panel li:hover {
  transform: translateX(6px) translateZ(12px);
  background: rgba(255, 255, 255, 0.05);
}

.skill-orb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  box-shadow: 0 0 14px rgba(124, 108, 255, 0.55);
  flex-shrink: 0;
}

.skill-orb.node {
  background: #68a063;
  box-shadow: 0 0 14px rgba(104, 160, 99, 0.55);
}
.skill-orb.vue {
  background: #42b883;
  box-shadow: 0 0 14px rgba(66, 184, 131, 0.55);
}
.skill-orb.react {
  background: #61dafb;
  box-shadow: 0 0 14px rgba(97, 218, 251, 0.55);
}
.skill-orb.electron {
  background: #9feaf9;
  box-shadow: 0 0 14px rgba(159, 234, 249, 0.45);
}
.skill-orb.ios {
  background: #a2aaad;
  box-shadow: 0 0 14px rgba(162, 170, 173, 0.45);
}
.skill-orb.android {
  background: #3ddc84;
  box-shadow: 0 0 14px rgba(61, 220, 132, 0.5);
}

.panel-note {
  margin: 16px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  position: relative;
}

/* ---------- Education ---------- */
.edu-card {
  position: relative;
  padding: clamp(32px, 5vw, 48px);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(135deg, rgba(124, 108, 255, 0.16), rgba(61, 224, 208, 0.08) 50%, rgba(16, 22, 36, 0.85));
  border: 1px solid var(--glass-border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.edu-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  right: -60px;
  top: -80px;
  background: radial-gradient(circle, rgba(61, 224, 208, 0.35), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  animation: drift 12s ease-in-out infinite alternate;
}

.edu-school {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  position: relative;
}

.edu-program {
  margin: 0 0 8px;
  color: var(--cyan);
  font-weight: 600;
  position: relative;
}

.edu-grad {
  margin: 0 0 16px;
  font-size: 1.1rem;
  position: relative;
}

.edu-body {
  margin: 0;
  max-width: 48em;
  color: var(--muted);
  position: relative;
}

/* ---------- Contact ---------- */
.contact {
  padding-bottom: clamp(80px, 12vw, 120px);
}

.contact-panel {
  text-align: center;
  padding: clamp(40px, 6vw, 72px) clamp(24px, 4vw, 48px);
  border-radius: calc(var(--radius) + 8px);
  background:
    radial-gradient(circle at 50% 0%, rgba(124, 108, 255, 0.25), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

.contact-panel h2 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  max-width: 14ch;
  margin-left: auto;
  margin-right: auto;
}

.contact-panel > p {
  color: var(--muted);
  max-width: 36em;
  margin: 0 auto 28px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 48px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13.5px;
}

.footer p {
  margin: 0;
}

/* ---------- Reveal (translate/scale leave transform free for tilt) ---------- */
.reveal {
  opacity: 0;
  translate: 0 36px;
  scale: 0.98;
  transition:
    opacity 0.8s var(--ease),
    translate 0.8s var(--ease),
    scale 0.8s var(--ease);
}

.reveal.visible {
  opacity: 1;
  translate: 0 0;
  scale: 1;
}

.delay-1 {
  transition-delay: 0.12s;
}
.delay-2 {
  transition-delay: 0.22s;
}

/* ---------- Hero cards: idle wobble only (no pointer tilt) ---------- */
@keyframes hero-card-wobble {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  25% {
    transform: translate3d(var(--wobble-x), calc(var(--wobble-y) * -1), 0)
      rotate(var(--wobble-rotate));
  }
  50% {
    transform: translate3d(calc(var(--wobble-x) * -1.15), calc(var(--wobble-y) * -0.45), 0)
      rotate(calc(var(--wobble-rotate) * -0.9));
  }
  75% {
    transform: translate3d(calc(var(--wobble-x) * 0.7), calc(var(--wobble-y) * -1.25), 0)
      rotate(calc(var(--wobble-rotate) * 0.75));
  }
}

.float-card.card-kind,
.float-card.card-citsci {
  animation: hero-card-wobble var(--wobble-duration-kind) ease-in-out infinite;
  transform-origin: center center;
  will-change: transform;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.float-card.card-kind {
  animation-duration: var(--wobble-duration-kind);
  animation-delay: 0s;
}

.float-card.card-citsci {
  animation-duration: var(--wobble-duration-citsci);
  animation-delay: var(--wobble-delay-citsci);
}

/* ---------- Pointer tilt groups (JS reads --tilt-max / --tilt-lift) ---------- */
.project,
.timeline-card,
.skill-panel,
.edu-card,
.ambition-chip,
.contact-panel,
.meta-chip {
  --tilt-max: 0;
  --tilt-lift: 0px;
  transform-style: preserve-3d;
  transform: perspective(var(--tilt-perspective)) rotateX(0deg) rotateY(0deg) translateY(0);
  transform-origin: center center;
  transition:
    transform var(--tilt-reset-ms) var(--ease),
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  will-change: transform;
}

/* Per-section knobs — override any one of these, or set --tilt-max: 0 to kill tilt */
.project {
  --tilt-max: var(--tilt-project-max);
  --tilt-lift: var(--tilt-project-lift);
}
.timeline-card {
  --tilt-max: var(--tilt-timeline-max);
  --tilt-lift: var(--tilt-timeline-lift);
}
.skill-panel {
  --tilt-max: var(--tilt-skills-max);
  --tilt-lift: var(--tilt-skills-lift);
}
.edu-card {
  --tilt-max: var(--tilt-edu-max);
  --tilt-lift: var(--tilt-edu-lift);
}
.ambition-chip {
  --tilt-max: var(--tilt-ambition-max);
  --tilt-lift: var(--tilt-ambition-lift);
}
.contact-panel {
  --tilt-max: var(--tilt-contact-max);
  --tilt-lift: var(--tilt-contact-lift);
}
.meta-chip {
  --tilt-max: var(--tilt-meta-max);
  --tilt-lift: var(--tilt-meta-lift);
}

.project.is-tilting,
.timeline-card.is-tilting,
.skill-panel.is-tilting,
.edu-card.is-tilting,
.ambition-chip.is-tilting,
.contact-panel.is-tilting,
.meta-chip.is-tilting {
  transition:
    transform var(--tilt-active-ms) linear,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 40px;
    padding-bottom: 32px;
    gap: 36px;
  }

  .hero-copy {
    order: 1;
  }

  .hero-stage {
    order: 2;
    height: auto;
    min-height: 0;
    max-width: 100%;
    margin: 0;
    /* Kill desktop 3D stage on tablet/mobile — it was crushing cards into thin strips */
    transform: none !important;
    perspective: none;
  }

  .device-stack {
    transform: none !important;
    height: auto;
    display: grid;
    gap: 14px;
    transform-style: flat;
  }

  .float-card {
    position: relative;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: none;
  }

  .project-grid,
  .skills-3d,
  .ambition-layout {
    grid-template-columns: 1fr;
  }

  .project-lg {
    grid-column: auto;
  }

  .ambition-highlights {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    inset: var(--nav-h) 16px auto 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border-radius: 18px;
    background: rgba(10, 14, 24, 0.95);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    z-index: 60;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    width: min(100% - 32px, 1120px);
    padding-top: 28px;
  }

  .hero h1 {
    font-size: clamp(2rem, 8.8vw, 2.65rem);
  }

  .lede {
    font-size: 0.98rem;
    max-width: none;
  }

  .hero-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .meta-value {
    font-size: 13px;
  }

  .float-card p {
    overflow-wrap: anywhere;
  }

  .section {
    width: min(100% - 32px, 1120px);
    padding: 64px 0;
  }

  .kind-brand .kind-wordmark {
    font-size: 1.55rem;
  }

  .kind-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .timeline {
    padding-left: 12px;
  }

  .timeline-item {
    padding-left: 22px;
  }

  .footer {
    flex-direction: column;
    text-align: center;
    width: min(100% - 32px, 1120px);
  }
}

@media (max-width: 420px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }

  .hero-meta {
    grid-template-columns: 1fr;
  }

  .hero-meta .meta-chip:last-child {
    grid-column: auto;
  }

  .contact-links {
    flex-direction: column;
    align-items: stretch;
  }

  .ambition-highlights {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .orb,
  .orbit,
  .mesh,
  .nodes span,
  .grid-floor,
  .accent-gradient,
  .card-bar span {
    animation: none !important;
  }

  .float-card.card-kind,
  .float-card.card-citsci {
    animation: none !important;
  }

  .project,
  .timeline-card,
  .skill-panel,
  .edu-card,
  .ambition-chip,
  .contact-panel,
  .meta-chip {
    transform: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
  }

  .reveal {
    opacity: 1;
    translate: none;
    scale: none;
    transition: none;
  }
}
