/* ============================================
   Base Theme
   ============================================ */
:root {
  --bg: #0b0f14;
  --bg-2: #0f1722;
  --surface: #141c28;
  --surface-2: #1b2533;
  --text: #f8fafc;
  --muted: #b5c1d1;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-3: #f59e0b;
  --border: rgba(148, 163, 184, 0.2);
  --shadow: 0 20px 60px rgba(2, 6, 23, 0.45);
  --glow: 0 0 40px rgba(34, 211, 238, 0.25);
  --radius: 18px;
  --radius-sm: 12px;
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-mode {
  --bg: #f7f6fb;
  --bg-2: #f2f4ff;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --text: #0f172a;
  --muted: #4b5563;
  --border: rgba(15, 23, 42, 0.1);
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  --glow: 0 0 36px rgba(139, 92, 246, 0.25);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Outfit", system-ui, sans-serif;
  background:
    radial-gradient(800px 400px at 10% 10%, rgba(34, 211, 238, 0.18), transparent 60%),
    radial-gradient(900px 600px at 90% 0%, rgba(139, 92, 246, 0.2), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

button {
  font-family: inherit;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 96px 0;
  position: relative;
}

.section-title {
  font-size: clamp(2rem, 2.2vw + 1.5rem, 3.2rem);
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}

.section-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 48px;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(18px);
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid var(--border);
}

body.light-mode .navbar {
  background: rgba(247, 246, 251, 0.8);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--muted);
  font-weight: 500;
  position: relative;
  padding-bottom: 6px;
  transition: color var(--transition);
}

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

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

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

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--text);
  display: grid;
  place-items: center;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ============================================
   Hero
   ============================================ */
.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 120px 0 80px;
  position: relative;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.6;
  z-index: 0;
}

.hero::before {
  top: -120px;
  left: -120px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.9), transparent 65%);
}

.hero::after {
  bottom: -160px;
  right: -120px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.8), transparent 65%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.hero-title {
  font-size: clamp(2.4rem, 3vw + 1.8rem, 4rem);
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

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

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0b0f14;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.hero-scroll i {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

/* ============================================
   About
   ============================================ */
.about {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.about-text h3 {
  color: var(--accent-2);
  margin: 24px 0 10px;
}

.about-text p {
  color: var(--muted);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.skill-item {
  background: var(--surface-2);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.skill-item i {
  font-size: 2rem;
  color: var(--accent-2);
  margin-bottom: 8px;
}

.skill-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

/* ============================================
   Projects
   ============================================ */
.projects {
  background: transparent;
}

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

.project-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
}

.project-image {
  height: 200px;
  padding: 18px;
  display: flex;
  align-items: flex-end;
}

.project-tag {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.45);
  color: #fff;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-info {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 12px;
}

.project-title {
  margin: 0;
  font-size: 1.3rem;
}

.project-description {
  color: var(--muted);
  flex-grow: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  background: rgba(148, 163, 184, 0.16);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.project-links {
  display: flex;
  gap: 12px;
}

.project-link {
  flex: 1;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text);
  transition: background var(--transition), border var(--transition);
}

.project-link:hover {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.15);
}

/* ============================================
   Contact
   ============================================ */
.contact {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.contact-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
}

.contact-form {
  display: grid;
  gap: 16px;
}

.contact-form input,
.contact-form textarea {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

.contact-info {
  display: grid;
  gap: 16px;
}

.contact-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: transform var(--transition), box-shadow var(--transition);
}

.contact-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.contact-item i {
  font-size: 1.4rem;
  color: var(--accent-3);
}

.contact-item h3 {
  margin: 0 0 4px;
}

.contact-item a {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  text-align: center;
  padding: 32px 0;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ============================================
   Reveal Animations
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ============================================
   Notifications
   ============================================ */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0b0f14;
  z-index: 9999;
  animation: slide-in 0.3s ease;
  box-shadow: var(--shadow);
}

.notification-success {
  background: linear-gradient(120deg, #22c55e, #86efac);
}

.notification-error {
  background: linear-gradient(120deg, #f87171, #fecaca);
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
  .about-content,
  .contact-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
    border-bottom: 1px solid var(--border);
  }

  .nav-menu.active {
    max-height: 320px;
  }

  .nav-link {
    padding: 16px 24px;
  }

  .hamburger {
    display: flex;
  }
}

@media (max-width: 520px) {
  section {
    padding: 72px 0;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .project-links {
    flex-direction: column;
  }
}
