/* ───────────────────────── Fonts ───────────────────────── */
@font-face { font-family: "DM Sans"; src: url(fonts/dm-sans-latin-wght-normal.woff2) format("woff2"); font-weight: 100 1000; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url(fonts/caveat-latin-wght-normal.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

/* ───────────────────────── Tokens ───────────────────────── */
:root {
  color-scheme: dark;
  --bg: #0c0b0a;
  --surface: #151412;
  --surface-2: #1c1a17;
  --line: #26231f;
  --line-strong: #37332d;
  --ink: #efece6;
  --stone: #9c968c;
  --meta: #8a847a;
  --faint: #666159;
  --ember: #e07a3d;
  --sky: #8ab8f0;
  --sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --col: 600px;
  --gut: 20px;
}

/* ───────────────────────── Base ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.7 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--ember); color: #1a0d05; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -80px; z-index: 300; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font: 600 .85rem var(--sans); transition: top .2s; }
.skip:focus { top: 12px; }
.ic { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ib { fill: currentColor; flex: none; }

.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 120; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--sky); transform-origin: 0 50%; transform: scaleX(0); opacity: .8; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* Underlined inline links, the way the whole page reads */
.lead a, .prose a, .egg, .u-btn, .item__d a, .foot a {
  color: var(--ink); text-decoration: underline; text-decoration-color: rgba(239, 236, 230, .28); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color .25s, color .25s;
}
.lead a:hover, .prose a:hover, .egg:hover, .u-btn:hover, .item__d a:hover { text-decoration-color: var(--ink); }
.egg, .u-btn { cursor: pointer; }

/* ───────────────────────── Sky ───────────────────────── */
.sky { position: absolute; z-index: 0; top: 0; left: 0; right: 0; height: 300px; pointer-events: none; -webkit-mask-image: linear-gradient(#000 16%, transparent 80%); mask-image: linear-gradient(#000 16%, transparent 80%); }
.sky canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; opacity: 0; transition: opacity 1.2s var(--ease); }
.sky canvas.on { opacity: 1; }

.page { position: relative; z-index: 1; width: 100%; max-width: calc(var(--col) + var(--gut) * 2); margin-inline: auto; padding: 0 var(--gut) 56px; }
.where { padding-top: 26px; display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--ink); text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.where i { font-style: normal; color: var(--stone); }
.where time, .where #wx { color: var(--ink); }

/* ───────────────────────── Intro ───────────────────────── */
.intro { margin-top: 92px; }
.name-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-strong); }
.name { font: 600 36px/1.1 var(--sans); letter-spacing: -.03em; color: var(--ink); }
.socials { display: flex; align-items: center; gap: 12px; margin-left: 4px; }
.socials a, .socials button { display: grid; place-items: center; width: 28px; height: 28px; color: var(--ink); opacity: .72; border-radius: 8px; transition: opacity .2s, transform .35s var(--ease), background .2s; }
.socials a:hover, .socials button:hover { opacity: 1; background: var(--surface-2); transform: translateY(-1px); }
.hand { margin-top: 4px; font: 500 22px/1.2 var(--hand); color: var(--sky); transition: color 1.2s; }
.lead { margin-top: 18px; color: var(--ink); }
.lead + .lead { margin-top: 12px; }
.lead--dim { color: var(--stone); }
.lead--dim b { font-weight: 500; color: var(--ink); }
.note { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; font: 500 20px/1 var(--hand); color: var(--sky); vertical-align: -4px; }

/* ───────────────────────── Labels & timeline ───────────────────────── */
.label { display: flex; align-items: center; gap: 14px; margin: 60px 0 22px; font: 500 12.5px/1 var(--sans); letter-spacing: .01em; color: var(--meta); }
.label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.label + .tl, .label + .list, .label + .prose, .label + .chips, .label + .panel { margin-top: 0; }

.tl { position: relative; padding-left: 28px; }
.tl::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: 0; width: 1px; background: var(--line-strong); }
.tl__i { position: relative; padding-bottom: 40px; }
.tl__i:last-child { padding-bottom: 6px; }
.tl__i::before { content: ""; position: absolute; left: -28px; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--line-strong); }
.tl__i--now::before { background: var(--sky); border-color: var(--sky); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky) 20%, transparent); transition: background 1.2s, border-color 1.2s; }
.when { font-size: 13px; line-height: 1.4; color: var(--meta); }
.tl__i--now .when { color: var(--sky); transition: color 1.2s; }
.tl__t { display: flex; align-items: center; gap: 9px; margin-top: 6px; font: 600 18px/1.3 var(--sans); letter-spacing: -.015em; color: var(--ink); }
.tl__ico { width: 20px; height: 20px; border-radius: 5px; flex: none; }
.tl__ico--tile { display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--stone); }
.tl__sub { font-size: 14px; color: var(--stone); }
.tl__d { margin-top: 10px; color: var(--stone); }
.shot { margin-top: 16px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-strong); background: #3ea0f7; }
.shot img { width: 100%; transition: transform 1.2s var(--ease); }
.shot:hover img { transform: scale(1.03); }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.card { display: grid; grid-template-columns: 22px minmax(0, 1fr) 12px; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; transition: border-color .25s, transform .4s var(--ease), background .25s; }
.card:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-1px); }
.card .ico { width: 22px; height: 22px; border-radius: 6px; }
.card__t { display: grid; gap: 1px; min-width: 0; }
.card__t b { font-weight: 600; font-size: 14px; line-height: 1.3; color: var(--ink); }
.card__t span { font-size: 13px; line-height: 1.4; color: var(--stone); }
.out { color: var(--faint); transition: color .2s, transform .35s var(--ease); align-self: start; margin-top: 4px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.card:hover .out { color: var(--ink); transform: translate(2px, -2px); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chips li { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13.5px; line-height: 1.4; color: var(--ink); transition: border-color .25s, transform .4s var(--ease); }
.chips li svg { color: var(--stone); }
.chips li:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.chips--lg { margin-top: 0; gap: 9px; }
.chips--lg li { padding: 7px 13px; font-size: 14px; }

/* ───────────────────────── Lists ───────────────────────── */
.list { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 28px; }
.item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.item--plain { grid-template-columns: 1fr; }
.ico { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.ico--round { border-radius: 50%; }
.ico--tile { display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--stone); font: 600 13px/1 var(--mono); }
.item__n { display: inline-flex; align-items: center; gap: 8px; font: 600 15px/1.35 var(--sans); color: var(--ink); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease); }
.item__n:hover { background-size: 100% 1px; }
.item__n--mono { font: 500 14px/1.35 var(--mono); letter-spacing: -.01em; }
.item__d { margin-top: 1px; font-size: 13.5px; line-height: 1.55; color: var(--stone); }
.repo { font: 500 11.5px/1 var(--mono); }
.badge { font: 500 10.5px/1 var(--mono); padding: 3px 6px; border-radius: 6px; color: var(--sky); border: 1px solid color-mix(in srgb, var(--sky) 40%, transparent); background: color-mix(in srgb, var(--sky) 10%, transparent); }
.stars { display: inline-flex; align-items: center; gap: 4px; font: 500 11.5px/1 var(--mono); color: var(--meta); }
.stars .ic { color: var(--sky); fill: color-mix(in srgb, var(--sky) 40%, transparent); }
.stars i { font-style: normal; }
.prose { color: var(--stone); }
.prose + .panel { margin-top: 16px; }

/* ───────────────────────── Panels ───────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.panel + .panel { margin-top: 12px; }

/* Skins picker */
.picker { display: grid; gap: 16px; }
.picker__stage { display: flex; align-items: center; gap: 18px; padding: 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.picker__ball img { width: 112px; height: 112px; filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .5)); }
.picker__ball img.swap { animation: swap .7s var(--ease); }
@keyframes swap { from { opacity: 0; transform: rotate(-50deg) scale(.8); } }
.picker__name { display: grid; gap: 3px; }
.picker__name span { font: 500 11.5px/1 var(--mono); color: var(--meta); letter-spacing: .06em; }
.picker__name b { font: 600 20px/1.15 var(--sans); letter-spacing: -.02em; color: var(--ink); }
.picker__name em { font-style: normal; font-size: 13px; color: var(--stone); }
.picker__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.picker__grid button { position: relative; aspect-ratio: 1; border-radius: 50%; transition: transform .45s var(--ease); }
.picker__grid button img { width: 100%; height: 100%; border-radius: 50%; }
.picker__grid button:hover { transform: translateY(-3px) scale(1.06); }
.picker__grid button[aria-checked="true"]::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ember); }

/* Lab */
.lab { display: grid; gap: 14px; }
.lab h3 { font: 600 15px/1.3 var(--sans); color: var(--ink); }
.lab header p { font-size: 14px; color: var(--stone); }
.lab__fig { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lab__fig svg { display: block; width: 100%; height: 150px; color: var(--ink); }
.lab__ctl { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; }
.lab__ctl label { font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--meta); }
.lab__out { font: 500 12px/1.4 var(--mono); color: var(--ink); }
.lab__foot { font-size: 12.5px; line-height: 1.55; color: var(--meta); }
#q-out { min-width: 14ch; text-align: right; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: var(--line-strong); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: var(--line-strong); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7.5px; border-radius: 50%; background: var(--bg); border: 4px solid var(--ember); transition: transform .3s var(--ease); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 4px solid var(--ember); }
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.18); }
.lab__fig--tok { display: flex; flex-direction: column; }
.lab__fig--tok textarea { width: 100%; resize: vertical; min-height: 74px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 400 13px/1.55 var(--mono); padding: 12px 14px; border-radius: 0; }
.lab__fig--tok textarea:focus-visible { outline-offset: -3px; }
.toks { padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 3px; align-content: flex-start; min-height: 88px; font: 500 12px/1 var(--mono); color: var(--ink); }
.toks span { padding: 6px 7px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre; animation: pop .45s var(--ease) both; }
.toks span:nth-child(3n+2) { background: color-mix(in srgb, var(--ember) 22%, transparent); border-color: color-mix(in srgb, var(--ember) 40%, transparent); }
@keyframes pop { from { opacity: 0; transform: translateY(5px) scale(.92); } }

/* Activity */
.heat__t { font-size: 14px; color: var(--ink); margin-bottom: 10px; }
.heat__scroll { overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.heat__scroll::-webkit-scrollbar { display: none; }
.heat__months { position: relative; height: 16px; font: 500 10.5px/1 var(--mono); color: var(--meta); min-width: max-content; }
.heat__months span { position: absolute; top: 0; }
.heat__grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 9px); gap: 3px; width: max-content; }
.heat__grid i, .heat__legend i { width: 9px; height: 9px; border-radius: 2px; background: var(--surface-2); display: block; }
.heat__grid i { animation: cell .6s var(--ease) both; animation-delay: calc(var(--w, 0) * 9ms); }
@keyframes cell { from { opacity: 0; transform: scale(.4); } }
.l1 { background: color-mix(in srgb, var(--ember) 32%, var(--surface-2)) !important; }
.l2 { background: color-mix(in srgb, var(--ember) 55%, var(--surface-2)) !important; }
.l3 { background: color-mix(in srgb, var(--ember) 78%, var(--surface-2)) !important; }
.l4 { background: var(--ember) !important; }
.heat__foot { margin-top: 10px; display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--meta); }
.heat__legend { display: inline-flex; align-items: center; gap: 4px; }

/* Footer */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0 9px; margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--meta); }
.foot i { font-style: normal; color: var(--faint); }
.foot .u-btn { color: var(--ink); }

/* ───────────────────────── Easter egg ───────────────────────── */
.egg-ov { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; }
.egg-ov__bg { position: absolute; inset: 0; width: 100%; background: rgba(12, 11, 10, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: pointer; animation: fade .3s both; }
@keyframes fade { from { opacity: 0; } }
.pols { position: relative; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0; max-width: 760px; pointer-events: none; }
.pol { width: 168px; margin: -10px -6px; padding: 9px 9px 12px; background: #efece6; border-radius: 3px; box-shadow: 0 24px 40px -14px rgba(0, 0, 0, .7), 0 2px 4px rgba(0, 0, 0, .4); transform: rotate(var(--r)) translateY(var(--y, 0)); animation: polin .8s var(--ease) both; animation-delay: calc(var(--i) * 90ms); }
@keyframes polin { from { opacity: 0; transform: rotate(0deg) translateY(40px) scale(.85); } }
.pol__ph { aspect-ratio: 4 / 5; display: grid; place-items: center; background: var(--bgc, #2b2622); }
.pol__ph img { width: 84%; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .45)); }
.pol figcaption { margin-top: 6px; text-align: center; font: 500 20px/1 var(--hand); color: #2a2622; }
.egg-ov__hint { position: absolute; bottom: 28px; left: 0; right: 0; text-align: center; font: 500 20px/1 var(--hand); color: var(--stone); pointer-events: none; }

/* ───────────────────────── Reveal ───────────────────────── */
.js [data-reveal] { opacity: 0; transform: translateY(12px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ───────────────────────── Responsive ───────────────────────── */
@media (max-width: 640px) {
  .intro { margin-top: 84px; }
  .name { font-size: 32px; }
  .cards { grid-template-columns: 1fr; }
  .list { grid-template-columns: 1fr; gap: 20px; }
  .picker__ball img { width: 92px; height: 92px; }
  .lab__ctl { grid-template-columns: 1fr auto; }
  .lab__ctl label { grid-column: 1 / -1; }
  .pol { width: 132px; }
  .pols { max-width: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; transition-delay: 0s !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
