:root {
  --bg: #0f1115;
  --surface: #151922;
  --text: #e6e6e6;
  --muted: #a3a7b7;
  --accent: #7c5cff;
  --accent-2: #a7a7a7;
  --ring: rgba(124, 92, 255, 0.35);
  --gradient: linear-gradient(135deg, #5b21b6 0%, #0891b2 100%);
  --shadow-soft: 0 10px 30px rgba(0,0,0,0.3);
  --cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23415BA1" stroke="%2307020F" stroke-width="2" d="M5.5 3.21V20.8c0 .45.54.67.85.35l4.86-4.86a.5.5 0 0 1 .35-.15h6.87a.5.5 0 0 0 .35-.85L6.35 2.85a.5.5 0 0 0-.85.35Z"/></svg>') 4 4, auto;
}

html[data-theme="light"] {
  --bg: #f4eaea;
  --surface: #ffffff;
  --text: #1d2433;
  --muted: #5b6474;
  --accent: #000000;
  --accent-2: #06b6d4;
  --ring: rgba(91, 108, 255, 0.25);
  --gradient: linear-gradient(135deg, #5b6cff 0%, #06b6d4 100%);
}

* {
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: var(--cursor);
  
}

h1, h2, h3, h4, h5 {
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0 0 12px 0;
  line-height: 1.2;
}

img { max-width: 100%; display: block; opacity: 100%; background-image: none;}

/* Floating theme toggle */
.theme-toggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: transparent;
  color: #0045ae;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
  cursor: var(--cursor);
}
.theme-toggle:hover { transform: translateY(-2px); }
.theme-toggle:active { transform: translateY(0); }

/* Page container + section base */
.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

section {
  position: relative;
  padding: 96px 0;
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Hero */
#home {
  padding-top: 120px;
  background:
    radial-gradient(1200px 600px at 100% -200px, rgba(124,92,255,0.15), transparent 60%),
    radial-gradient(900px 500px at -100px 20%, rgba(34,211,238,0.12), transparent 60%);
}
#home .hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: center;
}
#home .kicker { color: var(--accent); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }
#home h1 { font-size: clamp(2rem, 4vw, 3.25rem); margin-bottom: 12px; }
#home p { color: var(--muted); margin-bottom: 24px; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.btn-primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn-outline { background: transparent; border-color: var(--ring); }

#home .visual {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  border: none;
  overflow: hidden;
}

/* Bottom blur */
#home .visual::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
}

/* About */
#about .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
}
#about .card {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
}
#about .grid > .card { height: 100%; display: flex; flex-direction: column; }
#about p { color: var(--muted); }

/* About extras */
#about .about-media { display: flex; align-items: center; gap: 16px; }
#about .portrait { width: 88px; height: 88px; border-radius: 50%; padding: 3px; background: var(--accent); box-shadow: var(--shadow-soft); flex: 0 0 auto; }
#about .portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; background: var(--surface); }
#about .meta { list-style: none; padding: 0; margin: 8px 0 0 0; display: flex;  flex-wrap: wrap; color: var(--muted); text-align: center; justify-content: space-around; }
#about .meta i { color: var(--accent); margin-right: 6px; }
#about .facts { margin-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
#about .fact { text-align: center; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 10px 8px; }
#about .fact strong { display: block; font-size: 18px; line-height: 1; }
#about .fact small { display: block; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
#about .badges { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 6px 0 0 0; }
#about .badges li { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--ring); background: rgba(124,92,255,0.08); color: var(--text); font-weight: 600; font-size: 14px; }

/* Skills meter */
#about .skills { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#about .skill { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 12px; }
#about .skill-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; margin-bottom: 8px; }
#about .skill-head .title { display: inline-flex; align-items: center; gap: 10px; }
#about .skill-head i { color: var(--accent); }
#about .meter { position: relative; width: 100%; height: 10px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; }
#about .meter .bar { position: absolute; left: 0; top: 0; bottom: 0; width: var(--value); background: var(--accent); border-radius: 999px; box-shadow: 0 2px 10px var(--ring); }

/* Projects - Carousel */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
}
.carousel-track {
  display: flex;
  transition: transform 500ms cubic-bezier(.2,.8,.2,1);
  will-change: transform;
  background: transparent;
}
.slide { min-width: 100%; position: relative; }
.slide img { width: 100%; height: 420px; object-fit: cover; display: block; }
.slide .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.6) 100%);
}
.slide .caption {
  position: absolute;
  left: 20px;
  bottom: 20px;
  color: #fff;
}
.carousel button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.35);
  color: #fff;
  border: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .2s ease;
  cursor: var(--cursor);
}
.carousel button:hover { background: rgba(0,0,0,0.55); }
.carousel .prev { left: 12px; }
.carousel .next { right: 12px; }

/* Projects – layout and typography */
.projects-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
.project {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}
.project header p { color: var(--muted); margin: 6px 0 14px 0; }
.project .stack { color: var(--muted); font-weight: 600; margin: 10px 0 14px 0; }
.project .features { margin: 0 0 16px 0; padding: 0 0 0 18px; }
.project .features li { margin: 6px 0; }
.project .features strong { color: var(--text); }
.project .carousel { margin-top: 12px; }
.project .slide .caption { font-weight: 600; font-size: 14px; line-height: 1.4; text-shadow: 0 1px 2px rgba(0,0,0,0.35); }

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.service-card {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 24px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); border-color: var(--ring); }
.service-card h3 { margin-top: 8px; }
.service-card p { color: var(--muted); }

/* Contact */
.contact {
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 24px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: box-shadow .2s ease, border-color .2s ease;
}
input:focus, textarea:focus { border-color: var(--ring); box-shadow: 0 0 0 4px var(--ring); }
textarea { min-height: 140px; resize: vertical; }

/* Section headings */
.section-head {
  display: flex; align-items: end; justify-content: space-between; gap: 16px;
  margin-bottom: 18px;
}
.section-head h2 { font-size: clamp(1.5rem, 2.6vw, 2.25rem); }
.section-head p { color: var(--muted); margin: 0; }

/* Responsive */
@media (max-width: 980px) {
  #home .hero { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .slide img { height: 360px; }
}
@media (max-width: 640px) {
  section { padding: 72px 0; }
  .services-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .slide img { height: 280px; }
  #home .hero { text-align: center; }
  #home .actions { justify-content: center; }
  #home .visual { margin: 0 auto; max-width: 420px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  #about .grid { grid-template-columns: 1fr; }
  #about .card { padding: 20px; }
  #about .about-media { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  #about .portrait { width: 96px; height: 96px; }
  #about .facts { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  #about .fact { padding: 12px 8px; }
  #about .badges { justify-content: center; gap: 8px; }
  #about .badges li { font-size: 13px; padding: 8px 10px; }
  #about .skills { grid-template-columns: 1fr; gap: 12px; }
  #about .skill { padding: 12px; }
  #about .meter { height: 10px; }
}
@media (max-width: 420px) {
  #about .facts { grid-template-columns: repeat(2, 1fr); }
}
/* Button Loader */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 8px;
  border: none;
  cursor: var(--cursor);
}

.btn .btn-loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-top: 3px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 10px;
  cursor: var(--cursor);
}

.btn.loading .btn-text {
  display: none;
}

.btn.loading .btn-loader {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-content {
  background: var(--surface);
  color: var(--text);
  padding: 32px;
  border-radius: 16px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal.show .modal-content {
  transform: translateY(0);
}

.modal-content i {
  font-size: 48px;
  margin-bottom: 16px;
  display: inline-block;
}

.modal-content h3 {
  margin-bottom: 8px;
  font-size: 1.5rem;
}

.modal-content p {
  color: var(--muted);
  margin-bottom: 24px;
}

.modal-content .success { color: #22c55e; }
.modal-content .error { color: #ef4444; }

.modal-close {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.modal-close:active {
  transform: translateY(0);
}

@keyframes pop {
  from { 
    transform: scale(0.95);
    opacity: 0;
  }
  to { 
    transform: scale(1);
    opacity: 1;
  }
}


