:root {
  --bg1: #120b2e;
  --bg2: #3b0f5c;
  --pink: #ff6ad5;
  --cyan: #00f0ff;
  --amber: #ffb86b;
  --text: #f3e8ff;
  --muted: #b9a6d9;
  --card: rgba(255, 255, 255, .045);
  --line: rgba(0, 240, 255, .22);
  --mono: 'VT323', ui-monospace, monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
  --rail: 22px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg1); overflow-x: clip; }
body {
  margin: 0; min-height: 100vh; overflow-x: clip;
  font: 17px/1.65 var(--sans); color: var(--text);
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 55%, #1c0a3a 100%) fixed;
}
/* grain */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: var(--cyan); }
h1, h2 { line-height: 1.05; margin: 0 0 .4em; letter-spacing: -.02em; }
h2 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; }
kbd { font: 1.05em var(--mono); padding: 0 .35em; border: 1px solid var(--line); border-radius: 4px; color: var(--cyan); }
::selection { background: var(--pink); color: var(--bg1); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.spot {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(520px circle at var(--x, -999px) var(--y, -999px), rgba(255, 106, 213, .13), transparent 60%);
}

/* top bar */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; padding: 14px 20px;
  background: linear-gradient(var(--bg1), transparent);
}
.logo { font: 28px var(--mono); color: var(--text); text-decoration: none; }
.bar nav { display: flex; gap: 8px; }
.chip {
  font: 19px var(--mono); color: var(--cyan); background: rgba(18, 11, 46, .6);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 10px; cursor: pointer;
}
.chip kbd { border: 0; padding: 0; font-size: 1em; }
.touch-only { display: none; }
@media (pointer: coarse) {
  .touch-only { display: revert; }
  .no-touch, .chip kbd { display: none; }
}
.chip:hover { border-color: var(--cyan); }
.blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* pipeline rail */
main { position: relative; max-width: 1120px; margin: 0 auto; padding: 0 24px 0 calc(var(--rail) + 48px); }
.rail { position: absolute; top: 0; bottom: 0; left: var(--rail); width: 2px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.fill { position: absolute; inset: 0; background: linear-gradient(var(--cyan), var(--pink)); box-shadow: 0 0 12px var(--cyan); transform-origin: top; }
.packets { position: absolute; inset: 0; }
.packets i { position: absolute; left: -2px; top: 0; width: 6px; height: 18px; border-radius: 3px; background: #fff; box-shadow: 0 0 10px var(--cyan), 0 0 20px var(--pink); }
section { position: relative; padding: 18vh 0 10vh; z-index: 1; }
.node {
  position: absolute; left: calc(-48px - 7px); top: calc(18vh + 8px); width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg1); border: 2px solid var(--cyan); box-shadow: 0 0 14px var(--cyan);
}
.stage { font: 22px var(--mono); color: var(--pink); text-transform: uppercase; letter-spacing: .12em; margin: 0 0 .6em; }
.lede { color: var(--muted); max-width: 60ch; margin: 0 0 2.5rem; font-size: 1.1rem; }

/* hero */
.hero { min-height: 100vh; padding-top: 22vh; overflow: visible; }
.hero .node { top: calc(22vh + 8px); }
.status { font: 20px var(--mono); color: var(--muted); margin: 0 0 1rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #3dff9a; box-shadow: 0 0 10px #3dff9a; animation: blink 1.6s steps(1) infinite; }
.name {
  position: relative; z-index: 2; font-size: clamp(3.2rem, 11vw, 8.5rem); font-weight: 700; text-transform: uppercase;
  background: linear-gradient(180deg, #fff 0%, #ffd6f3 40%, var(--pink) 60%, var(--cyan) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(255, 106, 213, .35));
}
.title { position: relative; z-index: 2; font: clamp(28px, 4vw, 40px) var(--mono); color: var(--cyan); margin: 0 0 1rem; text-shadow: 0 0 12px rgba(0, 240, 255, .6); }
.pitch { position: relative; z-index: 2; max-width: 52ch; font-size: 1.2rem; color: var(--text); margin: 0 0 2rem; }
.ctas { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-block; font: 500 1rem var(--sans); text-decoration: none; cursor: pointer;
  padding: 14px 26px; border-radius: 999px; border: 1px solid var(--pink);
  background: var(--pink); color: var(--bg1); transition: box-shadow .2s, transform .15s ease-out;
}
.btn:hover { box-shadow: 0 0 28px rgba(255, 106, 213, .6); }
.btn.ghost { background: transparent; color: var(--cyan); border-color: var(--cyan); }
.btn.ghost:hover { box-shadow: 0 0 28px rgba(0, 240, 255, .45); }
.sun {
  position: absolute; z-index: 1; right: 0; top: 14vh; width: min(38vw, 420px); aspect-ratio: 1; border-radius: 50%;
  background: linear-gradient(180deg, #ffe66b, var(--pink) 60%, #b534ff);
  -webkit-mask: linear-gradient(#000 52%, transparent 52% 56%, #000 56% 64%, transparent 64% 69%, #000 69% 76%, transparent 76% 82%, #000 82% 88%, transparent 88%);
  mask: linear-gradient(#000 52%, transparent 52% 56%, #000 56% 64%, transparent 64% 69%, #000 69% 76%, transparent 76% 82%, #000 82% 88%, transparent 88%);
  opacity: .85; filter: drop-shadow(0 0 40px rgba(255, 106, 213, .5));
}
.grid {
  position: absolute; z-index: 0; left: 50%; bottom: 0; width: 140vw; height: 42vh; transform: translateX(-50%);
  perspective: 280px; overflow: hidden; pointer-events: none;
  -webkit-mask: linear-gradient(transparent, #000 60%); mask: linear-gradient(transparent, #000 60%);
}
.grid::before {
  content: ''; position: absolute; inset: -100% -50% 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 106, 213, .55) 0 2px, transparent 2px 80px),
    repeating-linear-gradient(0deg, rgba(0, 240, 255, .5) 0 2px, transparent 2px 80px);
  transform: rotateX(62deg); transform-origin: bottom;
  animation: grid 3s linear infinite;
}
@keyframes grid { to { background-position: 0 0, 0 80px; } }

/* transform: task runs */
.runs { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.run { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; backdrop-filter: blur(4px); }
.run::before { content: ''; position: absolute; left: -48px; top: 32px; width: 40px; height: 1px; background: var(--line); }
.run.edu { border-style: dashed; border-color: rgba(255, 184, 107, .4); margin-left: clamp(0px, 4vw, 48px); }
.run-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font: 20px var(--mono); color: var(--muted); }
.run-head b { font: 700 1.5rem var(--sans); color: var(--text); letter-spacing: -.01em; }
.badge { margin-left: auto; font: 18px var(--mono); padding: 0 10px; border-radius: 6px; color: #3dff9a; border: 1px solid rgba(61, 255, 154, .4); }
.badge.running { color: var(--cyan); border-color: var(--line); animation: pulse 1.8s ease-in-out infinite; }
.edu .badge { color: var(--amber); border-color: rgba(255, 184, 107, .4); }
@keyframes pulse { 50% { box-shadow: 0 0 14px var(--cyan); } }
.run p.role { margin: 2px 0 10px; color: var(--pink); }
.run ul { margin: 0 0 14px; padding-left: 1.1em; color: var(--text); }
.run li::marker { color: var(--cyan); content: '▹  '; }
.gantt { position: relative; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .07); margin: 0 0 14px; }
.gantt span { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: linear-gradient(90deg, var(--cyan), var(--pink)); box-shadow: 0 0 8px var(--pink); }
.edu .gantt span { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 17px var(--mono); color: var(--cyan); padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; }

/* load: universe */
.universe { position: relative; height: 520px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(circle at 50% 50%, rgba(59, 15, 92, .6), rgba(18, 11, 46, .85)); cursor: grab; touch-action: pan-y; }
.universe canvas { display: block; width: 100%; height: 100%; }
.u-tag { position: absolute; left: 16px; top: 10px; margin: 0; font: 20px var(--mono); color: var(--cyan); }
.u-info { position: absolute; left: 16px; right: 16px; bottom: 12px; margin: 0; font-size: 15px; }
.u-info b { font: 24px var(--mono); font-weight: 400; margin-right: 10px; }
.legend { display: flex; gap: 18px; font: 19px var(--mono); margin: 10px 0 28px; }
.k-job { color: var(--pink); } .k-edu { color: var(--amber); } .k-skill { color: var(--cyan); }
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px 28px; }
.skills h3 { font: 20px var(--mono); color: var(--pink); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 6px; font-weight: 400; }
.skills .tag { cursor: default; }
.skills .tag:hover { background: rgba(0, 240, 255, .12); }

/* serve */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 36px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.stat b { display: block; font: 64px/1 var(--mono); color: var(--cyan); text-shadow: 0 0 16px rgba(0, 240, 255, .5); }
.stat span { color: var(--muted); font-size: .95rem; }
.project { background: var(--card); border: 1px solid var(--pink); border-radius: 14px; padding: 24px; box-shadow: 0 0 30px rgba(255, 106, 213, .12); }
.project h3 { margin: 0 0 6px; font-size: 1.4rem; }
.project p { color: var(--muted); margin: 0 0 14px; }

/* interests bento */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; grid-column: span 2; min-height: 180px; transition: border-color .2s, transform .2s; }
.tile:hover { border-color: var(--pink); transform: translateY(-3px); }
.tile.wide { grid-column: span 4; }
.tile h3 { margin: 0 0 8px; font-size: 1.25rem; }
.tile p { margin: 0; color: var(--muted); }
.tile .mono { font: 20px var(--mono); color: var(--cyan); }
.tile .clock { font: 56px/1 var(--mono); color: var(--pink); margin: 6px 0; }
.photos { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; }
.photos img { height: 120px; border-radius: 8px; }

/* contact */
.big { font-size: clamp(2.4rem, 7vw, 5rem); max-width: 14ch; }
#contact { padding-bottom: 16vh; }
.psst { font: 20px var(--mono); color: var(--muted); margin-top: 3rem; }

/* dialogs */
dialog { border: 1px solid var(--line); border-radius: 14px; background: rgba(18, 11, 46, .96); color: var(--text); padding: 0; box-shadow: 0 0 60px rgba(255, 106, 213, .25); }
dialog::backdrop { background: rgba(10, 5, 25, .6); backdrop-filter: blur(3px); }
.cmdk { width: min(560px, calc(100vw - 32px)); margin-top: 14vh; }
.cmdk input { width: 100%; font: 24px var(--mono); padding: 16px 18px; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--text); outline: none; }
.cmdk ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.cmdk li { padding: 10px 14px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; }
.cmdk li small { font: 17px var(--mono); color: var(--muted); }
.cmdk li[aria-selected="true"] { background: rgba(255, 106, 213, .16); color: var(--pink); }
.term { width: min(860px, calc(100vw - 32px)); height: min(560px, 80vh); display: none; flex-direction: column; }
.term[open] { display: flex; }
.term-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; font: 19px var(--mono); color: var(--muted); border-bottom: 1px solid var(--line); }
.term-top button { font-size: 22px; background: none; border: 0; color: var(--muted); cursor: pointer; }
.out { flex: 1; margin: 0; padding: 14px; overflow: auto; font: 20px/1.2 var(--mono); color: #3dff9a; white-space: pre; }
.out .q { color: var(--cyan); } .out .err { color: #ff6b6b; } .out .dim { color: var(--muted); }
.prompt { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); font: 20px var(--mono); color: var(--pink); }
.prompt input { flex: 1; font: inherit; color: var(--text); background: none; border: 0; outline: none; }

/* scroll-driven motion — static fallback where unsupported */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .fill { animation: grow linear both; animation-timeline: scroll(root); }
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% cover 25%; }
    .node { animation: light linear both; animation-timeline: view(); animation-range: entry 20% cover 45%; }
  }
  .packets i { animation: flow 9s linear infinite; }
  .packets i:nth-child(2) { animation-delay: -3s; }
  .packets i:nth-child(3) { animation-delay: -6s; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blink, .dot, .badge.running, .grid::before { animation: none; }
}
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes light { from { border-color: rgba(255, 255, 255, .2); box-shadow: none; } to { border-color: var(--pink); box-shadow: 0 0 18px var(--pink); } }
@keyframes flow { from { transform: translateY(-20px); } to { transform: translateY(calc(var(--h, 4000px))); } }

@media (max-width: 720px) {
  :root { --rail: 10px; }
  body { font-size: 16px; }
  main { padding: 0 16px 0 calc(var(--rail) + 22px); }
  .node { left: calc(-22px - 7px); }
  .run::before { display: none; }
  .run { padding: 18px; }
  .badge { margin-left: 0; }
  .sun { width: 58vw; top: 10vh; opacity: .35; }
  .universe { height: 400px; }
  .bento { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat b { font-size: 48px; }
  .tile, .tile.wide { grid-column: auto; }
}

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; font: 20px var(--mono); color: var(--bg1); background: var(--cyan); padding: 6px 16px; border-radius: 8px; box-shadow: 0 0 20px var(--cyan); }
.project + .project { margin-top: 16px; }
