/* ============================================================
   PARMEET GILL — Personal Website  (Redesign v2)
   Skills: frontend-design · ui-ux-pro-max · animated-website
   ============================================================ */

/* ── CSS VARIABLES ─────────────────────────────────────────── */
:root {
  --gold:        #c9a84c;
  --gold-light:  #e0c472;
  --gold-dark:   #a07830;
  --gold-glow:   rgba(201,168,76,0.25);

  --cyber:       #00d4ff;
  --cyber-dim:   rgba(0,212,255,0.12);
  --cyber-glow:  rgba(0,212,255,0.2);

  --transition:  0.3s ease;

  --font-serif:  'Playfair Display', Georgia, serif;
  --font-sans:   'DM Sans', system-ui, sans-serif;
}

/* Dark theme (default) */
[data-theme="dark"] {
  --bg:           #0a0e16;
  --bg-alt:       #0f1520;
  --bg-card:      rgba(20, 28, 46, 0.75);
  --bg-card-hover:rgba(24, 35, 58, 0.85);
  --border:       rgba(42, 58, 82, 0.7);
  --border-light: rgba(60, 80, 110, 0.5);
  --text:         #dde4ef;
  --text-muted:   #7a8fa8;
  --text-heading: #eef2f8;
  --nav-bg:       rgba(10,14,22,0.88);
  --shadow:       0 8px 32px rgba(0,0,0,0.6);
  --cursor-color: #c9a84c;
}

/* Light theme */
[data-theme="light"] {
  --bg:           #f4f0e8;
  --bg-alt:       #ece7de;
  --bg-card:      rgba(255, 255, 255, 0.85);
  --bg-card-hover:rgba(253, 248, 240, 0.95);
  --border:       rgba(200, 185, 160, 0.7);
  --border-light: rgba(180, 165, 140, 0.5);
  --text:         #2c2a25;
  --text-muted:   #6b6254;
  --text-heading: #1a1714;
  --nav-bg:       rgba(244,240,232,0.9);
  --shadow:       0 8px 32px rgba(0,0,0,0.1);
  --cursor-color: #8b6914;
}

/* ── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background-color var(--transition), color var(--transition);
  cursor: none;
  overflow-x: hidden;
}

a  { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ── CINEMATIC TERMINAL INTRO ────────────────────────────────── */
#cinematic-intro {
  position: fixed;
  inset: 0;
  z-index: 10000;
  /* Solid dark background — no backdrop-filter blur (too expensive on hosted sites) */
  background: rgb(4, 6, 14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  overflow: hidden;
  will-change: opacity;
  contain: layout paint style;
  transform: translateZ(0);
  transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Clicking ENTER SITE: overlay fades out, revealing the site beneath */
#cinematic-intro.exit {
  opacity: 0;
  pointer-events: none;
}

/* CRT scanlines overlay */
.intro-scanlines {
  position: absolute;
  inset: 0;
  /* Extra height so translateY scroll doesn't expose a gap */
  height: 200%;
  top: -100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  pointer-events: none;
  z-index: 3;
  /* transform is GPU-composited (no repaint) — much faster than background-position */
  will-change: transform;
  animation: scanline-sweep 8s linear infinite;
}

@keyframes scanline-sweep {
  0%   { transform: translateY(0); }
  100% { transform: translateY(50%); }
}

/* CRT vignette */
.intro-crt-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0,0,0,0.75) 100%);
  pointer-events: none;
  z-index: 2;
}

/* Noise texture */
.intro-noise {
  position: absolute;
  inset: -200%;
  width: 400%;
  height: 400%;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  animation: grain-shift 0.35s steps(2) infinite;
  pointer-events: none;
  z-index: 1;
  will-change: transform;
}

/* ── Terminal window ── */
.intro-terminal {
  position: relative;
  z-index: 5;
  width: min(680px, 90vw);
  background: rgba(0, 15, 5, 0.92);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 0 30px rgba(201,168,76,0.08),
    0 0 80px rgba(0,0,0,0.9),
    inset 0 0 30px rgba(0,0,0,0.5);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: rgba(201,168,76,0.06);
  border-bottom: 1px solid rgba(201,168,76,0.12);
}

.t-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.t-dot.red    { background: #ff5f57; }
.t-dot.yellow { background: #febc2e; }
.t-dot.green  { background: #28c840; }

.t-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  color: rgba(201,168,76,0.5);
  margin-left: auto;
  margin-right: auto;
  letter-spacing: 0.04em;
}

.terminal-body {
  padding: 1.4rem 1.6rem 1.2rem;
  min-height: 170px;
  position: relative;
}

#terminalLines {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.t-line {
  font-size: clamp(0.72rem, 1.5vw, 0.85rem);
  line-height: 1.5;
  color: rgba(201,168,76,0.75);
  white-space: pre;
  overflow: hidden;
}
.t-line.gold   { color: var(--gold); }
.t-line.cyber  { color: var(--cyber); }
.t-line.green  { color: #4ade80; font-weight: 700; }
.t-line.dim    { color: rgba(201,168,76,0.35); }

/* Inline progress bar inside terminal */
.t-progress-fill {
  display: inline-block;
  background: var(--gold);
  height: 0.8em;
  vertical-align: middle;
  width: 0;
  transition: width 0.04s linear;
}

.terminal-cursor {
  display: inline-block;
  color: var(--gold);
  font-size: 0.85rem;
  animation: cursor-blink 0.85s step-end infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Big name reveal ── */
.intro-name-wrap {
  position: relative;
  z-index: 5;
  text-align: center;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.intro-name-wrap.visible {
  opacity: 1;
  transform: scale(1);
}

.intro-name-glitch {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  position: relative;
  line-height: 1;
  animation: name-glitch 3s step-end infinite;
}

.intro-name-glitch::before,
.intro-name-glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: transparent;
}

.intro-name-glitch::before {
  color: #ff0040;
  animation: glitch-slice-top 3s step-end infinite;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.intro-name-glitch::after {
  color: #00d4ff;
  animation: glitch-slice-bot 3s step-end infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch-slice-top {
  0%, 90%, 100% { transform: translate(0, 0); opacity: 0; }
  91%  { transform: translate(-4px, -2px); opacity: 0.8; }
  92%  { transform: translate(4px, 0);    opacity: 0.8; }
  93%  { transform: translate(-2px, 1px); opacity: 0.8; }
  94%  { transform: translate(0, 0);      opacity: 0; }
}

@keyframes glitch-slice-bot {
  0%, 90%, 100% { transform: translate(0, 0); opacity: 0; }
  91%  { transform: translate(3px, 2px);  opacity: 0.8; }
  92%  { transform: translate(-3px, 0);   opacity: 0.8; }
  93%  { transform: translate(2px, -1px); opacity: 0.8; }
  94%  { transform: translate(0, 0);      opacity: 0; }
}

@keyframes name-glitch {
  0%, 90%, 100% { text-shadow: none; transform: none; }
  91% { text-shadow: -3px 0 rgba(255,0,64,0.5), 3px 0 rgba(0,212,255,0.5); transform: skewX(-1deg); }
  93% { text-shadow: 2px 0 rgba(255,0,64,0.5), -2px 0 rgba(0,212,255,0.5); transform: skewX(0.5deg); }
  95% { text-shadow: none; transform: none; }
}

.intro-name-rule {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0.6rem auto 0.65rem;
}

.intro-name-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(0.65rem, 1.5vw, 0.82rem);
  letter-spacing: 0.25em;
  color: rgba(201,168,76,0.55);
  text-transform: uppercase;
  min-height: 1.2em;
}

/* ── Enter button ── */
.intro-enter-btn {
  position: relative;
  z-index: 5;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  background: transparent;
  border: 1px solid rgba(201,168,76,0.4);
  padding: 0.7rem 2.2rem;
  border-radius: 4px;
  cursor: none;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s ease;
  animation: enter-pulse 2s ease-in-out infinite;
}

.intro-enter-btn.show {
  opacity: 1;
  transform: translateY(0);
}

.intro-enter-btn:hover {
  background: var(--gold);
  color: #000;
  box-shadow: 0 0 30px var(--gold-glow), 0 0 60px var(--gold-glow);
  animation: none;
}

.enter-bracket {
  opacity: 0.5;
  transition: opacity 0.2s ease;
}
.intro-enter-btn:hover .enter-bracket { opacity: 1; }

@keyframes enter-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(201,168,76,0.15); border-color: rgba(201,168,76,0.4); }
  50%       { box-shadow: 0 0 22px rgba(201,168,76,0.35); border-color: rgba(201,168,76,0.7); }
}

/* ── Skip button ── */
.intro-skip {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 10;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: rgba(201,168,76,0.35);
  background: none;
  border: none;
  cursor: none;
  transition: color 0.2s ease;
}
.intro-skip:hover { color: rgba(201,168,76,0.75); }

/* crt-flicker keyframes kept for future use */
@keyframes crt-flicker {
  0%, 97%, 100% { opacity: 1; }
  97.5% { opacity: 0.9; }
  98.5% { opacity: 0.85; }
}

/* Full-screen glitch — fires on whole intro after ACCESS GRANTED */
@keyframes screen-glitch-full {
  0%   { filter: none;                                              transform: none; }
  8%   { filter: hue-rotate(90deg)  brightness(2.8) saturate(3);  transform: skewX(-4deg) scaleY(1.01); }
  16%  { filter: hue-rotate(200deg) brightness(1.3);               transform: skewX(3deg); }
  24%  { filter: brightness(0.08)   saturate(0);                   transform: skewX(-2deg) translateX(4px); }
  32%  { filter: brightness(3.5)    hue-rotate(45deg);             transform: scaleX(1.004) skewX(1.5deg); }
  40%  { filter: none;                                              transform: none; }
  50%  { filter: hue-rotate(160deg) brightness(2) saturate(4);     transform: skewX(-3deg); }
  58%  { filter: brightness(0.2);                                   transform: translateX(-3px) skewX(1deg); }
  66%  { filter: none;                                              transform: none; }
  76%  { filter: hue-rotate(70deg)  brightness(1.6);               transform: skewX(1.5deg); }
  86%  { filter: brightness(0.5)    saturate(0);                   transform: skewX(-0.5deg); }
  100% { filter: none;                                              transform: none; }
}

#cinematic-intro.screen-glitch {
  animation: screen-glitch-full 0.75s steps(1) forwards !important;
}

/* ── FILM GRAIN ─────────────────────────────────────────────── */
.film-grain {
  position: fixed;
  inset: -200%;
  width: 400%;
  height: 400%;
  z-index: 100;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  animation: grain-shift 0.45s steps(2) infinite;
}

[data-theme="light"] .film-grain { opacity: 0.018; }

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-6%, -10%); }
  50%  { transform: translate(-14%, 6%); }
  75%  { transform: translate(8%, -24%); }
}

/* ── VIGNETTE ───────────────────────────────────────────────── */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(6,8,16,0.55) 100%);
}

[data-theme="light"] .vignette {
  background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(220,210,195,0.4) 100%);
}

/* ── SCROLL PROGRESS ────────────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 9999;
  background: transparent;
}

#scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--cyber));
  border-radius: 0 2px 2px 0;
  transition: width 0.08s linear;
  box-shadow: 0 0 8px var(--gold-glow);
}

/* ── CHAPTER NAV (right side) ───────────────────────────────── */
.chapter-nav {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.ch-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-light);
  border: 1px solid var(--border);
  display: block;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
  position: relative;
  cursor: none;
}

.ch-dot::before {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.ch-dot:hover::before { opacity: 1; }

.ch-dot.active {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 10px var(--gold-glow), 0 0 20px var(--gold-glow);
  transform: scale(1.4);
}

.ch-dot:hover:not(.active) {
  background: var(--text-muted);
  transform: scale(1.2);
}

@media (max-width: 768px) { .chapter-nav { display: none; } }

/* ── CANVAS BG ──────────────────────────────────────────────── */
#bgCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.5s ease;
  /* Own compositing layer so backdrop-filter elements don't force re-raster */
  will-change: contents;
  transform: translateZ(0);
}

[data-theme="light"] #bgCanvas { opacity: 0.2; }

/* ── CUSTOM CURSOR ──────────────────────────────────────────── */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 7px;
  height: 7px;
  background: var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10002;
  will-change: transform;
  transition: width 0.15s ease, height 0.15s ease, background 0.15s ease;
}

.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10001;
  will-change: transform;
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease;
  opacity: 0.55;
}

body.cursor-hover .cursor-dot  { width: 13px; height: 13px; background: var(--cyber); }
body.cursor-hover .cursor-ring { width: 50px; height: 50px; border-color: var(--cyber); opacity: 0.85; }
body.cursor-click .cursor-dot  { width: 5px; height: 5px; }
body.cursor-click .cursor-ring { width: 26px; height: 26px; }

/* ── NAVBAR ─────────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition),
              transform 0.35s cubic-bezier(0.16,1,0.3,1), box-shadow var(--transition);
}

#navbar.nav-hidden { transform: translateY(-100%); }

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  text-decoration: none;
  display: inline-block;
  perspective: 260px;
  perspective-origin: 50% 50%;
}

/* ── 3D Logo Spin ── */
.pg-3d-logo {
  display: inline-block;
  transform-style: preserve-3d;
  animation: pg-y-spin 4s linear infinite;
  position: relative;
  line-height: 1;
}

.pg-3d-logo:hover {
  animation-play-state: paused;
}

.pg-face {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  display: block;
  user-select: none;
}

/* Front face — brightest gold, sits farthest forward */
.pg-front {
  color: var(--gold);
  transform: translateZ(8px);
  position: relative; /* holds layout space */
}

/* Depth layers — stacked behind front face, progressively darker */
.pg-depth {
  position: absolute;
  inset: 0;
  color: var(--dc);
  transform: translateZ(var(--dz));
}

/* Back face — darkest, sits farthest back */
.pg-back {
  position: absolute;
  inset: 0;
  color: #1e1000;
  transform: translateZ(0px);
}

@keyframes pg-y-spin {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width var(--transition);
}

.nav-links a:hover { color: var(--gold); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--gold); }
.nav-links a.active::after { width: 100%; }

.nav-resume-btn {
  color: var(--gold) !important;
  border: 1px solid var(--gold);
  padding: 0.3rem 0.85rem;
  border-radius: 4px;
  transition: background var(--transition), color var(--transition) !important;
}
.nav-resume-btn:hover {
  background: var(--gold) !important;
  color: #0a0e16 !important;
}
.nav-resume-btn::after { display: none !important; }

/* ── THEME TOGGLE ────────────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: none;
  cursor: none;
  padding: 0;
  flex-shrink: 0;
}

.toggle-track {
  display: flex;
  align-items: center;
  width: 56px;
  height: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative;
  padding: 0 4px;
  transition: background var(--transition), border-color var(--transition);
}

.toggle-thumb {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  left: 4px;
  transition: transform var(--transition), background var(--transition);
  z-index: 1;
}

[data-theme="light"] .toggle-thumb { transform: translateX(28px); }

.toggle-icon {
  font-size: 0.7rem;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity var(--transition);
  z-index: 0;
}
.toggle-icon.sun  { right: 6px; opacity: 1; }
.toggle-icon.moon { left: 6px;  opacity: 0.5; }
[data-theme="light"] .toggle-icon.sun  { opacity: 0.5; }
[data-theme="light"] .toggle-icon.moon { opacity: 1; }

/* ── HAMBURGER ────────────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: none;
  padding: 4px;
  margin-left: auto;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: background var(--transition);
}

/* ── MOBILE MENU ─────────────────────────────────────────────── */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.77,0,0.175,1);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu ul { text-align: center; }
.mobile-menu li + li { margin-top: 1.5rem; }
.mobile-menu a {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--text);
  transition: color var(--transition);
}
.mobile-menu a:hover { color: var(--gold); }
.mobile-close {
  position: absolute;
  top: 1.5rem; right: 1.75rem;
  background: none; border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: none;
}

/* ── MAIN / SECTIONS ─────────────────────────────────────────── */
main { position: relative; z-index: 2; }

.section { padding: 7rem 0; }
.section-alt {
  background: var(--bg-alt);
  transition: background var(--transition);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── SECTION TITLES with DRAW UNDERLINE + GLITCH ─────────────── */
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--cyber));
  margin-top: 0.5rem;
  border-radius: 2px;
  transition: width 0.55s cubic-bezier(0.16,1,0.3,1) 0.15s;
}

/* Reveal title: starts invisible, glitch effect on entry */
.reveal-title {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-title.visible {
  opacity: 1;
  transform: translateY(0);
  animation: title-glitch 0.45s ease forwards;
}

.reveal-title.visible::after { width: 60px; }

@keyframes title-glitch {
  0%   { opacity: 0; transform: translateY(22px); }
  55%  { opacity: 1; transform: translateY(-2px); }
  65%  { transform: translateY(-2px) skewX(-1.5deg); text-shadow: -1px 0 rgba(0,212,255,0.45); }
  75%  { transform: translateY(-1px) skewX(1deg);   text-shadow:  1px 0 rgba(201,168,76,0.4); }
  85%  { transform: translateY(0) skewX(-0.5deg);   text-shadow: none; }
  100% { opacity: 1; transform: translateY(0); text-shadow: none; }
}

/* ── HERO ────────────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 820px;
  width: 100%;
  will-change: transform;
}

.hero-eyebrow {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--gold);
  margin-bottom: 0.75rem;
  opacity: 0;
  animation: hero-rise 0.7s cubic-bezier(0.16,1,0.3,1) 0.1s both paused;
}
body.site-ready .hero-eyebrow { animation-play-state: running; }

.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 9vw, 7rem);
  font-weight: 700;
  line-height: 1.0;
  color: var(--text-heading);
  margin-bottom: 1.25rem;
  overflow: visible;
}

/* Letter-split char animation (injected by JS) */
.hero-name .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.hero-name .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(110%);
  animation: char-enter 0.65s cubic-bezier(0.16,1,0.3,1) both paused;
}
body.site-ready .hero-name .char { animation-play-state: running; }

.name-accent .char { color: var(--gold); }

@keyframes char-enter {
  from { opacity: 0; transform: translateY(110%); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-tagline {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  letter-spacing: 0.02em;
  font-weight: 300;
  opacity: 0;
  animation: hero-rise 0.7s cubic-bezier(0.16,1,0.3,1) 0.4s both paused;
}
body.site-ready .hero-tagline { animation-play-state: running; }

/* Social Icons */
.hero-socials {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: hero-rise 0.7s cubic-bezier(0.16,1,0.3,1) 0.65s both paused;
}
body.site-ready .hero-socials { animation-play-state: running; }

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: none;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}

.social-icon svg {
  width: 21px;
  height: 21px;
}

.social-icon:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.1);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--gold-glow);
}

/* Email dropdown */
.email-wrapper {
  position: relative;
  display: inline-flex;
}

.email-dropdown {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 160px;
  box-shadow: var(--shadow);
  z-index: 200;
}
.email-dropdown.open {
  display: flex;
  animation: dropdown-in 0.18s ease;
}

.email-dropdown::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border);
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.email-opt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
  white-space: nowrap;
}

.email-opt svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition);
}

.email-opt:hover { background: rgba(201,168,76,0.1); color: var(--gold); }
.email-opt:hover svg { color: var(--gold); }

/* Scroll hint */
.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  animation: fade-bob 2.5s ease-in-out 1s infinite paused;
}
body.site-ready .hero-scroll-hint { animation-play-state: running; }

.scroll-line {
  width: 1px;
  height: 38px;
  background: linear-gradient(to bottom, var(--gold), transparent);
}

@keyframes fade-bob {
  0%, 100% { opacity: 0.35; transform: translateX(-50%) translateY(0); }
  50%       { opacity: 0.9;  transform: translateX(-50%) translateY(6px); }
}

/* ── ABOUT ───────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  color: var(--text);
  font-size: 1rem;
  font-weight: 300;
  margin-bottom: 1.2rem;
  line-height: 1.8;
}
.about-text strong { color: var(--gold); font-weight: 600; }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: 10px;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35), 0 0 0 1px var(--gold-glow);
}
.stat-card:hover::before { opacity: 1; }

.stat-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  position: relative;
}

.stat-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 0.4rem;
  line-height: 1.4;
  position: relative;
}

/* ── TIMELINE (EXPERIENCE) ───────────────────────────────────── */
.timeline { position: relative; padding-left: 2rem; }

.timeline-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.timeline-item.visible { opacity: 1; transform: translateX(0); }

.timeline-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  background: var(--gold);
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 3px var(--gold), 0 0 12px var(--gold-glow);
  margin-top: 0.35rem;
  flex-shrink: 0;
  transition: box-shadow 0.3s ease;
}

.timeline-line {
  width: 2px;
  max-height: 0;
  overflow: hidden;
  flex: 1;
  background: linear-gradient(to bottom, var(--gold), var(--border));
  margin-top: 6px;
  transition: max-height 1s cubic-bezier(0.16,1,0.3,1) 0.35s;
}

.timeline-item.visible .timeline-line { max-height: 300px; }

.timeline-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  flex: 1;
  transition: box-shadow var(--transition), transform var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
}

.timeline-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 0;
  background: linear-gradient(to bottom, var(--gold), var(--cyber));
  transition: height 1s cubic-bezier(0.16,1,0.3,1) 0.4s;
  border-radius: 0 0 0 0;
}

.timeline-item.visible .timeline-card::before { height: 100%; }

.timeline-card:hover {
  box-shadow: var(--shadow), 0 0 0 1px var(--gold-glow);
  transform: translateX(5px);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.company-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  padding: 0.18rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}

.job-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-heading);
}

.job-date {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: 0.25rem;
  font-weight: 300;
}

.job-bullets { padding-left: 1.1rem; list-style: disc; }
.job-bullets li {
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 0.5rem;
  list-style-type: disc;
  line-height: 1.65;
}
.job-bullets strong { color: var(--gold); font-weight: 600; }

/* ── PROJECTS ────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1),
              box-shadow 0.4s ease,
              background var(--transition);
  opacity: 0;
  transform: translateY(32px);
  position: relative;
  overflow: hidden;
}

.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--cyber-dim) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 14px;
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 0 1px var(--cyber-glow);
  background: var(--bg-card-hover);
}

.project-card:hover::after { opacity: 1; }

/* SVG project icon */
.project-icon-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 10px;
  margin-bottom: 1.25rem;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.project-icon-wrap svg {
  width: 22px;
  height: 22px;
  color: var(--gold);
  stroke: var(--gold);
}

.project-card:hover .project-icon-wrap {
  background: rgba(0,212,255,0.1);
  border-color: rgba(0,212,255,0.3);
}

.project-card:hover .project-icon-wrap svg {
  color: var(--cyber);
  stroke: var(--cyber);
}

.project-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.project-desc {
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}
.project-desc strong { color: var(--gold); font-weight: 500; }

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.tag {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gold);
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.22);
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
}

.project-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gold);
  transition: color var(--transition), letter-spacing var(--transition);
  position: relative;
  z-index: 1;
}
.project-link:hover { color: var(--cyber); letter-spacing: 0.02em; }

/* ── SKILLS ──────────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
}

.skill-group {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease, background var(--transition);
}
.skill-group.visible { opacity: 1; transform: translateY(0); }
.skill-group:hover {
  box-shadow: var(--shadow), 0 0 0 1px var(--border-light);
  border-color: var(--border-light);
}

.skill-group-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.skill-pills { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.pill {
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--text);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  transition: all 0.25s ease;
  cursor: default;
}

.pill:hover {
  background: var(--cyber-dim);
  border-color: rgba(0,212,255,0.3);
  color: var(--cyber);
  transform: translateY(-1px);
}

/* ── EDUCATION & CERTS ───────────────────────────────────────── */
.edu-certs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.subsection-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 1.5rem;
}

.edu-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateX(-22px);
  transition: opacity 0.5s ease, transform 0.5s ease, background var(--transition);
}
.edu-card.visible { opacity: 1; transform: translateX(0); }
.edu-card:hover { box-shadow: var(--shadow); }

.edu-icon-wrap {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 8px;
}

.edu-icon-wrap svg {
  width: 20px;
  height: 20px;
  color: var(--gold);
  stroke: var(--gold);
}

.edu-school {
  font-weight: 600;
  color: var(--text-heading);
  font-size: 0.9rem;
}
.edu-program {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--gold);
  margin-top: 0.15rem;
}

/* Certs */
.certs-list { display: flex; flex-direction: column; gap: 0.7rem; }

.cert-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  opacity: 0;
  transform: translateX(22px);
  transition: opacity 0.5s ease, transform 0.5s ease, background var(--transition);
}
.cert-item.visible { opacity: 1; transform: translateX(0); }
.cert-item:hover { box-shadow: var(--shadow); }

.cert-name {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text);
}

.cert-status {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.cert-status.in-progress {
  background: rgba(201,168,76,0.12);
  color: var(--gold);
  border: 1px solid rgba(201,168,76,0.28);
}
.cert-status.earned {
  background: rgba(34,197,94,0.1);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.25);
}
[data-theme="light"] .cert-status.earned {
  color: #15803d;
  background: rgba(21,128,61,0.08);
  border-color: rgba(21,128,61,0.25);
}

/* ── FOOTER ──────────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 300;
  background: var(--bg);
  transition: background var(--transition), border-color var(--transition);
}

/* ── SCROLL-ANIMATE HELPER [data-aos] ────────────────────────── */
[data-aos] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
[data-aos].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── REDUCED MOTION SUPPORT ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .film-grain { display: none; }
  .hero-name .char {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .hero-eyebrow, .hero-tagline, .hero-socials { animation: none; opacity: 1; }
  .reveal-title { opacity: 1; transform: none; animation: none; }
  .reveal-title::after { width: 60px !important; }
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .skills-grid    { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .about-grid     { grid-template-columns: 1fr; }
  .edu-certs-grid { grid-template-columns: 1fr; }
  .skills-grid    { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links     { display: none; }
  .nav-hamburger { display: flex; }
  .timeline      { padding-left: 0; }
  .timeline-item { flex-direction: column; gap: 0.75rem; }
  .timeline-marker { flex-direction: row; }
  .timeline-line { display: none; }
  .about-stats   { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .section       { padding: 5rem 0; }
  .about-stats   { grid-template-columns: 1fr; }
}

/* ── 3D TILT CARDS ───────────────────────────────────────────── */
.project-card,
.timeline-card,
.stat-card {
  transform-style: preserve-3d;
  will-change: transform;
}

/* Tilt shine reflection */
.tilt-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.07) 0%, transparent 65%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.project-card:hover .tilt-shine,
.timeline-card:hover .tilt-shine,
.stat-card:hover .tilt-shine {
  opacity: 1;
}

/* ── CURSOR TRAIL ────────────────────────────────────────────── */
#cursorTrail { position: fixed; inset: 0; pointer-events: none; z-index: 10003; }

.trail-dot {
  position: fixed;
  top: 0; left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  pointer-events: none;
  will-change: transform;
  transform: translate(-50%, -50%);
  animation: trail-fade 0.6s ease forwards;
}

@keyframes trail-fade {
  0%   { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(0.2); }
}

/* ── HERO TAGLINE TYPEWRITER ─────────────────────────────────── */
.hero-tagline-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--gold);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: cursor-blink 0.85s step-end infinite;
}

/* ── MAGNETIC SOCIAL ICONS ───────────────────────────────────── */
.social-icon {
  transition: transform 0.2s cubic-bezier(0.16,1,0.3,1),
              border-color 0.3s ease,
              color 0.3s ease,
              background 0.3s ease,
              box-shadow 0.3s ease !important;
}

/* ── HOVER RIPPLE ON BUTTONS ─────────────────────────────────── */
.nav-resume-btn,
.project-link,
.intro-enter-btn {
  position: relative;
  overflow: hidden;
}

.nav-resume-btn::before,
.intro-enter-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(201,168,76,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.nav-resume-btn:hover::before,
.intro-enter-btn:hover::before {
  opacity: 1;
}


/* ── COMPANY LOGO WRAPS (Experience) ─────────────────────────── */
.timeline-header-main {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.company-logo-wrap {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

[data-theme="light"] .company-logo-wrap {
  background: rgba(255,255,255,0.9);
}

.timeline-card:hover .company-logo-wrap {
  border-color: var(--gold);
  background: rgba(201,168,76,0.07);
  box-shadow: 0 0 14px rgba(201,168,76,0.15);
}

.company-logo-wrap svg {
  width: 28px;
  height: 28px;
  display: block;
}

/* ── SCHOOL LOGO WRAPS (Education) ───────────────────────────── */
.edu-logo-wrap {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  transition: box-shadow var(--transition), transform var(--transition);
}

.edu-card:hover .edu-logo-wrap {
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transform: scale(1.05);
}

/* ── CERT BADGE ICONS ─────────────────────────────────────────── */
.cert-badge-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.cert-item:hover .cert-badge-icon {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.cert-badge-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}


/* ══════════════════════════════════════════════════════════════
   AI CHAT SIDEBAR
   ══════════════════════════════════════════════════════════════ */

/* ── Navbar "Ask AI" button ── */
.nav-ask-ai-btn {
  background: linear-gradient(135deg, var(--gold) 0%, #e8d070 100%);
  color: #08090f;
  border: none;
  border-radius: 20px;
  padding: 0.32rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.nav-ask-ai-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px var(--gold-glow);
}

/* Mobile Ask AI */
.mobile-ask-ai {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  color: var(--gold) !important;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

/* ── Overlay ── */
.chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 4999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  /* No backdrop-filter — full-screen blur over animated canvas kills perf */
}
.chat-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Chat Sidebar Panel ── */
.chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  /* Solid background — no backdrop-filter (causes lag over animated canvas) */
  background: var(--bg);
  border-left: 1px solid var(--border);
  border-left-color: var(--gold);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -8px 0 48px rgba(0,0,0,0.55), -1px 0 0 var(--gold-glow);
  z-index: 5000;

  will-change: transform;
  contain: layout paint style;

  /* Hidden state — slides off-screen to the right */
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-panel.open {
  transform: translateX(0);
}

@keyframes spin-glow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Panel Header ── */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(201,168,76,0.06);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #e8d070);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-weight: 700;
  color: #08090f;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--gold-glow);
}

.chat-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.3;
}

.chat-subtitle {
  font-size: 0.65rem;
  color: var(--cyber);
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.06em;
  opacity: 0.8;
  margin-top: 0.1rem;
}

.chat-minimize {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: none;
  padding: 0.2rem;
  line-height: 1;
  transition: color var(--transition);
  flex-shrink: 0;
}
.chat-minimize:hover { color: var(--gold); }

/* ── Messages ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chat-msg {
  display: flex;
  flex-direction: column;
  animation: msg-appear 0.25s cubic-bezier(0.16,1,0.3,1);
}
.chat-msg.user { align-items: flex-end; }
.chat-msg.ai   { align-items: flex-start; }

@keyframes msg-appear {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg-bubble {
  max-width: 84%;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.65;
  font-weight: 300;
  word-wrap: break-word;
}

.chat-msg.user .msg-bubble {
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.28);
  color: var(--text);
  border-bottom-right-radius: 3px;
}

.chat-msg.ai .msg-bubble {
  background: rgba(0,212,255,0.06);
  border: 1px solid rgba(0,212,255,0.18);
  color: var(--text);
  border-bottom-left-radius: 3px;
}

/* Typing dots */
.typing-indicator .msg-bubble { padding: 0.85rem 1rem; }

.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  height: 14px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyber);
  animation: typing-bounce 1.3s ease-in-out infinite;
  opacity: 0.5;
}
.typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-7px); opacity: 1; }
}

/* ── Suggestion Chips ── */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1.1rem 0.9rem;
  flex-shrink: 0;
}

.chat-suggestion {
  font-size: 0.7rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.28rem 0.7rem;
  cursor: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.chat-suggestion:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.07);
  transform: translateY(-1px);
}

/* ── Input Area ── */
.chat-input-area {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(0,0,0,0.1);
}

.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.84rem;
  color: var(--text);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition), background var(--transition);
  cursor: text;
}

.chat-input::placeholder { color: var(--text-muted); opacity: 0.65; }

.chat-input:focus {
  border-color: rgba(201,168,76,0.5);
  background: rgba(255,255,255,0.06);
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--gold);
  border: none;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), transform 0.2s ease, opacity 0.2s ease;
}

.chat-send-btn:hover:not(:disabled) {
  background: var(--gold-light);
  transform: scale(1.06);
}

.chat-send-btn:disabled { opacity: 0.45; }

.chat-send-btn svg {
  width: 15px;
  height: 15px;
  color: #08090f;
}

/* Light theme overrides */
[data-theme="light"] .chat-panel {
  box-shadow: -8px 0 48px rgba(0,0,0,0.12), -1px 0 0 var(--gold-glow);
}
[data-theme="light"] .chat-msg.ai .msg-bubble {
  background: rgba(0,150,180,0.06);
  border-color: rgba(0,150,180,0.2);
}
[data-theme="light"] .chat-overlay {
  background: rgba(0,0,0,0.25);
}

/* Responsive — full-width on mobile */
@media (max-width: 480px) {
  .chat-panel { width: 100vw; }
}
