/* =========================================================================
   Navang Gandhi — Personal Website
   A modern, elegant, glassmorphic theme with an animated aurora background.
   ========================================================================= */

/* ----- Design tokens ----- */
:root {
  /* Brand gradient */
  --g1: #8b5cf6;   /* violet */
  --g2: #ec4899;   /* pink   */
  --g3: #22d3ee;   /* cyan   */
  --gradient: linear-gradient(120deg, var(--g1), var(--g2) 55%, var(--g3));

  --accent: #8b5cf6;
  --accent-soft: rgba(139, 92, 246, 0.14);

  --radius: 22px;
  --radius-sm: 14px;
  --container: 1120px;
  --nav-h: 76px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', var(--font);
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

/* Dark (default) */
[data-theme="dark"] {
  --bg: #07070c;
  --bg-2: #0b0b14;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-solid: #12121d;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #f5f5fa;
  --text-muted: #b4b6c6;
  --text-soft: #7c7f93;

  --glass-blur: 18px;
  --grain-opacity: 0.05;
  --aurora-opacity: 0.55;

  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.55);
}

/* Light */
[data-theme="light"] {
  --bg: #f7f7fb;
  --bg-2: #eef0f8;
  --surface: rgba(255, 255, 255, 0.7);
  --surface-solid: #ffffff;
  --border: rgba(17, 17, 34, 0.08);
  --border-strong: rgba(17, 17, 34, 0.16);

  --text: #14141f;
  --text-muted: #4c4f60;
  --text-soft: #868a9c;

  --glass-blur: 16px;
  --grain-opacity: 0.04;
  --aurora-opacity: 0.4;

  --shadow-lg: 0 24px 60px rgba(40, 30, 80, 0.16);
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.5s ease, color 0.5s ease;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
em { font-style: normal; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }

/* Elegant serif-italic accent used inside headings */
.section__title em,
.hero__subtitle em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.06em;
}

/* Animated gradient text */
.gradient-text {
  background: linear-gradient(120deg, var(--g1), var(--g2), var(--g3), var(--g1));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 8s linear infinite;
}

/* ----- Ambient background: aurora + grain ----- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  opacity: var(--aurora-opacity);
  pointer-events: none;
}
.aurora__blob {
  position: absolute;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}
.aurora__blob--1 { background: var(--g1); top: -10%; left: -8%; animation: drift1 22s ease-in-out infinite; }
.aurora__blob--2 { background: var(--g2); top: 20%; right: -12%; animation: drift2 26s ease-in-out infinite; }
.aurora__blob--3 { background: var(--g3); bottom: -18%; left: 30%; animation: drift3 30s ease-in-out infinite; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ----- Scroll progress ----- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient);
  z-index: 200;
  transition: width 0.1s linear;
}

/* ----- Buttons ----- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.9rem 1.7rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn__arrow { transition: transform 0.25s ease; }
.btn:hover .btn__arrow { transform: translateX(4px); }

.btn--primary {
  background: var(--gradient);
  background-size: 160% 160%;
  color: #fff;
  box-shadow: 0 10px 30px -8px var(--g1);
}
.btn--primary:hover { box-shadow: 0 16px 42px -8px var(--g2); transform: translateY(-3px); }

.btn--ghost {
  background: var(--surface);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

/* ----- Glass surface ----- */
.glass {
  background: var(--surface);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ----- Navbar ----- */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
  border-bottom: 1px solid transparent;
}
.navbar.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}
.nav { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; }

.nav__logo {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--gradient);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 20px -6px var(--g1);
  transition: transform 0.3s ease;
}
.nav__logo:hover { transform: rotate(-6deg) scale(1.05); }

.nav__menu { display: flex; gap: 0.25rem; }
.nav__link {
  position: relative;
  padding: 0.5rem 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 10px;
  transition: color 0.25s ease;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 4px;
  width: 0; height: 2px;
  background: var(--gradient);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 0.3s ease;
}
.nav__link:hover { color: var(--text); }
.nav__link.active { color: var(--text); }
.nav__link.active::after { width: 60%; }

.nav__actions { display: flex; align-items: center; gap: 0.7rem; }

.theme-toggle {
  width: 46px; height: 46px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  cursor: pointer;
  font-size: 1.15rem;
  display: grid;
  place-items: center;
  transition: transform 0.3s ease, border-color 0.25s ease;
}
.theme-toggle:hover { transform: translateY(-2px) rotate(12deg); border-color: var(--accent); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 46px; height: 46px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 14px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav__toggle span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s ease, opacity 0.3s ease; }
.nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ----- Hero ----- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
}
.hero__inner { max-width: 820px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  margin-bottom: 1.6rem;
  animation: fadeUp 0.7s ease both;
}
.badge__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 2s infinite;
}

.hero__eyebrow {
  font-family: var(--font-display);
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.92rem;
  margin-bottom: 1rem;
  animation: fadeUp 0.7s ease 0.1s both;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -2px;
  margin-bottom: 0.6rem;
  animation: fadeUp 0.7s ease 0.2s both;
}
.hero__subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.4vw, 2rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1.4rem;
  animation: fadeUp 0.7s ease 0.3s both;
}
.hero__subtitle em { font-size: 1.08em; }
.hero__text {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 2.2rem;
  animation: fadeUp 0.7s ease 0.4s both;
}
.hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; animation: fadeUp 0.7s ease 0.5s both; }

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-soft);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: floaty 2.4s ease-in-out infinite;
}
.hero__scroll-mouse { width: 26px; height: 42px; border: 2px solid var(--text-soft); border-radius: 14px; position: relative; }
.hero__scroll-mouse::before {
  content: ""; position: absolute; top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 8px; background: var(--text-soft); border-radius: 2px;
  animation: scroll 2s infinite;
}

/* ----- Sections ----- */
.section { position: relative; padding: 7rem 0; }
.section--alt::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-2);
  opacity: 0.6;
  z-index: -1;
}

.section__eyebrow {
  font-family: var(--font-display);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-bottom: 0.7rem;
}
.section__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 3rem;
}

/* ----- About ----- */
.about { display: grid; grid-template-columns: 1.55fr 1fr; gap: 2.5rem; align-items: start; }
.about__text p { color: var(--text-muted); margin-bottom: 1.15rem; font-size: 1.08rem; }
.about__note { font-size: 0.95rem; }
.about__note em { font-family: var(--font-serif); font-style: italic; }
.about__note code { background: var(--accent-soft); color: var(--accent); padding: 0.1rem 0.45rem; border-radius: 6px; font-size: 0.85em; }
.about__facts { padding: 2rem; box-shadow: var(--shadow-lg); }
.about__facts-title { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 1.1rem; }
.about__facts-list li { display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 0; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.about__facts-list li:last-child { border-bottom: none; }
.about__facts-list strong { color: var(--text); font-weight: 600; }

/* ----- Skills ----- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.5rem; }
.skill-card { padding: 2rem; }
.skill-card__icon {
  width: 58px; height: 58px;
  border-radius: 16px;
  background: var(--gradient);
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 10px 24px -10px var(--g1);
}
.skill-card h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 0.55rem; }
.skill-card p { color: var(--text-muted); font-size: 0.98rem; }

/* ----- Timeline ----- */
.timeline { position: relative; padding-left: 2.2rem; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--g1), var(--g2), var(--g3));
  opacity: 0.5;
}
.timeline__item { position: relative; padding-bottom: 1.5rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute; left: calc(-2.2rem + 1px); top: 28px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gradient);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline__content { padding: 1.6rem 1.8rem; transition: transform 0.3s ease, border-color 0.3s ease; }
.timeline__content:hover { transform: translateX(6px); border-color: var(--border-strong); }
.timeline__date {
  display: inline-block; font-family: var(--font-display); font-size: 0.8rem; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  padding: 0.22rem 0.75rem; border-radius: 999px; margin-bottom: 0.6rem;
}
.timeline__role { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 0.15rem; }
.timeline__org { color: var(--text-muted); font-weight: 600; margin-bottom: 0.5rem; }
.timeline__content > p:last-child { color: var(--text-muted); }

/* ----- Experience (single role, narrative) ----- */
.exp { max-width: 900px; display: grid; gap: 1.4rem; }
.exp__role {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.exp__card { padding: 1.75rem 2rem; transition: transform 0.3s ease, border-color 0.3s ease; }
.exp__card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.exp__card p { color: var(--text-muted); margin: 0; }

/* ----- Projects ----- */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.5rem; }
.project-card { padding: 1.8rem; display: flex; flex-direction: column; }
.project-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.project-card__tag {
  font-family: var(--font-display); font-size: 0.76rem; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  padding: 0.22rem 0.75rem; border-radius: 999px;
}
.project-card__links a { font-size: 1.3rem; color: var(--text-soft); transition: color 0.25s ease, transform 0.25s ease; display: inline-block; }
.project-card__links a:hover { color: var(--accent); transform: translate(3px, -3px); }
.project-card h3 { font-family: var(--font-display); font-size: 1.35rem; margin-bottom: 0.55rem; }
.project-card > p { color: var(--text-muted); font-size: 0.98rem; flex-grow: 1; }
.project-card__tech { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.3rem; }
.project-card__tech li { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); border: 1px solid var(--border-strong); padding: 0.22rem 0.7rem; border-radius: 8px; }

/* ----- Contact ----- */
.contact { text-align: center; max-width: 720px; margin-inline: auto; padding: 4rem 2rem; box-shadow: var(--shadow-lg); }
.contact .section__title { margin-bottom: 1.2rem; }
.contact__text { color: var(--text-muted); font-size: 1.15rem; margin-bottom: 2.2rem; }
.contact__socials { display: flex; justify-content: center; gap: 1.8rem; flex-wrap: wrap; margin-top: 2.6rem; }
.contact__socials a { font-family: var(--font-display); color: var(--text-muted); font-weight: 600; transition: color 0.25s ease; }
.contact__socials a:hover { color: var(--accent); }

/* ----- Footer ----- */
.footer { border-top: 1px solid var(--border); padding: 2.4rem 0; position: relative; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; color: var(--text-muted); font-size: 0.92rem; }
.footer__top { font-family: var(--font-display); font-weight: 600; transition: color 0.25s ease; }
.footer__top:hover { color: var(--accent); }

/* ----- Cursor spotlight on cards ----- */
.spotlight { position: relative; overflow: hidden; }
.spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.spotlight:hover::before { opacity: 1; }

/* ----- Tilt ----- */
[data-tilt] { transform-style: preserve-3d; transition: transform 0.2s ease, box-shadow 0.3s ease, border-color 0.3s ease; }
[data-tilt]:hover { box-shadow: var(--shadow-lg); border-color: var(--border-strong); }

/* ----- Scroll reveal (with stagger) ----- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s cubic-bezier(.2,.8,.2,1), transform 0.7s cubic-bezier(.2,.8,.2,1); }
.reveal.visible { opacity: 1; transform: none; }
.skills .reveal:nth-child(2) { transition-delay: 0.08s; }
.skills .reveal:nth-child(3) { transition-delay: 0.16s; }
.skills .reveal:nth-child(4) { transition-delay: 0.24s; }
.projects .reveal:nth-child(2) { transition-delay: 0.1s; }
.projects .reveal:nth-child(3) { transition-delay: 0.2s; }

/* ----- Animations ----- */
@keyframes shimmer { to { background-position: 300% 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }
@keyframes scroll { 0% { opacity: 1; top: 8px; } 100% { opacity: 0; top: 22px; } }
@keyframes pulse { 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); } }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(8vw, 6vh) scale(1.15); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-7vw, 9vh) scale(1.1); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(5vw, -8vh) scale(1.2); } }

/* ----- Responsive ----- */
@media (max-width: 880px) { .about { grid-template-columns: 1fr; } }

@media (max-width: 740px) {
  .nav__menu {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem 1.4rem;
    transform: translateY(-160%);
    transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
  }
  .nav__menu.open { transform: translateY(0); }
  .nav__link { display: block; padding: 0.95rem 0.5rem; }
  .nav__link::after { display: none; }
  .nav__toggle { display: flex; }
  .section { padding: 5rem 0; }
  .contact { padding: 3rem 1.5rem; }
}

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .aurora { opacity: 0.3; }
}
