/* Type scale: 14 / 16 / 20 / 24 / 32 / 48 / 64 / 96
   Spacing scale: 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 96 / 128 */
:root {
  --bg: #0a0a0b;
  --surface: #141416;
  --border: #26262a;
  --text: #f0efeb;
  --muted: #a1a1aa;
  --accent: #ff5c9d;
  --accent-2: #a78bfa;
  --font-body: "Onest", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Unbounded", ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 24px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Shared bits */
.label {
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.num { font-size: 14px; color: var(--accent); letter-spacing: 0.1em; }
.accent {
  color: var(--accent);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-accent { background: var(--accent); color: #0a0a0b; }
.btn-accent:hover { background: #ff7db1; }
.btn-ghost { border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-sm { min-height: 44px; padding: 8px 16px; font-size: 14px; }
.arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow, .list a:hover .arrow { transform: translate(4px, -4px); }

/* Nav */
.nav-wrap {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 16px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 16px;
  background: rgba(20, 20, 22, 0.8);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.nav-links { position: relative; display: none; gap: 4px; }
.nav-links a {
  position: relative;
  z-index: 1;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 16px;
  color: var(--muted);
  transition: color 0.4s var(--ease);
}
.nav-links a:hover, .nav-links a:focus-visible, .nav-links a.active { color: var(--text); }
/* While another link is hovered, the active one steps back so only one is lit. */
.nav-links:hover a.active:not(:hover) { color: var(--muted); }

/* One shared highlight that glides under the hovered link (script.js sets --x and --w). */
.nav-pill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--w, 0px);
  border-radius: 999px;
  background: #1f1f23;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  opacity: 0;
  transform: translateX(var(--x, 0px));
  transition:
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s var(--ease);
  pointer-events: none;
}
.nav-pill.show { opacity: 1; }
.nav-pill.instant { transition: opacity 0.3s var(--ease); }

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: 128px 0 64px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%);
}
.blob {
  position: absolute;
  top: 12%;
  right: -32%;
  width: 96vw;
  height: 96vw;
  max-width: 640px;
  max-height: 640px;
  background:
    radial-gradient(circle at 35% 35%, rgba(10, 10, 11, 0.9) 0 18%, transparent 40%),
    radial-gradient(circle at 65% 60%, rgba(10, 10, 11, 0.7) 0 12%, transparent 32%),
    radial-gradient(circle at 50% 50%, #ff5c9d 0%, #8b5cf6 55%, #1e0b3a 80%);
  border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
  filter: blur(4px);
  opacity: 0.55;
  box-shadow: 0 0 128px rgba(255, 92, 157, 0.3);
  animation: morph 16s var(--ease) infinite alternate, spin 40s linear infinite;
}
@keyframes morph {
  0%   { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; }
  50%  { border-radius: 63% 37% 41% 59% / 58% 63% 37% 42%; }
  100% { border-radius: 37% 63% 56% 44% / 49% 37% 63% 51%; }
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero-inner { position: relative; width: 100%; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 32px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.8);
  font-size: 14px;
}
.live { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 8px #4ade80; }

.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.display span { display: block; }
.outline { color: transparent; -webkit-text-stroke: 1px #a1a1aa; }

.hero-bottom { display: grid; gap: 32px; margin-top: 48px; }
.lead { max-width: 60ch; font-size: 16px; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Marquee */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: scroll 40s linear infinite;
}
.marquee-track span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  text-transform: uppercase;
  color: var(--text);
  padding: 0 24px;
  white-space: nowrap;
}
.marquee-track span::after { content: "✕"; color: var(--accent-2); margin-left: 48px; font-size: 20px; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* Sections */
.section { padding: 96px 0; }
.section-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.rule { width: 32px; height: 1px; background: var(--border); }
.title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
  text-transform: uppercase;
  margin-bottom: 48px;
}
.subtitle {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  text-transform: uppercase;
  margin: 64px 0 16px;
}

/* Projects */
/* Cards stick under the nav and the next one slides over them like a deck.
   script.js sets --top (taller cards stick higher so their bottom stays readable),
   --y (keeps covered cards lined up in the deck), --p (0 → 1 as the next card
   covers this one) and --clip (the part hidden under the next card). */
.project-stack { margin-bottom: 24px; }
.project {
  --p: 0;
  position: sticky;
  top: var(--top, 96px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  margin-bottom: 32px;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.5);
  transform: translateY(var(--y, 0px));
  clip-path: inset(0 0 var(--clip, 0px) 0 round var(--radius));
  transition: border-color 0.4s var(--ease);
}
.project:last-child { margin-bottom: 0; }
.project::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--bg);
  opacity: calc(var(--p) * 0.7);
  pointer-events: none;
}
.project:hover { border-color: #3a3a40; }
.project-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.year { margin-left: auto; font-size: 14px; color: var(--muted); }
.project-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.project p { max-width: 66ch; color: var(--muted); }
.points { margin-top: 24px; display: grid; gap: 8px; max-width: 66ch; }
.points li { position: relative; padding-left: 24px; }
.points li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tags span {
  font-size: 14px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
}
.link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 16px;
  color: var(--accent);
}
.link:hover { text-decoration: underline; }
.links { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 16px; }
.links .link { margin-top: 0; }
.project .note { margin-top: 24px; font-size: 14px; }

/* GitHub stats */
.stats {
  display: grid;
  gap: 16px;
  margin-bottom: 48px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat { display: grid; gap: 4px; }
.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 14px; color: var(--muted); }

/* Lists (earlier work, contact) */
.list { border-top: 1px solid var(--border); }
.list li { border-bottom: 1px solid var(--border); }
.list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  align-items: center;
  padding: 24px 0;
  transition: color 0.3s var(--ease);
}
.list-name { font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.list-main { display: grid; gap: 4px; }
.list-desc { color: var(--muted); font-size: 16px; max-width: 60ch; }
.list-meta { grid-column: 1; color: var(--muted); font-size: 16px; word-break: break-word; }
.list .arrow { grid-column: 2; grid-row: 1 / span 2; color: var(--accent); font-size: 24px; }
.list a:hover .list-name { color: var(--accent); }

/* Experience */
.timeline { display: grid; gap: 64px; }
.job { display: grid; gap: 12px; }
.job-date { font-size: 14px; color: var(--muted); }
.job-company {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
  text-transform: uppercase;
}
.job-role { color: var(--accent-2); font-size: 20px; margin-top: 8px; }
.job-where { color: var(--muted); }
.cards { display: grid; gap: 12px; margin-top: 24px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}
.card-lg { padding: 24px; border-radius: var(--radius); }
.card-lg p { color: var(--muted); }
.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
  margin: 12px 0 8px;
}
.grid-2 { display: grid; gap: 16px; }

/* Stack */
.stack-row {
  display: grid;
  gap: 12px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.stack-row:first-child { border-top: 1px solid var(--border); }
.stack-items {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.3;
}
.stack-items i { font-style: normal; color: var(--muted); }

/* Contact */
.contact {
  background:
    radial-gradient(ellipse at 30% 0%, rgba(255, 92, 157, 0.12), transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(167, 139, 250, 0.1), transparent 60%);
}
.contact-title { margin-bottom: 32px; }
.contact .lead { margin-bottom: 32px; }
.contact-list { margin-top: 64px; }

/* Footer */
.footer { padding-top: 32px; overflow: hidden; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}
.footer-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20vw;
  line-height: 0.8;
  text-align: center;
  margin-top: 32px;
  color: transparent;
  background: linear-gradient(180deg, rgba(255, 92, 157, 0.4), rgba(167, 139, 250, 0));
  -webkit-background-clip: text;
  background-clip: text;
  user-select: none;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* Tablet */
@media (min-width: 768px) {
  .container { padding: 0 40px; }
  .nav-links { display: flex; }
  .display { font-size: 64px; }
  .title { font-size: 48px; }
  .lead { font-size: 20px; }
  .blob { right: -8%; width: 64vw; height: 64vw; }
  .project { padding: 48px; }
  .project-title { font-size: 32px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .list a { grid-template-columns: 1fr auto auto; }
  .list-meta { grid-column: 2; }
  .list .arrow { grid-column: 3; grid-row: 1; }
  .stack-row { grid-template-columns: 240px 1fr; align-items: baseline; }
  .stack-items { font-size: 32px; }
  .section { padding: 128px 0; }
}

/* Desktop */
@media (min-width: 1100px) {
  .display { font-size: 96px; }
  .hero { padding-top: 160px; }
  .hero-bottom { grid-template-columns: 1fr auto; align-items: end; }
  .blob { top: 16%; right: 2%; }
  .job { grid-template-columns: 200px 1fr; gap: 32px; }
  .job-date { padding-top: 12px; }
  .cards { grid-template-columns: repeat(3, 1fr); }
}

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