/* ═══════════════════════════════════════════
   RESET & VARIABLES
═══════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:          #060808;
  --bg2:         #0a0d0b;
  --bg3:         #0d1210;
  --g1:          #E8002A;
  --g2:          #A80020;
  --g3:          #FF2244;
  --t1:          #ffffff;
  --t2:          #9aa89d;
  --t3:          #5a6660;
  --card:        #0c100f;
  --cb:          rgba(232,0,42,0.15);
  --glass:       rgba(255,255,255,0.025);
  --mono:        'Space Mono', monospace;
  --sans:        'DM Sans', sans-serif;
  --ease:        cubic-bezier(0.23, 1, 0.32, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --cube-size:   320px;
  --small-size:  102px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  background: var(--bg);
  color: var(--t1);
  font-family: var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
  cursor: none;
}

/* ═══════════════════════════════════════════
   GRAIN OVERLAY
═══════════════════════════════════════════ */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%; height: 200%;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  animation: grainAnim 0.8s steps(1) infinite;
}

@keyframes grainAnim {
  0%   { transform: translate(0,     0   ); }
  10%  { transform: translate(-3%,  -4%  ); }
  20%  { transform: translate(-5%,   3%  ); }
  30%  { transform: translate( 3%,  -2%  ); }
  40%  { transform: translate(-1%,   5%  ); }
  50%  { transform: translate( 4%,   1%  ); }
  60%  { transform: translate( 2%,  -4%  ); }
  70%  { transform: translate(-4%,   2%  ); }
  80%  { transform: translate( 5%,  -1%  ); }
  90%  { transform: translate(-2%,   4%  ); }
  100% { transform: translate(0,     0   ); }
}

/* ═══════════════════════════════════════════
   CUSTOM CURSOR
═══════════════════════════════════════════ */
#cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0   3px rgba(232,0,42,0.35),
    0 0 12px 5px rgba(232,0,42,0.55),
    0 0 28px 8px rgba(232,0,42,0.28);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%,-50%);
  transition:
    width .18s var(--ease),
    height .18s var(--ease),
    background .18s,
    box-shadow .18s,
    opacity .18s;
  will-change: transform;
}

#cursor-ring {
  position: fixed;
  top: 0; left: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(232,0,42,0.55);
  pointer-events: none;
  z-index: 9997;
  transform: translate(-50%,-50%);
  transition:
    width .35s var(--ease),
    height .35s var(--ease),
    border-color .25s,
    opacity .25s;
  will-change: transform;
}

body.cursor-hover #cursor-dot {
  width: 14px; height: 14px;
  background: var(--g1);
  box-shadow: 0 0 0 4px rgba(232,0,42,0.25), 0 0 20px 8px rgba(232,0,42,0.5);
}
body.cursor-hover #cursor-ring {
  width: 52px; height: 52px;
  border-color: rgba(232,0,42,0.8);
}
body.cursor-click #cursor-dot {
  width: 8px; height: 8px;
  background: #fff;
}
body.cursor-click #cursor-ring {
  width: 24px; height: 24px;
  border-color: #fff;
}

/* ═══════════════════════════════════════════
   SCROLL PROGRESS BAR
═══════════════════════════════════════════ */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  z-index: 9999;
  background: linear-gradient(90deg, var(--g2), var(--g1), var(--g3));
  box-shadow: 0 0 10px rgba(232,0,42,0.7), 0 0 20px rgba(232,0,42,0.4);
  transition: width 0.08s linear;
  border-radius: 0 2px 2px 0;
  pointer-events: none;
}
#scroll-progress::after {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px 3px rgba(232,0,42,0.9);
}

/* ═══════════════════════════════════════════
   AMBIENT BACKGROUND
═══════════════════════════════════════════ */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(232,0,42,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 85% 60%, rgba(232,0,42,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 10% 80%, rgba(232,0,42,0.03) 0%, transparent 60%);
  pointer-events: none;
}
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(232,0,42,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,0,42,0.018) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 100%);
  pointer-events: none;
}

/* ═══════════════════════════════════════════
   PARTICLE CANVAS
═══════════════════════════════════════════ */
#particle-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}
#border-nebula {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
}

/* ═══════════════════════════════════════════
   LOADER
═══════════════════════════════════════════ */
#page-loader {
  position: fixed; inset: 0; z-index: 9990;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
#page-loader.fade-out {
  animation: loaderFadeOut 0.7s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes loaderFadeOut {
  0%   { opacity: 1; transform: scale(1); }
  60%  { opacity: 0.9; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1.12); }
}

#hi-svg { width: 260px; height: 180px; overflow: visible; }
.hi-stroke {
  fill: none; stroke: #ffffff;
  stroke-width: 7; stroke-linecap: round; stroke-linejoin: round;
}
#h-stem {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: drawStroke 0.38s cubic-bezier(0.4,0,0.2,1) 0.15s forwards;
}
#h-arch {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: drawStroke 0.48s cubic-bezier(0.4,0,0.2,1) 0.48s forwards;
}
#i-stem {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: drawStroke 0.28s cubic-bezier(0.4,0,0.2,1) 0.96s forwards;
}
#i-dot {
  r: 0; opacity: 0;
  animation: dotPop 0.22s cubic-bezier(0.34,1.56,0.64,1) 1.22s forwards;
}
@keyframes drawStroke { to { stroke-dashoffset: 0; } }
@keyframes dotPop {
  0%   { r: 0;   opacity: 0; }
  60%  { r: 8;   opacity: 1; }
  100% { r: 6.5; opacity: 1; }
}

#site-content {
  opacity: 0;
  animation: contentReveal 0.6s ease 1.95s forwards;
}
@keyframes contentReveal { to { opacity: 1; } }

/* ═══════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════ */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 960px; margin: 0 auto;
  padding: 0 1.75rem; height: 70px;
  background: rgba(6,8,8,0.75);
  border-bottom: 1px solid rgba(232,0,42,0.12);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 0 0 1px rgba(232,0,42,0.04), 0 20px 40px -20px rgba(0,0,0,0.8);
  transition: background 0.3s, border-color 0.3s;
}
nav.scrolled {
  background: rgba(6,8,8,0.93);
  border-color: rgba(232,0,42,0.22);
}

.logo {
  font-family: var(--mono);
  font-size: 1.25rem; font-weight: 700;
  background: linear-gradient(130deg, #fff 30%, var(--g1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  color: var(--t2); text-decoration: none;
  font-size: .875rem; font-weight: 400;
  transition: color .2s; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 50%;
  width: 0; height: 1.5px;
  background: var(--g1);
  transform: translateX(-50%);
  transition: width 0.22s var(--ease);
  box-shadow: 0 0 8px var(--g1);
}
.nav-links a:hover { color: var(--t1); }
.nav-links a:hover::after { width: 80%; }

/* ═══════════════════════════════════════════
   HERO
═══════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 6rem 2rem 2rem;
  position: relative; margin-top: 70px;
}
.hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--g1), transparent);
  animation: scanBeam 10s ease-in-out infinite;
  opacity: 0.3; z-index: 2;
}
@keyframes scanBeam {
  0%,100% { top: 0;   opacity: 0.1; }
  30%     { opacity: 0.4; }
  70%     { opacity: 0.4; }
  90%     { top: 92%; opacity: 0.2; }
}

.hero-top { text-align: center; width: 100%; margin-top: 1rem; margin-bottom: 1rem; }

.hero-title {
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 600;
  background: linear-gradient(135deg, #fff 40%, var(--g1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.6rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.hero-subtitle {
  font-size: 1.45rem; color: var(--t2);
  font-weight: 300;
}
/* ── HERO MIDDLE ── */
.hero-middle {
  display: flex; justify-content: center; align-items: center;
  flex: 1; width: 100%; perspective: 1200px;
  margin: 3.5rem 0; position: relative;
  padding: 60px 0; overflow: visible; min-height: 460px;
}
.hero-middle::after {
  content: ''; position: absolute; bottom: 8%;
  left: 50%; transform: translateX(-50%);
  width: 400px; height: 55px;
  background: radial-gradient(ellipse 70% 45% at 52% 50%, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.55) 45%, transparent 80%);
  filter: blur(22px); pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════════
   HERO VIDEO
═══════════════════════════════════════════ */
.hero-video-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}
.hero-video-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    linear-gradient(to right,  var(--bg) 0%, transparent 22%, transparent 78%, var(--bg) 100%),
    linear-gradient(to bottom, var(--bg) 0%, transparent 18%, transparent 82%, var(--bg) 100%);
}
.hero-video {
  height: 460px;
  width: auto;
  max-width: 92vw;
  display: block;
  position: relative;
  z-index: 1;
  filter: brightness(0.92) saturate(1.1);
}

/* ═══════════════════════════════════════════
   CUBE — Resend-style 3×3×3 Rubik's cube
═══════════════════════════════════════════ */
.scene {
  width: var(--cube-size); height: var(--cube-size);
  position: relative; transform-style: preserve-3d;
  cursor: none; z-index: 1; isolation: isolate;
}

/* Tilt wrapper: JS drives rotateX/Y from mouse movement */
.cube-tilt {
  width: 100%; height: 100%;
  position: absolute; transform-style: preserve-3d;
  transform: rotateX(-22deg);
  will-change: transform;
}

/* Pivot: slow Y-only CSS rotation */
.pivot {
  width: 100%; height: 100%;
  position: absolute; transform-style: preserve-3d;
  animation: pivotSpin 18s linear infinite;
}
@keyframes pivotSpin {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(360deg); }
}

/* ── 27 individual cubelets ── */
.pieces-container {
  position: absolute; width: 100%; height: 100%;
  transform-style: preserve-3d;
}
.small-cube {
  position: absolute;
  width: var(--small-size); height: var(--small-size);
  top: 109px; left: 109px;
  transform-style: preserve-3d;
  opacity: 1;
  transform:
    translate3d(
      calc(var(--x) * var(--small-size)),
      calc(var(--y) * var(--small-size)),
      calc(var(--z) * var(--small-size))
    ) scale(0.92);
  transition: transform 0.7s cubic-bezier(0.175,0.885,0.32,1.275),
              opacity 0.4s ease;
}
.small-cube .face {
  width: var(--small-size); height: var(--small-size);
  position: absolute; border-radius: 2px;
  background: #0e1012;
  border: 1px solid rgba(0,0,0,0.95);
}
/* Inner bevel — subtle top-left highlight + bottom-right shadow */
.small-cube .face::before {
  content: ''; position: absolute; inset: 0; border-radius: 2px;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.10),
    inset -1px -1px 0 rgba(0,0,0,0.45);
  pointer-events: none; z-index: 2;
}
/* Directional lighting per face */
.small-cube .top    {
  transform: rotateX(90deg)  translateZ(51px);
  background: linear-gradient(145deg, #343a3e 0%, #282e32 50%, #1e2428 100%);
}
.small-cube .front  {
  transform: rotateY(0deg)   translateZ(51px);
  background: linear-gradient(160deg, #222628 0%, #1a1e22 60%, #141618 100%);
}
.small-cube .right  {
  transform: rotateY(90deg)  translateZ(51px);
  background: linear-gradient(180deg, #181c1e 0%, #111416 100%);
}
.small-cube .left   {
  transform: rotateY(-90deg) translateZ(51px);
  background: #101214;
}
.small-cube .back   {
  transform: rotateY(180deg) translateZ(51px);
  background: #0c0e10;
}
.small-cube .bottom {
  transform: rotateX(-90deg) translateZ(51px);
  background: #090b0d;
}

/* Click to explode */
.scene.split .small-cube {
  transform:
    translate3d(
      calc(var(--x) * 148px),
      calc(var(--y) * 148px),
      calc(var(--z) * 148px)
    ) scale(1);
}

/* ── HERO BOTTOM ── */
.hero-bottom {
  width: 100%; max-width: 960px;
  margin: 1rem auto 2rem;
  border-top: 1px solid rgba(232,0,42,0.18);
  border-bottom: 1px solid rgba(232,0,42,0.18);
  padding: 1.2rem 0;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(8px);
}
.social-buttons {
  display: flex; flex-wrap: wrap;
  justify-content: center; align-items: center; gap: 0.85rem;
}
.social-btn {
  background: rgba(232,0,42,0.08);
  border: 1px solid rgba(232,0,42,0.25);
  border-radius: 40px; padding: 0.55rem 1.15rem;
  color: var(--t1); text-decoration: none; font-size: 0.875rem;
  display: inline-flex; align-items: center; gap: 0.45rem;
  transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
  cursor: none;
}
.social-btn:hover {
  background: rgba(232,0,42,0.18);
  border-color: var(--g1);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px -8px rgba(232,0,42,0.35), 0 0 0 1px rgba(232,0,42,0.15);
}

/* ═══════════════════════════════════════════
   SECTIONS
═══════════════════════════════════════════ */
.section {
  position: relative; z-index: 2;
  max-width: 1200px; margin: 0 auto 1.5rem;
  padding: 4rem 2rem 5rem;
}
.section:not(#experience) {
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 24px;
}
.section-label {
  text-align: center; font-family: var(--mono);
  font-size: 0.7rem; color: var(--g1);
  letter-spacing: 0.22em; text-transform: uppercase;
  margin-bottom: 0.75rem; opacity: 0.7;
}
.section-title {
  text-align: center; font-size: 2.4rem; font-weight: 300;
  margin-bottom: 3.5rem; color: var(--t1);
  letter-spacing: -0.025em;
  position: relative; display: inline-block; width: 100%;
}
.section-title::after {
  content: ''; position: absolute;
  bottom: -12px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 1.5px;
  background: var(--g1);
  box-shadow: 0 0 12px rgba(232,0,42,0.6);
  border-radius: 2px;
}

/* ═══════════════════════════════════════════
   ABOUT
═══════════════════════════════════════════ */
.about-description {
  font-size: 1.18em; line-height: 1.75;
  color: var(--t2); max-width: 860px;
  margin: 0 auto; text-align: center;
}
.about-description + .about-description { margin-top: 1.15rem; }

/* the practical bits — the logistics a recruiter checks first */
.facts-head {
  font-family: var(--mono); font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--g1); text-align: center;
  margin: 3rem 0 1.2rem;
}
.facts { max-width: 780px; margin: 0 auto; }
.facts-row {
  display: grid; grid-template-columns: 130px 1fr;
  gap: 1.5rem; align-items: baseline;
  padding: 0.95rem 0;
  border-top: 1px solid var(--cb);
}
.facts-row:last-child { border-bottom: 1px solid var(--cb); }
.facts dt {
  font-family: var(--mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--t3);
}
.facts dd { margin: 0; color: var(--t2); line-height: 1.6; }
.facts dd a { color: var(--g3); text-decoration: none; border-bottom: 1px solid var(--cb); }
.facts dd a:hover { border-bottom-color: var(--g1); }
@media (max-width: 640px) {
  .facts-row { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* "more about me" button — same treatment as .social-btn, which it mirrors */
.about-more { text-align: center; margin-top: 2.4rem; }
.about-btn {
  background: rgba(232,0,42,0.08);
  border: 1px solid rgba(232,0,42,0.25);
  border-radius: 40px; padding: 0.6rem 1.5rem;
  color: var(--t1); font-size: 0.875rem; font-family: inherit;
  display: inline-flex; align-items: center; gap: 0.45rem;
  transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
  cursor: none;
}
.about-btn:hover,
.about-btn:focus-visible {
  background: rgba(232,0,42,0.18);
  border-color: var(--g1);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px -8px rgba(232,0,42,0.35), 0 0 0 1px rgba(232,0,42,0.15);
}

/* about-me popup: photo column beside the prose */
.about-grid {
  display: grid; grid-template-columns: 260px 1fr;
  gap: 2.2rem; align-items: start;
}
.about-photo-col { text-align: center; }
.about-photo {
  width: 220px; height: 220px;
  object-fit: cover; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 16px 48px rgba(0,0,0,0.5);
  transition: transform 0.3s var(--ease), filter 0.3s, box-shadow 0.3s;
}
.about-photo:hover {
  transform: scale(1.06);
  filter: brightness(1.15);
  box-shadow: 0 0 0 1px rgba(232,0,42,0.35), 0 0 26px rgba(232,0,42,0.45), 0 16px 48px rgba(0,0,0,0.5);
}
.about-copy { text-align: left; }
.about-copy p + p { margin-top: 0.9rem; }
@media (max-width: 700px) {
  .about-grid { grid-template-columns: 1fr; gap: 1.6rem; }
}

/* hover a marked word, emojis drift up out of it in a loop */
.pop {
  position: relative;
  color: var(--t1);
  border-bottom: 1px dashed var(--cb);
  transition: border-color 0.2s, color 0.2s;
}
.pop:hover { color: var(--g3); border-bottom-color: var(--g1); }
.pop::before, .pop::after {
  content: attr(data-emoji);
  position: absolute; left: 50%; top: 0;
  opacity: 0; pointer-events: none;
  font-size: 0.95em; line-height: 1;
  will-change: transform, opacity;
}
/* two streams, offset in time and drift, so it reads as a flow not a blink */
.pop:hover::after  { animation: emojiFlowA 1.6s ease-out infinite; }
.pop:hover::before { animation: emojiFlowB 1.6s 0.8s ease-out infinite; }

@keyframes emojiFlowA {
  0%   { opacity: 0; transform: translate(-50%, 0.1em) scale(0.5) rotate(0deg); }
  18%  { opacity: 1; }
  60%  { opacity: 0.85; }
  100% { opacity: 0; transform: translate(-115%, -3.4em) scale(1.05) rotate(-16deg); }
}
@keyframes emojiFlowB {
  0%   { opacity: 0; transform: translate(-50%, 0.1em) scale(0.5) rotate(0deg); }
  18%  { opacity: 1; }
  60%  { opacity: 0.85; }
  100% { opacity: 0; transform: translate(10%, -3.1em) scale(0.95) rotate(18deg); }
}
@media (prefers-reduced-motion: reduce) {
  .pop:hover::after  { animation: none; opacity: 1; transform: translate(-50%, -1.4em); }
  .pop:hover::before { animation: none; }
}

/* ═══════════════════════════════════════════
   EXPERIENCE 3-COLUMN SCROLL
═══════════════════════════════════════════ */
#experience.section {
  padding: 0;
}
.exp3-driver {
  position: relative;
  height: 180vh;
}
.exp3-stage {
  position: sticky;
  top: 88px;
  height: calc(100vh - 88px);
  display: grid;
  grid-template-columns: 210px 1fr;
  grid-template-rows: auto 1fr;
  gap: 0.75rem 2rem;
  padding: 2rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 24px;
  overflow: hidden;
}
.exp3-header {
  grid-column: 1 / -1;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.exp3-header .section-label { text-align: center; }
.exp3-header .section-title { text-align: center; margin-bottom: 0.25rem; }

/* left and panel sit in row 2, self-centered */
.exp3-left  { align-self: center; }
.exp3-panel { align-self: center; }

.exp3-panel {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2rem 2.5rem;
  background: rgba(255,255,255,0.032);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 22px;
  min-height: 0;
}

/* LEFT */
.exp3-left { display: flex; flex-direction: column; gap: 0.3rem; }
.exp3-org {
  display: flex; align-items: center;
  padding: 0.85rem 1.1rem;
  border-radius: 100px;
  cursor: none;
  transition: background 0.35s var(--ease), opacity 0.35s var(--ease),
              transform 0.3s var(--ease), box-shadow 0.3s;
  opacity: 0.38;
}
/* same lift + glow as the logos, so it reads as clickable */
.exp3-org:hover {
  opacity: 1;
  transform: translateX(4px) scale(1.02);
  background: rgba(232,0,42,0.10);
  box-shadow: 0 0 0 1px rgba(232,0,42,0.35), 0 0 22px rgba(232,0,42,0.32);
}
.exp3-org:hover .exp3-org-name { color: var(--t1); }
.exp3-org.active {
  background: rgba(255,255,255,0.92);
  opacity: 1;
}
/* the active pill stays white on hover, just picks up the glow */
.exp3-org.active:hover { background: rgba(255,255,255,0.92); }
.exp3-org.active:hover .exp3-org-name { color: #0a0d0b; }
.exp3-org-indicator { display: none; }

.exp3-org-name {
  font-family: var(--mono); font-size: 0.92rem; font-weight: 700;
  color: var(--t2); transition: color 0.35s; letter-spacing: -0.01em;
}
.exp3-org.active .exp3-org-name { color: #0a0d0b; }
.exp3-org-period {
  font-size: 0.68rem; color: var(--t3); margin-top: 3px;
  transition: color 0.35s;
}
.exp3-org.active .exp3-org-period { color: #444; }

/* MIDDLE */
.exp3-middle { position: relative; flex: 1; min-height: 260px; cursor: none; }
/* the names no longer open the popup, so the panel has to advertise that it does */
.exp3-middle::after {
  content: 'click for detail ↗';
  position: absolute; top: 0; right: 0;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em;
  color: var(--t3); opacity: 0.55; pointer-events: none;
  transition: opacity 0.25s, color 0.25s;
}
.exp3-middle:hover::after { opacity: 1; color: var(--g1); }
.exp3-slide {
  position: absolute; top: 0; left: 0; right: 0;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  pointer-events: none;
}
.exp3-slide.active {
  opacity: 1; transform: translateY(0);
  pointer-events: auto; position: relative;
}
.exp3-status {
  font-family: var(--mono); font-size: 0.7rem;
  color: #3FB950; margin-bottom: 0.65rem; letter-spacing: 0.05em;
}
.exp3-status.active-tag { color: var(--g1); }
.exp3-role {
  font-size: 1.45rem; font-weight: 600; color: var(--t1);
  margin-bottom: 0.35rem; line-height: 1.25; letter-spacing: -0.02em;
}
.exp3-location {
  font-size: 0.8rem; color: var(--t3); margin-bottom: 1.4rem;
}
.exp3-desc { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.exp3-desc li {
  font-size: 0.875rem; color: var(--t2);
  padding-left: 1.1rem; position: relative; line-height: 1.6;
}
.exp3-desc li::before {
  content: '—'; position: absolute; left: 0;
  color: var(--g1); opacity: 0.55;
}

/* RIGHT */
.exp3-right {
  display: flex; align-items: center; justify-content: center;
  position: relative; min-height: 160px; flex-shrink: 0; width: 150px;
}
.exp3-logo {
  position: absolute;
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
  opacity: 0; transform: scale(0.88);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  pointer-events: none;
}
.exp3-logo.active {
  opacity: 1; transform: scale(1);
  pointer-events: auto; position: relative;
}
/* the hover lift lives on the img, not .exp3-logo — that wrapper's scale is the crossfade */
.exp3-logo-link { display: block; cursor: none; }
.exp3-logo-img {
  width: 120px; height: 120px;
  object-fit: contain; border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 16px 48px rgba(0,0,0,0.5);
  transition: transform 0.3s var(--ease), filter 0.3s, box-shadow 0.3s;
}
.exp3-logo-link:hover .exp3-logo-img,
.exp3-logo-link:focus-visible .exp3-logo-img {
  transform: scale(1.06);
  filter: brightness(1.15);
  box-shadow: 0 0 0 1px rgba(232,0,42,0.35), 0 0 26px rgba(232,0,42,0.45), 0 16px 48px rgba(0,0,0,0.5);
}

@media (max-width: 700px) {
  .exp3-driver { height: auto; }
  .exp3-stage {
    position: relative; top: 0; height: auto; overflow: visible;
    grid-template-columns: 1fr; grid-template-rows: auto;
    gap: 1.5rem; padding: 1.25rem;
  }
  .exp3-header { grid-column: 1; }
  .exp3-panel { flex-direction: column; padding: 1.25rem; }
  .exp3-right { display: none; }
  .exp3-left { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
  .exp3-org { border-bottom: none; padding: 0.5rem 0.75rem; }
  .exp3-org-indicator { display: none; }
  .exp3-slide { position: relative; opacity: 1 !important; transform: none !important; }
  .exp3-slide:not(.active) { display: none; }
  /* no :hover on touch, so let the hint flow to the bottom instead of sitting on the status line */
  .exp3-middle::after {
    position: static; display: block; text-align: right;
    opacity: 1; color: var(--g1); margin-top: 1rem;
  }
}

/* ═══════════════════════════════════════════
   EXPERIENCE TERMINAL STACK
═══════════════════════════════════════════ */
.exp-scroll-driver { position: relative; z-index: 2; }
.exp-sticky-stage  { position: sticky; top: 88px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.exp-cards-stack   { position: relative; width: 680px; max-width: calc(100vw - 3rem); }

.terminal-card {
  position: absolute; top: 0; left: 0; right: 0; width: 100%;
  background: #1a1a1a; border-radius: 16px; overflow: hidden; cursor: none;
  will-change: transform, opacity;
  box-shadow:
    0 2px 0 1px rgba(255,255,255,0.05),
    0 24px 64px rgba(0,0,0,0.75),
    0 0 0 1px rgba(232,0,42,0.25),
    0 0 60px rgba(232,0,42,0.12);
  transition: box-shadow 0.3s;
}
.terminal-card:hover {
  box-shadow:
    0 2px 0 1px rgba(255,255,255,0.08),
    0 28px 70px rgba(0,0,0,0.85),
    0 0 0 1px rgba(232,0,42,0.50),
    0 0 70px rgba(232,0,42,0.20);
}

.terminal-titlebar {
  background: linear-gradient(180deg, #2f2f2f 0%, #262626 100%);
  padding: 11px 16px; display: flex; align-items: center;
  border-bottom: 1px solid rgba(232,0,42,0.15);
  position: relative; user-select: none;
}
.terminal-titlebar::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(232,0,42,0.55) 30%, rgba(232,0,42,0.75) 50%, rgba(232,0,42,0.55) 70%, transparent 100%);
}

.terminal-dots { display: flex; gap: 7px; align-items: center; flex-shrink: 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: block; }
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green  { background: #28c840; }

.terminal-filename {
  font-family: var(--mono); font-size: 0.76rem; color: #a0b0a4;
  flex: 1; text-align: center; padding: 0 2rem; letter-spacing: 0.01em;
}
.terminal-tag {
  background: rgba(232,0,42,0.12); border: 1px solid rgba(232,0,42,0.25);
  border-radius: 4px; padding: 2px 8px;
  font-family: var(--mono); font-size: 0.68rem; color: var(--g1);
  flex-shrink: 0;
}

.terminal-body { padding: 1.2rem 0 1.4rem; background: #1a1a1a; }
.terminal-footer {
  padding: 0.7rem 1.4rem; background: #181818;
  border-top: 1px solid rgba(232,0,42,0.08);
  display: flex; align-items: center; justify-content: space-between;
}
.tf-left { display: flex; align-items: center; gap: 1rem; font-family: var(--mono); font-size: 0.72rem; }
.tf-branch { display: flex; align-items: center; gap: 5px; color: var(--g1); opacity: 0.7; }
.tf-lang   { display: flex; align-items: center; gap: 5px; color: #7a8a7d; }
.tf-hint   { font-family: var(--mono); font-size: 0.68rem; color: rgba(232,0,42,0.4); letter-spacing: 0.02em; }

.code-block { font-family: 'Space Mono', 'Consolas', monospace; font-size: 0.82rem; line-height: 1.75; color: #d4d4d4; }
.code-line  { display: flex; align-items: baseline; padding: 0 1.4rem 0 0; min-height: 1.75em; }
.code-line:hover { background: rgba(255,255,255,0.025); }
.line-num   { font-family: 'Space Mono', monospace; font-size: 0.72rem; color: #383838; min-width: 44px; text-align: right; padding-right: 1.2rem; user-select: none; flex-shrink: 0; }

.exp-scroll-hint {
  text-align: center; padding: 1.2rem 0 2rem;
  font-family: var(--mono); font-size: 0.75rem;
  color: rgba(232,0,42,0.35); letter-spacing: 0.08em;
  opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
.exp-scroll-hint.visible { opacity: 1; }
.exp-scroll-hint i { animation: bounceY 1.4s ease-in-out infinite; display: inline-block; }
@keyframes bounceY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* syntax tokens */
.ck { color: #c792ea; }
.cs { color: #c3e88d; }
.cc { color: #546e7a; font-style: italic; }
.cp { color: #82aaff; }
.cn { color: #f78c6c; }
.cb { color: #89ddff; }
.co { color: #89ddff; }
.cg { color: #c3e88d; font-weight: 700; }
.ct { color: #ffcb6b; }
.cv { color: #f07178; }

@media (max-width: 700px) {
  .exp-scroll-driver { height: auto !important; }
  .exp-sticky-stage  { position: relative !important; top: 0 !important; height: auto !important; overflow: visible !important; }
  .exp-cards-stack   { height: auto !important; position: relative !important; display: flex; flex-direction: column; gap: 1.5rem; }
  .terminal-card     { position: relative !important; transform: none !important; opacity: 1 !important; }
}

/* ═══════════════════════════════════════════
   RESEARCH CARDS — hover expand
═══════════════════════════════════════════ */
.cards.research-cards {
  display: flex;
  gap: 1.25rem;
  align-items: stretch;
}
.cards.research-cards .card {
  flex: 1;
  min-width: 0;
  transition: flex 0.52s cubic-bezier(0.23,1,0.32,1),
              border-color 0.3s, box-shadow 0.35s;
}
.cards.research-cards .card:hover {
  flex: 2.6;
  transform: none;
}
.cards.research-cards:has(.card:hover) .card:not(:hover) {
  flex: 0.6;
}

/* extra details — hidden until hover */
.card-extra {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.48s cubic-bezier(0.23,1,0.32,1),
              opacity 0.32s 0.12s;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.cards.research-cards .card:hover .card-extra {
  max-height: 200px;
  opacity: 1;
  margin-top: 0.75rem;
}
.card-extra-stats {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.ces-item {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--t1); background: rgba(232,0,42,0.08);
  border: 1px solid rgba(232,0,42,0.2);
  border-radius: 20px; padding: 0.22rem 0.7rem;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap;
}
.ces-item i { color: var(--g1); font-size: 0.62rem; }
.ces-method {
  font-size: 0.8rem; color: var(--t2); line-height: 1.55;
}
.ces-authors {
  font-size: 0.72rem; color: var(--t3);
  font-family: var(--mono); border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 0.5rem; line-height: 1.5;
}
.ces-authors i { color: var(--g1); margin-right: 4px; }

@media (max-width: 700px) {
  .cards.research-cards { flex-direction: column; }
  .cards.research-cards .card,
  .cards.research-cards .card:hover,
  .cards.research-cards:has(.card:hover) .card:not(:hover) { flex: none; }
}

/* ═══════════════════════════════════════════
   CARDS
═══════════════════════════════════════════ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--card);
  border: 1px solid rgba(232,0,42,0.08);
  border-radius: 20px; padding: 1.8rem 1.6rem;
  display: flex; flex-direction: column;
  transition: transform 0.35s var(--ease), border-color 0.3s, box-shadow 0.35s;
  position: relative; overflow: hidden; cursor: none;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,0,42,0.3), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.card::after {
  content: ''; position: absolute; inset: 0; border-radius: 20px;
  background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(232,0,42,0.04) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(232,0,42,0.22); box-shadow: 0 20px 48px -20px rgba(232,0,42,0.22), 0 0 0 1px rgba(232,0,42,0.07); }
.card:hover::before { opacity: 1; }
.card:hover::after  { opacity: 1; }
.card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(232,0,42,0.07); border: 1px solid rgba(232,0,42,0.14);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.2rem; font-size: 1.1rem;
  transition: background 0.2s, border-color 0.2s;
}
.card:hover .card-icon { background: rgba(232,0,42,0.14); border-color: rgba(232,0,42,0.3); }
.card h3      { font-size: 1.15rem; font-weight: 500; color: var(--t1); margin-bottom: 0.45rem; }
.card .subtitle { font-size: 0.85rem; color: var(--g1); margin-bottom: 0.5rem; opacity: 0.9; }
.card p       { font-size: 0.875rem; color: var(--t3); line-height: 1.65; margin-bottom: 1rem; }
.card .date-badge { align-self: flex-start; background: rgba(232,0,42,0.1); border: 1px solid rgba(232,0,42,0.2); border-radius: 20px; padding: 0.3rem 1rem; font-size: 0.8rem; color: var(--g1); margin-top: auto; }

/* ═══════════════════════════════════════════
   SKILLS
═══════════════════════════════════════════ */
.skills-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; margin-top: 2rem; }
.skill-category { background: var(--card); border: 1px solid rgba(232,0,42,0.08); border-radius: 20px; padding: 1.6rem; }
.skill-category h3 { color: var(--g1); margin-bottom: 1rem; font-size: 1.2rem; font-weight: 500; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.75rem; }
.skill-box {
  background: rgba(232,0,42,0.05); border: 1px solid rgba(232,0,42,0.09);
  border-radius: 10px; padding: 0.5rem 0.8rem;
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; color: var(--t2);
  transition: background 0.2s, border-color 0.2s, transform 0.2s; cursor: none;
}
.skill-box:hover { background: rgba(232,0,42,0.1); border-color: var(--g1); transform: translateY(-2px); }
.skill-box i { width: 20px; }

/* ═══════════════════════════════════════════
   EDUCATION
═══════════════════════════════════════════ */
.education-box { background: var(--card); border: 1px solid rgba(232,0,42,0.08); border-radius: 20px; padding: 2rem; }
.education-heading  { color: var(--t1); font-size: 1.5rem; }
.degree-subheading  { color: var(--g1); font-weight: 400; margin: 0.5rem 0; }
.location-text      { color: var(--t3); margin-bottom: 1.5rem; }
.coursework-list    { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.8rem; margin-top: 1rem; }
.coursework-item    { color: var(--t2); padding-left: 1.2rem; position: relative; }
.coursework-item::before { content: '▹'; color: var(--g1); position: absolute; left: 0; }

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
.site-footer {
  text-align: center; padding: 2rem; color: var(--t3);
  border-top: 1px solid rgba(232,0,42,0.1);
  background: rgba(0,0,0,0.2); font-size: 0.875rem;
}

/* ═══════════════════════════════════════════
   CHATBOT
═══════════════════════════════════════════ */
.chatbot-toggle {
  position: fixed; bottom: 2rem; right: 2rem;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--g2), var(--g3));
  border: none; cursor: none; z-index: 200;
  box-shadow: 0 0 20px rgba(232,0,42,0.4);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s;
  display: flex; align-items: center; justify-content: center;
}
.chatbot-toggle:hover { transform: scale(1.12); box-shadow: 0 0 35px rgba(232,0,42,0.65); }
.chatbot-toggle i { font-size: 1.5rem; color: #fff; transition: transform 0.3s var(--ease-spring); }
.chatbot-toggle.open i { transform: rotate(90deg); }

.chatbot-container {
  position: fixed; bottom: 5.5rem; right: 2rem;
  width: 360px; height: 520px;
  background: rgba(16,20,18,0.97);
  border: 1px solid rgba(232,0,42,0.18);
  border-radius: 22px;
  display: none; flex-direction: column;
  z-index: 200; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.65);
  backdrop-filter: blur(20px);
  transform-origin: bottom right;
}
.chatbot-container.active {
  display: flex;
  animation: chatOpen 0.38s var(--ease-spring);
}
.chatbot-container.closing {
  animation: chatClose 0.22s var(--ease) forwards;
}
@keyframes chatOpen  { from { opacity: 0; transform: scale(0.88) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes chatClose { to   { opacity: 0; transform: scale(0.9) translateY(8px); } }

.chatbot-header {
  background: linear-gradient(135deg, rgba(168,0,32,0.15) 0%, rgba(16,20,18,0) 100%);
  padding: 1rem 1rem 0.9rem; border-bottom: 1px solid rgba(232,0,42,0.12);
  position: relative;
}
.chatbot-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--g2), var(--g3));
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; margin-bottom: 0.4rem;
  box-shadow: 0 0 14px rgba(232,0,42,0.4);
}
.chatbot-title { color: var(--t1); font-size: 1rem; font-weight: 600; }
.chatbot-subtitle { color: var(--t3); font-size: 0.75rem; margin-top: 2px; }
.chatbot-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.7rem; color: #4ade80; margin-top: 3px;
}
.chatbot-status::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: statusPulse 2s ease-in-out infinite;
}
@keyframes statusPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.chatbot-close {
  position: absolute; top: 0.9rem; right: 0.9rem;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--t3); cursor: none; font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
}
.chatbot-close:hover { background: rgba(232,0,42,0.12); color: var(--g1); }

.chatbot-messages {
  flex: 1; padding: 1rem; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.85rem;
  scroll-behavior: smooth;
}
.chatbot-messages::-webkit-scrollbar { width: 3px; }
.chatbot-messages::-webkit-scrollbar-thumb { background: rgba(232,0,42,0.2); border-radius: 2px; }

.message {
  max-width: 84%; padding: 0.75rem 1rem;
  border-radius: 16px; font-size: 0.875rem; line-height: 1.5;
  animation: msgIn 0.28s var(--ease-spring);
}
@keyframes msgIn { from { opacity: 0; transform: translateY(6px) scale(0.96); } to { opacity: 1; transform: none; } }
.message.bot  { align-self: flex-start; background: rgba(255,255,255,0.06); color: var(--t1); border-bottom-left-radius: 4px; border: 1px solid rgba(255,255,255,0.06); }
.message.user { align-self: flex-end; background: linear-gradient(135deg, var(--g2), var(--g3)); color: #fff; border-bottom-right-radius: 4px; }
.message a    { color: var(--g3); text-decoration: underline; text-underline-offset: 2px; }

/* typing dots */
.typing-indicator { display: flex; gap: 5px; align-items: center; padding: 0.9rem 1rem; }
.typing-indicator span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--t3);
  animation: typingBounce 1.1s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.32s; }
@keyframes typingBounce { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-6px); opacity: 1; } }

/* quick reply chips */
.quick-replies {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  padding: 0 1rem 0.75rem; animation: msgIn 0.3s var(--ease-spring);
}
.quick-reply-btn {
  background: rgba(232,0,42,0.08); border: 1px solid rgba(232,0,42,0.2);
  border-radius: 20px; padding: 0.4rem 0.9rem;
  font-size: 0.78rem; color: var(--t2); cursor: none;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  font-family: inherit;
}
.quick-reply-btn:hover { background: rgba(232,0,42,0.16); color: var(--t1); border-color: var(--g1); }

.chatbot-input-area {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(232,0,42,0.1);
  background: rgba(0,0,0,0.15);
}
.chatbot-input-container { display: flex; gap: 0.5rem; align-items: flex-end; }
.chatbot-input {
  flex: 1; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(232,0,42,0.18); border-radius: 14px;
  padding: 0.7rem 0.9rem; color: var(--t1); resize: none;
  font-family: inherit; font-size: 0.875rem; max-height: 100px;
  transition: border-color 0.2s; cursor: none; line-height: 1.4;
}
.chatbot-input:focus { outline: none; border-color: rgba(232,0,42,0.45); }
.chatbot-input::placeholder { color: var(--t3); }
.chatbot-send {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--g2), var(--g3));
  border: none; color: #fff; cursor: none;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.chatbot-send:hover { transform: scale(1.12); box-shadow: 0 0 16px rgba(232,0,42,0.5); }

/* ═══════════════════════════════════════════
   POPUPS
═══════════════════════════════════════════ */
.popup {
  display: none; position: fixed; inset: 0;
  z-index: 1000;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.popup.active { display: flex; }

.popup-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  animation: backdropIn 0.28s ease forwards;
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.popup-content {
  position: relative; z-index: 1;
  background: linear-gradient(145deg, #191e1c 0%, #0d1110 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 26px; padding: 2.75rem;
  max-width: 1200px; width: 100%;
  max-height: 82vh; overflow-y: auto;
  color: var(--t1);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 48px 96px -24px rgba(0,0,0,0.95),
    0 0 60px rgba(232,0,42,0.05);
  animation: popupIn 0.42s var(--ease-spring) forwards;
}
/* we focus this container on open for screen readers; the browser's default ring
   (system accent colour) is noise here — the controls inside keep their own */
.popup-content:focus { outline: none; }
.popup-content::before {
  content: '';
  position: absolute; top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,0,42,0.55), transparent);
  border-radius: 50%;
  pointer-events: none;
}
@keyframes popupIn  { from { opacity: 0; transform: scale(0.94) translateY(16px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.popup-content::-webkit-scrollbar { width: 3px; }
.popup-content::-webkit-scrollbar-thumb { background: rgba(232,0,42,0.25); border-radius: 2px; }

.popup.closing .popup-backdrop { animation: backdropOut 0.22s ease forwards; }
.popup.closing .popup-content  { animation: popupOut  0.22s var(--ease) forwards; }
@keyframes backdropOut { to { opacity: 0; } }
@keyframes popupOut    { to { opacity: 0; transform: scale(0.95) translateY(8px); } }

.popup-esc-hint {
  position: absolute; top: 1.1rem; right: 1.1rem;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px; padding: 2px 8px;
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--t3); letter-spacing: 0.05em; user-select: none;
}

.popup-divider {
  height: 1px; margin: 1.1rem 0 1.75rem;
  background: linear-gradient(90deg, var(--g1) 0%, rgba(232,0,42,0.25) 40%, transparent 80%);
  border-radius: 1px;
}
.popup-heading {
  font-size: 1.85rem; font-weight: 700; margin-bottom: 0.35rem;
  letter-spacing: -0.025em; line-height: 1.2;
  background: linear-gradient(135deg, #ffffff 35%, var(--g1) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.popup-subheading {
  color: var(--t3); margin-bottom: 0; font-size: 0.9rem; letter-spacing: 0.01em;
}
.popup-body { line-height: 1.75; }
.popup-body h2 {
  color: var(--t1); font-size: 1.05rem; font-weight: 600;
  margin: 2rem 0 0.6rem; letter-spacing: -0.01em;
}
.popup-body h3 {
  font-family: var(--mono); font-size: 1.05rem; color: var(--g1);
  margin: 2rem 0 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; opacity: 1;
}
.popup-body ul {
  margin-left: 0; list-style: none; color: var(--t2);
  display: flex; flex-direction: column; gap: 0.4rem;
}
.popup-body ul li {
  padding-left: 1.1rem; position: relative; margin-bottom: 0;
}
.popup-body ul li::before {
  content: '·'; position: absolute; left: 0;
  color: var(--g1); font-size: 1.1rem; line-height: 1.5; font-weight: 700;
}
.popup-buttons { display: flex; gap: 0.75rem; margin-top: 2.25rem; justify-content: flex-end; flex-wrap: wrap; }
.popup-github, .popup-close {
  padding: 0.6rem 1.6rem; border-radius: 30px; text-decoration: none;
  font-size: 0.875rem; transition: transform 0.22s var(--ease-spring), box-shadow 0.22s; cursor: none;
}
.popup-github {
  background: linear-gradient(135deg, var(--g2), var(--g3));
  color: #fff; border: none; font-weight: 500;
}
.popup-github:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,0,42,0.4); }
.popup-close {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12); color: var(--t2);
}
.popup-close:hover { background: rgba(255,255,255,0.08); color: var(--t1); }
.popup-github:hover { transform: translateY(-2px); box-shadow: 0 8px 24px -8px rgba(232,0,42,0.5); }
.popup-close:hover  { border-color: rgba(232,0,42,0.4); color: var(--g1); }

.popup-divider { width: 100%; height: 1px; background: linear-gradient(90deg, transparent, rgba(232,0,42,0.3), transparent); margin: 1.5rem 0; }

/* ═══════════════════════════════════════════
   SCROLL REVEAL ANIMATIONS
═══════════════════════════════════════════ */
.scroll-animation {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.scroll-animation.visible { opacity: 1; transform: translateY(0); }

.cards .scroll-animation:nth-child(1) { transition-delay: 0s; }
.cards .scroll-animation:nth-child(2) { transition-delay: 0.06s; }
.cards .scroll-animation:nth-child(3) { transition-delay: 0.12s; }
.cards .scroll-animation:nth-child(4) { transition-delay: 0.18s; }
.cards .scroll-animation:nth-child(5) { transition-delay: 0.24s; }
.cards .scroll-animation:nth-child(6) { transition-delay: 0.30s; }
.cards .scroll-animation:nth-child(7) { transition-delay: 0.36s; }
.cards .scroll-animation:nth-child(8) { transition-delay: 0.42s; }
.cards .scroll-animation:nth-child(9) { transition-delay: 0.48s; }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .nav-links { gap: 1.2rem; }
  .nav-links a { font-size: 0.8rem; }
  .hero-title { font-size: 2.4rem; }
  .chatbot-container { width: calc(100vw - 2rem); right: 1rem; }
}
@media (max-width: 600px) {
  .section   { padding: 3rem 1.25rem 4rem; }
  .chatbot-toggle { bottom: 1.25rem; right: 1.25rem; }
  .chatbot-container { bottom: 4.8rem; right: 1.25rem; }
}
