/* ============================================================
   ZAIN ABBAS — PORTFOLIO STYLESHEET
   Reference: armghan.me | Color: Monochrome + Crimson #ff3131
   Font: Space Grotesk
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── CSS VARIABLES ──────────────────────────────────────── */
:root {
  --bg:          #ffffff;
  --bg-secondary:#f5f5f5;
  --bg-card:     #f9f9f9;
  --fg:          #111111;
  --fg-muted:    #6b7280;
  --border:      #e5e7eb;
  --border-dark: #d1d5db;
  --accent:      #ff3131;
  --accent-hover:#e02020;
  --accent-glow: rgba(255,49,49,0.30);
  --accent-glow2:rgba(255,49,49,0.15);
  --radius:      8px;
  --radius-lg:   14px;
  --radius-full: 9999px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:   0 10px 40px rgba(0,0,0,0.12);
  --transition:  0.22s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --bg:          #080808;
  --bg-secondary:#111111;
  --bg-card:     #0f0f0f;
  --fg:          #f4f4f5;
  --fg-muted:    #9ca3af;
  --border:      #1f1f1f;
  --border-dark: #2d2d2d;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:   0 10px 40px rgba(0,0,0,0.6);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  transition: background-color var(--transition), color var(--transition);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
ul, ol { list-style: none; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

::selection { background: var(--accent); color: #fff; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

section { 
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}

section::before {
  content: attr(data-bg-text);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(6rem, 20vw, 15rem);
  font-weight: 900;
  color: var(--fg);
  opacity: 0.03;
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
[data-theme="dark"] section::before {
  opacity: 0.02;
}

/* ─── NAVBAR ─────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
[data-theme="dark"] #navbar {
  background: var(--bg);
  border-bottom-color: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width var(--transition);
}
.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after { width: 100%; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#theme-toggle {
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 1rem;
}
#theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Hamburger */
#menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
}
#menu-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: all var(--transition);
}
#menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#menu-toggle.open span:nth-child(2) { opacity: 0; }
#menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 0.75rem 2rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
  transition: color var(--transition), background var(--transition);
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--accent); background: var(--bg-secondary); }

/* ─── HERO ───────────────────────────────────────────────── */
#hero {
  padding-top: 9rem;
  padding-bottom: 5rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
#hero::before {
  content: '';
  position: absolute;
  top: -200px; right: -150px;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,49,49,0.10) 0%, transparent 70%);
  animation: blob-drift 8s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}
#hero::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -100px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,49,49,0.06) 0%, transparent 70%);
  animation: blob-drift 10s ease-in-out infinite alternate-reverse;
  pointer-events: none;
  z-index: 0;
}
@keyframes blob-drift {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(40px,-30px) scale(1.08); }
}

/* Hero giant background text */
.hero-bg-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(8rem, 28vw, 18rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
  opacity: 0.04;
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  line-height: 1;
}
[data-theme="dark"] .hero-bg-text { opacity: 0.025; }

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* ── Availability badge ── */
.hero-availability {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: #e02020;
  background: rgba(22,163,74,0.08);
  border: 1px solid rgba(163, 31, 22, 0.25);
  margin-bottom: 1.2rem;
  letter-spacing: 0.02em;
}
.avail-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #dd6a6a;
  box-shadow: 0 0 0 3px rgba(197, 80, 34, 0.25);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.75); }
}

/* ── Greeting + Name ── */
.hero-greeting {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.hero-name {
  font-size: clamp(4rem, 9vw, 8rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.88;
  color: var(--fg);
  margin-bottom: 0.8rem;
}
.hero-name-accent {
  color: var(--accent);
}
[data-theme="dark"] .hero-name {
  background: linear-gradient(135deg, #ffffff 30%, rgba(255,49,49,0.9) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="dark"] .hero-name-accent {
  -webkit-text-fill-color: unset;
  color: var(--accent);
}

/* ── Typed title ── */
.hero-title {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 1.2rem;
  min-height: 2em;
}
.hero-title .typed-cursor {
  display: inline-block;
  width: 2px; height: 1.2em;
  background: var(--accent);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── Info pills ── */
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--fg-muted);
}
.hero-pill i { color: var(--accent); }
.hero-pill-accent {
  background: rgba(255,49,49,0.06);
  border-color: rgba(255,49,49,0.25);
  color: var(--accent);
}

/* ── Description ── */
.hero-desc {
  font-size: 0.97rem;
  color: var(--fg-muted);
  line-height: 1.75;
  max-width: 520px;
  margin-bottom: 2rem;
}

/* ── CTA buttons ── */
.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.hero-actions .btn-primary { padding: 0.7rem 1.6rem; font-size: 0.9rem; }
.hero-actions .btn-secondary { padding: 0.7rem 1.4rem; font-size: 0.9rem; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ── Social icons ── */
.hero-socials {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.socials-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 0.4rem;
}
.social-icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all var(--transition);
  text-decoration: none;
}
.social-icon-btn:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.social-icon-btn.whatsapp-btn:hover {
  background: #25d366;
  border-color: #25d366;
  box-shadow: 0 6px 20px rgba(37,211,102,0.35);
}

/* ── Hero image (right side) ── */
.hero-image-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  aspect-ratio: 1;
  max-width: 420px;
}

/* Decorative spinning ring */
.hero-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px dashed rgba(255,49,49,0.3);
  animation: ring-spin 18s linear infinite;
  pointer-events: none;
}
.hero-ring::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 1px dashed rgba(255,49,49,0.15);
  animation: ring-spin 12s linear infinite reverse;
}
@keyframes ring-spin { to { transform: rotate(360deg); } }

/* Circular profile photo */
.hero-image-circle {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--accent);
  box-shadow: 0 0 0 8px rgba(255,49,49,0.08), 0 24px 60px rgba(255,49,49,0.2);
  animation: float-hero 6s ease-in-out infinite;
  position: relative;
  z-index: 1;
}
.hero-image-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@keyframes float-hero {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-14px); }
}

/* Floating info badges */
.hero-float-badge {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 2;
  animation: float-hero 6s ease-in-out infinite;
  white-space: nowrap;
}
.hero-float-badge i {
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
}
.hero-float-badge div {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.hero-float-badge strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--fg);
}
.hero-float-badge span {
  font-size: 0.68rem;
  color: var(--fg-muted);
  font-weight: 500;
}
.badge-top-left {
  top: 5%;
  left: -8%;
  animation-delay: -2s;
}
.badge-top-right {
  top: 5%;
  right: -8%;
  animation-delay: -4s;
}
.badge-bottom {
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: -1s;
}

/* Teaching assistant counter badge */
.hero-exp-badge {
  position: absolute;
  right: -6%;
  bottom: 28%;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 0.7rem 1rem;
  text-align: center;
  box-shadow: 0 8px 28px var(--accent-glow);
  z-index: 2;
  animation: float-hero 7s ease-in-out infinite;
  animation-delay: -3s;
}
.hero-exp-badge strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
}
.hero-exp-badge span {
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0.03em;
}


/* ─── TICKER / MARQUEE ───────────────────────────────────── */
#ticker-section {
  padding: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.ticker-wrap {
  position: relative;
  overflow: hidden;
  padding: 0.9rem 0;
}
.ticker-wrap::before,
.ticker-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}
.ticker-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
}
.ticker-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  animation: ticker-scroll 30s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }

.ticker-group {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding-right: 0.6rem;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--fg-muted);
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  transition: all var(--transition);
}
.ticker-item:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.ticker-item svg { width: 12px; height: 12px; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─── SECTION HEADING ────────────────────────────────────── */
.section-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--fg);
  position: relative;
  padding-bottom: 1rem;
}
.section-title::after {
  content: '';
  display: block;
  width: 40px; height: 3px;
  margin: 0.75rem auto 0;
  background: var(--accent);
  border-radius: 2px;
}

.section-desc {
  font-size: 1rem;
  color: var(--fg-muted);
  max-width: 540px;
  line-height: 1.7;
}

/* ─── ABOUT ──────────────────────────────────────────────── */
#about { background: var(--bg-secondary); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  font-size: 1rem;
  color: var(--fg-muted);
  line-height: 1.8;
  margin-bottom: 1.2rem;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: center;
  transition: all var(--transition);
}
.stat-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px var(--accent-glow2);
  transform: translateY(-2px);
}
.stat-card .num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-card .label {
  font-size: 0.78rem;
  color: var(--fg-muted);
  font-weight: 500;
}

.about-highlights h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--fg);
}

.highlight-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.highlight-icon {
  width: 40px; height: 40px;
  min-width: 40px;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.highlight-item h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.2rem; }
.highlight-item p  { font-size: 0.82rem; color: var(--fg-muted); line-height: 1.5; }

/* ─── SKILLS ─────────────────────────────────────────────── */
.skills-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.45rem 1.2rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-dark);
  background: transparent;
  color: var(--fg-muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  transition: all var(--transition);
}
.tab-btn:hover { border-color: var(--accent); color: var(--accent); }
.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.skills-panel { display: none; }
.skills-panel.active {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  animation: fadeInUp 0.3s ease-out;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1rem;
  text-align: center;
  transition: all var(--transition);
  cursor: default;
}
.skill-card:hover {
  border-color: rgba(255,49,49,0.5);
  box-shadow: 0 8px 24px var(--accent-glow2);
  transform: translateY(-5px) scale(1.03);
  background: rgba(255,49,49,0.04);
}
.skill-card .skill-icon { font-size: 1.6rem; margin-bottom: 0.5rem; }
.skill-card .skill-name { font-size: 0.82rem; font-weight: 600; color: var(--fg); }
.skill-card .skill-level {
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 0.2rem;
}

/* ─── HORIZONTAL SLIDER TIMELINE ──────────────────────────── */
#experience { 
  background: var(--bg); 
  height: 500vh;
  position: relative;
  overflow: visible;
}

.sticky-scroll-container {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

#experience .section-heading {
  position: absolute;
  top: 40px;
  left: 5vw;
  z-index: 10;
}

.horizontal-slider {
  display: flex;
  height: 100%;
  width: max-content;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.slide-item {
  position: relative;
  min-width: 100vw;
  height: 100%;
  scroll-snap-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.slide-bg-text {
  position: absolute;
  font-size: clamp(10rem, 30vw, 40rem);
  font-weight: 900;
  color: var(--fg);
  opacity: 0.03;
  z-index: 1;
  white-space: nowrap;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-family: inherit;
}

.slide-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 0 2rem;
  margin-top: 5vh;
}

.slide-image-container {
  position: relative;
  width: min(80vw, 350px);
  height: min(60vh, 450px);
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.slide-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transition: filter 0.5s ease;
  border-radius: 8px;
}
.slide-item:hover .slide-image-container img {
  filter: grayscale(0%);
}

.slide-number {
  position: absolute;
  bottom: -30px;
  right: -30px;
  font-size: clamp(4rem, 8vw, 7rem);
  font-weight: 900;
  color: #ff3131;
  text-shadow: 2px 2px 10px rgba(0,0,0,0.3);
  line-height: 1;
}

.slide-subtitle {
  margin-top: 4rem;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--fg-muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}
.slide-subtitle::before {
  content: '';
  width: 30px;
  height: 2px;
  background: #ff3131;
}

.slide-title {
  font-size: clamp(2.5rem, 6vw, 6rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--fg);
  margin-top: 1rem;
  letter-spacing: -0.02em;
}

#slide-counter {
  position: absolute;
  bottom: 40px;
  left: 5vw;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--fg-muted);
  z-index: 10;
}

.timeline-card {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
}
.timeline-card h3 { 
  font-size: 1.1rem; 
  font-weight: 700; 
  color: var(--fg);
  margin-bottom: 0.3rem; 
}
.timeline-card .org {
  font-size: 0.9rem;
  color: var(--fg);
  opacity: 0.85;
  margin-bottom: 0.85rem;
  font-weight: 500;
}
.timeline-card p { 
  font-size: 0.9rem; 
  color: var(--fg-muted); 
  line-height: 1.7; 
}

/* ─── PROJECTS ───────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.45rem 1.2rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-dark);
  background: transparent;
  color: var(--fg-muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
  overflow: hidden;
  position: relative;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-dark), transparent);
  pointer-events: none;
}
.project-card:hover {
  border-color: rgba(255,49,49,0.4);
  box-shadow: 0 12px 40px var(--accent-glow2);
  transform: translateY(-6px);
}
[data-theme="dark"] .project-card:hover {
  background: rgba(255,49,49,0.04);
}
.project-card.hidden { display: none; }

.project-header {
  padding: 1.4rem 1.4rem 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.project-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.project-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--accent-glow2);
  color: var(--accent);
  border: 1px solid var(--accent-glow);
}

.project-body { padding: 0 1.4rem 1.4rem; flex: 1; }
.project-body h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.project-body p  { font-size: 0.83rem; color: var(--fg-muted); line-height: 1.6; margin-bottom: 1rem; }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.project-tags span {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--fg-muted);
}

.project-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.project-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition);
  text-decoration: none;
}
.project-link:hover { gap: 0.55rem; }

/* ─── SIGNAL LAB (OSCILLOSCOPE) ──────────────────────────── */
#signal-lab { background: var(--bg-secondary); }

.lab-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
  max-width: 900px;
  margin: 0 auto;
}

.oscilloscope-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.osc-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.osc-dot { width: 10px; height: 10px; border-radius: 50%; }
.osc-dot.red { background: #ff5f57; }
.osc-dot.yellow { background: #febc2e; }
.osc-dot.green { background: #28c840; }
.osc-label {
  margin-left: auto;
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--fg-muted);
  letter-spacing: 0.1em;
}

#oscCanvas {
  display: block;
  width: 100%;
  height: 220px;
  background: #0a0a0a;
}

.osc-info {
  display: flex;
  justify-content: space-around;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}
.osc-info span {
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--fg-muted);
}
.osc-info span strong { color: var(--accent); }

.lab-controls h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  margin-bottom: 1.25rem;
}

.control-group { margin-bottom: 1.5rem; }
.control-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.5rem;
}
.control-group label span {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
}

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
  transition: transform 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

.wave-selector {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.wave-btn {
  flex: 1;
  padding: 0.4rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border-dark);
  background: transparent;
  color: var(--fg-muted);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  transition: all var(--transition);
}
.wave-btn:hover { border-color: var(--accent); color: var(--accent); }
.wave-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ─── ACHIEVEMENTS ───────────────────────────────────────── */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.achievement-card {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  padding: 1.4rem 1.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}
.achievement-card:hover {
  border-color: rgba(255,49,49,0.4);
  box-shadow: 0 8px 24px var(--accent-glow2);
  transform: translateY(-3px);
}
.achievement-icon {
  font-size: 1.8rem;
  min-width: 2.2rem;
}
.achievement-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.25rem; }
.achievement-card p { font-size: 0.8rem; color: var(--fg-muted); line-height: 1.5; }

/* ─── CONTACT ────────────────────────────────────────────── */
#contact { background: var(--bg-secondary); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.contact-info p {
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-link-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--fg);
  transition: color var(--transition);
}
.contact-link-item:hover { color: var(--accent); }
.contact-link-item .icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
}
.contact-link-item:hover .icon {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.contact-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-group {
  margin-bottom: 1.25rem;
  position: relative;
}
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--fg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--fg-muted);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow2);
}
.form-group textarea { resize: vertical; min-height: 110px; }

.form-error {
  font-size: 0.73rem;
  color: var(--accent);
  margin-top: 0.3rem;
  display: none;
}
.form-group.error .form-error { display: block; }
.form-group.error input,
.form-group.error textarea { border-color: var(--accent); }

#form-success {
  display: none;
  text-align: center;
  padding: 1rem;
  color: #22c55e;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ─── CHATBOT ────────────────────────────────────────────── */
#chat-toggle {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 52px; height: 52px;
  border-radius: var(--radius-full);
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--accent-glow);
  z-index: 1000;
  transition: all var(--transition);
}
#chat-toggle:hover {
  background: var(--accent-hover);
  transform: scale(1.08);
}

.chat-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--bg);
  font-size: 0;
}

#chat-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: min(380px, calc(100vw - 32px));
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  display: flex;
  flex-direction: column;
  max-height: 72vh;
  overflow: hidden;
  transform: scale(0.95) translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
}
#chat-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.chat-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
}
.chat-header-info h4 {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
}
.chat-header-info p {
  font-size: 0.72rem;
  color: var(--fg-muted);
}
#chat-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1.1rem;
  padding: 4px;
  border-radius: var(--radius);
  transition: all var(--transition);
}
#chat-close:hover { color: var(--accent); background: var(--bg-secondary); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-msg {
  max-width: 85%;
  font-size: 0.85rem;
  line-height: 1.55;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  animation: fadeInUp 0.25s ease-out;
}
.chat-msg.bot {
  align-self: flex-start;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 3px;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-radius: 12px 12px 3px 12px;
}

.chat-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}
.chat-quick-btns button {
  font-size: 0.72rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-dark);
  background: var(--bg-secondary);
  color: var(--fg-muted);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  transition: all var(--transition);
}
.chat-quick-btns button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chat-input-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
}
.chat-input-bar input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--fg);
  outline: none;
  transition: border-color var(--transition);
}
.chat-input-bar input:focus { border-color: var(--accent); }
.chat-input-bar button {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.chat-input-bar button:hover { background: var(--accent-hover); }

/* ─── FOOTER ─────────────────────────────────────────────── */
footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-logo {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.footer-logo span { color: var(--accent); }

.footer-copy {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.footer-socials {
  display: flex;
  gap: 0.5rem;
}

/* ─── SCROLL TO TOP ──────────────────────────────────────── */
#scroll-top {
  position: fixed;
  bottom: 90px;
  right: 88px;
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
}
#scroll-top.visible { opacity: 1; pointer-events: all; }
#scroll-top:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 28px var(--accent-glow);
}

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 3rem; }
  .hero-image-wrap { order: -1; max-width: 300px; margin: 0 auto; }
  .hero-image-circle { width: 240px; height: 240px; }
  .badge-top-left { left: 0; }
  .badge-top-right { right: 0; }
  .hero-exp-badge { right: 0; }
  .hero-name { font-size: clamp(3rem, 10vw, 5rem); }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .lab-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-right .btn-primary { display: none; }
  #menu-toggle { display: flex; }
  section { padding: 3.5rem 0; }
  .projects-grid { grid-template-columns: 1fr; }
  .achievements-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-socials { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }
  .hero-name { font-size: clamp(2.5rem, 12vw, 4rem); }
  #chat-panel { bottom: 92px; right: 12px; left: 12px; width: auto; }
  #chat-toggle { right: 16px; bottom: 20px; }
}

/* ─── MISC OVERRIDES ──────────────────────────────────────── */
/* Stat cards */
.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  text-align: center;
  transition: all var(--transition);
}
.stat-card:hover {
  border-color: rgba(255,49,49,0.4);
  box-shadow: 0 8px 24px var(--accent-glow2);
  transform: translateY(-3px);
}

/* contact-form inputs */
.contact-form input,
.contact-form textarea,
.contact-form select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-dark);
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow2);
}

/* Highlight icon */
.highlight-icon {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--accent);
}

/* Filter buttons */
.filter-btn {
  background: transparent;
  border: 1px solid var(--border-dark);
}
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 20px var(--accent-glow);
}

/* Oscilloscope wrapper */
.oscilloscope-wrap {
  border: 1px solid var(--border) !important;
  background: var(--bg) !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Hero secondary button */
.hero-actions .btn-secondary {
  background: transparent;
  border: 1px solid var(--border-dark);
}
.hero-actions .btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}
