/* ============================================================
   PAGE LOADER — F1 LAUNCH SEQUENCE
   ============================================================ */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #09090e;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.75s cubic-bezier(0.9, 0, 1, 1);
}

#page-loader.loader-out {
  transform: translateY(-100%);
}

/* Track line across center */
.loader-track {
  position: absolute;
  bottom: 36%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(229,24,26,0.5) 20%, rgba(229,24,26,0.5) 80%, transparent 100%);
}

/* Track dashes above line */
.loader-track::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0; right: 0;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255,255,255,0.12) 0px,
    rgba(255,255,255,0.12) 24px,
    transparent 24px,
    transparent 48px
  );
}

/* Centered brand text that fades in then out */
.loader-brand {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: brandFade 2.2s ease forwards;
}

.loader-brand-name {
  font-family: "Sora", sans-serif;
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1;
}

.loader-brand-sub {
  font-family: "Space Grotesk", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

@keyframes brandFade {
  0%   { opacity: 0; transform: translateY(8px); }
  20%  { opacity: 1; transform: translateY(0); }
  70%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-4px); }
}

/* Car wrapper — slides across the screen */
.loader-car-wrap {
  position: absolute;
  bottom: calc(36% - 70px);  /* sit on the track line */
  left: 0;
  display: flex;
  align-items: flex-end;
  animation: carRush 1.45s cubic-bezier(0.04, 0, 0.78, 1) 0.55s both;
  will-change: transform;
}

@keyframes carRush {
  from { transform: translateX(-620px); }
  to   { transform: translateX(calc(100vw + 180px)); }
}

/* Motion blur glow trail */
.loader-trail {
  position: absolute;
  right: 100%;
  top: 30%;
  width: 420px;
  height: 56px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(229,24,26,0.08) 30%,
    rgba(229,24,26,0.35) 65%,
    rgba(255,180,0,0.2) 100%
  );
  filter: blur(6px);
  pointer-events: none;
}

/* Speed lines */
.loader-speed-lines {
  position: absolute;
  right: 102%;
  top: 0;
  bottom: 0;
  width: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
}

.loader-speed-line {
  height: 1.5px;
  border-radius: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), rgba(229,24,26,0.4));
  transform-origin: right center;
}

.loader-speed-line:nth-child(1)  { width: 280px; opacity: 0.7; }
.loader-speed-line:nth-child(2)  { width: 200px; opacity: 0.45; margin-left: 80px; }
.loader-speed-line:nth-child(3)  { width: 240px; opacity: 0.6; }
.loader-speed-line:nth-child(4)  { width: 160px; opacity: 0.3; margin-left: 120px; }
.loader-speed-line:nth-child(5)  { width: 220px; opacity: 0.5; margin-left: 40px; }
.loader-speed-line:nth-child(6)  { width: 180px; opacity: 0.35; margin-left: 100px; }
.loader-speed-line:nth-child(7)  { width: 260px; opacity: 0.6; }
.loader-speed-line:nth-child(8)  { width: 140px; opacity: 0.25; margin-left: 160px; }

/* F1 car SVG sizing inside loader */
.loader-car-svg {
  width: 560px;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 32px rgba(229,24,26,0.55));
}

/* Loader bottom sector marker */
.loader-sector {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Space Grotesk", monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.18);
  animation: sectorPulse 1.8s ease-in-out infinite;
}

@keyframes sectorPulse {
  0%, 100% { opacity: 0.18; }
  50%       { opacity: 0.45; }
}

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Background layers */
  --bg:           #09090e;
  --surface:      #0e1117;
  --surface-2:    #141a24;
  --surface-3:    #1b2232;

  /* Typography */
  --text:         #e8ebf4;
  --muted:        #7a8499;
  --subtle:       #4a5568;

  /* Accents */
  --red:          #e5181a;
  --red-2:        #ff5533;
  --red-glow:     rgba(229, 24, 26, 0.18);
  --teal:         #00c0d4;
  --teal-dim:     rgba(0, 192, 212, 0.12);
  --ok:           #22c55e;

  /* Borders */
  --line:         rgba(255, 255, 255, 0.07);
  --line-hover:   rgba(229, 24, 26, 0.45);

  /* Shadows */
  --shadow-sm:    0 2px 12px rgba(0, 0, 0, 0.35);
  --shadow-md:    0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg:    0 20px 60px rgba(0, 0, 0, 0.55);

  /* Layout */
  --radius:       14px;
  --radius-sm:    8px;
  --radius-pill:  999px;

  /* Header */
  --header-bg:    rgba(9, 9, 14, 0.85);
  --header-line:  rgba(255, 255, 255, 0.06);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* ============================================================
   SCROLL PROGRESS BAR — F1 lap indicator
   ============================================================ */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #e5181a 0%, #ff4d4f 60%, #ffb400 100%);
  z-index: 10000;
  border-radius: 0 2px 2px 0;
  transition: width 0.08s linear;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(229, 24, 26, 0.6);
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: rgba(229, 24, 26, 0.3); }

a { color: inherit; }

/* ============================================================
   BACKGROUND LAYERS
   ============================================================ */
.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -3;
  background:
    radial-gradient(ellipse 80% 60% at 15% -10%, rgba(229, 24, 26, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 5%,   rgba(0, 192, 212, 0.04) 0%, transparent 55%),
    radial-gradient(ellipse 100% 80% at 50% 100%, rgba(229, 24, 26, 0.04) 0%, transparent 60%),
    var(--bg);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, black 30%, transparent 100%);
}

.cursor-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 24, 26, 0.14), transparent 68%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: transform;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 5vw;
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--header-line);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
}

.brand-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-family: "Sora", sans-serif;
  font-weight: 900;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.75rem 0.3rem 0.65rem;
  border-radius: 5px;
  clip-path: polygon(7% 0%, 100% 0%, 93% 100%, 0% 100%);
  box-shadow: 0 0 14px rgba(229,24,26,0.45);
  transition: box-shadow 0.2s;
}

.brand:hover .brand-plate {
  box-shadow: 0 0 22px rgba(229,24,26,0.7);
}

.nav {
  margin-left: auto;
  display: flex;
  gap: 0.15rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: color 0.18s, background 0.18s;
  letter-spacing: 0.01em;
}

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

.nav a.active {
  color: var(--red);
  background: rgba(229, 24, 26, 0.08);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mode-toggle-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}

.mode-toggle-btn:hover {
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
}

.theme-icon {
  width: 17px;
  height: 17px;
  fill: var(--muted);
  display: none;
  pointer-events: none;
}

body[data-theme="dark"] .sun-icon  { display: block; }
body[data-theme="dark"] .moon-icon { display: none;  }

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.42rem 0.75rem;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ============================================================
   LAYOUT
   ============================================================ */
main {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding-bottom: 6rem;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 3rem;
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: 3rem 0;
  position: relative;
}

.hero-content {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Space Grotesk", monospace;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

.eyebrow-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px rgba(229, 24, 26, 0.8);
}

h1 {
  font-family: "Sora", sans-serif;
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 1.1rem;
  color: var(--text);
}

.hero-copy {
  max-width: 560px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 1.4rem;
  font-size: 1.05rem;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.07);
  color: #4ade80;
  border-radius: var(--radius-pill);
  padding: 0.38rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.8rem;
  letter-spacing: 0.02em;
}

.avail-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.5);
  animation: pulse-ring 2.2s ease-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.icon-link {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.icon-link svg {
  width: 17px;
  height: 17px;
  fill: var(--muted);
  transition: fill 0.2s;
}

.icon-link:hover {
  border-color: rgba(229, 24, 26, 0.5);
  background: var(--red-glow);
  transform: translateY(-2px);
}

.icon-link:hover svg { fill: var(--text); }

.social-text-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.38rem 0.8rem;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.social-text-link:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
}

/* ============================================================
   HERO VISUAL
   ============================================================ */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.avatar-wrap {
  position: relative;
  width: 320px;
  height: 320px;
}

.avatar-wrap img,
.avatar-wrap svg {
  width: 100%;
  height: 100%;
  animation: avatar-float 3.5s ease-in-out infinite;
}

@keyframes avatar-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-14px); }
}

/* Subtle glow ring behind avatar */
.avatar-wrap::before {
  content: "";
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 24, 26, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  animation: avatar-breathe 4s ease-in-out infinite;
}

@keyframes avatar-breathe {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.06); }
}

/* ============================================================
   SECTION BASE
   ============================================================ */
.section {
  padding: 3.5rem 0 1rem;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.8rem;
}

.section-num {
  font-family: "Space Grotesk", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--red);
  background: rgba(229, 24, 26, 0.1);
  border: 1px solid rgba(229, 24, 26, 0.2);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.55rem;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

h2 {
  font-family: "Sora", sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

.section-rule {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--line) 0%, transparent 100%);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.1rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 20px rgba(229, 24, 26, 0.3);
}

.btn-primary:hover {
  background: #ff2820;
  box-shadow: 0 8px 28px rgba(229, 24, 26, 0.42);
}

.btn-outline {
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.03);
  color: var(--text);
}

.btn-outline:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
}

.btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  padding: 0.42rem 0.85rem;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(229, 24, 26, 0.4);
  background: var(--red-glow);
}

/* ============================================================
   CARDS
   ============================================================ */
.cards { display: grid; gap: 1rem; }

.two-col   { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.22s, box-shadow 0.22s, transform 0.22s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255,255,255,0.025) 0%, transparent 60%);
  pointer-events: none;
}

.card:hover {
  border-color: rgba(229, 24, 26, 0.35);
  box-shadow: 0 0 0 1px rgba(229, 24, 26, 0.12), var(--shadow-md);
  transform: translateY(-3px);
}

.card h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.tilt-card { transform-style: preserve-3d; }

/* ============================================================
   MUTED / SMALL
   ============================================================ */
.muted { color: var(--muted); }
.small { font-size: 0.9rem; line-height: 1.55; }

/* ============================================================
   EDUCATION
   ============================================================ */
.edu-card .edu-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.edu-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  background: rgba(229, 24, 26, 0.1);
  border: 1px solid rgba(229, 24, 26, 0.2);
  border-radius: var(--radius-pill);
  padding: 0.18rem 0.5rem;
}

/* ============================================================
   TIMELINE (Experience + Leadership)
   ============================================================ */
.timeline { display: grid; gap: 1px; }

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0 1.2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child { border-bottom: none; }

.timeline-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
}

.org-logo-wrap {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #f8f9fb;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.org-logo {
  width: 88%;
  height: 88%;
  object-fit: contain;
  border-radius: 4px;
}

.org-logo.is-hidden { display: none; }

.org-fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-family: "Sora", sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.org-logo.is-hidden ~ .org-fallback { display: inline-flex; }

.timeline-connector {
  width: 1px;
  flex: 1;
  background: var(--line);
  margin-top: 8px;
}

.timeline-item:last-child .timeline-connector { display: none; }

.timeline-body { min-width: 0; }

.timeline-head {
  margin-bottom: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.timeline-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.timeline-company {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--red);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
}

.timeline-date {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.timeline-date-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

.timeline-body ul {
  padding-left: 1.1rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.timeline-body ul li { margin-bottom: 0.3rem; }
.timeline-body ul li:last-child { margin-bottom: 0; }

/* ============================================================
   PROJECTS
   ============================================================ */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.8rem;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.chip:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.chip.active {
  border-color: var(--red);
  background: rgba(229, 24, 26, 0.12);
  color: var(--text);
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 230px;
  transition: border-color 0.22s, box-shadow 0.22s, transform 0.22s, opacity 0.22s;
}

.project-card:hover {
  border-color: rgba(229,24,26,0.45);
  box-shadow: 0 0 0 1px rgba(229,24,26,0.15), 0 12px 40px rgba(229,24,26,0.12), 0 8px 24px rgba(0,0,0,0.4);
  transform: translateY(-6px);
}

.project-card p {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
  margin: 0 0 0.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.project-card a { margin-top: auto; align-self: flex-start; }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
}

.project-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-dim);
  border-radius: var(--radius-pill);
  padding: 0.18rem 0.5rem;
}

/* ============================================================
   RESEARCH
   ============================================================ */
.research-list { display: grid; gap: 1px; }

.research-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 1rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  transition: border-color 0.2s, background 0.2s;
  margin-left: -1.25rem;
}

.research-item:last-child { border-bottom: none; }

.research-item:hover {
  border-left-color: var(--red);
  background: rgba(229,24,26,0.04);
}

.research-item:hover .research-meta h3 { color: var(--red); }

.research-meta h3 {
  margin: 0 0 0.5rem;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.45;
  transition: color 0.18s;
}

.research-meta p { margin: 0; font-size: 0.88rem; color: var(--muted); line-height: 1.55; }
.research-meta p + p { margin-top: 0.5rem; }

.research-venue {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  padding: 0.22rem 0.6rem;
}

/* Per-venue colour coding */
.research-venue.ieee   { color: #00c0d4; background: rgba(0,192,212,0.1);  border: 1px solid rgba(0,192,212,0.25); }
.research-venue.scopus { color: #f59e0b; background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25); }
.research-venue.conf   { color: var(--red); background: var(--red-glow);  border: 1px solid rgba(229,24,26,0.3); }

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.skill-card h3 {
  margin-bottom: 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-icon {
  font-size: 0.95rem;
  opacity: 0.85;
  flex-shrink: 0;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tags span {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.skill-tags span:hover {
  border-color: rgba(229, 24, 26, 0.4);
  color: var(--text);
  background: var(--red-glow);
}

/* ============================================================
   AWARDS
   ============================================================ */
.award-card {
  border-left: 3px solid var(--red);
}

.award-card h3 { color: var(--text); }

.award-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #facc15;
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.55rem;
  margin-bottom: 0.6rem;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1rem;
}

.contact-items {
  margin-top: 1rem;
  display: grid;
  gap: 0.6rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.contact-item:hover {
  border-color: rgba(229, 24, 26, 0.4);
  background: var(--red-glow);
  transform: translateX(4px);
}

.contact-item-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.contact-item-icon svg {
  width: 16px;
  height: 16px;
  fill: var(--muted);
}

.contact-item-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
  margin-bottom: 0.1rem;
}

.contact-item-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Contact form */
.contact-form {
  display: grid;
  gap: 0.75rem;
}

.contact-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

input, textarea {
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  transition: border-color 0.18s, box-shadow 0.18s;
  resize: vertical;
}

input:focus, textarea:focus {
  outline: none;
  border-color: rgba(229, 24, 26, 0.6);
  box-shadow: 0 0 0 3px rgba(229, 24, 26, 0.12);
}

.form-status {
  min-height: 1.2rem;
  margin: 0;
  font-size: 0.88rem;
  color: var(--ok);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  width: min(1120px, 92vw);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.87rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s;
}

.site-footer a:hover { color: var(--text); }

.f1-tooltip {
  position: relative;
  cursor: default;
  display: inline-block;
  margin-left: 0.2rem;
}

.f1-tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid rgba(229,24,26,0.35);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 100;
}

.f1-tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(229,24,26,0.35);
}

.f1-tooltip:hover .f1-tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.show {
  opacity: 1;
  transform: none;
}

/* ============================================================
   CHAT
   ============================================================ */
.chat-launcher {
  position: fixed;
  right: 1.4rem;
  bottom: 1.5rem;
  z-index: 60;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--red);
  box-shadow: 0 8px 28px rgba(229, 24, 26, 0.4);
  transition: box-shadow 0.2s, transform 0.2s;
}

.chat-launcher:hover {
  box-shadow: 0 12px 36px rgba(229, 24, 26, 0.55);
  transform: translateY(-2px);
}

.chat-launcher svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.chat-nudge {
  position: fixed;
  right: 1.4rem;
  bottom: 5.8rem;
  z-index: 61;
  max-width: min(300px, calc(100vw - 2rem));
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--surface);
  color: var(--text);
  font-size: 0.84rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.24s, transform 0.24s;
  pointer-events: none;
}

.chat-nudge.show  { opacity: 1; transform: none; }
.chat-nudge.hide  { opacity: 0; transform: translateY(4px); }

.chatbot-panel {
  position: fixed;
  right: 1.4rem;
  bottom: 5.4rem;
  z-index: 60;
  width: min(420px, calc(100vw - 2rem));
  max-height: 74vh;
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.chatbot-panel.open { display: flex; }

.chatbot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-head h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.chatbot-head p {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.chatbot-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.18s, color 0.18s;
}

.chatbot-close:hover { border-color: rgba(255,255,255,0.25); color: var(--text); }

.chatbot-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chat-prompt {
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.79rem;
  min-height: 36px;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.chat-prompt:hover {
  border-color: rgba(229, 24, 26, 0.4);
  color: var(--text);
  background: var(--red-glow);
}

.chatbot-messages {
  min-height: 160px;
  max-height: 42vh;
  overflow: auto;
  display: grid;
  gap: 0.5rem;
  padding-right: 0.2rem;
}

.chat-msg {
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-msg.user {
  justify-self: end;
  background: rgba(229, 24, 26, 0.15);
  border: 1px solid rgba(229, 24, 26, 0.3);
}

.chat-msg.bot {
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.chatbot-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.chatbot-input-row input { min-width: 0; }

/* ============================================================
   LIGHT MODE
   ============================================================ */
body[data-theme="light"] {
  --bg:           #f4f6fb;
  --surface:      #ffffff;
  --surface-2:    #eef1f8;
  --surface-3:    #e4e9f5;
  --text:         #111827;
  --muted:        #566079;
  --subtle:       #8b96aa;
  --line:         rgba(17, 24, 39, 0.1);
  --line-hover:   rgba(229, 24, 26, 0.4);
  --red-glow:     rgba(229, 24, 26, 0.08);
  --teal-dim:     rgba(0, 150, 170, 0.1);
  --shadow-sm:    0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-md:    0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-lg:    0 20px 60px rgba(0, 0, 0, 0.15);
  --header-bg:    rgba(244, 246, 251, 0.9);
  --header-line:  rgba(17, 24, 39, 0.08);

  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(229, 24, 26, 0.05) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 5%, rgba(0, 192, 212, 0.04) 0%, transparent 50%),
    var(--bg);
}

body[data-theme="light"] .bg-grid {
  background-image:
    linear-gradient(to right, rgba(17,24,39,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17,24,39,0.04) 1px, transparent 1px);
}

body[data-theme="light"] .cursor-glow {
  background: radial-gradient(circle, rgba(229,24,26,0.1), transparent 68%);
}

body[data-theme="light"] .moon-icon { display: block; }
body[data-theme="light"] .sun-icon  { display: none; }

body[data-theme="light"] .theme-icon { fill: var(--muted); }

body[data-theme="light"] .icon-link svg { fill: var(--muted); }

body[data-theme="light"] .availability {
  color: #15803d;
  border-color: rgba(34,197,94,0.3);
  background: rgba(34,197,94,0.07);
}

body[data-theme="light"] .chatbot-panel,
body[data-theme="light"] .chat-nudge {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

body[data-theme="light"] .chat-msg.bot {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text);
}

body[data-theme="light"] .chat-prompt,
body[data-theme="light"] .chatbot-close {
  color: var(--muted);
  background: rgba(0,0,0,0.03);
}

body[data-theme="light"] .nav {
  background: var(--header-bg);
  border-bottom-color: var(--header-line);
}

body[data-theme="light"] .contact-item-icon svg { fill: var(--muted); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 4rem 0 2rem;
    text-align: center;
  }

  .hero-content {
    order: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-visual {
    order: 1;
    margin: 0 auto;
  }

  .avatar-wrap { width: 240px; height: 240px; }

  .hero-copy { max-width: 520px; }

  .social-row { justify-content: center; }
}

@media (max-width: 860px) {
  .three-col    { grid-template-columns: repeat(2, 1fr); }
  .skills-grid  { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }

  .research-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0.1rem;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-line);
    padding: 0.75rem 5vw;
    backdrop-filter: blur(16px);
    z-index: 49;
  }

  .nav.open { display: flex; }

  .menu-btn {
    display: inline-flex;
    margin-left: auto;
  }

  .chatbot-panel {
    right: 0.75rem;
    bottom: 4.8rem;
    width: calc(100vw - 1.5rem);
  }

  .chat-launcher { right: 0.75rem; bottom: 1rem; }
  .chat-nudge    { right: 0.75rem; bottom: 5.2rem; }
}

@media (max-width: 620px) {
  .three-col { grid-template-columns: 1fr; }

  .timeline-item {
    grid-template-columns: 44px 1fr;
    gap: 0 0.85rem;
  }

  h1 { letter-spacing: -0.02em; }
}

@media (max-width: 480px) {
  .avatar-wrap { width: 160px; height: 160px; }

  .chat-launcher {
    width: 46px;
    height: 46px;
    right: 1rem;
    bottom: 1rem;
  }

  .chatbot-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100vw;
    max-height: 80vh;
    border-radius: 18px 18px 0 0;
  }

  .chat-nudge { right: 1rem; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ── RESUME MODAL ──────────────────────────────────────────── */
.resume-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.resume-modal.open {
  opacity: 1;
  pointer-events: all;
}
.resume-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.resume-modal-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 880px);
  height: min(92vh, 1080px);
  background: var(--surface-1);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 100px rgba(0,0,0,0.55);
  transform: translateY(24px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.34,1.4,0.64,1);
}
.resume-modal.open .resume-modal-panel {
  transform: translateY(0) scale(1);
}
.resume-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: var(--surface-2);
  flex-shrink: 0;
}
.resume-modal-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.01em;
}
.resume-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.btn-sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
}
.resume-modal-actions button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.resume-modal-actions button:hover {
  background: rgba(255,255,255,0.08);
  color: var(--fg);
}
.resume-modal-frame {
  flex: 1;
  border: none;
  width: 100%;
  background: #fff;
}
