/* ============================================================
   Aditya Sharma — Portfolio
   ============================================================ */

:root {
  --bg: #0a0e1a;
  --bg-soft: #101528;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #e6e9f2;
  --text-dim: #98a0b8;
  --accent: #7c6cff;
  --accent-2: #00d4ff;
  --accent-3: #ff5c9e;
  --glow: rgba(124, 108, 255, 0.35);
  --nav-bg: rgba(10, 14, 26, 0.75);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

html[data-theme="light"] {
  --bg: #f4f5fb;
  --bg-soft: #ffffff;
  --card: rgba(20, 25, 60, 0.04);
  --card-border: rgba(20, 25, 60, 0.1);
  --text: #171b2e;
  --text-dim: #565e7c;
  --accent: #5a48f0;
  --accent-2: #0090c0;
  --accent-3: #e0407e;
  --glow: rgba(90, 72, 240, 0.25);
  --nav-bg: rgba(244, 245, 251, 0.8);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.5s ease;
}

::selection { background: var(--accent); color: #fff; }

/* ---------- Preloader ---------- */
#preloader {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.preloader-name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.35em;
  display: flex;
}
.pl-letter {
  display: inline-block;
  opacity: 0;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.preloader-bar {
  margin-top: 1.5rem; height: 3px; width: 100%;
  background: var(--card-border); border-radius: 3px; overflow: hidden;
}
.preloader-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* ---------- Custom cursor ---------- */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor-dot {
  width: 8px; height: 8px;
  background: var(--accent-2);
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid var(--accent);
  border-radius: 0;
  clip-path: polygon(50% 0%, 61% 36%, 98% 36%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 36%, 39% 36%);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.cursor-ring.cursor-hovering {
  width: 60px; height: 60px;
  background: var(--glow);
  border-color: transparent;
}
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ---------- Particle canvas ---------- */
#particle-canvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
}

/* ---------- Scroll progress ---------- */
#scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 1001;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
}

/* ---------- Nav ---------- */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1.5rem, 5vw, 4rem);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--nav-bg);
  border-bottom: 1px solid transparent;
  transition: transform 0.4s ease, border-color 0.4s ease;
}
#navbar.nav-scrolled { border-color: var(--card-border); }
#navbar.nav-hidden { transform: translateY(-110%); }

.nav-logo {
  font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
  color: var(--text); text-decoration: none;
  display: inline-block;
}
.logo-dot { color: var(--accent-2); }

.nav-links {
  display: flex; gap: 2rem; list-style: none;
}
.nav-link {
  color: var(--text-dim); text-decoration: none; font-size: 0.95rem;
  font-weight: 500; position: relative; padding: 0.25rem 0;
  transition: color 0.25s ease;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.3s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after {
  transform: scaleX(1); transform-origin: left;
}

.nav-right { display: flex; align-items: center; gap: 0.75rem; }

#theme-toggle {
  background: var(--card); border: 1px solid var(--card-border);
  color: var(--text); width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
}
#theme-toggle:hover { transform: rotate(25deg) scale(1.08); }
html[data-theme="light"] .icon-moon { display: none; }
html:not([data-theme="light"]) .icon-sun { display: none; }

#nav-burger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
#nav-burger span {
  width: 24px; height: 2px; background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
#nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#nav-burger.open span:nth-child(2) { opacity: 0; }
#nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Layout ---------- */
.section {
  position: relative; z-index: 1;
  max-width: 1080px; margin: 0 auto;
  padding: clamp(4rem, 10vh, 7rem) clamp(1.5rem, 5vw, 3rem);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 2.5rem;
  white-space: nowrap;
}
.title-num { color: var(--accent-2); font-family: var(--font-mono); font-size: 0.75em; }
.section-title::after {
  content: ""; height: 1px; flex: 1;
  background: var(--card-border);
}

/* Pre-animation states (removed if reduced motion) */
[data-animate] { opacity: 0; }
.no-preanim [data-animate] { opacity: 1; }

/* ---------- Hero ---------- */
#hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 1080px;
}
.hero-blobs { position: absolute; inset: 0; overflow: visible; z-index: -1; }
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.35;
}
.blob-1 { width: 420px; height: 420px; background: var(--accent); top: 8%; right: -6%; }
.blob-2 { width: 320px; height: 320px; background: var(--accent-2); bottom: 12%; left: -10%; opacity: 0.22; }
.blob-3 { width: 240px; height: 240px; background: var(--accent-3); top: 55%; right: 25%; opacity: 0.16; }

.hero-kicker {
  font-family: var(--font-mono); color: var(--accent-2);
  font-size: 1rem; margin-bottom: 1rem; opacity: 0;
}
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  font-weight: 700; line-height: 1.05;
  margin-bottom: 0.5rem;
  min-height: 1.1em;
  --gx: 50%;
  --gy: 50%;
}
.hero-name .h-letter {
  display: inline-block; opacity: 0;
  cursor: default;
  background-image: radial-gradient(260px circle at var(--gx) var(--gy) in oklch,
    var(--accent-2), var(--accent-3) 45%, var(--accent) 75%, var(--text) 100%);
  background-repeat: no-repeat;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-name .h-space { display: inline-block; width: 0.35em; }

.hero-role {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.5vw, 1.9rem);
  font-weight: 500; color: var(--text-dim);
  margin-bottom: 1.5rem; min-height: 1.5em;
}
#typed-text { color: var(--text); }
.typed-caret {
  color: var(--accent-2); font-weight: 400;
  animation: blink 0.9s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-tagline {
  max-width: 560px; color: var(--text-dim);
  font-size: 1.05rem; margin-bottom: 2.25rem; opacity: 0;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; opacity: 0; }
.hero-socials { display: flex; gap: 0.9rem; opacity: 0; }

.social-link {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-dim);
  border: 1px solid var(--card-border);
  background: var(--card);
  transition: color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.social-link:hover {
  color: var(--accent-2); border-color: var(--accent-2);
  box-shadow: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.8rem 1.6rem; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  text-decoration: none; cursor: pointer;
  border: none; position: relative; overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}
.btn span { position: relative; z-index: 1; }
.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
}
.btn-primary:hover { box-shadow: none; }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--accent);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 100px rgba(124, 108, 255, 0.12); }

/* ---------- Scroll hint ---------- */
.scroll-hint {
  position: absolute; bottom: 2rem; left: 50%;
  transform: translateX(-50%); opacity: 0;
}
.mouse {
  width: 26px; height: 42px; border: 2px solid var(--text-dim);
  border-radius: 14px; display: flex; justify-content: center; padding-top: 7px;
}
.wheel {
  width: 4px; height: 8px; border-radius: 3px;
  background: var(--accent-2);
  animation: wheel-scroll 1.6s ease-in-out infinite;
}
@keyframes wheel-scroll {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ---------- About ---------- */
.about-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem;
  align-items: start;
}
.about-text p { margin-bottom: 1.1rem; color: var(--text-dim); }
.hl { color: var(--text); font-weight: 600; position: relative; }
.hl::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 1px;
  height: 6px; background: var(--glow); z-index: -1; border-radius: 2px;
}

.about-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.stat-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 1.4rem 1.1rem;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.stat-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: none;
}
.stat-value {
  font-family: var(--font-display); font-weight: 700;
  font-size: 2.1rem; color: var(--text);
}
.stat-unit { color: var(--accent-2); }
.stat-label { font-size: 0.82rem; color: var(--text-dim); margin-top: 0.3rem; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 2.2rem; }
.timeline-line {
  position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: var(--card-border); border-radius: 2px;
  overflow: hidden;
}
.timeline-line-fill {
  width: 100%; height: 0%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.timeline-item { position: relative; margin-bottom: 2.2rem; }
.timeline-dot {
  position: absolute; left: -2.2rem; top: 26px;
  width: 18px; height: 18px; margin-left: 1px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 0 var(--glow);
  animation: dot-pulse 2.5s ease-out infinite;
}
@keyframes dot-pulse {
  0% { box-shadow: 0 0 0 0 var(--glow); }
  70% { box-shadow: 0 0 0 12px rgba(124, 108, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(124, 108, 255, 0); }
}
.timeline-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 18px; padding: 1.6rem 1.8rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.timeline-card:hover {
  transform: translateX(6px);
  border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}
.tc-header {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 0.6rem;
}
.tc-role { font-family: var(--font-display); font-size: 1.25rem; }
.tc-company { color: var(--accent-2); font-size: 0.92rem; font-weight: 500; }
.tc-date {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim);
  border: 1px solid var(--card-border); padding: 0.2rem 0.7rem; border-radius: 999px;
  white-space: nowrap;
}
.tc-sub {
  font-weight: 600; font-size: 0.95rem; margin: 0.9rem 0 0.35rem;
  color: var(--text);
}
.tc-bullets { list-style: none; }
.tc-bullets li {
  color: var(--text-dim); font-size: 0.93rem;
  padding-left: 1.2rem; position: relative; margin-bottom: 0.4rem;
}
.tc-bullets li::before {
  content: "▹"; position: absolute; left: 0; color: var(--accent);
}
.tc-bullets b { color: var(--text); font-weight: 600; }
.tc-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.tag {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--accent-2); background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.25);
  padding: 0.18rem 0.65rem; border-radius: 999px;
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}
.project-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: 20px; padding: 1.6rem;
  text-decoration: none; color: var(--text);
  transform-style: preserve-3d;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}
.pc-glare {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(124, 108, 255, 0.14), transparent 45%);
  opacity: 0;
}
.project-card:hover .pc-glare { opacity: 0; }
.pc-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.1rem; transform: translateZ(30px);
}
.pc-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  color: var(--accent-2);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
}
.pc-links { display: flex; align-items: center; gap: 0.7rem; color: var(--text-dim); }
.pc-stats {
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--text-dim);
}
.pc-badge {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--accent-3); border: 1px solid var(--accent-3);
  padding: 0.15rem 0.6rem; border-radius: 999px; opacity: 0.85;
}
.pc-title {
  font-family: var(--font-display); font-size: 1.2rem;
  margin-bottom: 0.5rem; transform: translateZ(24px);
}
.pc-desc {
  color: var(--text-dim); font-size: 0.92rem; flex: 1;
  margin-bottom: 1rem; transform: translateZ(16px);
}
.pc-desc b { color: var(--text); }
.pc-tags {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  transform: translateZ(20px);
}
.pc-tags span {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--accent); background: rgba(124, 108, 255, 0.1);
  border: 1px solid rgba(124, 108, 255, 0.3);
  padding: 0.18rem 0.65rem; border-radius: 999px;
}
.projects-more { text-align: center; margin-top: 2.5rem; }

/* ---------- Skills ---------- */
.skills-filters {
  display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem;
}
.filter-chip {
  font-family: var(--font-display); font-size: 0.88rem; font-weight: 600;
  padding: 0.5rem 1.2rem; border-radius: 999px; cursor: pointer;
  background: var(--card); color: var(--text-dim);
  border: 1px solid var(--card-border);
  transition: all 0.3s ease;
}
.filter-chip:hover { color: var(--text); border-color: var(--accent); }
.filter-chip.active {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff; border-color: transparent;
  box-shadow: none;
}
.skills-cloud { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.skill-pill {
  font-family: var(--font-mono); font-size: 0.9rem;
  padding: 0.55rem 1.2rem; border-radius: 999px;
  background: var(--card); border: 1px solid var(--card-border);
  color: var(--text); cursor: default;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.skill-pill:hover {
  border-color: var(--accent-2);
  box-shadow: none;
  background: rgba(0, 212, 255, 0.07);
}
.skill-pill.pill-hidden { display: none; }

/* ---------- Resume ---------- */
#resume { text-align: center; }
#resume .section-title { justify-content: center; }
#resume .section-title::after { display: none; }
.resume-box {
  max-width: 620px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--card-border);
  padding: 2.6rem 2rem;
}
.resume-lede { color: var(--text-dim); margin-bottom: 1.8rem; font-size: 1.05rem; }
.resume-actions {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
}

/* ---------- Contact ---------- */
#contact { text-align: center; }
#contact .section-title { justify-content: center; }
#contact .section-title::after { display: none; }
.contact-box {
  max-width: 620px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 24px; padding: 2.6rem 2rem;
}
.contact-lede { color: var(--text-dim); margin-bottom: 1.8rem; font-size: 1.05rem; }
.contact-actions {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  margin-bottom: 1.6rem;
}
.contact-meta {
  display: flex; gap: 1.6rem; justify-content: center; flex-wrap: wrap;
  color: var(--text-dim); font-size: 0.9rem;
}

/* ---------- Footer ---------- */
#footer {
  text-align: center; padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--card-border);
  position: relative; z-index: 1;
}
.footer-socials { display: flex; gap: 1.6rem; justify-content: center; margin-bottom: 0.8rem; }
.footer-socials a {
  color: var(--text-dim); text-decoration: none; font-size: 0.9rem;
  transition: color 0.25s ease;
}
.footer-socials a:hover { color: var(--accent-2); }
.footer-note { color: var(--text-dim); font-size: 0.8rem; font-family: var(--font-mono); }
#konami-hint { cursor: help; opacity: 0.6; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff; font-family: var(--font-display); font-weight: 600;
  padding: 0.85rem 1.6rem; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  z-index: 5000; pointer-events: none;
}

/* ---------- Hard Edge Overrides ---------- */
#theme-toggle,
#nav-burger,
.social-link,
.btn,
.mouse,
.hl::after,
.stat-card,
.timeline-line,
.timeline-card,
.tc-date,
.tag,
.project-card,
.pc-icon,
.pc-badge,
.pc-tags span,
.filter-chip,
.skill-pill,
.contact-box,
.resume-box,
.toast,
.preloader-bar,
.preloader-bar-fill {
  border-radius: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .nav-links {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 2.2rem;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.35s ease;
  }
  #navbar.menu-open .nav-links { opacity: 1; pointer-events: auto; }
  .nav-link { font-size: 1.3rem; }
  #nav-burger { display: flex; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
