/* ---------- Fonts ---------- */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

/* Wordmark fonts: one is picked at random per visit (see main.js).
   The browser only downloads the one that gets used. */
@font-face { font-family: "wm-syne"; src: url("/fonts/wordmark/syne.woff2") format("woff2"); font-weight: 800; }
@font-face { font-family: "wm-unbounded"; src: url("/fonts/wordmark/unbounded-800.woff2") format("woff2"); font-weight: 800; }
@font-face { font-family: "wm-bricolage"; src: url("/fonts/wordmark/bricolage-grotesque-800.woff2") format("woff2"); font-weight: 800; }
@font-face { font-family: "wm-space-grotesk"; src: url("/fonts/wordmark/space-grotesk-700.woff2") format("woff2"); font-weight: 700; }
@font-face { font-family: "wm-archivo-black"; src: url("/fonts/wordmark/archivo-black.woff2") format("woff2"); font-weight: 400; }
@font-face { font-family: "wm-anton"; src: url("/fonts/wordmark/anton.woff2") format("woff2"); font-weight: 400; }
@font-face { font-family: "wm-dela-gothic"; src: url("/fonts/wordmark/dela-gothic-one.woff2") format("woff2"); font-weight: 400; }
@font-face { font-family: "wm-big-shoulders"; src: url("/fonts/wordmark/big-shoulders.woff2") format("woff2"); font-weight: 900; }
@font-face { font-family: "wm-sora"; src: url("/fonts/wordmark/sora.woff2") format("woff2"); font-weight: 800; }
@font-face { font-family: "wm-rubik-mono"; src: url("/fonts/wordmark/rubik-mono-one.woff2") format("woff2"); font-weight: 400; }
@font-face { font-family: "wm-climate-crisis"; src: url("/fonts/wordmark/climate-crisis.woff2") format("woff2"); font-weight: 400; }
@font-face { font-family: "wm-bungee"; src: url("/fonts/wordmark/bungee.woff2") format("woff2"); font-weight: 400; }
@font-face { font-family: "wm-monoton"; src: url("/fonts/wordmark/monoton.woff2") format("woff2"); font-weight: 400; }
@font-face { font-family: "wm-rubik-glitch"; src: url("/fonts/wordmark/rubik-glitch.woff2") format("woff2"); font-weight: 400; }
@font-face { font-family: "wm-press-start"; src: url("/fonts/wordmark/press-start-2p.woff2") format("woff2"); font-weight: 400; }
@font-face { font-family: "wm-pacifico"; src: url("/fonts/wordmark/pacifico.woff2") format("woff2"); font-weight: 400; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #000;
  --card: #0b0b0c;
  --card-hover: #111113;
  --line: #1d1d20;
  --line-strong: #2c2c31;
  --text: #ededed;
  --muted: #8b8b93;
  --faint: #55555c;
  --coral: #ff8f5e;
  --green: #4ade80;
  --wm-color: #ededed;

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --max: 1040px;
  --gutter: clamp(20px, 5vw, 48px);
  --radius: 24px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  background: var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--coral); color: #000; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 6px; }

.stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* ---------- Screens ---------- */
.screen {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  scroll-snap-align: start;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(72px, 10vh, 120px) var(--gutter);
}
.inner { width: 100%; max-width: var(--max); margin: 0 auto; }
.label {
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 28px;
}

/* ---------- Intro ---------- */
.intro { padding: 0; }
.wordmark {
  position: absolute; margin: 0;
  /* main.js sets --fx/--fy (0–1). Defaults keep it centered without JS. */
  left: calc(8% + var(--fx, .5) * 84%);
  top: calc(12% + var(--fy, .45) * 64%);
  transform: translate(calc(var(--fx, .5) * -100%), calc(var(--fy, .45) * -100%));
  font-family: var(--wm-font, var(--sans));
  font-weight: var(--wm-weight, 800);
  font-style: var(--wm-style, normal);
  font-size: calc(clamp(44px, 7.5vw, 124px) * var(--wm-scale, 1));
  letter-spacing: var(--wm-tracking, -0.01em);
  line-height: 1.05;
  color: var(--wm-color);
  white-space: nowrap;
  transition: opacity .8s ease;
}
.js .wordmark { opacity: 0; }
.js .wordmark.ready { opacity: 1; }

.scroll-hint {
  position: absolute; left: 50%; bottom: max(28px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--faint); text-decoration: none;
  transition: opacity .5s ease, color .2s;
}
.scroll-hint:hover { color: var(--muted); }
.scroll-hint i {
  position: relative; display: block; width: 1px; height: 36px; overflow: hidden;
  background: var(--line-strong);
}
.scroll-hint i::after {
  content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%;
  background: var(--text);
  animation: drip 2.2s cubic-bezier(.6, 0, .3, 1) infinite;
}
@keyframes drip { to { top: 100%; } }
.scrolled .scroll-hint { opacity: 0; pointer-events: none; }

/* ---------- Section dots ---------- */
.dots {
  position: fixed; right: clamp(14px, 2vw, 28px); top: 50%; transform: translateY(-50%);
  z-index: 20; display: flex; flex-direction: column; gap: 14px;
}
.dots a {
  display: block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--line-strong); transition: background .3s, transform .3s;
}
.dots a:hover { background: var(--muted); }
.dots a.active { background: var(--text); transform: scale(1.35); }

/* ---------- About ---------- */
.about {
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 24px;
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
}
.about-lead {
  margin: 0 0 24px;
  font-size: clamp(34px, 5vw, 58px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 550;
  text-wrap: balance;
}
.about-body {
  margin: 0; max-width: 30em;
  font-size: clamp(18px, 1.8vw, 21px); line-height: 1.55; color: var(--muted);
}
.planet-wrap {
  width: 118%; max-width: 560px; aspect-ratio: 1; justify-self: center;
  transform: translate3d(var(--px, 0), var(--py, 0), 0);
  transition: transform .8s cubic-bezier(.2,.8,.2,1), opacity .8s ease;
}
.planet { width: 100%; height: 100%; overflow: visible; animation: float 12s ease-in-out infinite; }
.orbit-line { fill: none; stroke: #fff; stroke-opacity: .1; stroke-dasharray: 2 7; }
.bands { animation: spin-bands 60s linear infinite; }
@keyframes spin-bands { to { transform: translateX(-244px); } }
@keyframes float { 50% { transform: translateY(-12px); } }

/* ---------- Project card ---------- */
.project {
  position: relative; display: block;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); overflow: hidden; isolation: isolate;
  transition: border-color .3s, transform .4s cubic-bezier(.2,.8,.2,1), background .3s;
}
.project::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 143, 94, .1), transparent 60%);
}
.project:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.project:hover::before { opacity: 1; }
.project-top { display: flex; align-items: center; gap: 16px; padding: clamp(22px, 3.2vw, 32px) clamp(22px, 3.2vw, 36px) 0; }
.project-icon { width: 56px; height: 56px; border-radius: 13px; flex: none; }
.project-title h2 { margin: 0; font-size: 28px; line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; }
.project-title p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.pill {
  margin-left: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: ping 2.4s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .55); } 80%, 100% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } }
.project-body {
  display: grid; grid-template-columns: 1fr auto; gap: 16px 32px; align-items: end;
  padding: 18px clamp(22px, 3.2vw, 36px) clamp(22px, 3.2vw, 30px);
}
.project-desc { grid-column: 1 / -1; margin: 0; color: var(--muted); max-width: 44em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chips li { font-size: 13px; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.project-links { display: flex; gap: 20px; flex-wrap: wrap; }
.project-link {
  font-weight: 600; white-space: nowrap; text-decoration: none;
  border-bottom: 1px solid var(--coral); padding-bottom: 2px;
}
.project-link span { display: inline-block; transition: transform .25s; }
/* The main link stretches over the whole card, so clicking anywhere opens the site. */
.project-main::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.project:hover .project-main span { transform: translate(3px, -3px); }
/* Secondary links sit above the stretched area so they stay clickable. */
.project-secondary { position: relative; z-index: 2; color: var(--muted); border-bottom-color: var(--line-strong); transition: color .2s, border-color .2s; }
.project-secondary:hover { color: var(--text); border-bottom-color: var(--text); }
.project-secondary:hover span { transform: translate(3px, -3px); }
.project-shot {
  margin: 0 clamp(8px, 1.4vw, 14px) clamp(8px, 1.4vw, 14px);
  border-radius: calc(var(--radius) - 10px); overflow: hidden; background: #8cc2ef;
}
.project-shot img {
  width: 100%; height: auto; aspect-ratio: 3840 / 1646; object-fit: cover;
  transition: transform 1.2s cubic-bezier(.2,.8,.2,1);
}
.project:hover .project-shot img { transform: scale(1.02); }

/* ---------- Upcoming ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(48px, 8vw, 96px) 24px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.empty-orbit { width: 96px; height: 96px; color: var(--muted); margin-bottom: 24px; }
.empty-moon { transform-origin: 60px 60px; animation: orbit 10s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.empty-title { margin: 0; font-size: clamp(22px, 2.6vw, 28px); font-weight: 550; letter-spacing: -0.02em; }
.empty-body { margin: 6px 0 0; color: var(--muted); }

/* ---------- Contact ---------- */
.contact-copy { margin: 0 0 28px; color: var(--muted); font-size: clamp(18px, 1.8vw, 21px); max-width: 28em; }
.contact-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.email {
  font-size: clamp(28px, 5.4vw, 64px); font-weight: 550; letter-spacing: -0.035em; line-height: 1.1;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size .4s cubic-bezier(.2,.8,.2,1);
  overflow-wrap: anywhere;
}
.email:hover { background-size: 100% 2px; }
.copy {
  font: inherit; font-size: 13px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); cursor: pointer;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent;
  transition: color .2s, border-color .2s;
}
.copy:hover { color: var(--text); border-color: var(--muted); }
.copy.done { color: var(--green); border-color: var(--green); }
.social { margin: 28px 0 0; }
.social a { color: var(--muted); text-decoration: none; }
.social a:hover { color: var(--text); }
.footer {
  position: absolute; left: 0; right: 0; bottom: max(24px, env(safe-area-inset-bottom));
  text-align: center; color: var(--faint); font-size: 13px;
}

/* ---------- Reveal on scroll (only when JS runs) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.8,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
/* The planet only fades in; its transform belongs to the pointer parallax. */
.js .planet-wrap.reveal, .js .planet-wrap.reveal.in { transform: translate3d(var(--px, 0), var(--py, 0), 0); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .about { grid-template-columns: 1fr; gap: 0; }
  .planet-wrap { order: -1; width: 100%; max-width: 340px; margin: -20px auto -10px; }
  .project-body { grid-template-columns: 1fr; align-items: start; }
  .project-shot img { aspect-ratio: 16 / 10; object-position: 52% 50%; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .dots { display: none; }
  .project-top { flex-wrap: wrap; }
  .pill { margin-left: 0; order: 3; }
  .project-shot img { aspect-ratio: 4 / 3; object-position: 30% 50%; }
  .planet-wrap { max-width: 280px; }
}

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