/* ============================================================
   MANTU KUMAR — PORTFOLIO
   Minimal dark hardware-engineering aesthetic
   ============================================================ */

:root {
  --bg: #0a0a0c;
  --bg-2: #0f0f13;
  --surface: #131318;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eaeaea;
  --text-dim: #8a8a93;
  --accent: #00e58c;
  --accent-dim: rgba(0, 229, 140, 0.12);
  --font-sans: "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}

@media (hover: none), (max-width: 900px) {
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
}

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

.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

a { color: inherit; text-decoration: none; }

/* ---------- Boot preloader ---------- */
.boot {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.boot.done { opacity: 0; visibility: hidden; }
.boot-inner { width: min(420px, 80vw); }
.boot-log {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  min-height: 7em;
  white-space: pre-wrap;
  margin-bottom: 16px;
}
.boot-log .ok { color: var(--accent); }
.boot-bar {
  height: 2px; background: var(--line); overflow: hidden;
}
.boot-bar span {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  transition: width 0.2s linear;
}

/* ---------- Custom cursor ---------- */
.cursor-dot {
  position: fixed; z-index: 999; pointer-events: none;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
}
.cursor-ring {
  position: fixed; z-index: 999; pointer-events: none;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(0, 229, 140, 0.45);
  transform: translate(-50%, -50%);
  transition: width 0.25s, height 0.25s, border-color 0.25s, background 0.25s;
}
.cursor-ring.hovering {
  width: 56px; height: 56px;
  background: rgba(0, 229, 140, 0.08);
  border-color: var(--accent);
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 2px; width: 0;
  background: var(--accent);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 64px);
  transition: background 0.4s, backdrop-filter 0.4s, padding 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10, 10, 12, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 14px clamp(20px, 5vw, 64px);
  border-bottom-color: var(--line);
}
.nav-logo {
  font-family: var(--font-mono);
  font-weight: 500; font-size: 1.05rem; letter-spacing: 0.05em;
}
.logo-mark { color: var(--text); }
.logo-cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; gap: clamp(16px, 2.5vw, 36px); }
.nav-link {
  font-size: 0.82rem; letter-spacing: 0.06em;
  color: var(--text-dim);
  position: relative;
  transition: color 0.3s;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-index {
  font-family: var(--font-mono);
  font-size: 0.6rem; color: var(--accent);
  margin-right: 6px; vertical-align: super;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 1px; background: var(--accent);
  transition: width 0.35s var(--ease);
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 14px 28px;
  border: 1px solid var(--line);
  position: relative; overflow: hidden;
  transition: color 0.35s var(--ease), border-color 0.35s;
  will-change: transform;
}
.btn::before {
  content: ""; position: absolute; inset: 0;
  background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease);
  z-index: -1;
}
.btn:hover::before { transform: scaleX(1); transform-origin: left; }
.btn:hover { color: #000; border-color: var(--accent); }
.btn-fill { background: var(--accent); color: #000; border-color: var(--accent); }
.btn-fill::before { background: var(--text); }
.nav-cta { padding: 10px 20px; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px clamp(20px, 5vw, 64px) 0;
  overflow: hidden;
}
.pcb-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.5;
}
.hero-grid-lines {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at 30% 40%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, black 30%, transparent 75%);
}

.hero-content {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  max-width: 1280px; margin: 0 auto; width: 100%;
  flex: 1;
}

.hero-eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.68rem; letter-spacing: 0.18em;
  color: var(--text-dim);
  margin-bottom: 22px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(0,229,140,0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,229,140,0.5); }
  70% { box-shadow: 0 0 0 10px rgba(0,229,140,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,229,140,0); }
}

.hero-title {
  font-size: clamp(3.2rem, 9vw, 7rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.hero-title .line { display: block; overflow: hidden; }
.reveal-text {
  display: inline-block;
  transform: translateY(110%);
  animation: riseUp 1s var(--ease) forwards;
}
.hero-title .line:nth-child(2) .reveal-text { animation-delay: 0.12s; }
@keyframes riseUp { to { transform: translateY(0); } }

.hero-role {
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 1.6vw, 1.15rem);
  color: var(--accent);
  letter-spacing: 0.04em;
  min-height: 1.8em;
}
.role-prefix { color: var(--text-dim); margin-right: 8px; }
.type-caret { animation: blink 1s steps(1) infinite; }

.hero-desc {
  margin-top: 18px;
  max-width: 480px;
  color: var(--text-dim);
  font-size: 1.02rem;
  font-weight: 300;
}

.hero-actions { display: flex; gap: 16px; margin-top: 36px; flex-wrap: wrap; }

.hero-stats {
  display: flex; align-items: center; gap: clamp(20px, 3vw, 40px);
  margin-top: 56px;
}
.stat-num {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 600;
  color: var(--text);
  display: block; line-height: 1;
}
.stat-label {
  font-size: 0.6rem; letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
  display: block; margin-top: 8px;
}
.stat-divider { width: 1px; height: 44px; background: var(--line); }

/* Portrait */
.hero-right { display: flex; justify-content: center; }
.portrait-frame {
  position: relative;
  width: min(360px, 80vw);
  aspect-ratio: 3 / 4;
  will-change: transform;
}
.portrait-img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top;
  filter: grayscale(35%) contrast(1.05);
  transition: filter 0.6s var(--ease);
  display: block;
}
.portrait-frame:hover .portrait-img { filter: grayscale(0%) contrast(1); }
.portrait-corners i {
  position: absolute; width: 22px; height: 22px;
  border: 1px solid var(--accent);
  transition: all 0.4s var(--ease);
  z-index: 3;
}
.portrait-corners i:nth-child(1) { top: -8px; left: -8px; border-right: none; border-bottom: none; }
.portrait-corners i:nth-child(2) { top: -8px; right: -8px; border-left: none; border-bottom: none; }
.portrait-corners i:nth-child(3) { bottom: -8px; left: -8px; border-right: none; border-top: none; }
.portrait-corners i:nth-child(4) { bottom: -8px; right: -8px; border-left: none; border-top: none; }
.portrait-frame:hover .portrait-corners i { width: 34px; height: 34px; }
.portrait-scanline {
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0,229,140,0.7), transparent);
  animation: scan 4.5s linear infinite;
  z-index: 2; pointer-events: none;
}
@keyframes scan { 0% { top: 0; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
.portrait-tag {
  position: absolute; bottom: 14px; left: 14px; right: 14px;
  display: flex; justify-content: space-between;
  font-size: 0.58rem; letter-spacing: 0.12em;
  color: var(--text);
  background: rgba(10,10,12,0.72);
  backdrop-filter: blur(6px);
  padding: 9px 12px;
  border: 1px solid var(--line);
  z-index: 3;
}

/* Marquee */
.hero-marquee {
  position: relative; z-index: 2;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 14px 0;
  margin-top: clamp(36px, 6vh, 72px);
  white-space: nowrap;
}
.marquee-track {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.22em;
  color: var(--text-dim);
  animation: marquee 36s linear infinite;
}
.hero-marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(80px, 12vh, 140px) clamp(20px, 5vw, 64px) 0;
}
.section-head {
  display: flex; align-items: baseline; gap: 20px;
  margin-bottom: clamp(40px, 6vh, 64px);
}
.section-index {
  font-size: 0.75rem; color: var(--accent); letter-spacing: 0.2em;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 600; letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.section-rule { flex: 1; height: 1px; background: var(--line); }

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.about-lead {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 400; line-height: 1.4;
  margin-bottom: 22px;
}
.hl {
  color: var(--accent);
  border-bottom: 1px solid rgba(0,229,140,0.35);
}
.about-text > p:not(.about-lead) {
  color: var(--text-dim); font-weight: 300;
}
.about-facts {
  margin-top: 34px; list-style: none;
}
.about-facts li {
  display: flex; gap: 18px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--text);
}
.about-facts li:last-child { border-bottom: 1px solid var(--line); }
.about-facts li span {
  color: var(--accent); min-width: 110px;
  font-size: 0.62rem; letter-spacing: 0.16em;
  padding-top: 3px;
}

/* Terminal card */
.about-terminal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
}
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.term-bar i {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--line);
}
.term-bar i:first-child { background: rgba(255,95,86,0.7); }
.term-bar i:nth-child(2) { background: rgba(255,189,46,0.7); }
.term-bar i:nth-child(3) { background: rgba(39,201,63,0.7); }
.term-bar span { margin-left: auto; font-size: 0.62rem; color: var(--text-dim); }
.term-body {
  padding: 22px;
  font-size: 0.76rem;
  line-height: 1.9;
  color: var(--text-dim);
  white-space: pre-wrap;
}
.term-body::first-line { color: var(--accent); }

/* ---------- Experience ---------- */
.xp-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(28px, 4vw, 52px);
  position: relative;
  overflow: hidden;
  will-change: transform;
}
.xp-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.xp-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; flex-wrap: wrap;
  margin-bottom: 38px;
}
.xp-role { font-size: clamp(1.3rem, 2.4vw, 1.8rem); font-weight: 600; }
.xp-org { color: var(--text-dim); margin-top: 6px; }
.xp-org .mono { font-size: 0.72rem; letter-spacing: 0.08em; }
.xp-date {
  font-size: 0.7rem; letter-spacing: 0.16em;
  color: var(--accent);
  border: 1px solid rgba(0,229,140,0.3);
  padding: 8px 14px; border-radius: 100px;
  white-space: nowrap;
}
.xp-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px 40px;
}
.xp-key {
  display: block;
  font-size: 0.62rem; letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 10px;
}
.xp-item p { color: var(--text-dim); font-size: 0.92rem; font-weight: 300; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  position: relative;
  transition: border-color 0.4s;
  will-change: transform;
}
.skill-card:hover { border-color: rgba(0,229,140,0.4); }
.skill-num {
  font-size: 0.62rem; color: var(--text-dim); letter-spacing: 0.2em;
  transition: color 0.3s;
}
.skill-card:hover .skill-num { color: var(--accent); }
.skill-card h3 {
  font-size: 1.1rem; font-weight: 600;
  margin: 12px 0 18px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  font-family: var(--font-mono);
  font-size: 0.66rem; letter-spacing: 0.04em;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 100px;
  transition: all 0.3s;
}
.chips span:hover {
  color: var(--accent);
  border-color: rgba(0,229,140,0.45);
  background: var(--accent-dim);
}

/* ---------- Projects ---------- */
.projects-list { display: flex; flex-direction: column; gap: 20px; }
.project {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(26px, 3.5vw, 44px);
  transition: border-color 0.4s;
  position: relative;
  overflow: hidden;
  will-change: transform;
}
.project::after {
  content: "";
  position: absolute; top: 0; right: 0;
  width: 140px; height: 140px;
  background: radial-gradient(circle at top right, var(--accent-dim), transparent 70%);
  opacity: 0; transition: opacity 0.5s;
  pointer-events: none;
}
.project:hover { border-color: rgba(0,229,140,0.4); }
.project:hover::after { opacity: 1; }
.project-meta {
  display: flex; gap: 22px;
  font-size: 0.62rem; letter-spacing: 0.18em;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.project-meta span:first-child { color: var(--accent); }
.project-title {
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  font-weight: 600;
  margin-bottom: 12px;
}
.project p { color: var(--text-dim); font-weight: 300; max-width: 720px; margin-bottom: 20px; }

/* ---------- Education ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.edu-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 32px;
  transition: border-color 0.4s;
  will-change: transform;
}
.edu-card:hover { border-color: rgba(0,229,140,0.4); }
.edu-date { font-size: 0.62rem; letter-spacing: 0.2em; color: var(--accent); }
.edu-card h3 { font-size: 1.15rem; margin: 14px 0 8px; }
.edu-card p { color: var(--text-dim); font-weight: 300; }
.edu-badge {
  display: inline-block; margin-top: 18px;
  font-size: 0.64rem; letter-spacing: 0.14em;
  color: var(--accent);
  border: 1px solid rgba(0,229,140,0.3);
  padding: 6px 14px; border-radius: 100px;
}

/* ---------- Contact ---------- */
.contact-inner {
  text-align: center;
  padding: clamp(30px, 6vh, 70px) 0 clamp(60px, 10vh, 110px);
}
.contact-eyebrow {
  font-size: 0.7rem; letter-spacing: 0.22em;
  color: var(--text-dim);
  margin-bottom: 26px;
}
.contact-mail {
  display: inline-block;
  font-size: clamp(1.4rem, 4.5vw, 3.4rem);
  font-weight: 600; letter-spacing: -0.02em;
  position: relative;
  transition: color 0.3s;
  will-change: transform;
}
.contact-mail::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.5s var(--ease);
}
.contact-mail:hover::after { transform: scaleX(1); }
.contact-links {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; flex-wrap: wrap;
  margin-top: 34px;
}
.contact-link {
  font-size: 0.74rem; letter-spacing: 0.16em;
  color: var(--text-dim);
  transition: color 0.3s;
}
a.contact-link:hover { color: var(--accent); }
.dot-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--line); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap;
  padding: 26px clamp(20px, 5vw, 64px);
  font-size: 0.62rem; letter-spacing: 0.14em;
  color: var(--text-dim);
}
.back-top { transition: color 0.3s; }
.back-top:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links {
    position: fixed; inset: 0;
    background: rgba(10,10,12,0.97);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center; justify-content: center;
    gap: 34px;
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
    z-index: 90;
  }
  .nav-links.open { opacity: 1; visibility: visible; }
  .nav-links .nav-link { font-size: 1.3rem; }
  .nav-cta { display: none; }
  .nav-toggle {
    display: flex; flex-direction: column; gap: 6px;
    background: none; border: none; cursor: pointer;
    z-index: 95; padding: 6px;
  }
  .nav-toggle span {
    width: 26px; height: 1.5px; background: var(--text);
    transition: transform 0.35s var(--ease), opacity 0.3s;
  }
  .nav-toggle.open span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav-toggle.open span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

  .hero { padding-top: 100px; }
  .hero-content { grid-template-columns: 1fr; gap: 44px; }
  .hero-right { order: -1; }
  .portrait-frame { width: min(280px, 70vw); }
  .hero-stats { flex-wrap: wrap; }
  .about-grid { grid-template-columns: 1fr; }
  .xp-top { flex-direction: column; }
}

@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; }
}
