/* ============================================================
   Prashant Basnet — scroll-driven portfolio
   Theme tokens morph per career chapter via body[data-theme]
   ============================================================ */

@property --bg      { syntax: '<color>'; inherits: true; initial-value: #07090d; }
@property --bg2     { syntax: '<color>'; inherits: true; initial-value: #0c1016; }
@property --fg      { syntax: '<color>'; inherits: true; initial-value: #eaf1f6; }
@property --muted   { syntax: '<color>'; inherits: true; initial-value: #7c8794; }
@property --accent  { syntax: '<color>'; inherits: true; initial-value: #39d0d8; }
@property --accent2 { syntax: '<color>'; inherits: true; initial-value: #7af0ff; }
@property --line    { syntax: '<color>'; inherits: true; initial-value: rgba(255,255,255,.12); }

:root {
  --ease: cubic-bezier(.22,.61,.36,1);
  --maxw: 1320px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: --bg .9s var(--ease), --bg2 .9s var(--ease), --fg .9s var(--ease),
              --muted .9s var(--ease), --accent .9s var(--ease),
              --accent2 .9s var(--ease), --line .9s var(--ease);
}

/* ---- theme palettes ---- */
body[data-theme="hero"]     { --bg:#07090d; --bg2:#0c1016; --fg:#eaf1f6; --muted:#7c8794; --accent:#39d0d8; --accent2:#7af0ff; --line:rgba(120,200,210,.16); }
body[data-theme="zulu"]     { --bg:#03100b; --bg2:#06190f; --fg:#dffaf0; --muted:#5e9a83; --accent:#22f59a; --accent2:#9bffd0; --line:rgba(34,245,154,.20); }
body[data-theme="att"]      { --bg:#040a1c; --bg2:#071228; --fg:#e6eefb; --muted:#5d7197; --accent:#3b82f6; --accent2:#34d3ee; --line:rgba(59,130,246,.24); }
body[data-theme="unisala"]  { --bg:#eef1f8; --bg2:#e3e8f4; --fg:#11131c; --muted:#5b6275; --accent:#5b5bf0; --accent2:#8a5cf6; --line:rgba(91,91,240,.22); }
body[data-theme="blueflite"]{ --bg:#0a0b0e; --bg2:#101319; --fg:#eef1f4; --muted:#7b8593; --accent:#ff6a1a; --accent2:#2dd4ff; --line:rgba(255,106,26,.26); }
body[data-theme="letstrade"]{ --bg:#051a14; --bg2:#092420; --fg:#e0f3ed; --muted:#5a8b7f; --accent:#1dd4bf; --accent2:#5eead4; --line:rgba(29,212,191,.24); }
body[data-theme="proof"]    { --bg:#06080c; --bg2:#0b0f15; --fg:#eef4f7; --muted:#828d9a; --accent:#39d0d8; --accent2:#ffffff; --line:rgba(120,200,210,.18); }
body[data-theme="closing"]  { --bg:#06080c; --bg2:#0b0f15; --fg:#eef4f7; --muted:#828d9a; --accent:#39d0d8; --accent2:#ffffff; --line:rgba(120,200,210,.18); }

/* ============================================================
   Fixed layers: canvas scene + readability scrim
   ============================================================ */
#scene {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 0; display: block;
}
.scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 86%, transparent) 30%,
                    color-mix(in srgb, var(--bg) 30%, transparent) 58%, transparent 78%),
    radial-gradient(140% 120% at 18% 50%, transparent 40%, color-mix(in srgb, var(--bg) 65%, transparent) 100%);
  transition: background .9s var(--ease);
}
.scanlines {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: .35;
  background-image: repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
body[data-theme="unisala"] .scanlines { opacity: .12; }

/* ============================================================
   Timeline rail (fixed left) — progress + nav
   ============================================================ */
.rail {
  position: fixed; left: clamp(20px, 3.2vw, 54px); top: 0; bottom: 0;
  z-index: 30; display: flex; align-items: center;
}
.rail__inner { position: relative; height: min(560px, 64vh); display: flex; }
.rail__track {
  position: absolute; left: 5px; top: 0; bottom: 0; width: 2px;
  background: var(--line); transition: background .9s var(--ease);
}
.rail__fill {
  position: absolute; left: 5px; top: 0; width: 2px; height: 0%;
  background: linear-gradient(var(--accent), var(--accent2));
  box-shadow: 0 0 12px var(--accent);
  transition: height .12s linear, background .9s var(--ease);
}
.rail__nodes { list-style: none; display: flex; flex-direction: column;
  justify-content: space-between; height: 100%; }
.rail__node {
  position: relative; display: flex; align-items: center; gap: 14px;
  cursor: pointer; background: none; border: 0; padding: 0; color: inherit;
  font-family: 'JetBrains Mono', monospace;
}
.rail__dot {
  width: 12px; height: 12px; border-radius: 50%; flex: none;
  border: 2px solid var(--line); background: var(--bg);
  transition: all .4s var(--ease); position: relative; z-index: 2;
}
.rail__yr {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); opacity: 0; transform: translateX(-6px);
  transition: all .4s var(--ease); white-space: nowrap; pointer-events: none;
}
.rail__node:hover .rail__yr { opacity: 1; transform: translateX(0); }
.rail__node[aria-current="true"] .rail__dot {
  border-color: var(--accent); background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent), 0 0 16px var(--accent);
  transform: scale(1.15);
}
.rail__node[aria-current="true"] .rail__yr { opacity: 1; transform: translateX(0); color: var(--fg); }

/* ============================================================
   Content column
   ============================================================ */
main { position: relative; z-index: 10; }

.chapter { position: relative; min-height: 230vh; }
.chapter__sticky {
  position: sticky; top: 0; height: 100vh;
  display: flex; align-items: center;
  padding-left: clamp(78px, 11vw, 220px); padding-right: 6vw;
}
.panel {
  max-width: 620px; width: 100%;
  opacity: 0; transform: translateY(34px);
  will-change: opacity, transform;
}

.kicker {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace; margin-bottom: 22px;
}
.era {
  font-size: 13px; letter-spacing: .2em; color: var(--accent);
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.tag { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }

.company {
  font-size: clamp(48px, 7.4vw, 104px); font-weight: 700; line-height: .92;
  letter-spacing: -.03em; margin-bottom: 14px;
  text-shadow: 0 0 44px color-mix(in srgb, var(--accent) 30%, transparent);
}
.role {
  font-family: 'JetBrains Mono', monospace; font-size: 14px; letter-spacing: .04em;
  color: var(--muted); margin-bottom: 26px;
}
.lead {
  font-size: clamp(17px, 1.5vw, 21px); line-height: 1.5; color: var(--fg);
  max-width: 540px; margin-bottom: 26px; text-wrap: pretty;
}
.points { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px; }
.points li {
  position: relative; padding-left: 24px; font-size: 15px; line-height: 1.45;
  color: color-mix(in srgb, var(--fg) 82%, var(--muted)); max-width: 560px; text-wrap: pretty;
}
.points li::before {
  content: ''; position: absolute; left: 2px; top: 9px; width: 7px; height: 7px;
  border: 1.5px solid var(--accent); transform: rotate(45deg);
}

/* hero stat — secondary, mono-flavored */
.stat { display: flex; align-items: baseline; gap: 18px; margin-bottom: 24px; max-width: 540px; }
.stat__num {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(40px, 5vw, 64px); line-height: 1; letter-spacing: -.02em;
  color: var(--accent); text-shadow: 0 0 26px color-mix(in srgb, var(--accent) 40%, transparent);
  font-variant-numeric: tabular-nums;
}
.stat__label {
  font-size: 13px; line-height: 1.4; color: var(--muted);
  font-family: 'JetBrains Mono', monospace; max-width: 230px; letter-spacing: .02em;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chip {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .04em;
  color: color-mix(in srgb, var(--fg) 75%, var(--muted));
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 2px;
  background: color-mix(in srgb, var(--bg2) 50%, transparent);
}
.stack {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .08em;
  color: var(--muted); padding-top: 18px; border-top: 1px solid var(--line);
  max-width: 540px;
}

/* in-view reveal driven by JS opacity, but provide entrance for children */
.panel.is-active { opacity: 1; transform: translateY(0); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.panel.is-active .kicker,
.panel.is-active .company,
.panel.is-active .role,
.panel.is-active .lead,
.panel.is-active .points li,
.panel.is-active .stat,
.panel.is-active .chips,
.panel.is-active .stack { animation: rise .7s var(--ease) both; }
.panel.is-active .company { animation-delay: .05s; }
.panel.is-active .role { animation-delay: .1s; }
.panel.is-active .lead { animation-delay: .16s; }
.panel.is-active .points li:nth-child(1){ animation-delay: .22s; }
.panel.is-active .points li:nth-child(2){ animation-delay: .28s; }
.panel.is-active .points li:nth-child(3){ animation-delay: .34s; }
.panel.is-active .stat { animation-delay: .4s; }
.panel.is-active .chips { animation-delay: .46s; }
.panel.is-active .stack { animation-delay: .52s; }

@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes riseY { from { transform: translateY(24px); } to { transform: translateY(0); } }

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; z-index: 10; height: 100vh; min-height: 640px;
  display: flex; align-items: center; padding-left: clamp(78px, 11vw, 220px); padding-right: 6vw; }
.hero__kicker {
  font-family: 'JetBrains Mono', monospace; font-size: 13px; letter-spacing: .34em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 26px;
  animation: riseY .8s var(--ease) .2s both;
}
.hero__name {
  font-size: clamp(64px, 12vw, 168px); font-weight: 700; line-height: .86;
  letter-spacing: -.04em; margin-bottom: 32px;
  animation: riseY .9s var(--ease) .32s both;
  text-shadow: 0 0 60px color-mix(in srgb, var(--accent) 26%, transparent);
}
.hero__statement {
  font-size: clamp(20px, 2.3vw, 30px); line-height: 1.34; max-width: 720px;
  color: var(--fg); margin-bottom: 18px; text-wrap: balance;
  animation: riseY .9s var(--ease) .5s both;
}
.hero__statement b { color: var(--accent2); font-weight: 500; }
.hero__sub {
  font-family: 'JetBrains Mono', monospace; font-size: 14px; line-height: 1.6;
  color: var(--muted); max-width: 560px; letter-spacing: .02em;
  animation: riseY .9s var(--ease) .64s both;
}
.hero__scroll {
  position: absolute; bottom: 38px; left: clamp(78px, 11vw, 220px);
  font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .28em;
  text-transform: uppercase; color: var(--muted);
  animation: riseY .9s var(--ease) .9s both;
  display: flex; align-items: center; gap: 12px;
}
.hero__scroll::after { content: ''; width: 1px; height: 34px; background: linear-gradient(var(--accent), transparent);
  animation: scrollpulse 1.8s var(--ease) infinite; }
@keyframes scrollpulse { 0%,100%{ opacity:.3; transform: scaleY(.6); transform-origin: top; } 50%{ opacity:1; transform: scaleY(1); } }

/* ============================================================
   Closing
   ============================================================ */
.closing { position: relative; z-index: 10; min-height: 100vh; display: flex; align-items: center;
  padding-left: clamp(78px, 11vw, 220px); padding-right: 6vw; }
.closing__inner { max-width: 820px; opacity: 0; transform: translateY(30px); }
.closing__inner.is-active { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform .9s var(--ease); }
.closing .kicker { color: var(--accent); }
.closing h2 {
  font-size: clamp(34px, 5vw, 64px); font-weight: 700; line-height: 1.04; letter-spacing: -.025em;
  margin-bottom: 22px; text-wrap: balance;
}
.closing h2 b { color: var(--accent); font-weight: 700; }
.closing__lead { font-size: clamp(18px, 2vw, 24px); color: var(--muted); margin-bottom: 42px; }
.links { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 38px; }
.link {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: 'JetBrains Mono', monospace; font-size: 14px; letter-spacing: .04em;
  color: var(--fg); padding: 14px 20px; border: 1px solid var(--line); border-radius: 3px;
  background: color-mix(in srgb, var(--bg2) 60%, transparent);
  transition: border-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease), background .3s var(--ease);
}
.link:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px);
  background: color-mix(in srgb, var(--accent) 8%, transparent); }
.link .arrow { color: var(--muted); transition: transform .3s var(--ease); }
.link:hover .arrow { transform: translate(3px,-3px); color: var(--accent); }
.loc { font-family: 'JetBrains Mono', monospace; font-size: 13px; letter-spacing: .1em;
  color: var(--muted); text-transform: uppercase; }

/* proof-of-work tiles */
.proof__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 30px; }
.proof__tile { display: flex; flex-direction: column; gap: 7px; text-decoration: none;
  padding: 26px 26px 22px; border: 1px solid var(--line); border-radius: 14px;
  background: color-mix(in srgb, var(--bg2) 60%, transparent);
  transition: transform .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease); }
.proof__tile:hover { transform: translateY(-5px); border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent); }
.proof__num { font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(44px, 5.4vw, 72px); line-height: 1; color: var(--accent); letter-spacing: -.02em; }
.proof__what { font-size: 16px; font-weight: 600; color: var(--fg); }
.proof__sub { font-size: 13.5px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.proof__cta { margin-top: 10px; font-family: 'JetBrains Mono', monospace; font-size: 12.5px;
  letter-spacing: .05em; color: var(--accent); }
.proof__tile:hover .proof__cta { text-decoration: underline; }
@media (max-width: 760px) { .proof__grid { grid-template-columns: 1fr; } }

/* closing footnotes: education / research / origins */
.notes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 34px; margin-bottom: 40px;
  padding-top: 26px; border-top: 1px solid var(--line); }
.note__kicker { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.note__main { font-size: 15px; line-height: 1.5; color: var(--fg); margin-bottom: 6px; text-wrap: pretty; }
.note__sub { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); line-height: 1.5; }
.note__origins { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); line-height: 1.6;
  font-style: italic; text-wrap: pretty; }
@media (max-width: 760px) { .notes { grid-template-columns: 1fr; } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  .rail { display: none; }
  .chapter__sticky, .hero, .closing { padding-left: 26px; padding-right: 22px; }
  .hero__scroll { left: 26px; }
  .scrim { background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 30%, transparent), color-mix(in srgb, var(--bg) 84%, transparent)),
    linear-gradient(90deg, var(--bg), color-mix(in srgb, var(--bg) 55%, transparent) 70%, color-mix(in srgb, var(--bg) 30%, transparent)); }
  .stat { flex-direction: column; gap: 8px; }
  .stat__label { max-width: 320px; }
  .mobile-progress { display: block !important; }
}

.mobile-progress {
  display: none; position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 40; box-shadow: 0 0 10px var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .panel,
  .hero__kicker, .hero__name, .hero__statement, .hero__sub, .hero__scroll,
  .closing__inner > * { opacity: 1 !important; transform: none !important; }
  * { animation-duration: .01ms !important; animation-delay: 0s !important; }
}
