:root {
  color-scheme: dark;
  --bg-main: #050816;
  --bg-alt: #0d142b;
  --bg-card: rgba(14, 24, 44, 0.9);
  --bg-surface: rgba(255, 255, 255, 0.05);
  --bg-surface-strong: rgba(20, 31, 57, 0.95);
  --text-primary: #f4f7ff;
  --text-secondary: #9fb0d1;
  --accent: #5b7cff;
  --accent-strong: #8d5bff;
  --nav-btn-color: #f4f7ff;
  --border-color: rgba(255, 255, 255, 0.12);
  --shadow-color: rgba(0, 0, 0, 0.28);
  --hero-eyebrow: #8ca0ff;
  --pill-bg: rgba(91, 124, 255, 0.15);
  --pill-border: rgba(91, 124, 255, 0.25);
  --chip-bg: rgba(255, 255, 255, 0.06);
  --chip-border: rgba(255, 255, 255, 0.08);
  --btn-shadow: rgba(91, 124, 255, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle at top left, rgba(91, 124, 255, 0.2), transparent 28%), var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.section {
  padding: 6rem 0;
  scroll-margin-top: 84px;
}

.background-glow {
  position: fixed;
  width: 24rem;
  height: 24rem;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.3;
  pointer-events: none;
  z-index: -1;
}

.glow-one {
  top: 8rem;
  left: -5rem;
  background: var(--accent);
}

.glow-two {
  bottom: 6rem;
  right: -4rem;
  background: var(--accent-strong);
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(5, 8, 22, 0.7);
  border-bottom: 1px solid var(--border-color);
}

.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 0;
  gap: 1rem;
  position: relative;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--nav-btn-color);
  padding: 0.6rem 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.16), rgba(79, 109, 245, 0.12));
  justify-self: start;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-links a {
  color: var(--text-secondary);
  transition: color 180ms ease, transform 180ms ease;
}

.nav-links a:hover {
  color: var(--text-primary);
  transform: translateY(-1px);
}

.nav-actions {
  display: flex;
  gap: 0.55rem;
  justify-self: end;
}

.icon-btn {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--nav-btn-color);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.icon-btn:hover {
  transform: translateY(-2px);
  background: var(--bg-surface);
}

.hero {
  display: flex;
  align-items: center;
  min-height: calc(100vh - 80px);
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
  width: 100%;
}

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

.hero-copy .eyebrow {
  margin-bottom: 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  color: var(--hero-eyebrow);
  text-transform: uppercase;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 4.2vw, 4rem);
  line-height: 1.08;
  margin-bottom: 1rem;
}

.hero-copy h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  -webkit-background-clip: text;
  color: transparent;
}

.hero-text {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: 1.35rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.scroll-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.2rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  opacity: 0.85;
  transition: opacity 180ms ease, transform 180ms ease;
}

.scroll-indicator:hover {
  opacity: 1;
  transform: translateY(2px);
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.profile-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: min(400px, 100%);
}

.profile-orb {
  position: absolute;
  inset: 0 10% auto 10%;
  height: 80%;
  border-radius: 999px;
  background: radial-gradient(circle, var(--glow-one), transparent 66%);
  filter: blur(60px);
  z-index: 0;
}

.profile-photo-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(380px, 78vw);
  aspect-ratio: 1 / 1.08;
  padding: 8px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 22px 50px var(--shadow-color);
  animation: float 5s ease-in-out infinite;
  transition: transform 250ms ease, box-shadow 250ms ease;
}

.profile-photo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
  object-position: center top;
  background: var(--bg-surface);
  transition: transform 300ms ease;
}

.profile-photo-wrap:hover {
  transform: translateY(-4px) scale(1.02);
}

.profile-photo-wrap:hover .profile-photo {
  transform: scale(1.03);
}

.floating-info-card {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  display: grid;
  gap: 0.7rem;
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-color) 0 20px 40px;
  backdrop-filter: blur(16px);
}

.info-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--pill-bg);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.8rem;
  color: var(--hero-eyebrow);
  margin-bottom: 1rem;
}

.hero h1,
.section-heading h2 {
  font-size: clamp(2rem, 3.5vw, 3.4rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  -webkit-background-clip: text;
  color: transparent;
}

.hero-text,
.about-grid p,
.github-intro,
.info-card p,
.project-card p,
.timeline-card p {
  color: var(--text-secondary);
  font-size: 1.02rem;
}

.hero-actions,
.card-actions,
.contact-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.8rem 1.25rem;
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  border: 1px solid transparent;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  box-shadow: 0 12px 30px var(--btn-shadow);
}

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-small {
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
}

.hero-stats {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.hero-stats div {
  min-width: 100px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
}

.hero-stats strong {
  display: block;
  font-size: 1.12rem;
}

.hero-stats span {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.hero-card,
.info-card,
.project-card,
.timeline-card,
.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 24px 60px var(--shadow-color);
  border-radius: 24px;
}

.hero-card {
  padding: 2rem;
}

.card-pill {
  display: inline-flex;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.hero-card h3,
.info-card h3,
.project-card h3,
.timeline-card h3 {
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
}

.hero-card ul,
.info-card ul {
  padding-left: 1.1rem;
  color: var(--text-secondary);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  align-items: start;
}

.info-card,
.timeline-card {
  padding: 1.35rem 1.4rem;
}

.skills-grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.skill-card,
.project-card {
  padding: 1.25rem;
  transition: transform 220ms ease, border-color 220ms ease;
}

.skill-card:hover,
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 77, 255, 0.35);
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.2rem;
}

.tech-list span {
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.timeline {
  display: flex;
  justify-content: flex-start;
}

.contact-actions {
  margin-top: 1.2rem;
}

.footer {
  padding: 2rem 0 3rem;
  color: var(--text-secondary);
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 900px) {
  .hero-grid,
  .about-grid,
  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-copy {
    max-width: 100%;
  }

  .hero-visual {
    justify-content: center;
  }

  .hero {
    min-height: auto;
  }
}

@media (max-width: 700px) {
  .nav {
    grid-template-columns: 1fr auto;
    justify-items: start;
    gap: 0.8rem;
  }

  .brand {
    justify-self: start;
  }

  .nav-actions {
    justify-self: end;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 0.6rem);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 20px 40px var(--shadow-color);
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 220ms ease, transform 220ms ease, max-height 220ms ease;
  }

  .nav-open .nav-links {
    opacity: 1;
    max-height: 320px;
    pointer-events: auto;
    transform: translateY(0);
  }

  .hero-grid,
  .about-grid,
  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .profile-photo-wrap {
    width: min(280px, 80vw);
  }

  .floating-info-card {
    width: 100%;
    max-width: 320px;
  }

  .section {
    padding: 4.5rem 0;
  }

  .hero-card,
  .info-card,
  .project-card,
  .timeline-card {
    padding: 1.2rem;
  }
}
