/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.6);
  --text-dim: rgba(255,255,255,0.35);
  --glass: rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.18);
  --glass-shine: rgba(255,255,255,0.22);
  --glass-hover: rgba(255,255,255,0.13);
  --accent: #a78bfa;
  --accent2: #60a5fa;
  --accent3: #f472b6;
  --green: #34d399;
  --radius: 20px;
  --radius-sm: 12px;
  --blur: blur(28px) saturate(180%);
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, 'SF Pro Display', 'Inter', sans-serif;
  background: #06030f;
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: var(--text); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.75; }

/* ── Aurora canvas background ── */
#bg-aurora {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}
#web-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
  opacity: 0.5;
}

/* Grain overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.45;
}

/* ── All content sits above bg ── */
.nav, section, footer { position: relative; z-index: 1; }

/* ── Glass Mixin (via class) ── */
.glass {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow:
    0 4px 6px -1px rgba(0,0,0,0.2),
    0 20px 60px rgba(0,0,0,0.3),
    inset 0 1px 0 var(--glass-shine),
    inset 0 -1px 0 rgba(0,0,0,0.1);
}

/* ── Nav ── */
.nav {
  position: fixed; top: 1.2rem; left: 50%; transform: translateX(-50%);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 0.5rem 0.75rem;
  width: min(680px, 92vw);
  background: rgba(255,255,255,0.1);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: 9999px;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.4),
    inset 0 1px 0 var(--glass-shine);
}


.nav-links {
  display: flex; gap: 0.25rem; list-style: none;
  position: relative;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  transition: color 0.2s ease, transform 0.22s cubic-bezier(0.34,1.56,0.64,1),
              text-shadow 0.2s ease;
  position: relative;
  z-index: 1;
  display: inline-block;
}
.nav-links a:hover {
  color: #e9e3ff;
  transform: translateY(-3px) scale(1.07);
  text-shadow: 0 0 10px rgba(196,181,253,1), 0 0 22px rgba(167,139,250,0.7),
               0 0 45px rgba(139,92,246,0.35);
}

.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.3rem; cursor: pointer; padding: 0.4rem; }

.nav-bubble {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: calc(100% - 6px);
  border-radius: 9999px;
  pointer-events: none;
  opacity: 0;
  will-change: left, width, opacity, transform;
  z-index: 0;
  transition: box-shadow 0.2s ease;

  /* layered glass — specular highlight top-left, refraction gradient, tinted body */
  background:
    radial-gradient(ellipse at 32% 28%, rgba(255,255,255,0.6) 0%, transparent 48%),
    radial-gradient(ellipse at 70% 75%, rgba(255,255,255,0.12) 0%, transparent 40%),
    linear-gradient(135deg, rgba(255,255,255,0.22) 0%, rgba(167,139,250,0.18) 50%, rgba(96,165,250,0.15) 100%);

  border: 1px solid rgba(255,255,255,0.38);
  box-shadow:
    inset 0 1.5px 2px rgba(255,255,255,0.55),
    inset 0 -1px 2px rgba(0,0,0,0.18),
    0 4px 18px rgba(167,139,250,0.28),
    0 1px 4px rgba(255,255,255,0.08);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: left 0.18s cubic-bezier(0.22,1,0.36,1),
              width 0.18s cubic-bezier(0.22,1,0.36,1),
              opacity 0.15s ease;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.75rem 1.8rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  position: relative; overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
  border-radius: inherit;
}
.btn:hover::before { background: rgba(255,255,255,0.08); }

.btn-primary {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    0 4px 20px rgba(167,139,250,0.3);
}
.btn-primary:hover { transform: translateY(-2px) scale(1.02); box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 8px 30px rgba(167,139,250,0.45); }

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: rgba(255,255,255,0.5); color: var(--text); transform: translateY(-2px); }

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
  padding: 8rem 6rem 4rem;
}

.hero-greeting {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}
.hero-name {
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 0.8rem;
  letter-spacing: -0.02em;
}
.hero-title {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  min-height: 2rem;
}
.cursor { animation: blink 1s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.hero-sub { color: var(--text-muted); max-width: 420px; margin-bottom: 2.5rem; font-size: 1.05rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Code Window (glass) */
.code-window {
  background: rgba(255,255,255,0.06);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 25px 80px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.2);
  transform: perspective(1000px) rotateY(-5deg) rotateX(3deg);
  transition: transform 0.6s ease;
}
.code-window:hover { transform: perspective(1000px) rotateY(0deg) rotateX(0deg); }

.code-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.code-filename { font-family: 'JetBrains Mono', 'SF Mono', monospace; font-size: 0.75rem; color: var(--text-dim); margin-left: 0.5rem; }
.code-body {
  padding: 1.5rem;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.9;
  color: rgba(255,255,255,0.85);
}
.kw { color: #c084fc; }
.str { color: #86efac; }
.bool { color: #67e8f9; }

/* ── Sections ── */
.section { padding: 7rem 2rem; }
.section-dark { background: rgba(0,0,0,0.15); }
.container { max-width: 1100px; margin: 0 auto; }

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 3.5rem;
  text-align: center;
  letter-spacing: -0.02em;
}
.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── About ── */
.about-grid { display: grid; grid-template-columns: auto 1fr; gap: 4rem; align-items: center; }
.about-avatar { display: flex; justify-content: center; }

.avatar-ring {
  width: 220px; height: 220px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  background: rgba(255,255,255,0.06);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow:
    0 0 60px rgba(167,139,250,0.3),
    inset 0 1px 0 rgba(255,255,255,0.3);
}
.avatar-ring::before {
  content: '';
  position: absolute; inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent2), var(--accent3), var(--accent));
  z-index: -1;
  filter: blur(2px);
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
  border-radius: 50%;
}

.about-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.li-badge {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.4rem;
  padding: 0.85rem 1.1rem;
  background: rgba(10,102,194,0.08);
  border: 1px solid rgba(10,102,194,0.3);
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
  max-width: 380px;
}
.li-badge:hover {
  background: rgba(10,102,194,0.16);
  border-color: rgba(10,102,194,0.6);
  transform: translateY(-2px);
}
.li-badge-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.li-icon { width: 28px; height: 28px; border-radius: 5px; flex-shrink: 0; }
.li-badge-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 12%;
  border: 2px solid rgba(10,102,194,0.5);
}
.li-badge-info {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  flex: 1;
  min-width: 0;
}
.li-badge-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.li-badge-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.3;
}
.li-badge-company {
  font-size: 0.7rem;
  color: rgba(10,102,194,0.85);
  font-weight: 500;
}
.li-badge-cta {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #0A66C2;
  background: rgba(10,102,194,0.12);
  border: 1px solid rgba(10,102,194,0.35);
  border-radius: 9999px;
  padding: 0.3rem 0.75rem;
  white-space: nowrap;
  transition: background 0.2s;
}
.li-badge:hover .li-badge-cta {
  background: rgba(10,102,194,0.25);
}
.about-text p { color: var(--text-muted); margin-bottom: 1rem; font-size: 1.02rem; }

.about-stats { display: flex; gap: 2rem; margin: 2rem 0; }
.stat {
  display: flex; flex-direction: column;
  padding: 1.2rem 1.5rem;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}
.stat-num {
  font-size: 1.9rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.1rem; }

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.skill-card {
  background: rgba(255,255,255,0.06);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 4px 24px rgba(0,0,0,0.2);
  transition: all var(--transition);
  position: relative; overflow: hidden;
}
.skill-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}
.skill-card:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
  transform: translateY(-6px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 16px 50px rgba(0,0,0,0.35);
}

.skill-icon { font-size: 2rem; margin-bottom: 1rem; }
.skill-card h3 { margin-bottom: 1.2rem; font-size: 1rem; font-weight: 600; }
.skill-card ul { list-style: none; color: var(--text-muted); font-size: 0.875rem; }
.skill-card ul li {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; gap: 0.5rem;
}
.skill-card ul li::before { content: '·'; color: var(--accent); font-size: 1.2rem; }
.skill-card ul li:last-child { border-bottom: none; }

/* ── Projects ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: rgba(255,255,255,0.06);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 4px 24px rgba(0,0,0,0.25);
  transition: all var(--transition);
  display: flex; flex-direction: column; gap: 1rem;
  position: relative; overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}
.project-card:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-6px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 20px 60px rgba(0,0,0,0.4);
}

.project-top { display: flex; justify-content: space-between; align-items: center; }
.project-icon { font-size: 2.5rem; }

.project-links a {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted); font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  transition: all var(--transition);
}
.project-links a:hover { color: var(--text); background: rgba(255,255,255,0.14); opacity: 1; }

.project-card h3 { font-size: 1.05rem; font-weight: 600; }
.project-card p { color: var(--text-muted); font-size: 0.9rem; flex: 1; }

.project-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.project-tags span {
  background: rgba(167,139,250,0.12);
  border: 1px solid rgba(167,139,250,0.25);
  color: var(--accent);
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
}

/* ── Contact ── */
.contact-sub { text-align: center; color: var(--text-muted); margin-bottom: 3rem; font-size: 1.05rem; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 3rem; align-items: start; }

.contact-info { display: flex; flex-direction: column; gap: 1.25rem; }
.contact-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.4rem;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
  font-size: 0.9rem;
}
.contact-item span { font-size: 1.3rem; }
.contact-item a { color: var(--text-muted); }
.contact-item a:hover { color: var(--text); opacity: 1; }

.contact-form { display: flex; flex-direction: column; gap: 0.9rem; }
.contact-form input,
.contact-form textarea {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.9rem 1.1rem;
  transition: all var(--transition);
  width: 100%;
  resize: vertical;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--text-dim); }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: rgba(167,139,250,0.5);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 3px rgba(167,139,250,0.15), inset 0 1px 0 rgba(255,255,255,0.15);
}
.form-note { font-size: 0.85rem; color: var(--green); min-height: 1.2rem; }

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 2.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: var(--text-dim);
  font-size: 0.85rem;
  position: relative; z-index: 1;
}
.footer strong { color: var(--text-muted); }
.footer-links { margin-top: 0.6rem; }
.footer-links a { color: var(--text-dim); margin: 0 0.5rem; font-size: 0.8rem; }
.footer-links a:hover { color: var(--text); opacity: 1; }

/* ── Resume download button (contact section) ── */
.resume-dl-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.1rem;
  background: rgba(167,139,250,0.1);
  border: 1px solid rgba(167,139,250,0.3);
  border-radius: 10px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  width: fit-content;
}
.resume-dl-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.resume-dl-btn:hover {
  background: rgba(167,139,250,0.2);
  border-color: rgba(167,139,250,0.6);
  transform: translateY(-2px);
}

/* ── Puzzle hint box (gaming section) ── */
.puzzle-hint-box {
  margin-top: 1.5rem;
  background: rgba(1,7,3,0.7);
  border: 1px solid rgba(0,255,65,0.18);
  border-radius: 10px;
  overflow: hidden;
  max-width: 360px;
}
.phb-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: rgba(0,12,5,0.9);
  border-bottom: 1px solid rgba(0,255,65,0.1);
}
.phb-dot {
  width: 9px; height: 9px; border-radius: 50%;
}
.phb-dot:nth-child(1) { background: #ff5f57; }
.phb-dot:nth-child(2) { background: #febc2e; }
.phb-dot:nth-child(3) { background: #28c840; }
.phb-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(0,255,65,0.35);
  margin-left: 6px;
}
.phb-body {
  padding: 0.85rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #00ff41;
  line-height: 1.9;
  text-shadow: 0 0 6px rgba(0,255,65,0.4);
}
.phb-body p { margin: 0; }
.phb-g { color: rgba(0,255,65,0.5); margin-right: 0.3rem; }
.phb-cmd {
  background: rgba(0,255,65,0.12);
  border: 1px solid rgba(0,255,65,0.25);
  border-radius: 4px;
  padding: 0 5px;
  font-weight: 700;
}
.phb-dim { color: rgba(0,255,65,0.4); }

.footer-hint {
  display: inline-block;
  margin-top: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: rgba(0,255,65,0.15);
  cursor: default;
  animation: termBlink 1.8s step-end infinite;
  user-select: none;
  transition: color 0.3s;
}
.footer-hint:hover { color: rgba(0,255,65,0.5); }

/* ── Resume puzzle modal ── */
#puzzle-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#puzzle-overlay.show {
  opacity: 1;
  pointer-events: all;
}
#puzzle-terminal {
  width: min(500px, 90vw);
  background: rgba(1,7,3,0.96);
  border: 1px solid rgba(0,255,65,0.3);
  border-radius: 10px;
  box-shadow: 0 0 60px rgba(0,255,65,0.12), 0 0 120px rgba(0,255,65,0.06);
  overflow: hidden;
  transform: scale(0.93) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
#puzzle-overlay.show #puzzle-terminal {
  transform: none;
}
.puzzle-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.25rem;
}
#puzzle-prompt {
  color: #00ff41;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.68rem, 1.4vw, 0.8rem);
  text-shadow: 0 0 8px rgba(0,255,65,0.5);
  white-space: nowrap;
  flex-shrink: 0;
}
#puzzle-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #00ff41;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.68rem, 1.4vw, 0.8rem);
  text-shadow: 0 0 8px rgba(0,255,65,0.5);
  caret-color: #00ff41;
}

/* ── Custom cursor ── */
html { cursor: none !important; }
a, button, label, input, textarea, select, [role="button"] { cursor: none !important; }

.cur-dot {
  position: fixed;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(196,181,253,0.95);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.18s ease, height 0.18s ease,
              background 0.18s ease, box-shadow 0.18s ease;
  animation: curPulse 2.2s ease-in-out infinite;
  will-change: left, top;
}
@keyframes curPulse {
  0%,100% { box-shadow: 0 0 7px rgba(167,139,250,0.8), 0 0 14px rgba(139,92,246,0.35); }
  50%     { box-shadow: 0 0 14px rgba(167,139,250,1),  0 0 28px rgba(139,92,246,0.65); }
}

.cur-ring {
  position: fixed;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(167,139,250,0.38);
  pointer-events: none;
  z-index: 9996;
  transform: translate(-50%, -50%);
  transition: width 0.38s cubic-bezier(0.25,0.46,0.45,0.94),
              height 0.38s cubic-bezier(0.25,0.46,0.45,0.94),
              border-color 0.28s ease, opacity 0.2s ease;
  will-change: left, top;
}

/* Hover over interactive element */
body.cur-hover .cur-dot {
  width: 10px; height: 10px;
  background: #a78bfa;
  box-shadow: 0 0 16px rgba(167,139,250,1), 0 0 32px rgba(139,92,246,0.6);
}
body.cur-hover .cur-ring {
  width: 52px; height: 52px;
  border-color: rgba(167,139,250,0.65);
}

/* Click burst */
body.cur-click .cur-ring {
  width: 20px; height: 20px;
  border-color: rgba(196,181,253,0.95);
  transition: width 0.08s ease, height 0.08s ease, border-color 0.08s ease;
}

/* Hide when mouse leaves window */
body.cur-out .cur-dot,
body.cur-out .cur-ring { opacity: 0; }

/* ── Hero entrance (intro ~4.5s total) ── */
.hero-greeting {
  animation: heroFadeUp 0.7s 4.5s both;
}
.hero-name {
  animation: heroFadeUp 0.8s 4.65s both;
}
.hero-title {
  animation: heroFadeUp 0.7s 4.8s both;
}
.hero-sub {
  animation: heroFadeUp 0.7s 4.95s both;
}
.hero-cta {
  animation: heroFadeUp 0.7s 5.1s both;
}
.hero-visual {
  animation: heroWindowIn 0.9s 4.7s both;
}
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(38px); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroWindowIn {
  from { opacity: 0; transform: perspective(1000px) rotateY(-18deg) rotateX(6deg) translateX(60px) scale(0.9); }
  to   { opacity: 1; transform: perspective(1000px) rotateY(-5deg) rotateX(3deg); }
}

/* ── Scroll reveal variants ── */
.reveal,
.reveal-left,
.reveal-right,
.reveal-scale {
  transition-delay: var(--delay, 0ms);
}

.reveal {
  opacity: 0;
  transform: translateY(65px);
  transition: opacity 0.75s cubic-bezier(0.4,0,0.2,1),
              transform 0.75s cubic-bezier(0.2,0.8,0.3,1);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-75px);
  transition: opacity 0.75s ease,
              transform 0.75s cubic-bezier(0.2,0.8,0.3,1);
}
.reveal-right {
  opacity: 0;
  transform: translateX(75px);
  transition: opacity 0.75s ease,
              transform 0.75s cubic-bezier(0.2,0.8,0.3,1);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.8) translateY(35px);
  transition: opacity 0.65s ease,
              transform 0.65s cubic-bezier(0.34,1.25,0.64,1);
}

.reveal.visible     { opacity: 1; transform: translateY(0); }
.reveal-left.visible  { opacity: 1; transform: translateX(0); }
.reveal-right.visible { opacity: 1; transform: translateX(0); }
.reveal-scale.visible { opacity: 1; transform: scale(1) translateY(0); }

/* When exiting: skip the stagger delay so all items reset together */
.reveal:not(.visible),
.reveal-left:not(.visible),
.reveal-right:not(.visible),
.reveal-scale:not(.visible) {
  transition-delay: 0ms;
}

/* ── Scroll Progress ── */
#scroll-prog {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
  z-index: 9998;
  pointer-events: none;
  transition: width 0.08s linear;
}

/* ═══════════════════════════════
   INTRO SPLASH
═══════════════════════════════ */
#intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #030008;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  transition: opacity 0.75s cubic-bezier(0.4,0,0.2,1);
}
#intro.out {
  opacity: 0;
  pointer-events: none;
}

/* ── Intro overlay (logo + terminal) ── */
#intro-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

#intro-logo {
  animation: introLogoIn 0.6s 0.2s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes introLogoIn {
  from { opacity: 0; transform: scale(0.6) rotate(-15deg); }
  to   { opacity: 1; transform: none; }
}
#intro-logo svg {
  width: 88px; height: 88px;
  filter: drop-shadow(0 0 14px rgba(139,92,246,0.75)) drop-shadow(0 0 30px rgba(139,92,246,0.3));
  animation: logoPulse 2.6s 0.8s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(139,92,246,0.75)) drop-shadow(0 0 30px rgba(139,92,246,0.3)); }
  50%       { filter: drop-shadow(0 0 20px rgba(167,139,250,1))   drop-shadow(0 0 50px rgba(139,92,246,0.5)); }
}

#intro-terminal {
  width: min(500px, 90vw);
  background: rgba(1, 7, 3, 0.9);
  border: 1px solid rgba(0,255,65,0.22);
  border-radius: 10px;
  box-shadow:
    0 0 40px rgba(0,255,65,0.07),
    0 0 80px rgba(139,92,246,0.07),
    inset 0 1px 0 rgba(0,255,65,0.08);
  overflow: hidden;
  animation: termIn 0.4s 0.45s cubic-bezier(0.25,0.46,0.45,0.94) both;
}
@keyframes termIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(0,12,5,0.95);
  border-bottom: 1px solid rgba(0,255,65,0.1);
}
.tdot {
  width: 11px; height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tdot:nth-child(1) { background: #ff5f57; box-shadow: 0 0 4px #ff5f57; }
.tdot:nth-child(2) { background: #febc2e; box-shadow: 0 0 4px #febc2e; }
.tdot:nth-child(3) { background: #28c840; box-shadow: 0 0 4px #28c840; }
.term-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: rgba(0,255,65,0.4);
  margin-left: 8px;
  letter-spacing: 0.04em;
}

.term-body {
  padding: 14px 18px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.68rem, 1.4vw, 0.8rem);
  color: #00ff41;
  line-height: 1.8;
  text-shadow: 0 0 8px rgba(0,255,65,0.45);
  min-height: 148px;
}
.tline { white-space: pre; }
.tline-dim { color: rgba(0,255,65,0.55); }

#term-cur {
  display: inline-block;
  animation: termBlink 0.75s step-end infinite;
  color: #00ff41;
  text-shadow: 0 0 10px rgba(0,255,65,0.8);
}
@keyframes termBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

#intro-granted {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1rem, 3vw, 1.7rem);
  font-weight: 700;
  letter-spacing: 0.4em;
  color: #00ff41;
  text-shadow: 0 0 18px rgba(0,255,65,1), 0 0 40px rgba(0,255,65,0.6), 0 0 80px rgba(0,255,65,0.3);
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}
#intro-granted.show {
  opacity: 1;
  transform: scale(1);
}

/* ── Canvas neon intro ── */
#intro-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ═══════════════════════════════
   EXPERIENCE SECTION
═══════════════════════════════ */
.exp-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding-left: 1.5rem;
  border-left: 2px solid rgba(167,139,250,0.2);
}

.exp-card {
  position: relative;
  background: rgba(255,255,255,0.05);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 4px 24px rgba(0,0,0,0.2);
  transition: all var(--transition);
}
.exp-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  transform: translateX(4px);
}

.exp-dot {
  position: absolute;
  left: calc(-1.5rem - 6px);
  top: 1.9rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #040110;
  box-shadow: 0 0 10px rgba(167,139,250,0.6);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.exp-title-block h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.exp-company {
  font-size: 0.875rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.exp-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.exp-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.exp-location {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.exp-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}
.exp-bullets li {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
  padding-left: 1.1rem;
  position: relative;
}
.exp-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
  top: 0.15em;
}

.exp-tags {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.exp-tags span {
  background: rgba(167,139,250,0.1);
  border: 1px solid rgba(167,139,250,0.22);
  color: var(--accent);
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.18rem 0.6rem;
  border-radius: 6px;
}

/* Education block */
.edu-block {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
}
.edu-heading {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.edu-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.edu-degree {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}
.edu-school {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.edu-year {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

/* ═══════════════════════════════
   RESEARCH SECTION
   ═══════════════════════════════ */
.research-card {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(167,139,250,0.18);
  border-radius: var(--radius);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}
.research-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(167,139,250,0.7), rgba(96,165,250,0.5), transparent);
}

.research-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(167,139,250,0.1);
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: 9999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(167,139,250,0.9);
  letter-spacing: 0.03em;
  width: fit-content;
}
.rb-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 6px rgba(167,139,250,0.8);
  animation: pulse 2s ease-in-out infinite;
}

.research-title {
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-top: 0.5rem;
}

.research-authors {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}
.research-authors strong {
  color: var(--accent);
}

/* Pipeline diagram */
.research-pipeline {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(167,139,250,0.12);
  border-radius: 14px;
  padding: 1.5rem 1rem;
  overflow-x: auto;
}
.pipe-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 90px;
  flex-shrink: 0;
}
.pipe-node-accent .pipe-icon {
  background: rgba(139,92,246,0.2);
  border-color: rgba(167,139,250,0.5);
  color: #c4b5fd;
  box-shadow: 0 0 20px rgba(139,92,246,0.25);
}
.pipe-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(196,181,253,0.75);
  transition: all 0.3s;
}
.pipe-icon svg { width: 24px; height: 24px; }
.pipe-node:hover .pipe-icon {
  background: rgba(167,139,250,0.12);
  border-color: rgba(167,139,250,0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139,92,246,0.2);
}
.pipe-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
}
.pipe-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: center;
  white-space: nowrap;
}
.pipe-arrow-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  min-width: 40px;
}
.pipe-connector {
  width: 100%;
  height: 1.5px;
  background: linear-gradient(90deg, rgba(167,139,250,0.3), rgba(96,165,250,0.4), rgba(167,139,250,0.3));
  position: relative;
}
.pipe-connector::after {
  content: '';
  position: absolute;
  right: -4px; top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-left: 6px solid rgba(167,139,250,0.5);
}
.pipe-arrow-label {
  font-size: 0.62rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Abstract */
.research-abstract {
  font-size: 0.96rem;
  color: var(--text-dim);
  line-height: 1.75;
  border-left: 3px solid rgba(167,139,250,0.4);
  padding-left: 1.2rem;
}

/* Stats row */
.research-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.rs-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.rs-val {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}
.rs-key {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

/* CTA row */
.research-cta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.research-cite {
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  line-height: 1.5;
}
.research-cite em { font-style: italic; }

/* ═══════════════════════════════
   INTERESTS / GAMING SECTION
═══════════════════════════════ */
.interests-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.interests-text h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.interests-text p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 0.9rem;
}
.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.4rem;
}
.interest-tags span {
  padding: 0.32rem 0.85rem;
  background: rgba(167,139,250,0.08);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 9999px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════
   3D GAMING ROOM SCENE
═══════════════════════════════ */
.room-scene {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 340px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  box-shadow: 0 28px 90px rgba(0,0,0,0.7);
  background: #030012;
}

/* Screen glow (behind everything) */
.scene-glow {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.8s ease;
  background:
    radial-gradient(ellipse 60% 50% at 42% 52%, rgba(96,165,250,0.13) 0%, transparent 100%),
    radial-gradient(ellipse 35% 40% at 78% 50%, rgba(167,139,250,0.09) 0%, transparent 100%);
}
.scene-glow.on { opacity: 1; }

/* Back wall */
.r-back-wall {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, #090420 0%, #07031c 100%);
  z-index: 1;
}

/* Wall poster (decorative) */
.r-wall-poster {
  position: absolute;
  top: 16px;
  right: 18%;
  width: 44px;
  height: 58px;
  background: rgba(167,139,250,0.07);
  border: 1px solid rgba(167,139,250,0.15);
  border-radius: 3px;
}
.r-wall-poster::before {
  content: '';
  position: absolute;
  inset: 5px;
  background: linear-gradient(135deg, rgba(167,139,250,0.15) 0%, rgba(96,165,250,0.1) 100%);
  border-radius: 2px;
}

/* Left side wall — angled to suggest room corner */
.r-left-wall {
  position: absolute;
  top: 0; left: 0;
  width: 14%;
  height: 80%;
  z-index: 2;
  background: linear-gradient(90deg, #060120 0%, #090428 80%, transparent 100%);
  clip-path: polygon(0 0, 100% 6%, 100% 100%, 0 100%);
}

/* Floor */
.r-floor {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, #0c052a 0%, #050118 100%);
  z-index: 1;
}

/* Perspective grid lines on floor */
.r-floor-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(167,139,250,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96,165,250,0.04) 1px, transparent 1px);
  background-size: 36px 24px;
  transform: perspective(180px) rotateX(48deg);
  transform-origin: top center;
  opacity: 0;
  transition: opacity 1.4s 0.8s ease;
}
.scene-glow.on ~ .r-floor .r-floor-grid,
.r-floor-grid.active { opacity: 1; }

/* Ceiling */
.r-ceiling {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  z-index: 3;
  background: #050118;
}
.r-ceil-rgb {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.02);
  transition: all 0.5s ease;
}
.r-ceil-rgb.on {
  background: linear-gradient(90deg, #f472b6, #a78bfa, #60a5fa, #34d399, #facc15, #fb923c, #f472b6);
  background-size: 200% 100%;
  animation: rgbChase 2.5s linear infinite;
  box-shadow: 0 4px 20px rgba(167,139,250,0.5), 0 6px 40px rgba(96,165,250,0.2);
}
@keyframes rgbChase {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* ── Desk wrap (positions all furniture) ── */
.r-desk-wrap {
  position: absolute;
  bottom: 62px;
  left: 50%;
  transform: translateX(-50%);
  width: 360px;
  z-index: 4;
}

/* Desk surface (top face) */
.r-desk-surface {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  height: 16px;
  background: linear-gradient(to bottom, #201048, #160c36);
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

/* Desk front face */
.r-desk-front-face {
  position: absolute;
  bottom: -14px;
  left: 0; right: 0;
  height: 14px;
  background: linear-gradient(to bottom, #100830, #0a0620);
  border-radius: 0 0 4px 4px;
  border: 1px solid rgba(255,255,255,0.06);
  border-top: none;
}

/* Desk RGB strip */
.r-desk-rgb {
  position: absolute;
  bottom: -1px;
  left: 10px; right: 10px;
  height: 2px;
  background: rgba(255,255,255,0.03);
  border-radius: 1px;
  transition: all 0.5s ease;
}
.r-ceil-rgb.on ~ * .r-desk-rgb,
.r-desk-surface .r-desk-rgb {
  /* toggled via JS adding .on to s-rgb which is r-ceil-rgb */
}

/* ── Monitor (3D tilt) ── */
.r-monitor {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-60%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.r-bezel {
  padding: 7px;
  background: #0d0922;
  border: 2px solid #1c1434;
  border-radius: 9px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transform: perspective(900px) rotateY(-4deg) rotateX(1.5deg);
  transition: border-color 0.8s ease;
}
.r-screen {
  width: 188px;
  height: 114px;
  background: #050210;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  transition: box-shadow 1s ease;
}
.r-screen.on {
  background: #07132a;
  box-shadow: 0 0 35px rgba(96,165,250,0.35), 0 0 90px rgba(96,165,250,0.1);
}
.r-bezel:has(.r-screen.on) {
  border-color: #1e3866;
}

/* CRT beam boot */
.s-beam {
  position: absolute;
  inset: 0;
  background: rgba(200,230,255,0.06);
  transform: scaleY(0.012);
  opacity: 0;
  z-index: 8;
  pointer-events: none;
}
.r-screen.on .s-beam {
  animation: beamBoot 0.65s 0.05s ease forwards;
}
@keyframes beamBoot {
  0%   { transform: scaleY(0.012); opacity: 1; background: rgba(200,230,255,0.88); }
  45%  { transform: scaleY(1); opacity: 0.5; background: rgba(150,200,255,0.18); }
  100% { transform: scaleY(1); opacity: 0; }
}

/* Screen UI */
.s-ui {
  position: absolute;
  inset: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  opacity: 0;
  z-index: 5;
}
.r-screen.on .s-ui {
  animation: uiFadeIn 0.4s 0.65s ease forwards;
}
@keyframes uiFadeIn { to { opacity: 1; } }

.s-titlebar { display: flex; gap: 3px; margin-bottom: 3px; }
.s-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.1); }
.s-dot-acc { background: rgba(96,165,250,0.75); }
.s-lines { display: flex; flex-direction: column; gap: 6px; }
.s-line { height: 4px; width: var(--w,60%); background: rgba(255,255,255,0.11); border-radius: 2px; }
.s-line-acc { background: rgba(167,139,250,0.45); }
.s-cursor {
  width: 6px; height: 9px;
  background: rgba(167,139,250,0.85);
  border-radius: 1px; margin-top: 2px;
  animation: cursorBlink2 1s step-end infinite;
}
@keyframes cursorBlink2 { 50% { opacity: 0; } }

.r-mon-neck {
  width: 14px; height: 16px;
  background: #100d20;
  border-left: 1px solid #1c1434;
  border-right: 1px solid #1c1434;
}
.r-mon-foot {
  width: 50px; height: 5px;
  background: #140b26;
  border-radius: 0 0 4px 4px;
  border: 1px solid #1c1434;
  border-top: none;
}

/* ── PC Tower — 3 visible faces ── */
.r-tower {
  position: absolute;
  bottom: 16px;
  right: 4%;
  width: 52px;
  height: 92px;
  transform-style: preserve-3d;
  transform: perspective(600px) rotateY(-18deg);
}

.r-tower-front {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #140f26, #0d0a1c);
  border: 1px solid #221840;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 5px 6px;
  gap: 6px;
}

/* Right-side face of tower */
.r-tower-side {
  position: absolute;
  top: 3px;
  left: calc(100% - 1px);
  width: 14px;
  height: calc(100% - 6px);
  background: linear-gradient(90deg, #0d0a1c, #080618);
  border: 1px solid #1a1434;
  border-left: none;
  border-radius: 0 4px 4px 0;
  transform: perspective(600px) rotateY(90deg);
  transform-origin: left center;
}

/* Top face of tower */
.r-tower-top {
  position: absolute;
  bottom: calc(100% - 1px);
  left: 3px;
  width: calc(100% - 6px);
  height: 10px;
  background: linear-gradient(to bottom, #1a1438, #110e28);
  border: 1px solid #221840;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  transform: perspective(600px) rotateX(90deg);
  transform-origin: bottom center;
}

/* Tower internals */
.s-power-led {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #1a1030;
  align-self: flex-end;
  margin-right: 1px;
  transition: background 0.6s ease, box-shadow 0.6s ease;
}
.r-tower.on .s-power-led,
#s-tower.on .s-power-led {
  background: #34d399;
  box-shadow: 0 0 5px rgba(52,211,153,0.9), 0 0 14px rgba(52,211,153,0.4);
}

.s-fan {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid #221840;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: border-color 0.5s ease;
}
#s-tower.on .s-fan { border-color: rgba(167,139,250,0.45); }

.s-fan-inner {
  width: 100%; height: 100%;
  position: absolute;
  border-radius: 50%;
}
.s-fan-inner.spin { animation: fanSpin 0.45s linear infinite; }
@keyframes fanSpin { to { transform: rotate(360deg); } }

.s-blade {
  position: absolute;
  top: 50%; left: 50%;
  width: 46%; height: 46%;
  background: rgba(255,255,255,0.07);
  border-radius: 50% 0;
  transform-origin: 0% 100%;
  margin-left: -46%; margin-top: -46%;
}
.s-blade:nth-child(2) { transform: rotate(120deg); }
.s-blade:nth-child(3) { transform: rotate(240deg); }

.s-fan-glow {
  position: absolute; inset: 0; border-radius: 50%;
  background: transparent; transition: background 0.6s ease;
}
#s-tower.on .s-fan-glow {
  background: radial-gradient(circle, rgba(167,139,250,0.3) 0%, transparent 70%);
}

/* RGB vertical strip on tower front */
.r-tower-strip {
  width: 4px; flex: 1;
  background: rgba(255,255,255,0.04);
  border-radius: 2px;
  align-self: flex-start;
  margin-left: 2px;
  transition: all 0.5s ease;
}
#s-tower.on .r-tower-strip {
  background: linear-gradient(to bottom, #f472b6, #a78bfa, #60a5fa, #34d399, #facc15, #f472b6);
  background-size: 100% 200%;
  box-shadow: 0 0 7px rgba(167,139,250,0.55);
  animation: stripScroll 2.5s linear infinite;
}
@keyframes stripScroll {
  0%   { background-position: 0% 0%; }
  100% { background-position: 0% 200%; }
}

/* RGB strip — activated by JS adding .on to #s-rgb which is .r-ceil-rgb */
#s-rgb.on {
  background: linear-gradient(90deg, #f472b6, #a78bfa, #60a5fa, #34d399, #facc15, #fb923c, #f472b6);
  background-size: 200% 100%;
  animation: rgbChase 2.5s linear infinite;
  box-shadow: 0 4px 20px rgba(167,139,250,0.5), 0 6px 40px rgba(96,165,250,0.2);
}

/* Keyboard */
.r-kbd {
  position: absolute;
  bottom: 18px;
  left: 8%;
  display: flex;
  flex-direction: column;
  gap: 2.5px;
}
.s-krow {
  height: 4px;
  width: 110px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.s-krow:nth-child(1) { width: 110px; }
.s-krow:nth-child(2) { width: 100px; }
.s-krow:nth-child(3) { width: 90px; }

#s-kbd.on .s-krow::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(167,139,250,0.55) 40%, rgba(96,165,250,0.55) 60%, transparent 100%);
  background-size: 80% 100%;
  background-repeat: no-repeat;
  animation: kbdWave 2.2s ease-in-out infinite;
}
.s-krow:nth-child(2)::after { animation-delay: 0.15s !important; }
.s-krow:nth-child(3)::after { animation-delay: 0.30s !important; }
@keyframes kbdWave {
  0%   { background-position: -80% 0; }
  100% { background-position: 180% 0; }
}

/* Mouse */
.r-mouse {
  position: absolute;
  bottom: 18px;
  right: 28%;
  width: 13px; height: 18px;
  background: rgba(255,255,255,0.06);
  border-radius: 7px 7px 5px 5px;
  border: 1px solid rgba(255,255,255,0.09);
}
.r-mouse::before {
  content: '';
  position: absolute;
  top: 3px; left: 50%;
  transform: translateX(-50%);
  width: 1px; height: 4px;
  background: rgba(255,255,255,0.13);
  border-radius: 1px;
}

/* ── Gaming Chair ── */
.r-chair {
  position: absolute;
  bottom: 16px;
  left: 8%;
  width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: perspective(500px) rotateY(10deg);
  transform-origin: bottom center;
  z-index: 4;
}
.r-chair-headrest {
  width: 36px;
  height: 15px;
  background: linear-gradient(160deg, #2d2248, #1a1030);
  border-radius: 8px 8px 3px 3px;
  border: 1px solid rgba(167,139,250,0.22);
  flex-shrink: 0;
  position: relative;
}
.r-chair-headrest::after {
  content: '';
  position: absolute;
  top: 4px; left: 7px; right: 7px;
  height: 5px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
}
.r-chair-back {
  position: relative;
  width: 52px;
  height: 58px;
  background: linear-gradient(175deg, #2a1f45 0%, #180f30 100%);
  border-radius: 5px 5px 3px 3px;
  border: 1px solid rgba(167,139,250,0.18);
  flex-shrink: 0;
  overflow: visible;
}
.r-chair-rgb {
  position: absolute;
  bottom: 0; left: 2px; right: 2px;
  height: 2.5px;
  border-radius: 0 0 2px 2px;
  background: rgba(100,70,160,0.2);
  transition: background 0.6s ease, box-shadow 0.6s ease;
}
.r-chair-rgb.on {
  background: linear-gradient(90deg, #ec4899, #a78bfa, #60a5fa, #a78bfa, #ec4899);
  background-size: 200% 100%;
  animation: rgbShift 2.5s linear infinite;
  box-shadow: 0 0 10px rgba(167,139,250,0.85), 0 0 22px rgba(167,139,250,0.45);
}
.r-chair-wing-l,
.r-chair-wing-r {
  position: absolute;
  top: 8px;
  width: 6px;
  height: 26px;
  background: #1e1535;
  border-radius: 3px;
  border: 1px solid rgba(167,139,250,0.12);
}
.r-chair-wing-l { left: -4px; }
.r-chair-wing-r { right: -4px; }
.r-chair-arms {
  width: 64px;
  height: 12px;
  display: flex;
  justify-content: space-between;
  flex-shrink: 0;
}
.r-chair-arm-l,
.r-chair-arm-r {
  width: 7px;
  height: 18px;
  background: #221840;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.07);
  margin-top: -4px;
}
.r-chair-seat {
  width: 58px;
  height: 14px;
  background: linear-gradient(160deg, #2d2248, #1a1030);
  border-radius: 6px 6px 4px 4px;
  border: 1px solid rgba(167,139,250,0.16);
  flex-shrink: 0;
  position: relative;
}
.r-chair-seat::after {
  content: '';
  position: absolute;
  top: 3px; left: 8px; right: 8px;
  height: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
}
.r-chair-col {
  width: 7px;
  height: 18px;
  background: linear-gradient(180deg, #5a4080, #2d1f50);
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.r-chair-base {
  width: 50px;
  height: 7px;
  background: #1e1535;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  position: relative;
}
.r-chair-base::before,
.r-chair-base::after {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  border-radius: inherit;
  border: inherit;
}
.r-chair-base::before { transform: rotate(72deg); }
.r-chair-base::after  { transform: rotate(-72deg); }

/* ══════════════════════════════════════
   TOUCH / MOBILE — disable custom cursor
   ══════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
  html { cursor: auto !important; }
  a, button, label, input, textarea, select, [role="button"] { cursor: pointer !important; }
  .cur-dot, .cur-ring { display: none !important; }
  /* Spider web reacts to mouse — hide on touch since there's no pointer */
  #web-canvas { display: none; }
}

/* ══════════════════════════════════════
   TABLET  ≤ 900px
   ══════════════════════════════════════ */
@media (max-width: 900px) {
  .section-title { font-size: 1.9rem; margin-bottom: 2.5rem; }

  .hero { grid-template-columns: 1fr; padding: 7rem 2rem 3rem; text-align: center; }
  .hero-sub { max-width: 100%; }
  .hero-cta { justify-content: center; }
  .hero-visual { display: none; }

  .about-grid { grid-template-columns: 1fr; text-align: center; }
  .about-avatar { justify-content: center; }
  .about-stats { justify-content: center; }
  .about-actions { justify-content: center; }

  .contact-grid { grid-template-columns: 1fr; }
  .interests-grid { grid-template-columns: 1fr; }
  .room-scene { max-width: 100%; margin: 0 auto; }

  .exp-header { flex-direction: column; }
  .exp-meta { align-items: flex-start; }
  .edu-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════
   PHONE  ≤ 600px
   ══════════════════════════════════════ */
@media (max-width: 600px) {
  /* Nav — hamburger */
  .nav { padding: 0.45rem 0.75rem; width: 92vw; gap: 0; justify-content: space-between; }
  .nav-links {
    display: none;
    position: absolute; top: calc(100% + 0.5rem); left: 0; right: 0;
    flex-direction: column;
    background: rgba(10,5,25,0.92);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    padding: 0.75rem; gap: 0.15rem;
    z-index: 300;
  }
  .nav-links.open { display: flex; }
  .nav-links a { border-radius: 10px; padding: 0.65rem 1rem; color: var(--text-muted); }
  .nav-bubble { display: none; } /* bubble doesn't work in stacked nav */
  .nav-toggle { display: block; }

  /* Hero */
  .hero { padding: 5.5rem 1.25rem 2rem; }
  .hero-name { font-size: clamp(2.2rem, 9vw, 3rem); }
  .hero-sub { font-size: 0.95rem; }
  .hero-cta { flex-wrap: wrap; gap: 0.75rem; }

  /* Sections */
  .section { padding: 4rem 1.25rem; }
  .section-title { font-size: 1.65rem; margin-bottom: 2rem; }

  /* About */
  .avatar-ring { width: 180px; height: 180px; }
  .about-stats { flex-direction: column; align-items: center; gap: 0.75rem; }
  .about-actions { flex-direction: column; align-items: center; }
  .about-actions .btn { width: 100%; justify-content: center; }

  /* Skills — force single column below ~460px */
  .skills-grid { grid-template-columns: 1fr; }

  /* Experience */
  .exp-timeline { padding-left: 1rem; }
  .exp-card { padding: 1.25rem 1rem; }

  /* Research */
  .research-card { padding: 1.5rem 1.25rem; }
  .research-pipeline { padding: 1rem 0.5rem; gap: 0; }
  .pipe-node { min-width: 72px; }
  .pipe-label { font-size: 0.72rem; }
  .pipe-sub { font-size: 0.6rem; }
  .pipe-icon { width: 42px; height: 42px; }
  .pipe-icon svg { width: 20px; height: 20px; }
  .research-cta { flex-direction: column; gap: 0.75rem; }
  .research-cta .btn { width: 100%; justify-content: center; }
  .research-stats { gap: 1rem; }

  /* Projects — single column */
  .projects-grid { grid-template-columns: 1fr; }

  /* Contact */
  .contact-grid { gap: 2rem; }
  .li-badge { max-width: 100%; }

  /* Gaming room */
  .room-scene { height: 280px; }
  .r-desk-wrap { width: 300px; }
  .r-monitor { left: 46%; }

  /* Buttons */
  .btn { padding: 0.7rem 1.4rem; }
}

/* ══════════════════════════════════════
   SMALL PHONE  ≤ 420px
   ══════════════════════════════════════ */
@media (max-width: 420px) {
  .hero { padding: 5rem 1rem 1.5rem; }
  .section { padding: 3.5rem 1rem; }
  .section-title { font-size: 1.5rem; }

  /* Room scene — scale down for tiny screens */
  .room-scene { height: 240px; }
  .r-desk-wrap { width: 240px; bottom: 50px; }
  .r-monitor { left: 44%; }
  .r-bezel { padding: 5px; }
  .r-screen { width: 150px; height: 92px; }
  .r-tower { right: 2%; width: 44px; height: 78px; }
  .r-chair { left: 4%; width: 56px; }
  .r-kbd { left: 6%; }
  .s-krow:nth-child(1) { width: 88px; }
  .s-krow:nth-child(2) { width: 80px; }
  .s-krow:nth-child(3) { width: 72px; }

  /* Research pipeline — hide sub-labels */
  .pipe-sub { display: none; }
  .pipe-arrow-label { display: none; }

  /* Puzzle hint */
  .puzzle-hint-box { max-width: 100%; }

  /* Footer */
  .footer { padding: 1.75rem 1rem; font-size: 0.8rem; }

  /* Reduce intro terminal size */
  .term-body { font-size: 0.7rem; padding: 10px 12px 14px; }
  #intro-logo svg { width: 70px; height: 70px; }
}

/* ══════════════════════════════════════
   LARGE SCREEN / TV  ≥ 1440px
   Targets 1080p TVs, 4K monitors, wide
   desktop displays via Chrome/browser.
   ══════════════════════════════════════ */
@media (min-width: 1440px) {
  .container { max-width: 1320px; }

  .hero {
    padding: 10rem 8rem 5rem;
    gap: 5rem;
  }
  .hero-name    { font-size: clamp(4rem, 4.2vw, 6rem); }
  .hero-title   { font-size: 1.75rem; }
  .hero-sub     { font-size: 1.15rem; max-width: 520px; }
  .code-body    { font-size: 1rem; line-height: 2; }

  .section      { padding: 9rem 3rem; }
  .section-title { font-size: 2.7rem; margin-bottom: 4rem; }

  /* About */
  .avatar-ring  { width: 260px; height: 260px; }
  .about-grid   { gap: 5rem; }
  .about-text p { font-size: 1.1rem; }
  .stat-num     { font-size: 2.2rem; }

  /* Skills */
  .skills-grid  { grid-template-columns: repeat(4, 1fr); gap: 1.75rem; }
  .skill-card   { padding: 2.5rem 2rem; }

  /* Projects */
  .projects-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
  .project-card  { padding: 2.5rem; }

  /* Experience */
  .exp-card     { padding: 2rem 2.5rem; }
  .exp-title-block h3 { font-size: 1.15rem; }

  /* Research */
  .research-card { padding: 3rem; }
  .research-title { font-size: 2rem; }
  .pipe-icon    { width: 64px; height: 64px; }
  .pipe-icon svg { width: 30px; height: 30px; }
  .pipe-label   { font-size: 0.9rem; }
  .pipe-sub     { font-size: 0.78rem; }

  /* Gaming room — bigger on large screens */
  .room-scene   { max-width: 560px; height: 400px; }
  .r-desk-wrap  { width: 430px; bottom: 76px; }
  .r-screen     { width: 220px; height: 135px; }
  .r-bezel      { padding: 9px; }
  .r-mon-neck   { width: 18px; height: 20px; }
  .r-mon-foot   { width: 62px; }
  .r-tower      { width: 62px; height: 110px; right: 3%; }
  .r-chair      { left: 6%; width: 80px; }
  .r-chair-back { width: 62px; height: 70px; }
  .r-chair-headrest { width: 44px; height: 18px; }
  .r-chair-seat { width: 70px; height: 17px; }
  .r-chair-arms { width: 76px; }
  .r-kbd        { left: 10%; }
  .s-krow:nth-child(1) { width: 130px; }
  .s-krow:nth-child(2) { width: 118px; }
  .s-krow:nth-child(3) { width: 106px; }

  /* Contact */
  .contact-grid { gap: 4rem; }
  .contact-item { font-size: 1rem; }

  /* Nav — slightly larger pill */
  .nav          { width: min(780px, 92vw); }
  .nav-links a  { font-size: 0.95rem; padding: 0.45rem 1rem; }
}

/* ══════════════════════════════════════
   4K / ULTRA-WIDE  ≥ 2000px
   ══════════════════════════════════════ */
@media (min-width: 2000px) {
  .container    { max-width: 1600px; }
  .hero         { padding: 12rem 10rem 6rem; gap: 7rem; }
  .hero-name    { font-size: clamp(5rem, 4vw, 7rem); }
  .section      { padding: 11rem 4rem; }
  .section-title { font-size: 3.2rem; }
  .nav          { width: min(900px, 92vw); }
  .nav-links a  { font-size: 1rem; padding: 0.5rem 1.1rem; }
  .room-scene   { max-width: 680px; height: 480px; }
  .r-desk-wrap  { width: 520px; }
  .r-screen     { width: 265px; height: 162px; }
}
