/* ============ MIDNIGHT VIOLET theme ============ */
:root {
  --bg: #060608;
  --ink: #ececf1;
  --dim: #8a8a96;
  --lav: #c4b5fd;
  --violet: #8b5cf6;
  --deep: #4c1d95;
  --display: "Clash Display", "Space Grotesk", sans-serif;
  --body: "Satoshi", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.has-gsap { scroll-behavior: auto; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.6;
  overflow-x: hidden;
}
::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }
.mono { font-family: var(--mono); }
.accent { color: var(--lav); }
.accent-grad {
  background: linear-gradient(100deg, var(--lav), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
a { color: inherit; text-decoration: none; }

/* ============ grain + orbs ============ */
.grain {
  position: fixed; inset: -50%; z-index: 3; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); } 10% { transform: translate(-5%,-10%); }
  20% { transform: translate(-15%,5%); } 30% { transform: translate(7%,-25%); }
  40% { transform: translate(-5%,25%); } 50% { transform: translate(-15%,10%); }
  60% { transform: translate(15%,0%); } 70% { transform: translate(0%,15%); }
  80% { transform: translate(3%,35%); } 90% { transform: translate(-10%,10%); }
}

.orb {
  position: fixed; border-radius: 50%; pointer-events: none; z-index: 0;
  filter: blur(60px);
}
.orb-1 {
  width: 420px; height: 420px; top: -10%; right: -8%;
  background: radial-gradient(circle, rgba(139,92,246,0.28), transparent 65%);
}
.orb-2 {
  width: 520px; height: 520px; top: 60%; left: -12%;
  background: radial-gradient(circle, rgba(196,181,253,0.14), transparent 65%);
}
.orb-3 {
  width: 300px; height: 300px; top: 30%; left: 55%;
  background: radial-gradient(circle, rgba(76,29,149,0.35), transparent 65%);
}

/* small crisp lavender moon (like moncy's) */
body::after {
  content: ""; position: fixed; top: 42%; right: 12%;
  width: 56px; height: 56px; border-radius: 50%;
  background: #d9ccff;
  box-shadow: 0 0 60px 20px rgba(196,181,253,0.35);
  z-index: 0; pointer-events: none;
}

/* ============ cursor ============ */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; border-radius: 50%;
  pointer-events: none; z-index: 99;
  transform: translate(-50%, -50%);
}
.cursor-dot { width: 8px; height: 8px; background: var(--lav); }
.cursor-ring {
  width: 38px; height: 38px;
  border: 1.5px solid rgba(196,181,253,0.5);
  transition: width 0.25s, height 0.25s, background 0.25s, border-color 0.25s;
}
.cursor-ring.hovering {
  width: 64px; height: 64px;
  background: rgba(196,181,253,0.12);
  border-color: transparent;
}
@media (hover: none) { .cursor-dot, .cursor-ring { display: none; } }

/* ============ preloader ============ */
#preloader {
  position: fixed; inset: 0; z-index: 100;
  background: #e8e6ee;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1);
}
#preloader.done { transform: translateY(-100%); }
.loader-marquee {
  position: absolute; top: 50%; left: 0; right: 0;
  transform: translateY(-50%);
  white-space: nowrap; overflow: hidden;
}
.loader-track { display: inline-flex; animation: slide 14s linear infinite; }
.loader-track span {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(70px, 12vw, 150px);
  color: #111; letter-spacing: -0.02em;
}
.loader-pill {
  position: relative; z-index: 2;
  background: #0d0d10; color: #fff;
  border-radius: 999px; padding: 26px 54px;
  display: flex; gap: 26px; align-items: baseline;
  box-shadow: 0 0 0 3px rgba(139,92,246,0.65), 0 30px 80px rgba(0,0,0,0.35);
}
.loader-label { font-family: var(--body); font-weight: 700; letter-spacing: 3px; font-size: 18px; }
.loader-count { font-size: 18px; color: var(--lav); min-width: 3ch; text-align: right; }

/* ============ nav ============ */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 26px 44px;
  mix-blend-mode: difference;
}
.logo { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: 0.5px; }
.nav-links { display: flex; gap: 38px; list-style: none; }
.nav-links a {
  font-weight: 700; font-size: 13px; letter-spacing: 2.5px;
  position: relative;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px; height: 1.5px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ============ hero ============ */
.hero {
  position: relative; z-index: 2;
  min-height: 100vh;
  display: flex; flex-direction: column;
  padding: 110px 44px 40px;
}
.hero-hello { color: var(--lav); font-size: 20px; font-weight: 500; margin-bottom: 6px; }
.hero-name {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(64px, 14vw, 190px);
  line-height: 0.95; letter-spacing: -0.02em;
  text-transform: uppercase;
}
.line { display: block; overflow: hidden; }
.line-inner {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
body.loaded .line-inner { transform: translateY(0); }
body.loaded .line:nth-child(2) .line-inner { transition-delay: 0.1s; }

.hero-core {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -46%);
  width: min(46vw, 430px); height: min(46vw, 430px);
  z-index: -1;
}
.core-glow {
  position: absolute; inset: -18%;
  background: radial-gradient(circle, rgba(139,92,246,0.5), rgba(76,29,149,0.22) 45%, transparent 70%);
  border-radius: 50%;
  animation: breathe 5s ease-in-out infinite;
}
.core {
  position: absolute; inset: 26%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,0.5), transparent 42%),
    radial-gradient(circle at 70% 75%, #2a1758, #0c0616 70%),
    #12082a;
  box-shadow:
    inset -18px -20px 50px rgba(0,0,0,0.7),
    0 0 90px rgba(139,92,246,0.5);
}
.core-ring {
  position: absolute; inset: 12%;
  border-radius: 50%;
  border: 1px solid rgba(196,181,253,0.35);
  border-left-color: transparent; border-right-color: transparent;
  animation: spin 9s linear infinite;
}
.core-ring.r2 { inset: 2%; animation-duration: 14s; animation-direction: reverse; border-color: rgba(139,92,246,0.22); border-top-color: transparent; border-bottom-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.07); opacity: 1; } }

.hero-title { margin-top: auto; text-align: center; position: relative; padding-bottom: 60px; }
.hero-a { color: var(--lav); font-size: clamp(16px, 2vw, 24px); letter-spacing: 6px; margin-bottom: 2px; }
.ghost-word {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(44px, 8.4vw, 110px);
  line-height: 1; letter-spacing: 0.01em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(196,181,253,0.35);
  transform: translateY(58%);
  user-select: none;
}
.solid-word {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(44px, 8.4vw, 110px);
  line-height: 1; letter-spacing: 0.01em;
  position: relative; z-index: 2;
  text-shadow: 0 10px 60px rgba(6,6,8,0.9);
}
.hero-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--dim); letter-spacing: 1px;
}
.scroll-cue { animation: bob 2s ease-in-out infinite; display: inline-block; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ============ marquee ============ */
.marquee {
  position: relative; z-index: 2;
  border-top: 1px solid rgba(196,181,253,0.14);
  border-bottom: 1px solid rgba(196,181,253,0.14);
  padding: 20px 0; overflow: hidden;
  background: rgba(10,8,18,0.5);
}
.marquee-track { display: inline-flex; white-space: nowrap; animation: slide 22s linear infinite; }
.marquee-track span {
  font-family: var(--display); font-weight: 500;
  font-size: 22px; letter-spacing: 2px; color: var(--dim);
}
@keyframes slide { to { transform: translateX(-50%); } }

/* ============ sections base ============ */
section { position: relative; z-index: 2; padding: 140px 44px; max-width: 1280px; margin: 0 auto; }
.sec-label { color: var(--lav); font-size: 13px; letter-spacing: 3px; margin-bottom: 34px; }
.display-h {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(44px, 7vw, 92px);
  line-height: 1.02; letter-spacing: -0.02em;
  margin-bottom: 70px;
}
.display-h.center { text-align: center; }

/* ============ about ============ */
.statement {
  font-family: var(--body); font-weight: 700;
  font-size: clamp(26px, 3.6vw, 46px);
  line-height: 1.35; letter-spacing: -0.01em;
  max-width: 1050px;
}
.statement .word { color: #2e2e38; transition: color 0.3s; }
.statement .word.lit { color: var(--ink); }
.statement .word.key.lit { color: var(--lav); }

.stat-row {
  margin-top: 90px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.stat { border-top: 1px solid rgba(196,181,253,0.2); padding-top: 22px; display: block; }
.stat-big {
  display: block;
  font-family: var(--display); font-weight: 600;
  font-size: clamp(40px, 5vw, 68px); line-height: 1;
  color: var(--ink);
}
a.stat:hover .stat-big { color: var(--lav); }
.stat-sub { display: block; margin-top: 10px; font-size: 11px; color: var(--dim); letter-spacing: 1.5px; }

/* ============ career ============ */
#career .display-h { text-align: center; }
.career-list { position: relative; max-width: 900px; margin: 0 auto; }
.career-list::before {
  content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 2px;
  background: linear-gradient(180deg, var(--violet), rgba(139,92,246,0.05));
}
.career-item {
  position: relative; padding: 0 0 90px 54px;
}
.career-dot {
  position: absolute; left: 1px; top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--lav);
  box-shadow: 0 0 24px rgba(196,181,253,0.8);
}
.career-year {
  position: absolute; right: 0; top: -14px;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(60px, 9vw, 120px); line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(196,181,253,0.22);
  user-select: none; pointer-events: none;
}
.career-body { max-width: 560px; }
.career-body h3 { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 3vw, 38px); letter-spacing: -0.01em; }
.career-org { color: var(--lav); font-size: 17px; margin: 6px 0 16px; }
.career-desc { color: var(--dim); font-size: 16px; }
.career-tools { margin-top: 14px; font-size: 12px; color: rgba(196,181,253,0.7); letter-spacing: 1px; }

/* ============ work (horizontal) ============ */
#work { max-width: none; padding: 140px 0 0; }
.work-h { padding: 0 44px; }
.work-wrap { overflow: hidden; }
.work-track {
  display: flex; gap: 0;
  will-change: transform;
}
.panel {
  flex: 0 0 min(88vw, 620px);
  min-height: 68vh;
  border-left: 1px solid rgba(196,181,253,0.14);
  padding: 60px 54px;
  position: relative;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(15,12,26,0.45), transparent 60%);
}
.panel-num {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(80px, 10vw, 150px); line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(196,181,253,0.28);
  margin-bottom: 24px;
}
.panel-cat { color: var(--lav); font-size: 12px; letter-spacing: 3px; margin-bottom: 12px; }
.panel-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(42px, 5.4vw, 74px); line-height: 1;
  letter-spacing: -0.01em; margin-bottom: 26px;
}
.panel-title a:not(.live-badge) { color: inherit; transition: color 0.3s; }
.panel-title a:not(.live-badge):hover { color: var(--lav); }
.live-badge {
  display: inline-flex; align-items: center; gap: 7px;
  vertical-align: middle; margin-left: 18px; transform: translateY(-0.35em);
  font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: 1.5px;
  color: #5fe3a1;
  border: 1px solid rgba(95,227,161,0.4); border-radius: 999px;
  padding: 6px 14px;
  transition: background 0.3s, box-shadow 0.3s, color 0.3s;
}
.live-badge:hover { background: rgba(95,227,161,0.12); box-shadow: 0 0 22px rgba(95,227,161,0.28); color: #7ff0b8; }
.live-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #5fe3a1; box-shadow: 0 0 10px #5fe3a1; animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.7); } }
.panel-desc { color: var(--dim); font-size: 16px; max-width: 460px; flex: 1; }
.panel-tools { font-size: 12px; color: rgba(196,181,253,0.7); letter-spacing: 1px; margin: 22px 0; }
.panel-link {
  font-family: var(--display); font-weight: 600; font-size: 18px;
  letter-spacing: 2px; color: var(--ink);
  border-bottom: 2px solid var(--violet);
  align-self: flex-start; padding-bottom: 4px;
  transition: color 0.3s, letter-spacing 0.3s;
}
.panel-link:hover { color: var(--lav); letter-spacing: 4px; }
.panel-last { justify-content: center; align-items: center; text-align: center; }
.panel-gh { border-bottom: 3px solid var(--violet); transition: color 0.3s; }
.panel-gh:hover { color: var(--lav); }

/* ============ techstack ============ */
#stack { max-width: none; padding-bottom: 0; }
.stack-hint { text-align: center; color: var(--dim); font-size: 12px; letter-spacing: 2px; margin: -40px 0 30px; }
#stackWrap { position: relative; height: 62vh; min-height: 420px; }
#stackCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ============ contact ============ */
#contact { text-align: center; padding-top: 170px; }
#contact .sec-label { margin-bottom: 20px; }
.lets-talk {
  display: inline-block;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(44px, 8.4vw, 110px);
  line-height: 0.92; letter-spacing: -0.02em;
  text-transform: uppercase;
}
.lets-talk .line-inner { transform: translateY(0); }
.lets-talk:hover .accent { color: var(--violet); }
.lets-talk .line { position: relative; }
.contact-mail { display: block; width: 100%; text-align: center; margin-top: 30px; color: var(--dim); font-size: 14px; letter-spacing: 2px; transition: color 0.3s; }
.contact-mail:hover { color: var(--lav); }
.socials { display: flex; gap: 34px; justify-content: center; margin-top: 56px; flex-wrap: wrap; }
.socials a {
  font-weight: 700; font-size: 13px; letter-spacing: 2.5px; color: var(--dim);
  transition: color 0.3s;
}
.socials a:hover { color: var(--lav); }

footer {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 30px 44px; margin-top: 120px;
  border-top: 1px solid rgba(196,181,253,0.14);
  color: var(--dim); font-size: 11px; letter-spacing: 2px;
}

/* ============ reveal helper ============ */
.rv { opacity: 0; transform: translateY(40px); transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1), transform 0.8s cubic-bezier(0.22,1,0.36,1); }
.rv.on { opacity: 1; transform: none; }

/* ============ responsive ============ */
@media (max-width: 860px) {
  #navbar { padding: 20px 22px; }
  .nav-links { gap: 20px; }
  .nav-links a { font-size: 11px; letter-spacing: 1.5px; }
  .hero { padding: 100px 22px 30px; }
  section { padding: 100px 22px; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 34px 20px; }
  .career-year { font-size: 64px; top: -8px; }
  .career-item { padding-left: 40px; padding-bottom: 70px; }
  #work { padding-top: 100px; }
  .work-h { padding: 0 22px; }
  .work-track { flex-direction: column; }
  .panel { flex-basis: auto; min-height: 0; border-left: 0; border-top: 1px solid rgba(196,181,253,0.14); padding: 44px 22px; }
  .panel-desc { max-width: none; }
  body::after { display: none; }
  .hero-foot { flex-direction: column; gap: 8px; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .line-inner { transform: none; }
}
