:root{
  --bg: #0b0f17;
  --bg2:#0e1420;
  --card:#111a2a;
  --text:#e9eef7;
  --muted:#a9b4c7;
  --line: rgba(255,255,255,.10);
  --shadow: 0 18px 50px rgba(0,0,0,.35);
  --grad1:#6ee7ff;
  --grad2:#b58bff;
  --accent:#7c5cff;
  --glass: rgba(255,255,255,.05);
  --glass2: rgba(255,255,255,.07);
  --shadow2: 0 12px 40px rgba(0,0,0,.25);
}

main, header, footer{
  position: relative;
  z-index: 1;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  background:
    radial-gradient(1200px 800px at 10% 0%, rgba(124,92,255,.35), transparent 60%),
    radial-gradient(1000px 700px at 90% 10%, rgba(110,231,255,.25), transparent 60%),
    radial-gradient(1000px 1000px at 50% 100%, rgba(181,139,255,.20), transparent 70%),
    var(--bg);

  background-attachment: fixed; 
  color: var(--text);
}

body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0; /* was -1 */

  background:
    radial-gradient(900px 700px at 20% 20%, rgba(124,92,255,.22), transparent 70%),
    radial-gradient(900px 700px at 85% 20%, rgba(110,231,255,.18), transparent 70%),
    radial-gradient(900px 900px at 50% 110%, rgba(181,139,255,.16), transparent 75%);

  opacity: .9;
}

.bg-blobs .blob{
  opacity: .22;
  filter: blur(34px);
}

.container{
  width:min(1100px, 92vw);
  margin:0 auto;
}

.progress{
  position:fixed;
  inset:0 auto auto 0;
  height:3px;
  width:0%;
  background: linear-gradient(90deg, var(--grad1), var(--grad2));
  z-index:9999;
}

/* NAV */
.nav{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(10px);
  background: rgba(10, 14, 22, .65);
  border-bottom: 1px solid var(--line);
}
.nav-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 0;
  gap:16px;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:var(--text);
  font-weight:800;
  letter-spacing:.2px;
}
.brand-badge{
  width:34px; height:34px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(110,231,255,.35), rgba(181,139,255,.35));
  border: 1px solid var(--line);
  box-shadow: 0 12px 36px rgba(124,92,255,.18);
}
.nav-links{
  display:flex;
  gap:18px;
  align-items:center;
}
.nav-links a{
  color:var(--muted);
  text-decoration:none;
  font-weight:600;
  font-size:14px;
}
.nav-links a:hover{ color:var(--text); }

.nav-actions{ display:flex; gap:10px; align-items:center; }

.icon-btn{
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
}

.burger{
  display:none;
  background:transparent;
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
}
.burger span{
  display:block;
  width:18px; height:2px;
  background: var(--text);
  margin:4px 0;
  border-radius:99px;
}

/* HERO */
.hero{
  background: transparent;
  position:relative;
  padding:72px 0 34px;
  overflow:hidden;
}
.hero-grid{
  display:grid;
  grid-template-columns: 1.3fr .9fr;
  gap:28px;
  align-items:start;
}
.pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  width: fit-content;
  background: rgba(255,255,255,.04);
  font-weight:600;
  font-size:13px;
}
h1{
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.03;
  margin: 14px 0 14px;
  letter-spacing: -0.02em;
}
.grad{
  background: linear-gradient(90deg, var(--grad1), var(--grad2));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.sub{
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 62ch;
}
.hero-cta{
  display:flex;
  gap:12px;
  margin: 18px 0 12px;
}
.hero-badges{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top: 6px;
}
.badge{
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  padding:8px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  font-weight:600;
}

.hero-card .card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.card-top{
  display:flex;
  gap:14px;
  align-items:center;
  margin-bottom: 14px;
}
.avatar{
  width:48px; height:48px;
  border-radius: 16px;
  display:grid;
  place-items:center;
  font-weight:800;
  background: linear-gradient(135deg, rgba(110,231,255,.25), rgba(181,139,255,.25));
  border:1px solid var(--line);
}
.card-name{ margin:0; font-weight:800; }
.card-role{ margin:2px 0 0; color: var(--muted); font-weight:600; font-size: 13px; }

.card-stats{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
  margin: 14px 0;
}
.stat{
  border:1px solid var(--line);
  border-radius: 16px;
  padding: 10px 10px;
  background: rgba(0,0,0,.12);
}
.stat-num{
  margin:0;
  font-size: 20px;
  font-weight: 800;
}
.stat-label{
  margin:4px 0 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

.card-actions{ display:flex; gap:10px; margin-top: 10px; }
.tiny{ color: var(--muted); font-size: 12px; line-height: 1.5; margin: 12px 0 0; }

/* BLOBS */
.bg-blobs .blob{
  position:absolute;
  filter: blur(28px);
  opacity:.38;
  border-radius: 999px;
}
.b1{ width:320px; height:320px; left:-90px; top:30px; background: rgba(124,92,255,.55); }
.b2{ width:280px; height:280px; right:-80px; top:10px; background: rgba(110,231,255,.45); }
.b3{ width:420px; height:420px; left:30%; bottom:-220px; background: rgba(181,139,255,.38); }

/* SECTIONS */
.section{ padding: 72px 0; }
.section.alt{
  background: transparent;
}
.section-head h2{
  margin:0 0 6px;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.muted{ color: var(--muted); }
.section-head{ margin-bottom: 18px; }

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}

.panel{
  border:1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(180deg, var(--glass2), var(--glass));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow2);
}

.chips{ display:flex; flex-wrap:wrap; gap:10px; margin-top: 14px; }
.chip{
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.10);
  color: var(--muted);
  font-weight: 600;
}

.tick{ padding-left: 18px; color: var(--muted); }
.tick li{ margin: 10px 0; }
.mini-actions{ display:flex; gap:14px; margin-top: 10px; }

/* SKILLS */
.skills-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:14px;
}
.skill-card{
  border:1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: linear-gradient(180deg, var(--glass2), var(--glass));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow2);
}
.skill-card h3{ margin: 0 0 6px; }
.bars{ display:grid; gap:10px; margin-top: 12px; }
.bar{
  height:10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border:1px solid var(--line);
  overflow:hidden;
}
.bar span{
  display:block;
  height:100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--grad1), var(--grad2));
}

/* PROJECTS */
.project-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 980px){
  .project-grid{ grid-template-columns: 1fr; }
}

.project{
  border:1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: linear-gradient(180deg, var(--glass2), var(--glass));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow2);
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width: 0; /* prevents overflow */
}
.project-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.project-top h3{
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.tag{
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  border:1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.14);
  white-space: nowrap;
}
.project .muted{
  margin: 0;
}

.project-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.pill2{
  font-size: 12px;
  color: var(--muted);
  border:1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.02);
  font-weight: 800;
}
.project-actions{ display:flex; gap:10px; margin-top: 2px; }

.note{
  margin-top: 14px;
  border:1px dashed rgba(255,255,255,.20);
  border-radius: 22px;
  padding: 14px 16px;
  background: rgba(0,0,0,.12);
}

/* CONTACT FORM */
form label{
  display:grid;
  gap:8px;
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--text);
}
input, textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  color: var(--text);
  outline:none;
}
input:focus, textarea:focus{
  border-color: rgba(124,92,255,.55);
  box-shadow: 0 0 0 4px rgba(124,92,255,.18);
}

/* BUTTONS & LINKS */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  text-decoration:none;
  font-weight: 800;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: var(--shadow2);
  cursor:pointer;
  transition: transform .18s ease, filter .18s ease;
}
.btn:hover{ transform: translateY(-1px); filter: brightness(1.05); }
.btn:active{ transform: translateY(0px); }

.btn-primary{
  background: linear-gradient(135deg, rgba(124,92,255,.85), rgba(181,139,255,.55));
  border-color: rgba(124,92,255,.35);
}

.btn-ghost{
  background: rgba(255,255,255,.04);
}
.btn-small{
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
}
.link{
  color: var(--text);
  text-decoration:none;
  font-weight: 800;
}
.link:hover{ text-decoration: underline; }

.contact-list{ display:grid; gap:10px; margin-top: 14px; }
.contact-item{
  display:flex;
  gap:10px;
  align-items:center;
  padding: 12px 12px;
  border-radius: 16px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.10);
  color: var(--text);
  text-decoration:none;
  font-weight: 700;
}
.contact-item:hover{ transform: translateY(-1px); }

/* FOOTER */
.footer{
  padding: 34px 0 46px;
  border-top:1px solid var(--line);
}
.footer-inner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  color: var(--muted);
}

/* REVEAL ANIMATION */
.reveal{
  opacity:0;
  transform: translateY(14px);
  transition: opacity .65s ease, transform .65s ease;
}
.reveal.show{
  opacity:1;
  transform: translateY(0);
}

/* RESPONSIVE */
@media (max-width: 980px){
  .hero-grid{ grid-template-columns: 1fr; }
  .skills-grid{ grid-template-columns: repeat(2, 1fr); }
  .project-grid{ grid-template-columns: 1fr; }
  .grid-2{ grid-template-columns: 1fr; }
  .nav-links{ display:none; }
  .burger{ display:inline-block; }
  .nav-links.open{
    display:flex;
    position:absolute;
    right: 4vw;
    top: 64px;
    flex-direction:column;
    gap:12px;
    padding: 14px;
    border:1px solid var(--line);
    border-radius: 16px;
    background: rgba(10,14,22,.92);
  }
}

/* LIGHT THEME */
body.light{
  --bg: #f6f7fb;
  --bg2:#ffffff;
  --card:#ffffff;
  --text:#0b1020;
  --muted:#4b5568;
  --line: rgba(11,16,32,.12);
  --shadow: 0 18px 50px rgba(10, 15, 25, .12);
}
body.light .nav{ background: rgba(246,247,251,.75); }
body.light .project,
body.light .panel,
body.light .skill-card{ background: rgba(255,255,255,.75); }
body.light input,
body.light textarea{ background: rgba(255,255,255,.9); }

.honeypot{ position:absolute; left:-9999px; opacity:0; height:0; width:0; }

/* Logo styling */
.contact-icon{
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}

.theme-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Smooth theme transition */
body, body * {
  transition:
    background-color 300ms ease,
    color 300ms ease,
    border-color 300ms ease,
    box-shadow 300ms ease,
    filter 300ms ease;
}

.theme-icon{
  width: 24px;
  height: 24px;
  object-fit: contain;
  transition: transform 220ms ease, opacity 220ms ease, filter 300ms ease;
  transform-origin: center;
}

/* black/white forcing */
body:not(.light) .theme-icon { filter: brightness(0) invert(1); }
body.light .theme-icon { filter: brightness(0); }

/* animation class we’ll toggle in JS */
.theme-icon.switching{
  opacity: 0;
  transform: scale(0.85) rotate(-10deg);
}

@media (prefers-reduced-motion: reduce) {
  body, body * { transition: none !important; }
  .theme-icon { transition: none !important; }
}