:root {
  --bg: #060918;
  --panel: #0e1330;
  --panel-2: #141a40;
  --line: #1f2650;
  --line-2: #3b4380;
  --violet: #8b5cf6;
  --indigo: #6366f1;
  --cyan: #22d3ee;
  --lilac: #c4b5fd;
  --amber: #fbbf24;
  --text: #e6e8f5;
  --muted: #8a90b5;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 7vw, 100px);
  --maxw: 1440px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--violet); color: #fff; }

#stars {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
}
main, .nav, .foot { position: relative; z-index: 1; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; color: #000; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---------- type ---------- */
.eyebrow {
  margin: 0 0 14px;
  font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--cyan);
}
.display {
  margin: 0;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(64px, 9vw, 132px); line-height: .92; letter-spacing: -.02em;
}
.display-2 {
  margin: 0;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(48px, 7.4vw, 108px); line-height: 1; letter-spacing: -.01em;
}
.title {
  margin: 0;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 5.6vw, 80px); line-height: 1.02;
}
.tagline {
  margin: 20px 0 0;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(28px, 3vw, 42px); line-height: 1.1; color: var(--lilac);
}
.lede { margin: 22px 0 0; color: var(--muted); font-size: 18px; max-width: 34em; }
.aside { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px;
  font: 600 16px/1 var(--sans); text-decoration: none; white-space: nowrap;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, background .25s, border-color .25s;
  will-change: transform;
}
.btn-sm { padding: 10px 20px; font-size: 15px; }
.btn-lg { padding: 18px 30px; font-size: 18px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(90deg, var(--violet), var(--indigo));
  box-shadow: 0 10px 30px -6px rgba(139, 92, 246, .55);
}
.btn-primary:hover { box-shadow: 0 14px 40px -4px rgba(139, 92, 246, .8); }
.btn-ghost { color: var(--text); border: 1px solid var(--line-2); background: rgba(14, 19, 48, .4); }
.btn-ghost:hover { border-color: var(--cyan); background: rgba(34, 211, 238, .08); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  transition: background .3s, padding .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(6, 9, 24, .72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding-top: 14px; padding-bottom: 14px;
  border-color: var(--line);
}
.logo { font-family: var(--serif); font-style: italic; font-size: 28px; text-decoration: none; }
.nav nav { display: flex; align-items: center; gap: 32px; }
.nav nav a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; transition: color .2s; }
.nav nav a:not(.btn):hover, .nav nav a.active { color: var(--text); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 24px;
  padding: 120px var(--gutter) 80px;
}
.hero-copy { position: relative; z-index: 2; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.cta.center { justify-content: center; }
.hint { position: absolute; left: var(--gutter); bottom: 28px; margin: 0; font-size: 13px; color: var(--muted); }

.orbit {
  --size: min(640px, 46vw);
  position: relative; width: var(--size); height: var(--size); justify-self: center;
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none;
}
.orbit.dragging { cursor: grabbing; }
.orbit-glow {
  position: absolute; inset: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,.55), rgba(99,102,241,.15) 55%, transparent 70%);
  filter: blur(30px);
  animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.12); opacity: .8; } }
.ring {
  position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.13);
  left: 50%; top: 50%; translate: -50% -50%;
}
.ring.r1 { width: 48%; height: 48%; }
.ring.r2 { width: 74%; height: 74%; border-style: dashed; border-color: rgba(255,255,255,.12); }
.ring.r3 { width: 98%; height: 98%; }
.sun {
  position: absolute; left: 50%; top: 50%;
  width: 27%; aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; padding: 4px;
  background: conic-gradient(from 0deg, var(--violet), var(--cyan), var(--violet));
  box-shadow: 0 0 60px rgba(139,92,246,.6), 0 0 120px rgba(34,211,238,.18);
  animation: spin 14s linear infinite;
}
.sun img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; animation: spin 14s linear infinite reverse; border: 3px solid var(--bg); }
@keyframes spin { to { rotate: 360deg; } }

.planet {
  position: absolute; left: 0; top: 0;
  width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.85), var(--c) 38%, color-mix(in srgb, var(--c) 55%, #000) 100%);
  box-shadow: 0 0 22px color-mix(in srgb, var(--c) 70%, transparent);
  transition: box-shadow .25s, scale .25s;
}
.planet::after {
  content: ""; position: absolute; inset: -9px; border-radius: 50%;
  border: 1.5px solid var(--cyan); opacity: 0; scale: .7; transition: opacity .25s, scale .25s;
}
.planet:hover, .planet:focus-visible, .planet.on { scale: 1.25; box-shadow: 0 0 36px var(--c); outline: none; }
.planet:hover::after, .planet:focus-visible::after, .planet.on::after { opacity: 1; scale: 1; }
.planet-label {
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  font: 500 12px/1 var(--sans); color: var(--muted); white-space: nowrap; pointer-events: none;
}
.tip {
  position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none;
  min-width: 190px; padding: 14px 16px; border-radius: 12px;
  background: rgba(14, 19, 48, .94); border: 1px solid var(--line);
  box-shadow: 0 20px 50px -10px rgba(0,0,0,.6);
  opacity: 0; translate: 0 6px; transition: opacity .2s, translate .2s;
}
.tip.show { opacity: 1; translate: 0 0; }
.tip b { display: block; font-size: 14px; }
.tip span { display: block; font-size: 12px; color: var(--muted); }
.tip i { display: block; margin-top: 4px; font-style: normal; font-size: 12px; font-weight: 600; color: var(--cyan); }

/* ---------- sections ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 48px; }

.journey { position: relative; }
.journey-sticky { padding: 110px 0 80px; }
.journey.pinned .journey-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 70px 0 40px; }
.track-wrap { overflow: hidden; }
.track {
  list-style: none; margin: 0; display: flex; gap: 32px;
  padding: 4px var(--gutter);
  will-change: transform;
}
.chapter {
  flex: 0 0 auto; width: min(440px, 82vw); min-height: 480px;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 32px 36px 36px; border-radius: 24px;
  background: var(--panel); border: 1px solid var(--line);
  transition: border-color .4s, transform .4s, background .4s;
}
.chapter:hover { border-color: var(--line-2); transform: translateY(-6px); }
.chapter.current { background: linear-gradient(180deg, #1a1f4d, var(--panel)); border-color: var(--violet); }
.ch-label { font-size: 13px; font-weight: 600; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.year { display: block; font-family: var(--serif); font-size: 110px; line-height: 1; color: var(--line-2); transition: color .4s; }
.chapter.current .year, .chapter:hover .year { color: var(--lilac); }
.chapter h3 { margin: 0 0 10px; font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.05; }
.chapter p { margin: 0; color: var(--muted); font-size: 15px; }
.chapter p strong { color: var(--text); font-weight: 600; }
.tags { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: 12px; font-weight: 500; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 999px; }
.progress { margin-top: 40px; }
.progress::before { content: ""; display: block; height: 2px; background: var(--line); }
.progress span { display: block; height: 2px; margin-top: -2px; width: 0; background: linear-gradient(90deg, var(--violet), var(--cyan)); box-shadow: 0 0 12px var(--cyan); }

/* projects */
.projects { padding: 120px 0 60px; }
.group { margin: 0 auto 24px; font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; margin-bottom: 80px; }
.card {
  position: relative; border-radius: 24px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line);
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s;
}
.card:hover { border-color: color-mix(in srgb, var(--a) 60%, transparent); box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--a) 60%, transparent); }
.card.feature { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr 1fr; }
.card.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 var(--cyan); } 30% { box-shadow: 0 0 0 6px var(--cyan), 0 0 80px var(--a); } 100% { box-shadow: 0 0 0 0 transparent; } }
.cover {
  position: relative; height: 300px; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--a) 85%, transparent), color-mix(in srgb, var(--b) 85%, transparent));
}
.card.feature .cover { height: auto; min-height: 420px; }
.cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 0%, rgba(255,255,255,.25), transparent 50%); pointer-events: none; }
.cover.phones { display: flex; justify-content: center; align-items: flex-start; gap: 18px; padding: 34px 20px 0; }
.cover.phones img {
  width: 34%; max-width: 190px; border-radius: 18px;
  box-shadow: 0 30px 50px -10px rgba(0,0,0,.55); border: 4px solid #0b0f24;
  transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
.card.feature .cover.phones img { width: 28%; }
.cover.phones img:nth-child(2) { margin-top: 40px; }
.cover.phones img:nth-child(3) { margin-top: 14px; }
.cover.phones.two img { width: 38%; }
.card:hover .cover.phones img:nth-child(1) { transform: translateY(-10px) rotate(-2deg); }
.card:hover .cover.phones img:nth-child(2) { transform: translateY(-18px) rotate(2deg); }
.card:hover .cover.phones img:nth-child(3) { transform: translateY(-6px); }
.cover.shot { padding: 36px 30px 0; }
.cover.shot img { border-radius: 12px 12px 0 0; box-shadow: 0 30px 50px -10px rgba(0,0,0,.55); transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.card:hover .cover.shot img { transform: translateY(-10px) scale(1.02); }
.cover.mascot { display: flex; align-items: center; justify-content: center; }
.cover.mascot img { position: relative; z-index: 1; max-height: 78%; width: auto; filter: drop-shadow(0 24px 30px rgba(0,0,0,.4)); transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.card:hover .cover.mascot img { transform: translateY(-8px) rotate(-4deg) scale(1.04); }
.cover.code { display: flex; align-items: center; justify-content: center; padding: 24px; }
.cover.code pre {
  margin: 0; max-width: 100%; min-width: 0; overflow: auto; padding: 22px 24px; border-radius: 14px;
  background: rgba(6, 9, 24, .82); border: 1px solid rgba(255,255,255,.15);
  font: 13px/1.7 ui-monospace, "SF Mono", Menlo, monospace; color: #cbd5ff;
}
.cover.code .k { color: #c4b5fd; } .cover.code .n { color: #fbbf24; } .cover.code .s { color: #34d399; } .cover.code .c { color: var(--muted); }
.cover.mark { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 220px; }
.cover.mark span { position: relative; z-index: 1; font-family: var(--serif); font-size: clamp(34px, 3.6vw, 52px); color: #fff; text-shadow: 0 4px 30px rgba(0,0,0,.3); transition: transform .6s cubic-bezier(.2,.8,.2,1); text-align: center; padding: 0 16px; }
.cover.mark em { position: relative; z-index: 1; font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #fff; opacity: .85; }
.card:hover .cover.mark span { transform: scale(1.06); }
.body { padding: 28px 32px 32px; }
.card.feature .body { display: flex; flex-direction: column; justify-content: center; padding: 40px; }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.body h4 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1.1; }
.card.feature .body h4 { font-size: 52px; }
.body h4 a { text-decoration: none; }
.body h4 a:hover { color: var(--cyan); }
.meta { font-size: 13px; font-weight: 600; color: var(--cyan); }
.body p { margin: 10px 0 0; color: var(--muted); }
.also { margin-bottom: 40px; }
.also-list { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.4; color: rgba(230,232,245,.82); }

/* skills */
.skills { padding: 100px 0 80px; }
.sky {
  position: relative; aspect-ratio: 1240 / 460; width: 100%;
  border-radius: 24px; background: rgba(14, 19, 48, .5); border: 1px solid var(--line);
  overflow: hidden;
}
.sky svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sky line { stroke: var(--violet); stroke-opacity: .35; stroke-width: 1.5; transition: stroke .3s, stroke-opacity .3s, stroke-width .3s; }
.sky line.on { stroke: var(--cyan); stroke-opacity: .95; stroke-width: 2.2; }
.sky.dim line:not(.on) { stroke-opacity: .1; }
.star {
  position: absolute; transform: translate(-50%, -50%);
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font: 500 14px/1 var(--sans); color: var(--text); white-space: nowrap;
  background: var(--bg); border: 1px solid var(--line-2);
  transition: background .3s, border-color .3s, opacity .3s, box-shadow .3s, scale .3s;
}
.star::before { content: "· "; color: var(--muted); }
.star.on { background: linear-gradient(90deg, var(--violet), var(--indigo)); border-color: transparent; color: #fff; font-weight: 700; box-shadow: 0 0 30px rgba(139,92,246,.7); scale: 1.08; }
.star.on::before { content: "✦ "; color: #fff; }
.star.near { border-color: var(--cyan); }
.sky.dim .star:not(.on):not(.near) { opacity: .35; }
.sky-caption { margin: 16px 0 0; min-height: 1.6em; color: var(--cyan); font-size: 15px; font-weight: 500; }
.more { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

/* awards */
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding-bottom: 40px; }
.award { padding: 26px 28px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); }
.badge { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--amber); }
.award h3 { margin: 8px 0 4px; font-family: var(--serif); font-weight: 400; font-size: 32px; }
.award p { margin: 0; color: var(--muted); font-size: 15px; }

/* contact */
.contact {
  text-align: center; padding: 160px var(--gutter) 100px;
  background: radial-gradient(ellipse 50% 45% at 50% 40%, rgba(139,92,246,.25), transparent 70%);
}
.contact .lede { margin-left: auto; margin-right: auto; }
.contact .cta { margin-top: 36px; }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 32px; padding-bottom: 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* reveal */
.reveal { opacity: 0; filter: blur(10px); transform: translateY(24px); transition: opacity 1s cubic-bezier(.2,.8,.2,1), filter 1s, transform 1s cubic-bezier(.2,.8,.2,1); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; filter: none; transform: none; }
.card.reveal { transition: opacity 1s cubic-bezier(.2,.8,.2,1), filter 1s, transform .5s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; padding-top: 110px; gap: 40px; }
  .orbit { --size: min(560px, 92vw); }
  .hint { position: static; text-align: center; }
  .grid { grid-template-columns: 1fr; gap: 28px; }
  .card.feature { grid-template-columns: 1fr; }
  .card.feature .cover { min-height: 340px; }
  .awards { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 720px) {
  .nav nav a:not(.btn) { display: none; }
  .logo { font-size: 24px; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 32px; }
  .track { overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: none; }
  .track::-webkit-scrollbar { display: none; }
  .chapter { scroll-snap-align: center; min-height: 440px; padding: 26px; }
  .year { font-size: 88px; }
  .cover { height: 260px; }
  .cover.code pre { font-size: 11px; padding: 16px; }
  .body { padding: 24px; }
  .card.feature .body { padding: 26px; }
  .card.feature .body h4 { font-size: 42px; }
  .planet-label { display: none; }
  .sky { aspect-ratio: auto; display: flex; flex-wrap: wrap; gap: 10px; padding: 20px; }
  .sky svg { display: none; }
  .star { position: static; transform: none; }
  .btn-lg { padding: 16px 24px; font-size: 16px; }
  .contact { padding-top: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; filter: none; transform: none; }
}
