:root {
  --blue: #0057FF;
  --blue-light: #3d7eff;
  --blue-pale: #e8f0ff;
  --black: #0a0a0f;
  --grey: #6b6b7b;
  --grey-light: #f4f4f7;
  --white: #ffffff;
  --border: #e2e2ec;
  --font-display: "Cormorant Garamond", serif;
  --font-body: "Cabinet Grotesk", sans-serif;
  --font-mono: "DM Mono", monospace;
}

/* ── Dark Mode ── */
html.dark {
  --blue: #4d8fff;
  --blue-light: #7aaeff;
  --blue-pale: #0d1e3d;
  --black: #f0f0f8;
  --grey: #9999aa;
  --grey-light: #111118;
  --white: #0c0c14;
  --border: #1e1e2e;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--black);
  overflow-x: hidden;
  cursor: none;
  transition: background 0.4s, color 0.4s;
}

/* ── Custom Cursor ── */
#cursor {
  width: 12px; height: 12px;
  background: var(--blue);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background 0.2s;
}
#cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid var(--blue);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%, -50%);
  opacity: 0.6;
  transition: width 0.3s, height 0.3s;
}
body.hov #cursor { width: 20px; height: 20px; background: var(--blue-light); }
body.hov #cursor-ring { width: 56px; height: 56px; opacity: 0.25; }

/* ── Navbar ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 3rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.4s;
}
html.dark nav { background: rgba(12, 12, 20, 0.92); }
nav.scrolled { border-color: var(--border); box-shadow: 0 2px 24px rgba(0, 87, 255, 0.06); }

.nav-logo {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
  color: var(--black); text-decoration: none; letter-spacing: -0.02em;
}
.nav-logo span { color: var(--blue); }

.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--grey);
  text-decoration: none; transition: color 0.2s; position: relative;
}
.nav-links a::after {
  content: ""; position: absolute; bottom: -3px; left: 0;
  width: 0; height: 2px; background: var(--blue); transition: width 0.3s;
}
.nav-links a:hover { color: var(--blue); }
.nav-links a:hover::after { width: 100%; }
.nav-cta { background: var(--blue) !important; color: #fff !important; padding: 0.5rem 1.2rem; border-radius: 50px; }
.nav-cta::after { display: none !important; }
.nav-cta:hover { background: var(--blue-light) !important; }
.nav-right { display: flex; align-items: center; gap: 1.2rem; }

/* ── Theme Toggle ── */
.theme-toggle {
  width: 44px; height: 24px; background: var(--border);
  border-radius: 50px; border: none; cursor: pointer;
  position: relative; transition: background 0.3s; flex-shrink: 0;
}
.theme-toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; background: #fff; border-radius: 50%;
  transition: transform 0.3s; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
html.dark .theme-toggle { background: var(--blue); }
html.dark .theme-toggle::after { transform: translateX(20px); }
.toggle-wrap { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }

/* ── Hamburger ── */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--black); border-radius: 2px; transition: 0.3s;
}

/* ── Mobile Nav ── */
@media (max-width: 900px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links {
    display: none; flex-direction: column; position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--white); padding: 1.5rem 2rem;
    gap: 1.2rem; border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); z-index: 199;
  }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
}

/* ── Shared Section Styles ── */
section { padding: 7rem 3rem; max-width: 1200px; margin: 0 auto; }

.section-label {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  color: var(--blue); text-transform: uppercase; letter-spacing: 0.14em;
  margin-bottom: 1.2rem;
}
.section-label::before { content: ""; width: 28px; height: 1.5px; background: var(--blue); }

h2.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 600; line-height: 1.1;
  letter-spacing: -0.02em; margin-bottom: 1rem; color: var(--black);
}
h2.section-title em { font-style: italic; color: var(--blue); }

/* ── Scroll Reveal ── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Hero ── */
#hero {
  min-height: 100vh; max-width: 100%;
  display: grid; grid-template-columns: 1fr 1fr;
  align-items: center; gap: 4rem;
  padding: 8rem 5rem 6rem;
  position: relative; overflow: hidden;
}
.hero-bg-grid {
  position: absolute; inset: 0; z-index: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px; opacity: 0.5;
  mask-image: radial-gradient(ellipse at 30% 50%, black 20%, transparent 75%);
}
.hero-bg-blob {
  position: absolute; width: 600px; height: 600px; border-radius: 50%;
  z-index: 0; background: radial-gradient(circle, rgba(0, 87, 255, 0.08) 0%, transparent 70%);
  top: -100px; right: -100px; pointer-events: none;
  animation: blobPulse 6s ease-in-out infinite alternate;
}
@keyframes blobPulse { from { transform: scale(1); } to { transform: scale(1.1) translate(30px, 20px); } }

.hero-content { position: relative; z-index: 1; }
.hero-greeting {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--blue);
  background: var(--blue-pale); padding: 0.4rem 1rem; border-radius: 50px;
  margin-bottom: 1.8rem; letter-spacing: 0.08em;
  animation: fadeUp 0.8s ease both;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue); animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.8); } }

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--black);
  animation: fadeUp 0.9s 0.1s ease both;
}
.hero-name .blue { color: var(--blue); }
.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 300; font-style: italic; color: var(--grey);
  margin: 1.2rem 0 2rem; line-height: 1.5;
  animation: fadeUp 1s 0.2s ease both;
}
.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; animation: fadeUp 1s 0.3s ease both; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.8rem; border-radius: 50px;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 700;
  text-decoration: none; transition: all 0.25s; letter-spacing: 0.02em;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-light); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 87, 255, 0.3); }
.btn-outline { border: 2px solid var(--border); color: var(--black); background: transparent; }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-2px); }

.hero-stats { display: flex; gap: 2.5rem; margin-top: 3rem; animation: fadeUp 1s 0.4s ease both; }
.stat { display: flex; flex-direction: column; gap: 0.2rem; }
.stat-num { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; color: var(--blue); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--grey); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }

.hero-visual { position: relative; z-index: 1; display: flex; justify-content: center; align-items: center; }
.photo-wrap { position: relative; }
.photo-frame {
  width: 340px; height: 420px;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  overflow: hidden; border: 3px solid var(--blue-pale);
  box-shadow: 0 30px 80px rgba(0, 87, 255, 0.12), 0 2px 0 var(--blue);
  animation: float 6s ease-in-out infinite, fadeUp 1s 0.2s ease both;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.photo-badge {
  position: absolute; bottom: -16px; right: -16px;
  background: var(--blue); color: #fff; padding: 0.7rem 1.2rem;
  border-radius: 16px; font-size: 0.8rem; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 87, 255, 0.3); white-space: nowrap;
}
.photo-deco {
  position: absolute; top: -20px; left: -20px;
  width: 80px; height: 80px; border: 2px solid var(--blue);
  border-radius: 50%; opacity: 0.2; animation: spin 12s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* ── About ── */
#about { display: grid; grid-template-columns: 1fr 1fr; gap: 6rem; align-items: start; }
.about-text p { font-size: 1.05rem; line-height: 1.85; color: var(--grey); margin-bottom: 1.2rem; }
.about-text p strong { color: var(--black); }
.about-highlight {
  background: var(--blue-pale); border-left: 3px solid var(--blue);
  padding: 1rem 1.4rem; border-radius: 0 12px 12px 0;
  margin: 1.5rem 0; font-style: italic; color: var(--black);
  font-size: 0.95rem; line-height: 1.6;
}
.info-row { display: flex; align-items: center; gap: 0.8rem; font-size: 0.88rem; margin-bottom: 0.8rem; }
.info-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--blue-pale); display: flex; align-items: center;
  justify-content: center; font-size: 1rem; flex-shrink: 0;
}
.info-label { color: var(--grey); font-size: 0.78rem; }
.info-value { color: var(--black); font-weight: 600; }

.about-card {
  background: var(--grey-light); border-radius: 24px;
  padding: 2rem; position: sticky; top: 7rem; transition: background 0.4s;
}
html.dark .about-card { background: #0f0f1a; }
.about-card-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; margin-bottom: 1.5rem; color: var(--black); }

.edu-card {
  background: var(--white); border-radius: 16px;
  padding: 1.2rem 1.4rem; border: 1px solid var(--border);
  margin-bottom: 1rem; transition: background 0.4s, border-color 0.4s;
}
html.dark .edu-card { background: #13131e; border-color: #1e1e2e; }
.edu-uni { font-weight: 700; font-size: 0.95rem; color: var(--black); }
.edu-degree { color: var(--grey); font-size: 0.85rem; margin-top: 0.2rem; }
.edu-cgpa {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 0.6rem; background: var(--blue-pale); padding: 0.25rem 0.7rem;
  border-radius: 50px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--blue);
}
.achievement-card {
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  border-radius: 16px; padding: 1.2rem 1.4rem; color: #fff; margin-top: 1rem;
}
.achievement-card .trophy { font-size: 1.5rem; margin-bottom: 0.5rem; }
.achievement-card p { font-size: 0.85rem; line-height: 1.5; opacity: 0.92; }
.achievement-card strong { font-size: 1rem; display: block; margin-bottom: 0.3rem; }

/* ── Skills ── */
#skills { background: var(--grey-light); max-width: 100%; transition: background 0.4s; }
#skills .inner { max-width: 1200px; margin: 0 auto; padding: 7rem 3rem; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 3rem; }
.skill-group {
  background: var(--white); border-radius: 20px; padding: 1.6rem;
  border: 1px solid var(--border);
  transition: transform 0.3s, box-shadow 0.3s, background 0.4s, border-color 0.4s;
}
html.dark .skill-group { background: #13131e; border-color: #1e1e2e; }
.skill-group:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0, 87, 255, 0.08); }
.skill-group-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--blue); font-family: var(--font-mono);
  margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem;
}
.skill-group-title::before { content: "//"; opacity: 0.4; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-tag {
  font-size: 0.82rem; font-weight: 600; padding: 0.35rem 0.85rem;
  border-radius: 50px; background: var(--blue-pale); color: var(--blue);
  transition: background 0.2s, color 0.2s; cursor: default;
}
.skill-tag:hover { background: var(--blue); color: #fff; }

/* ── Projects ── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.8rem; margin-top: 3rem; }
.project-card {
  border: 1px solid var(--border); border-radius: 24px;
  padding: 2rem; background: var(--white);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s, background 0.4s;
  position: relative; overflow: hidden;
}
html.dark .project-card { background: #13131e; border-color: #1e1e2e; }
.project-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  transform: scaleX(0); transform-origin: left; transition: transform 0.4s;
}
.project-card:hover { transform: translateY(-6px); box-shadow: 0 24px 60px rgba(0, 87, 255, 0.1); border-color: var(--blue-pale); }
.project-card:hover::before { transform: scaleX(1); }

.project-badge { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.7rem; padding: 0.3rem 0.8rem; border-radius: 50px; margin-bottom: 1rem; font-weight: 500; }
.badge-mern { background: #e3f2fd; color: #1565c0; }
.badge-js { background: #fff8e1; color: #f57f17; }
.badge-fi { background: #f3e5f5; color: #7b1fa2; }
.badge-html { background: #e8f5e9; color: #2e7d32; }
html.dark .badge-mern { background: #0d2040; color: #7aaeff; }
html.dark .badge-js { background: #2a2000; color: #ffc107; }
html.dark .badge-fi { background: #1e0a2e; color: #ce93d8; }
html.dark .badge-html { background: #1e2a1e; color: #4caf50; }

.project-title { font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; line-height: 1.2; margin-bottom: 0.7rem; color: var(--black); }
.project-desc { font-size: 0.88rem; line-height: 1.7; color: var(--grey); margin-bottom: 1.4rem; }
.project-tech { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.4rem; }
.tech-tag { font-size: 0.75rem; font-weight: 600; font-family: var(--font-mono); padding: 0.2rem 0.65rem; border-radius: 6px; background: var(--grey-light); color: var(--grey); }
html.dark .tech-tag { background: #1e1e2e; color: #9999aa; }
.project-link { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; font-weight: 700; text-decoration: none; color: var(--blue); transition: gap 0.2s; }
.project-link:hover { gap: 0.7rem; }

/* ── Contact ── */
#contact { background: var(--grey-light); max-width: 100%; transition: background 0.4s; }
#contact .inner { max-width: 1200px; margin: 0 auto; padding: 7rem 3rem; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 5rem; align-items: start; margin-top: 3rem; }
.contact-info { font-size: 1rem; color: var(--grey); line-height: 1.7; margin-bottom: 2rem; }
.contact-links { display: flex; flex-direction: column; gap: 1rem; }
.contact-link-item {
  display: flex; align-items: center; gap: 1rem;
  text-decoration: none; color: var(--black); padding: 1rem 1.2rem;
  border-radius: 14px; background: var(--white); border: 1px solid var(--border);
  transition: all 0.25s;
}
html.dark .contact-link-item { background: #13131e; border-color: #1e1e2e; }
.contact-link-item:hover { border-color: var(--blue); transform: translateX(4px); box-shadow: 0 4px 20px rgba(0, 87, 255, 0.08); }
.contact-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--blue-pale); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.c-label { font-size: 0.72rem; color: var(--grey); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.c-value { font-size: 0.88rem; font-weight: 700; color: var(--black); }

.contact-form { display: flex; flex-direction: column; gap: 1.2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.78rem; font-weight: 700; color: var(--black); text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input,
.form-group textarea {
  padding: 0.85rem 1rem; border: 1.5px solid var(--border);
  border-radius: 12px; font-family: var(--font-body); font-size: 0.9rem;
  color: var(--black); background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.4s;
  outline: none; resize: vertical;
}
html.dark .form-group input,
html.dark .form-group textarea { background: #13131e; border-color: #1e1e2e; }
.form-group input:focus,
.form-group textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.1); }
.form-group textarea { min-height: 130px; }

.btn-submit {
  background: var(--blue); color: #fff; border: none;
  padding: 1rem 2rem; border-radius: 50px;
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: all 0.25s; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 0.6rem;
}
.btn-submit:hover { background: var(--blue-light); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 87, 255, 0.3); }
.form-success { display: none; background: var(--blue-pale); border-radius: 12px; padding: 1rem 1.4rem; color: var(--blue); font-weight: 600; font-size: 0.9rem; margin-top: 0.5rem; }

/* ── Footer ── */
footer { text-align: center; padding: 2rem 3rem; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--grey); }
footer a { color: var(--blue); text-decoration: none; }

/* ── Responsive ── */
@media (max-width: 900px) {
  #hero { grid-template-columns: 1fr; padding: 7rem 1.5rem 4rem; text-align: center; }
  .hero-visual { order: -1; }
  .photo-frame { width: 240px; height: 300px; }
  .hero-btns, .hero-stats { justify-content: center; }
  #about { grid-template-columns: 1fr; gap: 3rem; }
  .about-card { position: static; }
  section { padding: 5rem 1.5rem; }
  #skills .inner, #contact .inner { padding: 5rem 1.5rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .form-row { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
}
