:root {
  --bg: #0b0f1a;
  --panel: #0f1526;
  --text: #e6ebff;
  --muted: #a5b0d6;
  --primary: #6c8cff;
  --primary-600: #5a78ff;
  --accent: #22d3ee;
  --danger: #ff6b6b;
  --ring: 0 0 0 6px rgb(108 140 255 / 15%);
  --radius: 12px;
  --shadow-1: 0 10px 30px rgb(0 0 0 / 35%);
}

/* Light theme vars */
:root.light {
  --bg: #f7f8fc;
  --panel: #ffffff;
  --text: #0b1220;
  --muted: #5a6b8a;
  --primary: #3b66ff;
  --primary-600: #2f53d6;
  --accent: #0ea5e9;
  --danger: #d84040;
  --ring: 0 0 0 6px rgb(59 102 255 / 18%);
  --shadow-1: 0 8px 24px rgb(0 0 0 / 10%);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Roboto, Inter, system-ui, -apple-system, Segoe UI, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 800px at 80% -10%, rgb(34 211 238 / 15%), transparent 40%),
    radial-gradient(1000px 700px at -10% 10%, rgb(108 140 255 / 18%), transparent 40%),
    var(--bg);
  line-height: 1.6;
}

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

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  outline: none;
  box-shadow: var(--ring);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  background: rgb(11 15 26 / 55%);
  border-bottom: 1px solid rgb(255 255 255 / 6%);
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #0a0f1a;
  font-weight: 800;
  text-decoration: none;
}

.site-nav ul {
  display: flex;
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: center;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
}

.site-nav a:hover {
  color: white;
}

.site-nav a.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 8px;
  border-radius: 8px;
}

.nav-toggle:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 4px 0;
  transition: transform .2s ease;
}

/* Hero */
.hero {
  padding: 96px 0 64px;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(108,140,255,0.1), transparent 70%);
  transform: rotate(-12deg);
  pointer-events: none;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
}

.hero-text {
  position: relative;
  z-index: 2;
}

.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  margin: 0 0 6px 0;
}

.hero h1 {
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.1;
  margin: 0 0 12px 0;
  font-family: Poppins, Inter, system-ui, -apple-system, Segoe UI, Arial;
}

.lead {
  font-size: 18px;
  color: var(--muted);
}

.cta-group {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.hero-social {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.chip-link {
  border: 1px solid rgb(255 255 255 / 18%);
  color: var(--text);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
}

.avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #0a0f1a;
  font-size: 40px;
  margin: 0 auto;
  box-shadow: var(--shadow-1);
}

.avatar-img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: var(--shadow-1);
  border: 3px solid rgb(255 255 255 / 14%);
}

/* Sections */
.section {
  padding: 72px 0;
}

.section h2 {
  font-size: 28px;
  margin: 0 0 16px 0;
}

/* Link cards */
.link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.link-card {
  background: var(--panel);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  display: grid;
  gap: 6px;
}

.link-card:hover {
  border-color: rgb(255 255 255 / 28%);
}

.link-title {
  font-weight: 600;
}

.link-sub {
  color: var(--muted);
  font-size: 14px;
}

.skills {
  margin-top: 12px;
}

.chip-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0;
  margin: 12px 0 0 0;
  list-style: none;
}

.chip-list li {
  background: var(--panel);
  border: 1px solid rgb(255 255 255 / 10%);
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.project-card {
  background: var(--panel);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-1);
  transform: translateY(0);
  transition: transform .22s cubic-bezier(.42,0,.27,1.27), border-color .2s, box-shadow .18s;
}

.project-card__body h3 {
  margin: 0 0 6px 0;
}

.project-card__body p {
  color: var(--muted);
  margin: 0;
}

.project-card__footer {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.project-card--spotlight {
  border: 1px solid rgb(255 255 255 / 30%);
}

.project-card:hover {
  transform: translateY(-7px) scale(1.032);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--primary), 0 7px 36px rgba(36,77,201,0.18);
  z-index: 1;
  background: linear-gradient(rgba(15, 21, 38, 0.97), rgba(15, 21, 38, 0.97)),
              radial-gradient(circle at top right, var(--accent), transparent 70%);
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 12px 0 0 0;
  padding: 0 0 0 18px;
  border-left: 2px solid rgb(255 255 255 / 12%);
}

.timeline-item {
  position: relative;
  margin: 0 0 18px 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 0 4px rgb(108 140 255 / 20%);
}

.timeline-meta {
  color: var(--muted);
  font-size: 13px;
}

.timeline-content h3 {
  margin: 2px 0 8px 0;
}

/* Education */
.edu {
  display: grid;
  gap: 12px;
}

.edu .muted {
  color: var(--muted);
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-1), 0 0 15px rgba(108,140,255,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
  font-size: 20px;
  font-weight: bold;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Reveal animations */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .5s ease, transform .5s ease;
  }
  .reveal.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Contact */
.contact-form {
  display: grid;
  gap: 14px;
  max-width: 640px;
}

.form-row label {
  display: block;
  margin-bottom: 6px;
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  background: #0a0f1a;
  color: var(--text);
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 10px;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  box-shadow: var(--ring);
  border-color: var(--primary);
}

.error {
  display: block;
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-top: 6px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-note {
  color: var(--muted);
  font-size: 13px;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgb(255 255 255 / 6%);
  padding: 20px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.social {
  display: flex;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col { max-width: 420px; }
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.footer-links a { color: var(--muted); text-decoration: none; }

.social a {
  color: var(--muted);
  text-decoration: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: white;
  border: 0;
  padding: 12px 16px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  filter: saturate(0.8);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgb(255 255 255 / 20%);
  color: var(--text);
}

.btn-sm {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .cta-group {
    justify-content: center;
  }
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .nav-toggle {
    display: inline-block;
  }
  .site-nav {
    position: fixed;
    inset: 64px 0 auto 0;
    background: rgb(11 15 26 / 95%);
    border-bottom: 1px solid rgb(255 255 255 / 8%);
    transform: translateY(-120%);
    transition: transform .25s ease;
  }
  .site-nav ul {
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
  }
  body.nav-open .site-nav {
    transform: translateY(0);
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .link-grid {
    grid-template-columns: 1fr;
  }
}

/* Certificates */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.cert-card {
  background: var(--panel);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: var(--radius);
  padding: 16px;
}

@media (max-width: 900px) {
  .cert-grid {
    grid-template-columns: 1fr;
  }
}

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 8px;
  margin: 24px 0 22px 0;
}
.filter-btn {
  padding: 7px 18px;
  border: none;
  font-family: inherit;
  font-size: 15px;
  border-radius: 22px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.filter-btn.active, .filter-btn:hover {
  background: var(--primary);
  color: #fff;
}

.project-thumb {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 16/10;
  display: block;
  object-fit: cover;
  border-radius: 13px;
  margin: 0 auto 12px auto;
  box-shadow: var(--shadow-1);
  background: #454b6b;
}

.skills-matrix {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-top: 30px;
}

.skill-category {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-1);
  border: 1px solid rgb(255 255 255 / 8%);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  border-color: var(--primary);
}

.skill-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.skill-icon {
  font-size: 24px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(108,140,255,0.1));
}

.skill-header h3 {
  font-size: 20px;
  margin: 0;
  font-family: Poppins, Inter, Arial;
  background: linear-gradient(135deg, var(--text), var(--muted));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.skill-list {
  display: grid;
  gap: 16px;
}

.skill-item {
  display: grid;
  gap: 8px;
}

.skill-name {
  font-size: 15px;
  color: var(--muted);
  font-family: 'Fira Code', monospace;
}

.skill-bar {
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  width: var(--progress);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.skill-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transform: translateX(-100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

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

/* Polished timeline (Experience & Edu) */
.polished-timeline { border-left: 3px solid var(--primary); margin-left: 12px; padding-left: 26px; }
.polished-timeline .timeline-item, .polished-timeline .edu-item {
  position: relative; margin: 0 0 30px 0;
}
.polished-timeline .timeline-meta, .edu-badge {
  color: var(--primary);
  font-size: 14px;
  font-family: Roboto, Inter, sans-serif;
}
.polished-timeline .timeline-item:before, .polished-timeline .edu-item:before {
  content: ""; position: absolute; left: -34px; top: 6px; width: 13px; height: 13px;
  border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px rgba(108,140,255,0.14);
}
.edu-badge { display:inline-block; width:13px; height:13px; background:var(--primary); border-radius:50%; }
.edu-item { margin-bottom: 24px; }

/* Modal fade+scale in */
.modal {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity .28s, transform .25s cubic-bezier(.6,-0.28,.74,0.05);
}
.modal[open], .modal.open {
  opacity: 1;
  transform: scale(1);
  display: block;
}
.modal-close {
  position: absolute;
  right: 22px;
  top: 16px;
  border: none;
  background: none;
  font-size: 25px;
  color: #fff;
  cursor: pointer;
}
.modal h3 { font-family: Poppins, Inter, sans-serif; margin-top: 0; }

.footer-col { flex-basis: 33%; }
.footer-inner { flex-wrap: wrap; gap: 20px;}
.footer-links { flex-basis: 33%; justify-content: flex-end;}
@media (max-width: 900px) {
  .skills-matrix { grid-template-columns: 1fr 1fr; }
  .footer-inner { flex-direction: column; }
}
@media (max-width: 600px) {
  .skills-matrix { grid-template-columns: 1fr; }
}

/* Skills Section Styles */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  margin-top: 30px;
}

.skill-group {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.skill-group:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.skill-group h3 {
  font-size: 20px;
  margin: 0 0 20px 0;
  font-family: Poppins, Inter, Arial;
  color: var(--text);
  position: relative;
  padding-bottom: 12px;
}

.skill-group h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  background: rgba(108, 140, 255, 0.1);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-family: 'Fira Code', monospace;
  border: 1px solid rgba(108, 140, 255, 0.2);
  transition: all 0.2s ease;
}

.skill-tag:hover {
  background: linear-gradient(135deg, rgba(108, 140, 255, 0.15), rgba(34, 211, 238, 0.15));
  border-color: var(--primary);
  transform: translateY(-1px);
}

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

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

.brand-effect {
  color: var(--primary);
  letter-spacing: 0.5px;
  font-weight: 700;
  filter: drop-shadow(0 2px 13px rgba(108,140,255,0.36));
  transition: text-shadow .18s;
}
.brand-effect:hover {
  text-shadow: 0 0 7px var(--primary), 0 0 16px var(--accent);
}

.hero-bg-animation{
  position: relative;
}
.hero-bg-animation:before {
  content: '';
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  opacity: 0.38;
  background:
    radial-gradient(circle at 70% 10%, #22d3ee 0%, transparent 70%),
    radial-gradient(circle at 30% 80%, #6c8cff 0%, transparent 65%),
    repeating-linear-gradient(-45deg, rgba(108,140,255,0.17), rgba(34,211,238,0.11) 20px);
  animation: hero-gradient-move 8s infinite linear;
}
@keyframes hero-gradient-move {
  0% {background-position: 0% 0%, 100% 100%, 0 0;}
  100% {background-position: 50% 60%, 40% 90%, 100px 100px;}
}

.project-card {
  background: var(--panel);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-1);
  transform: translateY(0);
  transition: transform .22s cubic-bezier(.42,0,.27,1.27), border-color .2s, box-shadow .18s;
}
.project-card:hover {
  transform: translateY(-7px) scale(1.032);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--primary), 0 7px 36px rgba(36,77,201,0.18);
  z-index: 1;
}
.btn, .btn-ghost {
  box-shadow: 0 0 0 2px var(--primary) inset,0 1px 7px rgb(22 44 120 / 13%);
  transition: box-shadow .19s, background .17s, color .17s;
}
.btn:hover, .btn-ghost:hover, .btn:focus{
  box-shadow: 0 0 0 3px var(--accent), 0 6px 18px rgb(108 140 255 / 26%);
}

/* Skill bars enhanced */
.bar span {
  position: relative;
  overflow: hidden;
}
.bar span:after {
  content: '';
  position: absolute;
  right: 0; top:0; bottom:0;
  width: 2px;
  background: var(--accent);
  opacity: 0.7;
  border-radius: 7px;
}

/* Social icon hover bounce/glow */
.social a, .footer-links a {
  position: relative;
  transition: color .2s, box-shadow .18s, transform .14s;
  border-radius: 20px;
  padding: 0 3px;
}
.social a:hover, .footer-links a:hover {
  color: var(--primary);
  box-shadow: 0 2px 11px 0 var(--primary), 0 0 3px var(--accent);
  transform: translateY(-2px) scale(1.13);
}

.site-header.sticky {
  background: rgba(22,33,49,0.83);
  box-shadow: 0 2px 16px rgba(24,33,64,0.13);
  backdrop-filter: blur(7px);
}
