/* One long scroll over a fixed voxel scene. The voxels form the >an_ prompt in the hero,
   drift as a cloud behind the reading sections, and land as a pixel island at the world portal. */
:root {
  --bg: #f4efe6;
  --fg: #1b2638;
  --muted: #5c6a72;
  --accent: #e8743b;
  --panel: #ebe3d6;
  --line: #d9cfbf;
  --term-bg: #1b2638;
  --term-fg: #f4efe6;
  --term-dim: #8f9ba5;
  --grass: #7a9a5c;
  --soil: #8b6b4d;
  --water: #5d8ba6;
  --leaf: #4e6f47;
  --wall: #fbf7f0;
  --display: "Inter", "Helvetica Neue", Arial, sans-serif;
  --body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "Fira Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131c2a; --fg: #f4efe6; --muted: #a9b4bd; --accent: #f08a55; --panel: #1b2638;
    --line: #2a3648; --term-bg: #0c131e; --term-fg: #f4efe6; --term-dim: #7d8a96;
    --grass: #6d8f55; --soil: #7a5c41; --water: #3f6f8c; --leaf: #46663f; --wall: #e9e2d6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131c2a; --fg: #f4efe6; --muted: #a9b4bd; --accent: #f08a55; --panel: #1b2638;
  --line: #2a3648; --term-bg: #0c131e; --term-fg: #f4efe6; --term-dim: #7d8a96;
  --grass: #6d8f55; --soil: #7a5c41; --water: #3f6f8c; --leaf: #46663f; --wall: #e9e2d6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--bg); }

#scene {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
  opacity: var(--scene-opacity, 1);
}
main, header.nav, footer { position: relative; z-index: 1; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* Nav */
header.nav {
  position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 20;
  padding-block: 18px;
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo {
  font-family: var(--mono); font-weight: 500; font-size: 18px; text-decoration: none;
  display: inline-flex; align-items: baseline;
}
.logo .cur { display: inline-block; width: .6em; height: 3px; background: var(--accent); margin-left: 1px; animation: blink 1.1s steps(1) infinite; align-self: flex-end; margin-bottom: .28em; }
.nav-links { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); font-size: 14px; }
.nav-links a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--fg); }
.nav-links .hide-sm { display: inline; }
.world-pill {
  font-family: var(--mono); font-size: 13px; color: var(--fg) !important;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 7px 12px; border-radius: 999px; display: inline-flex; gap: 8px; align-items: center;
}
.world-pill .px { width: 10px; height: 10px; background:
  linear-gradient(var(--accent) 0 0) 0 0 / 5px 5px no-repeat,
  linear-gradient(var(--grass) 0 0) 5px 0 / 5px 5px no-repeat,
  linear-gradient(var(--water) 0 0) 0 5px / 5px 5px no-repeat,
  linear-gradient(var(--fg) 0 0) 5px 5px / 5px 5px no-repeat; image-rendering: pixelated; }

/* Hero */
.hero { padding-block: clamp(110px, 16vh, 170px) clamp(48px, 8vh, 96px); }
.hero .hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.hero-copy { min-width: 0; }
.prompt { font-family: var(--mono); font-size: 14px; color: var(--muted); letter-spacing: .02em; }
.prompt b { color: var(--accent); font-weight: 500; }
h1.name {
  font-family: var(--display); font-weight: 800; letter-spacing: -.045em; line-height: .9;
  font-size: clamp(64px, 11vw, 168px); margin: 18px 0 22px;
}
h1.name .line { display: block; overflow: hidden; padding-bottom: .04em; }
h1.name .line span { display: inline-block; }
.role { font-size: clamp(22px, 2.6vw, 32px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 0; text-wrap: balance; }
.dot { color: var(--accent); }
.lede { color: var(--muted); max-width: 46ch; margin: 18px 0 30px; font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500;
  background: var(--fg); color: var(--bg); padding: 13px 20px; border-radius: 999px; font-size: 15px;
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.btn:hover { transform: translateY(-2px); }
.cmd-link {
  font-family: var(--mono); font-size: 14px; text-decoration: none; color: var(--fg);
  border-bottom: 1px dashed var(--muted); padding-bottom: 2px;
}
.cmd-link:hover { border-bottom-color: var(--accent); }
.cmd-link b { color: var(--accent); font-weight: 500; }
.hero-stage { aspect-ratio: 1 / .78; width: 100%; max-width: 100%; }
.facts {
  margin-top: clamp(40px, 7vh, 72px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line); font-size: 14px;
}
.facts div { padding: 16px 16px 0 0; min-width: 0; }
.facts dt { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.facts dd { margin: 4px 0 0; font-weight: 500; }

/* Manifesto */
.manifesto { padding-block: clamp(80px, 16vh, 180px); }
.manifesto p {
  font-family: var(--display); font-weight: 800; letter-spacing: -.035em; line-height: 1.08;
  font-size: clamp(34px, 5.6vw, 84px); margin: 0; max-width: 17ch; text-wrap: balance;
}
.manifesto .w { transition: color .15s linear; }
.js-motion .manifesto .w { color: color-mix(in srgb, var(--fg) 18%, var(--bg)); }
.js-motion .manifesto .w.on { color: var(--fg); }
.manifesto .w.hl.on { color: var(--accent); }

/* Section heads */
.sec { padding-block: clamp(64px, 12vh, 140px); }
.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; display: flex; gap: 10px; align-items: center; }
.eyebrow::before { content: ""; width: 8px; height: 8px; background: var(--accent); }
h2 {
  font-family: var(--display); font-weight: 800; letter-spacing: -.04em; line-height: .98;
  font-size: clamp(40px, 6.4vw, 96px); margin: 14px 0 0; text-wrap: balance;
}

/* What I do */
.do-grid { margin-top: 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--fg); }
.do-grid article { padding: 26px 26px 8px 0; min-width: 0; }
.do-grid article + article { padding-left: 26px; border-left: 1px solid var(--line); }
.do-grid h3 { font-size: 24px; letter-spacing: -.02em; margin: 0 0 10px; font-weight: 800; }
.do-grid p { margin: 0; color: var(--muted); max-width: 34ch; }
.do-grid .k { font-family: var(--mono); font-size: 12px; color: var(--accent); display: block; margin-bottom: 18px; }

/* Marquee */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding-block: 18px; background: var(--bg); }
.marquee-track { display: flex; width: max-content; gap: 40px; will-change: transform; }
.marquee span {
  font-family: var(--display); font-weight: 800; font-size: clamp(40px, 7vw, 104px); letter-spacing: -.04em;
  line-height: 1; white-space: nowrap; color: transparent; -webkit-text-stroke: 1.5px var(--fg);
}
.marquee span i { font-style: normal; color: var(--accent); -webkit-text-stroke: 0; }

/* Work: pinned horizontal track on wide screens */
.work { padding-block: clamp(64px, 12vh, 140px) 0; }
.work-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px; }
.work-head p { color: var(--muted); max-width: 36ch; margin: 0; }
.work-viewport { overflow: hidden; padding-block: 48px clamp(64px, 12vh, 140px); }
.work-track { display: flex; gap: 24px; padding-inline: var(--gutter); width: max-content; will-change: transform; }
.card {
  width: min(440px, 80vw); flex: none; min-width: 0; background: var(--panel); border-radius: 20px;
  padding: 26px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden;
  border: 1px solid var(--line);
}
.card .art { aspect-ratio: 16 / 10; max-width: 100%; border-radius: 12px; background: var(--term-bg); position: relative; overflow: hidden; }
.card .art canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.card .meta { display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.card h3 { margin: 0; font-size: 30px; letter-spacing: -.03em; font-weight: 800; line-height: 1.05; }
.card p { margin: 0; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tags span { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.card.next { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.card.next p, .card.next .meta { color: color-mix(in srgb, var(--bg) 70%, var(--fg)); }
.card.next .tags span { border-color: color-mix(in srgb, var(--bg) 30%, var(--fg)); }
.card.next .big { font-family: var(--display); font-weight: 800; font-size: 120px; line-height: .8; letter-spacing: -.06em; color: var(--accent); }

/* Stack terminal */
.split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.split > * { min-width: 0; }
.term {
  background: var(--term-bg); color: var(--term-fg); border-radius: 18px; font-family: var(--mono); font-size: 14px;
  line-height: 1.75; box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--fg) 45%, transparent);
  overflow: hidden;
}
.term-bar { display: flex; gap: 8px; padding: 14px 18px; border-bottom: 1px solid color-mix(in srgb, var(--term-fg) 12%, transparent); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: color-mix(in srgb, var(--term-fg) 22%, transparent); }
.term-bar i:first-child { background: var(--accent); }
.term-body { padding: 18px 22px 24px; overflow-x: auto; }
.term-body .c { color: var(--term-dim); }
.term-body .p { color: var(--accent); }
.term-body .row { display: grid; grid-template-columns: 13ch minmax(0, 1fr); gap: 12px; }
.term-body .row span:first-child { color: var(--term-dim); }
.caret { display: inline-block; width: .6em; height: 1.1em; background: var(--accent); vertical-align: -.2em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Path */
.path { margin-top: 44px; margin-bottom: 0; padding: 0; border-top: 1px solid var(--fg); }
.path li { list-style: none; display: grid; grid-template-columns: 14ch minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding-block: 22px; border-bottom: 1px solid var(--line); align-items: baseline; }
.path .when { font-family: var(--mono); font-size: 13px; color: var(--accent); font-variant-numeric: tabular-nums; }
.path .what { font-weight: 800; font-size: 22px; letter-spacing: -.02em; line-height: 1.2; }
.path .how { color: var(--muted); }

/* Portal */
.portal { padding-block: clamp(80px, 14vh, 160px); position: relative; }
.portal .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.portal-copy { min-width: 0; }
.portal-copy p.sub { color: var(--muted); max-width: 40ch; font-size: 18px; margin: 20px 0 30px; }
.portal-stage { aspect-ratio: 1 / .9; width: 100%; max-width: 100%; position: relative; }
.enter {
  display: block; text-decoration: none; color: var(--term-fg); background: var(--term-bg);
  border-radius: 18px; font-family: var(--mono); font-size: 15px; line-height: 1.8; overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--fg) 50%, transparent);
  max-width: 520px;
}
.enter:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 40px 70px -30px color-mix(in srgb, var(--accent) 60%, transparent); }
.enter .term-body { padding-bottom: 20px; }
.enter .go { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; padding-top: 14px; border-top: 1px dashed color-mix(in srgb, var(--term-fg) 18%, transparent); }
.enter .go b { color: var(--accent); font-weight: 500; }
.enter .key { border: 1px solid color-mix(in srgb, var(--term-fg) 30%, transparent); border-radius: 6px; padding: 0 8px; font-size: 13px; color: var(--term-dim); }
.hint { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 16px; }
.hint kbd { font-family: var(--mono); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--fg); }

/* Contact */
.contact { padding-block: clamp(64px, 12vh, 140px) 40px; border-top: 1px solid var(--line); background: var(--bg); }
.contact h2 { font-size: clamp(48px, 9vw, 150px); }
.mail-row { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.mail { font-family: var(--mono); font-size: clamp(18px, 2.4vw, 28px); user-select: all; word-break: break-all; text-decoration: none; }
.copy {
  font: 500 14px var(--body); border: 1px solid var(--line); background: transparent; color: var(--fg);
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
}
.copy:hover { border-color: var(--fg); }
.links { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px 28px; }
.links a { text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.links a:hover { border-color: var(--accent); }
footer { padding-block: 32px; font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--bg); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* Pixel wipe played before navigating to the world */
.wipe { position: fixed; inset: 0; z-index: 50; pointer-events: none; display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-auto-rows: 1fr; }
.wipe i { background: var(--term-bg); transform: scale(0); transition: transform .28s steps(3, end); transition-delay: var(--d, 0ms); }
.wipe i:nth-child(7n) { background: var(--accent); }
.wipe.on i { transform: scale(1.02); }
.wipe-msg { position: fixed; inset: 0; z-index: 51; display: grid; place-items: center; pointer-events: none; font-family: var(--mono); color: var(--term-fg); font-size: 16px; opacity: 0; transition: opacity .2s; }
.wipe-msg.on { opacity: 1; transition-delay: .55s; }

/* Load sequence */
.ready h1.name .line span { animation: rise .9s cubic-bezier(.2,.8,.2,1) both; }
.ready h1.name .line:nth-child(2) span { animation-delay: .08s; }
@keyframes rise { from { transform: translateY(105%); } }

@media (max-width: 900px) {
  .hero .hero-grid, .portal .wrap, .split { grid-template-columns: minmax(0, 1fr); }
  .hero-stage { order: -1; aspect-ratio: 1 / .62; margin-bottom: -10px; }
  .portal-stage { aspect-ratio: 1 / .8; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .do-grid { grid-template-columns: minmax(0, 1fr); }
  .do-grid article + article { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .work-viewport { overflow: visible; }
  .work-track { flex-direction: column; width: auto; padding-inline: var(--gutter); }
  .card { width: 100%; }
  .path li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .nav-links .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ready h1.name .line span, .logo .cur, .caret { animation: none; }
  .wipe i { transition: none; }
}
