/* =========================================================
   Base Styles & Theme
   - Modern, premium look using dark theme by default
   - Light theme available via .theme-light on body
   ========================================================= */

:root {
  --bg: #050814;
  --bg-elevated: rgba(15, 23, 42, 0.8);
  --bg-soft: rgba(15, 23, 42, 0.6);
  --bg-card: rgba(15, 23, 42, 0.9);
  --text: #e5e7eb;
  --text-soft: #9ca3af;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.3);
  --accent-strong: #0ea5e9;
  --border-subtle: rgba(148, 163, 184, 0.25);
  --glass-border: rgba(255, 255, 255, 0.12);
  --shadow-soft: 0 18px 60px rgba(15, 23, 42, 0.85);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --nav-height: 72px;
  --transition-fast: 180ms ease-out;
  --transition-med: 260ms cubic-bezier(0.33, 1, 0.68, 1);

  /* Customizable interaction strengths (tweak to adjust effects) */
  --spotlight-intensity: 0.25; /* Global cursor spotlight strength (keep low for subtlety) */
  --tilt-strength: 9; /* Max card tilt in degrees */
  --tilt-glare-strength: 0.6; /* Opacity multiplier for card shine */
  --parallax-strength: 1; /* Multiplier applied in script.js for background parallax */
  
  /* Starfield customization */
  --star-count: 200; /* Number of stars (adjust in JS) */
  --star-speed: 0.5; /* Star drift speed (pixels per frame) */
  --star-glow: 0.8; /* Star brightness/glow intensity (0-1) */
  --parallax-mouse: 0.3; /* Mouse parallax strength for stars */
  
  /* Animation customization */
  --spotlight-intensity: 0.15; /* Cursor spotlight glow intensity (0-1) */
  --spotlight-size: 400px; /* Cursor spotlight size */
  --tilt-strength: 8; /* Card tilt strength in degrees */
  --tilt-glare-strength: 0.5; /* Card shine opacity */
  --stagger-delay: 80ms; /* Delay between staggered reveals */
  --animation-speed: 1; /* Global animation speed multiplier */
}

/* Light theme overrides */
body.theme-light {
  --bg: #f4f4f8;
  --bg-elevated: rgba(255, 255, 255, 0.9);
  --bg-soft: rgba(255, 255, 255, 0.82);
  --bg-card: rgba(255, 255, 255, 0.98);
  --text: #020617;
  --text-soft: #6b7280;
  --accent: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.18);
  --accent-strong: #1d4ed8;
  --border-subtle: rgba(148, 163, 184, 0.3);
  --glass-border: rgba(15, 23, 42, 0.1);
  --shadow-soft: 0 16px 40px rgba(15, 23, 42, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* =========================================================
   Starfield Background Canvas
   ========================================================= */

.starfield-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -2;
  background: #050814;
  will-change: transform;
}

/* Vignette overlay for text readability */
.vignette-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    rgba(5, 8, 20, 0.3) 50%,
    rgba(5, 8, 20, 0.7) 100%
  );
}

/* Cursor spotlight effect */
.cursor-spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(
    circle var(--spotlight-size) at var(--spotlight-x, 50%) var(--spotlight-y, 50%),
    rgba(56, 189, 248, var(--spotlight-intensity)),
    transparent 60%
  );
  mix-blend-mode: soft-light;
  transition: opacity 300ms ease-out;
}

body.has-spotlight .cursor-spotlight {
  opacity: 1;
}

body.theme-light .starfield-canvas {
  background: #f4f4f8;
}

body.theme-light .vignette-overlay {
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    rgba(244, 244, 248, 0.2) 50%,
    rgba(244, 244, 248, 0.5) 100%
  );
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 32px) 20px 72px;
}

/* =========================================================
   Header & Navigation
   ========================================================= */

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(3, 7, 18, 0.85),
    rgba(3, 7, 18, 0.6),
    transparent
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

body.theme-light .header {
  background: linear-gradient(
    to bottom,
    rgba(248, 250, 252, 0.9),
    rgba(248, 250, 252, 0.6),
    transparent
  );
}

.nav-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 20% 20%, #f9fafb, transparent 70%),
    linear-gradient(135deg, #22d3ee, #4f46e5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #0f172a;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.6);
}

.logo-text {
  font-weight: 600;
  letter-spacing: 0.03em;
}

.nav {
  display: flex;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.nav-link {
  position: relative;
  padding: 6px 4px;
  color: var(--text-soft);
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border-radius: 999px;
  transition: width var(--transition-med);
}

.nav-link.active {
  color: var(--text);
}

.nav-link.active::after {
  width: 100%;
  animation: navUnderline 0.3s ease-out;
}

@keyframes navUnderline {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Generic animated underline for inline links (progressive enhancement) */
main a:not(.btn) {
  position: relative;
  text-decoration: none;
}

main a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border-radius: 999px;
  transition: width 200ms ease-out;
}

main a:not(.btn):hover::after {
  width: 100%;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at 10% 0%, rgba(248, 250, 252, 0.24), transparent),
    rgba(15, 23, 42, 0.8);
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #f97316;
  overflow: hidden;
}

body.theme-light .theme-toggle {
  background: rgba(248, 250, 252, 0.9);
}

.theme-icon {
  font-size: 0.8rem;
  opacity: 0.5;
  transition: opacity var(--transition-fast), transform var(--transition-med);
}

body.theme-light .theme-icon.sun {
  opacity: 1;
  transform: translateX(2px);
}

body.theme-light .theme-icon.moon {
  opacity: 0.25;
}

body:not(.theme-light) .theme-icon.moon {
  opacity: 1;
  transform: translateX(-2px);
}

body:not(.theme-light) .theme-icon.sun {
  opacity: 0.25;
}

.nav-menu-toggle {
  display: none;
  width: 34px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.7);
  padding-inline: 7px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

body.theme-light .nav-menu-toggle {
  background: rgba(248, 250, 252, 0.9);
}

.nav-menu-toggle span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: var(--text-soft);
  transition: transform var(--transition-med), opacity var(--transition-fast);
}

.nav-menu-toggle.is-open span:first-child {
  transform: translateY(3px) rotate(45deg);
}

.nav-menu-toggle.is-open span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

/* =========================================================
   Sections
   ========================================================= */

.section {
  margin-bottom: 72px;
}

.section:last-of-type {
  margin-bottom: 32px;
}

.section-header {
  max-width: 640px;
  margin-bottom: 28px;
}

.section-kicker {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 6px;
}

.section-title {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 2.1vw, 1.9rem);
}

.section-subtitle {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.96rem;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
  align-items: flex-start;
}

/* =========================================================
   Hero Section
   ========================================================= */

.hero-section {
  max-width: 960px;
  margin-inline: auto;
  margin-bottom: 80px;
}

.hero-kicker {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin: 0 0 6px;
}

.hero-title {
  margin: 0 0 4px;
  font-size: clamp(2.2rem, 3.4vw, 2.8rem);
}

.hero-title span {
  background: linear-gradient(120deg, var(--accent-strong), #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-weight: 500;
}

.hero-summary {
  margin: 0 0 18px;
  color: var(--text-soft);
  font-size: 0.98rem;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px 14px;
  margin: 0 0 20px;
}

.hero-meta-item dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.hero-meta-item dd {
  margin: 0;
  font-size: 0.92rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
}

.tag {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: radial-gradient(
      circle at 0% 0%,
      rgba(248, 250, 252, 0.18),
      transparent
    ),
    rgba(15, 23, 42, 0.9);
}

body.theme-light .tag {
  background: rgba(255, 255, 255, 0.9);
}

/* =========================================================
   Cards & Shared Components
   ========================================================= */

.card {
  border-radius: var(--radius-xl);
  padding: 18px 18px;
}

.glass {
  background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.78),
      rgba(15, 23, 42, 0.88)
    );
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
}

body.theme-light .glass {
  background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.96),
      rgba(246, 248, 252, 0.96)
    );
}

.card-title {
  margin: 0 0 8px;
  font-size: 1.02rem;
}

.card-body {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.icon-list,
.pill-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.icon-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.icon-list li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-size: 1rem;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 0.8rem;
}

.pill-list li {
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.7);
}

body.theme-light .pill-list li {
  background: rgba(255, 255, 255, 0.96);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-med), box-shadow var(--transition-med),
    background var(--transition-med), border-color var(--transition-fast),
    color var(--transition-fast);
  white-space: nowrap;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0f172a;
  box-shadow: 0 16px 40px rgba(56, 189, 248, 0.35);
  position: relative;
  overflow: hidden;
}

.primary-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-strong), #a855f7);
  opacity: 0;
  transition: opacity var(--transition-med);
  z-index: -1;
}

.primary-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 24px 60px rgba(56, 189, 248, 0.6);
}

.primary-btn:hover::before {
  opacity: 1;
}

.ghost-btn {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
}

body.theme-light .ghost-btn {
  background: rgba(255, 255, 255, 0.98);
}

.ghost-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.2);
}

.primary-btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 12px 26px rgba(56, 189, 248, 0.35);
}

.ghost-btn:active {
  transform: translateY(0);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.6);
}

/* 3D tilt + shine (applied to elements with data-tilt attribute) */
[data-tilt] {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1), 
              box-shadow 250ms ease-out;
  will-change: transform;
}

[data-tilt]::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    circle 200px at var(--pointer-x, 50%) var(--pointer-y, 0%),
    rgba(255, 255, 255, calc(0.5 * var(--tilt-glare-strength))),
    transparent 60%
  );
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity 200ms ease-out;
  z-index: 1;
}

[data-tilt].is-tilting {
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.4);
}

[data-tilt].is-tilting::after {
  opacity: 1;
}

.btn.full-width {
  width: 100%;
}

/* =========================================================
   Timeline & Education
   ========================================================= */

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item {
  padding: 18px 18px 16px;
}

.timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.timeline-role {
  margin: 0;
  font-size: 1rem;
}

.timeline-org {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.timeline-date {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline-list li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 6px;
  font-size: 0.93rem;
  color: var(--text-soft);
}

.timeline-list li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
}

.education-grid {
  display: grid;
  gap: 16px;
}

.education-card {
  padding: 18px 18px 16px;
}

.education-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.education-school {
  margin: 0;
  font-size: 1rem;
}

.education-degree {
  margin: 2px 0 0;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.education-date {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.education-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.93rem;
  color: var(--text-soft);
}

.education-meta li {
  margin-bottom: 4px;
}

/* =========================================================
   Skills
   ========================================================= */

/* Professional Skillset Section */
.skillset-section {
  margin-bottom: 48px;
}

.skillset-title {
  font-size: 1.3rem;
  margin: 0 0 24px;
  color: var(--text);
  font-weight: 600;
}

.skillset-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.skillset-group-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 16px;
  font-weight: 600;
}

.skill-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.85),
    rgba(15, 23, 42, 0.95)
  );
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: transform var(--transition-med),
    box-shadow var(--transition-med),
    border-color var(--transition-med),
    background var(--transition-med);
  cursor: default;
  position: relative;
  overflow: hidden;
}

body.theme-light .skill-pill {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.96),
    rgba(246, 248, 252, 0.96)
  );
  border-color: rgba(139, 92, 246, 0.3);
}

.skill-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(56, 189, 248, 0.2));
  opacity: 0;
  transition: opacity var(--transition-med);
  z-index: -1;
}

.skill-pill:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.35),
    0 0 0 1px rgba(139, 92, 246, 0.2);
}

.skill-pill:hover::before {
  opacity: 1;
}

.skill-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform var(--transition-med);
}

.skill-pill:hover .skill-icon {
  transform: scale(1.15) rotate(5deg);
}

@media (prefers-reduced-motion: reduce) {
  .skill-pill {
    transition: none;
  }
  .skill-pill:hover {
    transform: none;
  }
}

.skills-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: flex-start;
}

.skills-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.skill-card {
  padding: 14px 14px 12px;
}

.skill-title {
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.skill-body {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.skill-bars {
  padding: 16px 16px 14px;
}

.skill-bar {
  margin-bottom: 10px;
}

.skill-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  margin-bottom: 4px;
}

.skill-bar-track {
  position: relative;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  overflow: hidden;
}

body.theme-light .skill-bar-track {
  background: rgba(226, 232, 240, 0.9);
}

.skill-bar-fill {
  position: absolute;
  inset: 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.55);
  transform-origin: left;
}

.skill-bar.animate .skill-bar-fill {
  animation: skill-grow 1.4s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* =========================================================
   Contact
   ========================================================= */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 18px;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.93rem;
}

.contact-list li {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

.contact-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-soft);
  margin-bottom: 2px;
}

/* =========================================================
   Social Section
   ========================================================= */

.social-grid {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.social-button {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.85),
    rgba(15, 23, 42, 0.95)
  );
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
  color: var(--text);
  transition: transform var(--transition-med), box-shadow var(--transition-med),
    background var(--transition-med);
  cursor: pointer;
  overflow: visible;
}

body.theme-light .social-button {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.96),
    rgba(246, 248, 252, 0.96)
  );
}

.social-icon {
  width: 28px;
  height: 28px;
  transition: transform var(--transition-med);
}

.social-button:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 20px 50px rgba(56, 189, 248, 0.4);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0f172a;
}

.social-button:hover .social-icon {
  transform: rotate(5deg) scale(1.1);
}

.social-button:active {
  transform: translateY(-2px) scale(1.05);
}

.social-tooltip {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  font-size: 0.75rem;
  color: var(--text-soft);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  background: rgba(15, 23, 42, 0.95);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.social-button:hover .social-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================
   Footer
   ========================================================= */

.footer {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding: 24px 20px;
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to top,
    rgba(3, 7, 18, 0.92),
    rgba(3, 7, 18, 0.4),
    transparent
  );
}

body.theme-light .footer {
  background: linear-gradient(
    to top,
    rgba(248, 250, 252, 0.96),
    rgba(248, 250, 252, 0.4),
    transparent
  );
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer-left,
.footer-center {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.footer-left {
  text-align: left;
}

.footer-center {
  text-align: center;
}

.footer-social {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
}

.footer-social-link {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: color var(--transition-fast), transform var(--transition-fast);
  border-radius: 50%;
}

.footer-social-link svg {
  width: 18px;
  height: 18px;
}

.footer-social-link:hover {
  color: var(--accent);
  transform: translateY(-2px) scale(1.1);
}

/* =========================================================
   Back to top button
   ========================================================= */

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 20px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity var(--transition-med), transform var(--transition-med),
    box-shadow var(--transition-fast), background var(--transition-fast);
  z-index: 15;
}

body.theme-light .back-to-top {
  background: rgba(255, 255, 255, 0.98);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.8);
}

/* =========================================================
   Scroll Reveal Animations
   ========================================================= */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(4px);
  transition: opacity calc(600ms * var(--animation-speed)) cubic-bezier(0.22, 0.61, 0.36, 1),
    transform calc(600ms * var(--animation-speed)) cubic-bezier(0.22, 0.61, 0.36, 1),
    filter calc(600ms * var(--animation-speed)) cubic-bezier(0.22, 0.61, 0.36, 1);
}

.reveal.is-visible,
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}

/* Staggered reveal for child elements */
.reveal.is-visible .card,
.reveal.is-visible .section-header,
.reveal.is-visible .timeline-item,
.reveal.is-visible .education-card,
.reveal.is-visible .skill-card,
.reveal.is-visible .social-button,
.reveal.is-visible .skill-pill {
  animation: fadeInUpStagger 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  opacity: 0;
}

.reveal.is-visible .card:nth-child(1),
.reveal.is-visible .section-header { animation-delay: calc(var(--stagger-delay) * 1); }
.reveal.is-visible .card:nth-child(2) { animation-delay: calc(var(--stagger-delay) * 2); }
.reveal.is-visible .card:nth-child(3) { animation-delay: calc(var(--stagger-delay) * 3); }
.reveal.is-visible .card:nth-child(4) { animation-delay: calc(var(--stagger-delay) * 4); }
.reveal.is-visible .card:nth-child(5) { animation-delay: calc(var(--stagger-delay) * 5); }

.reveal.is-visible .skill-pill:nth-child(1) { animation-delay: calc(var(--stagger-delay) * 1); }
.reveal.is-visible .skill-pill:nth-child(2) { animation-delay: calc(var(--stagger-delay) * 2); }
.reveal.is-visible .skill-pill:nth-child(3) { animation-delay: calc(var(--stagger-delay) * 3); }
.reveal.is-visible .skill-pill:nth-child(4) { animation-delay: calc(var(--stagger-delay) * 4); }
.reveal.is-visible .skill-pill:nth-child(5) { animation-delay: calc(var(--stagger-delay) * 5); }
.reveal.is-visible .skill-pill:nth-child(6) { animation-delay: calc(var(--stagger-delay) * 6); }
.reveal.is-visible .skill-pill:nth-child(7) { animation-delay: calc(var(--stagger-delay) * 7); }
.reveal.is-visible .skill-pill:nth-child(8) { animation-delay: calc(var(--stagger-delay) * 8); }
.reveal.is-visible .skill-pill:nth-child(9) { animation-delay: calc(var(--stagger-delay) * 9); }
.reveal.is-visible .skill-pill:nth-child(10) { animation-delay: calc(var(--stagger-delay) * 10); }

/* Stagger for skill pills */

/* =========================================================
   Keyframes
   ========================================================= */


@keyframes skill-grow {
  0% {
    width: 0;
  }
  100% {
    width: var(--skill-target, 100%);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUpStagger {
  from {
    opacity: 0;
    transform: translateY(12px) translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
}

/* Hero animations */
.hero-section {
  animation: heroFadeIn 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.hero-title {
  animation: heroTitleSlide 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s forwards;
  opacity: 0;
  transform: translateY(20px);
}

.hero-subtitle {
  animation: heroSubtitleSlide 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.4s forwards;
  opacity: 0;
  transform: translateY(16px);
}

.hero-actions {
  animation: heroButtonsFade 1s cubic-bezier(0.22, 0.61, 0.36, 1) 0.6s forwards;
  opacity: 0;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes heroTitleSlide {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroSubtitleSlide {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroButtonsFade {
  to {
    opacity: 1;
  }
}

/* Floating effect for CTA buttons */
.hero-actions .btn {
  animation: buttonFloat 3s ease-in-out infinite;
  animation-delay: 1s;
}

@keyframes buttonFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-section,
  .hero-title,
  .hero-subtitle,
  .hero-actions,
  .hero-actions .btn {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease-out, transform 300ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast-content {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 280px;
  max-width: 90vw;
}

body.theme-light .toast-content {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 252, 0.98));
}

.toast-message {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.toast-submessage {
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* =========================================================
   Responsive Design
   ========================================================= */

@media (max-width: 960px) {
  main {
    padding-inline: 16px;
  }

  .hero-section {
    margin-bottom: 70px;
  }

  .hero-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-grid,
  .skills-layout,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .skills-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* =========================================================
   Mouse / Parallax helper
   ========================================================= */

[data-parallax] {
  will-change: transform;
  transition: transform 300ms cubic-bezier(0.22, 0.61, 0.36, 1);
}


@media (max-width: 768px) {
  .nav {
    position: absolute;
    inset-inline: 0;
    top: var(--nav-height);
    padding: 8px 20px 12px;
    background: radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.12), transparent),
      rgba(15, 23, 42, 0.97);
    transform-origin: top;
    transform: scaleY(0.7);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease-out, transform 220ms ease-out;
  }

  body.theme-light .nav {
    background: rgba(255, 255, 255, 0.98);
  }

  .nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: scaleY(1);
  }

  .nav-list {
    flex-direction: column;
    gap: 4px;
    font-size: 0.92rem;
  }

  .nav-menu-toggle {
    display: inline-flex;
  }

  .hero-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .section {
    margin-bottom: 60px;
  }

  .skills-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
  }

  .footer-left,
  .footer-center {
    text-align: center;
  }

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

@media (max-width: 480px) {
  .nav-container {
    padding-inline: 14px;
  }

  main {
    padding-inline: 14px;
  }

  .card {
    padding-inline: 14px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .back-to-top {
    right: 14px;
    bottom: 16px;
  }

  .social-grid {
    gap: 16px;
  }

  .social-button {
    width: 56px;
    height: 56px;
  }

  .social-icon {
    width: 24px;
    height: 24px;
  }
}


