/* ============================================================
   VEDANT CHAVAN — portfolio
   carbon terminal aesthetic · Archivo + JetBrains Mono
   ============================================================ */

:root {
  --bg:      #0a0e13;   /* carbon blue-black */
  --surface: #10161d;
  --line:    #1d2630;
  --ink:     #e9eff4;
  --muted:   #7e8b98;
  --green:   #3cf08b;   /* phosphor */
  --amber:   #f5b759;   /* log-warning amber, used sparingly */
  --display: "Archivo", sans-serif;
  --mono:    "JetBrains Mono", monospace;
  --pad: clamp(1.25rem, 5vw, 6rem);
}

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

html { scroll-behavior: auto; } /* Lenis owns scrolling */

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* subtle scanline texture */
body::before {
  content: "";
  position: fixed; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.012) 3px 4px);
  pointer-events: none; z-index: 9999;
}

::selection { background: var(--green); color: var(--bg); }

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--pad);
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav__logo { font-size: 1.1rem; font-weight: 700; letter-spacing: .02em; }

.nav__links { display: flex; gap: 2rem; align-items: center; }
.nav__links a {
  font-family: var(--mono); font-size: .82rem; color: var(--muted);
  transition: color .2s;
}
.nav__links a:hover { color: var(--green); }
.nav__cta {
  color: var(--bg) !important;
  background: var(--green);
  padding: .45rem 1rem; border-radius: 2px;
  font-weight: 700;
}
.nav__cta:hover { color: var(--bg) !important; filter: brightness(1.1); }

.nav__burger { display: none; }

/* ============ HERO ============ */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7rem var(--pad) 4rem;
  position: relative;
  z-index: 0;
  overflow: hidden;
}

/* ---- dark canvas backdrop: faint grid + soft glow points ---- */
.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(126, 139, 152, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 139, 152, .09) 1px, transparent 1px),
    radial-gradient(560px circle at 18% 22%, rgba(60, 240, 139, .16), transparent 60%),
    radial-gradient(480px circle at 84% 72%, rgba(77, 168, 255, .13), transparent 60%);
  background-size: 44px 44px, 44px 44px, auto, auto;
  background-attachment: fixed, fixed, fixed, fixed;
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

.hero__point {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px 2px var(--green), 0 0 42px 12px rgba(60, 240, 139, .22);
  animation: heroPointPulse 4.5s ease-in-out infinite;
}
.hero__point--1 { top: 20%; left: 14%; }
.hero__point--2 {
  top: 64%; left: 80%;
  background: #4da8ff;
  box-shadow: 0 0 12px 2px #4da8ff, 0 0 42px 12px rgba(77, 168, 255, .22);
  animation-delay: 1.4s;
}
.hero__point--3 { top: 42%; left: 56%; animation-delay: 2.8s; }

@keyframes heroPointPulse {
  0%, 100% { opacity: .35; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.7); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__point { animation: none; opacity: .6; }
}

@media (max-width: 900px) {
  /* iOS Safari doesn't support background-attachment: fixed well — fall back to scroll */
  .hero__canvas { background-attachment: scroll, scroll, scroll, scroll; }
}

.hero__prompt { font-size: .95rem; color: var(--muted); margin-bottom: 1.2rem; }
.cursor { color: var(--green); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero__name {
  font-size: clamp(3.4rem, 13.5vw, 12.5rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: .92;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.hero__line { display: block; overflow: hidden; }
.hero__line--indent { padding-left: clamp(1.5rem, 8vw, 9rem); }
.hero__word { display: inline-block; } /* animated by JS */
.hero__line--indent .hero__word { color: transparent; -webkit-text-stroke: 2px var(--ink); }

.hero__split {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: 2.5rem;
  margin-top: 3rem;
  max-width: 74rem;
}
.hero__text { display: flex; flex-direction: column; gap: 1.1rem; }
.hero__role { max-width: 32rem; color: var(--muted); font-size: 1.05rem; }
.hero__status { font-size: .8rem; color: var(--green); white-space: nowrap; }

.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); margin-right: .5rem;
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.hero__actions { display: flex; gap: 1rem; margin-top: .6rem; flex-wrap: wrap; }

/* ---- portrait: seamless cutout + orbiting skill ring ---- */
.hero__portrait {
  position: relative;
  width: clamp(240px, 26vw, 380px);
  margin: 0 auto;
  aspect-ratio: 2 / 3;
}
.hero__cutout {
  position: relative;
  z-index: 2;
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: bottom center;
  display: block;
  filter: contrast(1.03);
  -webkit-mask-image: linear-gradient(to bottom, black 92%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 92%, transparent 100%);
}

.hero__orbit {
  --r: 132px;
  position: absolute;
  top: 34%; left: 50%;
  width: clamp(200px, 22vw, 300px);
  height: clamp(200px, 22vw, 300px);
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}
.hero__ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--line);
}
.hero__ring--b { inset: 16%; border-color: rgba(60, 240, 139, .25); }
.hero__ring--spin { border: none; animation: orbitSpin 46s linear infinite; }

.hero__badge {
  position: absolute; top: 50%; left: 50%; width: 0; height: 0;
  transform: rotate(var(--angle)) translateX(var(--r)) rotate(calc(-1 * var(--angle)));
}
.hero__badge span {
  display: flex; align-items: center; justify-content: center;
  position: absolute; top: -16px; left: -32px;
  width: 64px; height: 32px;
  border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line);
  font-family: var(--mono); font-size: .6rem; color: var(--ink);
  letter-spacing: .02em; white-space: nowrap;
  box-shadow: 0 0 14px rgba(60, 240, 139, .12);
  animation: orbitSpinReverse 46s linear infinite;
}

@keyframes orbitSpin { to { transform: rotate(360deg); } }
@keyframes orbitSpinReverse { to { transform: rotate(-360deg); } }

@media (prefers-reduced-motion: reduce) {
  .hero__ring--spin, .hero__badge span { animation: none; }
}

@media (max-width: 900px) {
  .hero__split { grid-template-columns: 1fr; }
  .hero__portrait { width: clamp(200px, 55vw, 300px); margin-top: 1.5rem; }
  .hero__orbit { display: none; }
}

.btn {
  font-family: var(--mono); font-size: .85rem; font-weight: 500;
  padding: .8rem 1.5rem; border-radius: 2px; border: 1px solid var(--line);
  transition: all .25s; display: inline-block;
}
.btn--solid { background: var(--green); color: var(--bg); border-color: var(--green); font-weight: 700; }
.btn--solid:hover { box-shadow: 0 0 24px rgba(60,240,139,.35); transform: translateY(-2px); }
.btn--ghost { color: var(--ink); }
.btn--ghost:hover { border-color: var(--green); color: var(--green); }

.hero__scrollhint {
  position: absolute; bottom: 1.6rem; left: var(--pad);
  font-size: .72rem; color: var(--muted); letter-spacing: .35em;
  text-transform: uppercase;
}
.hero__scrollhint::after {
  content: ""; display: inline-block; width: 40px; height: 1px;
  background: var(--muted); margin-left: .8rem; vertical-align: middle;
}

/* ============ MARQUEE ============ */
.marquee {
  overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 1.1rem 0; background: var(--surface);
}
.marquee__track {
  display: flex; gap: 2.2rem; width: max-content;
  animation: marquee 28s linear infinite;
  font-family: var(--mono); font-size: .9rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .12em;
}
.marquee__track i { color: var(--green); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee:hover .marquee__track { animation-play-state: paused; }

/* ============ SECTIONS ============ */
.section { padding: clamp(5rem, 10vw, 9rem) var(--pad); }

.eyebrow {
  font-size: .8rem; color: var(--green); letter-spacing: .15em;
  margin-bottom: 1.4rem;
}

.section__title {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 800; font-stretch: 115%;
  letter-spacing: -.02em; line-height: 1.05;
  margin-bottom: 2.5rem;
}

/* ============ ABOUT ============ */
.about__grid {
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: clamp(2rem, 5vw, 5rem); align-items: start;
}
.about__text p { color: var(--muted); margin-bottom: 1.2rem; max-width: 36rem; }
.about__text .section__title { color: var(--ink); }

.about__facts {
  list-style: none; margin-top: 2rem; font-size: .82rem;
  border-top: 1px solid var(--line);
}
.about__facts li { padding: .8rem 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.about__facts b { color: var(--green); font-weight: 500; margin-right: .5rem; }

.about__terminal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; position: sticky; top: 6rem;
}
.terminal__bar {
  display: flex; align-items: center; gap: .45rem;
  padding: .7rem 1rem; font-size: .75rem; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.terminal__bar i {
  width: 10px; height: 10px; border-radius: 50%; background: var(--line);
}
.terminal__bar i:first-child { background: #e0604f; }
.terminal__bar i:nth-child(2) { background: var(--amber); }
.terminal__bar i:nth-child(3) { background: var(--green); }

.terminal__body {
  padding: 1.4rem; font-size: .8rem; line-height: 1.9; overflow-x: auto;
}
.terminal__body .tk { color: var(--green); }
.terminal__body .tv { color: var(--ink); display: block; }
.terminal__body em { color: var(--muted); font-style: normal; }

/* ============ PIPELINE (horizontal) ============ */
.pipeline { position: relative; }
.pipeline__viewport { overflow: hidden; }

.pipeline__rail {
  position: absolute; top: 4.5rem; left: var(--pad); right: var(--pad);
  height: 1px; background: var(--line); z-index: 2;
}
.pipeline__progress {
  height: 100%; width: 0%; background: var(--green);
  box-shadow: 0 0 12px var(--green);
}

.pipeline__track {
  display: flex; height: 100vh; width: max-content; will-change: transform;
}

.panel {
  width: 100vw; height: 100vh; flex-shrink: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 6rem var(--pad);
  border-right: 1px solid var(--line);
  position: relative; top: 0; left: 0;
}
.panel:nth-child(even) { background: var(--surface); }

.panel__stage { font-size: .85rem; color: var(--muted); letter-spacing: .12em; margin-bottom: 1.4rem; }
.panel__title {
  font-size: clamp(2rem, 5.5vw, 4.5rem);
  font-weight: 800; font-stretch: 120%; letter-spacing: -.02em;
  line-height: 1; margin-bottom: 1.6rem; max-width: 16ch;
}
.panel__desc { color: var(--muted); max-width: 34rem; margin-bottom: 1.6rem; font-size: 1.02rem; }
.panel__tags { font-size: .8rem; color: var(--green); margin-bottom: 2.2rem; }

/* keep the link button content-sized (flex column stretches children) */
.panel .btn { align-self: flex-start; }

/* panel content reveal — only hidden while the desktop pipeline
   animation is active (body.pipeline-anim, added by main.js) */
.pipeline-anim .panel > * {
  opacity: 0; transform: translateY(40px);
  transition: opacity .6s ease, transform .6s ease;
}
.pipeline-anim .panel.is-live > * { opacity: 1; transform: none; }
.pipeline-anim .panel.is-live > *:nth-child(2) { transition-delay: .07s; }
.pipeline-anim .panel.is-live > *:nth-child(3) { transition-delay: .14s; }
.pipeline-anim .panel.is-live > *:nth-child(4) { transition-delay: .21s; }
.pipeline-anim .panel.is-live > *:nth-child(5) { transition-delay: .28s; }

.panel--intro .panel__big {
  font-size: clamp(3.5rem, 12vw, 11rem);
  font-weight: 800; font-stretch: 125%; line-height: .95;
  letter-spacing: -.02em;
}
.panel__sub { color: var(--muted); max-width: 28rem; margin-top: 1.8rem; }
.panel__hint { color: var(--green); margin-top: 2rem; letter-spacing: .4em; font-size: 1.2rem; }

/* ============ EXPERIENCE LOG ============ */
.log { list-style: none; border-top: 1px solid var(--line); }
.log__row {
  display: grid; grid-template-columns: 11rem 1fr;
  gap: 2rem; padding: 2.2rem 0;
  border-bottom: 1px solid var(--line);
}
.log__date { color: var(--green); font-size: .82rem; padding-top: .35rem; }
.log__row h3 { font-size: 1.35rem; font-weight: 700; font-stretch: 110%; }
.log__org { color: var(--muted); font-size: .78rem; margin: .3rem 0 .7rem; }
.log__row p:not(.log__org) { color: var(--muted); max-width: 40rem; }

/* ============ WRITING ============ */
.posts { border-top: 1px solid var(--line); }
.post {
  display: grid; grid-template-columns: 7rem 1fr auto;
  align-items: center; gap: 1.5rem;
  padding: 1.7rem 0; border-bottom: 1px solid var(--line);
  transition: padding-left .25s, background .25s;
}
.post:hover { padding-left: 1rem; background: var(--surface); }
.post__tag { font-size: .72rem; color: var(--green); text-transform: uppercase; letter-spacing: .12em; }
.post__title { font-size: 1.05rem; font-weight: 500; }
.post__arrow { color: var(--muted); transition: color .2s, transform .25s; }
.post:hover .post__arrow { color: var(--green); transform: translateX(6px); }

/* ============ CONTACT ============ */
.contact { text-align: left; }
.contact__title {
  font-size: clamp(3rem, 10vw, 8.5rem);
  font-weight: 800; font-stretch: 125%; line-height: .95;
  letter-spacing: -.02em; text-transform: uppercase;
  margin-bottom: 1.8rem;
}
.contact__sub { color: var(--muted); max-width: 30rem; margin-bottom: 3rem; }

.contact__email {
  font-family: var(--mono);
  font-size: clamp(1.1rem, 3.4vw, 2.2rem);
  color: var(--green);
  border-bottom: 1px solid var(--green);
  padding-bottom: .3rem;
  transition: text-shadow .25s;
  display: inline-block;
  word-break: break-all;
}
.contact__email:hover { text-shadow: 0 0 20px rgba(60,240,139,.6); }

.contact__links { display: flex; gap: 2.2rem; margin-top: 3.2rem; font-size: .85rem; flex-wrap: wrap; }
.contact__links a { color: var(--muted); transition: color .2s; }
.contact__links a:hover { color: var(--green); }

/* ============ FOOTER ============ */
.footer {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.6rem var(--pad);
  border-top: 1px solid var(--line);
  font-size: .72rem; color: var(--muted);
}

/* ============ REVEAL (JS adds .is-visible) ============ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .nav__links {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; justify-content: center; gap: 2.4rem;
    background: var(--bg);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .3s, visibility .3s;
  }
  .nav__links a { font-size: 1.3rem; }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; pointer-events: auto; z-index: 99; }

  .nav__burger {
    display: flex; flex-direction: column; gap: 6px; z-index: 100;
    background: none; border: none; cursor: pointer; padding: .4rem;
  }
  .nav__burger span { width: 26px; height: 2px; background: var(--ink); transition: transform .3s, opacity .3s; }
  .nav.is-open .nav__burger span:first-child { transform: translateY(8px) rotate(45deg); }
  .nav.is-open .nav__burger span:last-child  { transform: translateY(-8px) rotate(-45deg); }

  .about__grid { grid-template-columns: 1fr; }
  .about__terminal { position: static; }

  /* pipeline stacks vertically on mobile — no pinning */
  .pipeline__rail { display: none; }
  .pipeline__track { flex-direction: column; height: auto; width: 100%; }
  .panel {
    width: 100%; height: auto; min-height: 0;
    padding: 4rem var(--pad);
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .panel--intro .panel__big { font-size: clamp(3rem, 16vw, 5.5rem); }
  .panel__hint { display: none; }

  .log__row { grid-template-columns: 1fr; gap: .4rem; }
  .post { grid-template-columns: 1fr auto; }
  .post__tag { grid-column: 1 / -1; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}