:root {
  --bg: #0a0a0f;
  --bg-alt: #111118;
  --surface: #16161f;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f0f0f5;
  --text-muted: #9494a8;
  --accent: #00bcd4;
  --accent-2: #7c4dff;
  --gradient: linear-gradient(135deg, #00bcd4, #7c4dff);
  --radius: 16px;
  --nav-height: 72px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: #4dd0e1;
}

img {
  max-width: 100%;
  display: block;
}

/* Cursor glow (desktop only) */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 188, 212, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  z-index: 1000;
  transition: background var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  padding: 0.25rem 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: calc(var(--nav-height) + 2rem) 5% 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: float 8s ease-in-out infinite;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: rgba(0, 188, 212, 0.15);
  top: 10%;
  left: -10%;
}

.orb-2 {
  width: 350px;
  height: 350px;
  background: rgba(124, 77, 255, 0.12);
  bottom: 10%;
  right: -5%;
  animation-delay: -3s;
}

.orb-3 {
  width: 250px;
  height: 250px;
  background: rgba(0, 188, 212, 0.08);
  top: 50%;
  left: 50%;
  animation-delay: -5s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(30px, -30px) scale(1.05);
  }
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 4rem;
  max-width: 1100px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-image-wrap {
  position: relative;
  flex-shrink: 0;
}

.hero-photo {
  width: 280px;
  height: 280px;
  object-fit: cover;
  border-radius: 24px;
  position: relative;
  z-index: 1;
  animation: photoIn 1s ease-out;
}

.hero-ring {
  position: absolute;
  inset: -8px;
  border-radius: 28px;
  background: var(--gradient);
  z-index: 0;
  animation: ringPulse 3s ease-in-out infinite;
}

@keyframes photoIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes ringPulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.hero-greeting {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.hero-text h1 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.hero-tagline {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  min-height: 1.8rem;
}

.cursor-blink {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-bio {
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 188, 212, 0.3);
  color: #fff;
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.scroll-indicator span {
  width: 4px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(8px);
    opacity: 0.3;
  }
}

/* Sections */
.section {
  padding: 6rem 5%;
  max-width: 1200px;
  margin: 0 auto;
}

.section--alt {
  max-width: none;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section--alt .section-header,
.section--alt .skills-grid,
.section--alt .tech-pills {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.section-tag {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-header p {
  color: var(--text-muted);
  max-width: 600px;
}

.section-header {
  margin-bottom: 3rem;
}

/* Projects */
.skill-project-group {
  margin-bottom: 3.5rem;
}

.skill-project-group:last-child {
  margin-bottom: 0;
}

.skill-project-header {
  margin-bottom: 1.25rem;
}

.skill-project-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(0, 188, 212, 0.12);
  color: var(--accent);
  border: 1px solid rgba(0, 188, 212, 0.25);
}

.section-header code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85em;
  padding: 0.15rem 0.45rem;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--accent);
}

.projects-error {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(0, 188, 212, 0.3);
}

.project-thumb {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-thumb img {
  transform: scale(1.08);
}

.project-thumb--gradient {
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-icon {
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.9);
}

.gradient-ts {
  background: linear-gradient(135deg, #3178c6, #1a3a5c);
}

.gradient-js {
  background: linear-gradient(135deg, #f7df1e33, #f7df1e11), linear-gradient(135deg, #1a1a2e, #16213e);
}

.gradient-py {
  background: linear-gradient(135deg, #3776ab, #ffd43b33);
}

.gradient-html {
  background: linear-gradient(135deg, #e44d26, #f16529);
}

.project-lang {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.project-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.project-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.project-body > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.project-innovation {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: rgba(124, 77, 255, 0.08);
  border: 1px solid rgba(124, 77, 255, 0.2);
  border-radius: 10px;
}

.project-innovation > i {
  color: #b388ff;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.project-innovation strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b388ff;
  margin-bottom: 0.25rem;
}

.project-innovation p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.project-tags span {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: rgba(0, 188, 212, 0.1);
  color: var(--accent);
  border-radius: 6px;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.project-link--demo {
  color: var(--accent-2);
}

.project-link i {
  font-size: 0.75rem;
  transition: transform var(--transition);
}

.project-card:hover .project-link i {
  transform: translate(2px, -2px);
}

.projects-cta {
  text-align: center;
  margin-top: 3rem;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.skill-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.skill-pct {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
}

.skill-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0;
  background: var(--gradient);
  border-radius: 6px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-item.animated .skill-fill {
  width: var(--level);
}

.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.tech-pills span {
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: var(--transition);
  animation: pillIn 0.5s ease backwards;
}

.tech-pills span:nth-child(odd) {
  animation-delay: 0.05s;
}

.tech-pills span:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

@keyframes pillIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
}

.about-image {
  padding: 4px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 40px rgba(0, 188, 212, 0.15);
}

.about-image img {
  width: 100%;
  border-radius: 50%;
}

.about-content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.about-content strong {
  color: var(--text);
}

.about-details {
  list-style: none;
  margin-top: 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.about-details li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.about-details i {
  color: var(--accent);
  width: 18px;
}

/* Footer */
.footer {
  padding: 4rem 5% 2rem;
  border-top: 1px solid var(--border);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-text h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.footer-text p {
  color: var(--text-muted);
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  transition: var(--transition);
}

.footer-social a:hover {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
  transform: translateY(-3px);
}

.footer-copy {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal[data-delay="1"] {
  transition-delay: 0.1s;
}

.reveal[data-delay="2"] {
  transition-delay: 0.2s;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 2.5rem;
  }

  .hero-bio {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about-image {
    max-width: 220px;
    margin: 0 auto;
  }

  .about-details li {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    transform: translateY(-120%);
    opacity: 0;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
  }

  .cursor-glow {
    display: none;
  }

  .hero-photo {
    width: 220px;
    height: 220px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
