@font-face { font-family: "Inter"; src: url(/fonts/inter-regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-semibold.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/jetbrains-mono.woff2) format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #000;
  --surface: #121214;
  --raised: #1b1b1e;
  --line: #242428;
  --menu: #0a0a0b;
  --text: #f5f5f7;
  --accent: #db5000;
  --accent-hi: #f26a12;
  --r-card: 22px;
  --r-inner: 14px;
  --pad: max(20px, min(4vw, 48px));
  --shell: 1440px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
@supports (corner-shape: squircle) {
  :root { --r-card: 34px; --r-inner: 22px; }
  .card, .cat, .g-slide img, .info, .tip, .lightbox img, pre { corner-shape: squircle; }
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--sans); letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; overflow-x: clip;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
pre, code, kbd { -webkit-user-select: text; user-select: text; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-weight: 600; margin: 0; letter-spacing: -0.022em; }
.mark { fill: var(--accent); }
code, kbd { font-family: var(--mono); font-size: 0.9em; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); text-align: center; line-height: 1.5; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Nav: centred floating capsule. Collapses to logo, name and (i) once scrolled.
   Transforms only: the capsule is two end caps and a middle that scales; the brand and (i) slide in. */
.nav {
  --d: 0px; --s: 1;
  position: fixed; z-index: 30; top: calc(env(safe-area-inset-top) + 12px); left: 50%;
  display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 6px;
  transform: translateX(-50%); transform-origin: 50% 0;
  white-space: nowrap; pointer-events: none;
}
.nav > a, .nav > button, .links a { pointer-events: auto; }
.nav-bg { position: absolute; inset: 0; z-index: -1; }
.nav-bg i { position: absolute; top: 0; bottom: 0; background: var(--surface); border: 1px solid var(--line); }
.nav-bg .cap { width: 23px; }
.nav-bg .cap.l { left: 0; border-right: 0; border-radius: 22px 0 0 22px; }
.nav-bg .cap.r { right: 0; border-left: 0; border-radius: 0 22px 22px 0; }
.nav-bg .mid { left: 22px; right: 22px; border-left: 0; border-right: 0; transform-origin: 50% 50%; }
.nav, .nav-bg i, .nav .brand, .info-btn, .links { transition: transform .5s cubic-bezier(.32, .72, 0, 1), opacity .3s ease; }
.links { display: flex; align-items: center; gap: 2px; }
.nav.folded { transform: translateX(-50%) scale(.818); }
.nav.folded .cap.l, .nav.folded .brand { transform: translateX(var(--d)); }
.nav.folded .cap.r, .nav.folded .info-btn { transform: translateX(calc(-1 * var(--d))); }
.nav.folded .mid { transform: scaleX(var(--s)); }
.nav.folded .links { opacity: 0; transform: scale(.96); }
.nav.folded .links a { pointer-events: none; }
.nav.folded .links { transition: transform .5s cubic-bezier(.32, .72, 0, 1), opacity .16s ease; }
.nav a { display: flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 500; text-decoration: none; transition: background-color .2s; }
.nav a:hover { background: var(--raised); }
.nav .brand { gap: 8px; padding: 0 12px 0 10px; font-weight: 600; letter-spacing: -0.01em; }
.nav .brand:hover { background: none; }
.nav .brand .mark { width: 22px; height: 11px; }
.info-btn {
  width: 32px; height: 32px; margin-left: 2px; border: 1px solid var(--line); border-radius: 50%;
  background: var(--raised); font: 600 14px/1 Georgia, "Times New Roman", serif; font-style: italic; cursor: pointer;
  transition: transform .5s cubic-bezier(.32, .72, 0, 1), box-shadow .2s;
}
.info-btn:hover, .info-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px rgba(219, 80, 0, .35); }

/* (i) popover */
.info {
  position: fixed; z-index: 29; top: calc(env(safe-area-inset-top) + 66px); left: 50%;
  width: min(520px, calc(100vw - 24px)); max-height: calc(100svh - env(safe-area-inset-top) - 90px); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px 22px 18px; background: var(--menu); border: 1px solid var(--line); border-radius: var(--r-card);
  transform: translateX(-50%); font-size: 14px; line-height: 1.55;
  animation: info-in .2s ease-out both;
}
.info.closing { animation: info-out .16s ease-in both; }
@keyframes info-in { from { opacity: 0; transform: translateX(-50%) translateY(-6px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes info-out { from { opacity: 1; transform: translateX(-50%); } to { opacity: 0; transform: translateX(-50%) translateY(-6px); } }
.info section { padding-top: 14px; }
.info section + section { border-top: 1px solid var(--line); margin-top: 14px; }
.info h4 { font-size: 13px; color: var(--accent-hi); margin-bottom: 4px; letter-spacing: -0.005em; }
.info p { margin: 0 0 8px; }
.info p:last-child { margin-bottom: 0; }
.info a { text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 2px; }

/* Layout */
main { width: 100%; max-width: calc(var(--shell) + 2 * var(--pad)); margin: 0 auto; padding: 0 calc(var(--pad) + env(safe-area-inset-right)) 0 calc(var(--pad) + env(safe-area-inset-left)); }

/* Hero: logo, one line, buttons and a stat row on the left; the ClickGUI's panels alone on the right, cut out of an
   in-game shot over a black frame, side by side in a tilted row. */
.hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: clamp(24px, 3vw, 56px);
  min-height: min(100svh, 940px); padding: calc(env(safe-area-inset-top) + 96px) 0 48px;
}
.hero h1 { margin: 0; line-height: 0; }
.logo { width: clamp(240px, 26vw, 400px); height: auto; }
.lede { margin: 26px 0 0; max-width: 34ch; text-wrap: balance; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.35; font-weight: 500; letter-spacing: -0.015em; }
.cta { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.stats { display: flex; gap: clamp(22px, 2.6vw, 40px); margin: 40px 0 0; flex-wrap: wrap; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dd { margin: 0; font-size: clamp(24px, 2.2vw, 30px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; color: var(--accent-hi); font-variant-numeric: tabular-nums; }
.stats dt { margin-top: 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

.stage { --pw: clamp(90px, 8.4vw, 172px); position: relative; perspective: 1700px; perspective-origin: 30% 40%; }
.stage::before {
  content: ""; position: absolute; inset: 5% -6% 0 4%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(219, 80, 0, .2), rgba(219, 80, 0, .07) 55%, transparent);
}
.panels {
  display: flex; align-items: flex-start; justify-content: center; gap: calc(var(--pw) * .16);
  transform-style: preserve-3d; transform-origin: 50% 40%;
  transform: rotateY(-22deg) rotateX(12deg) rotateZ(2deg);
  animation: rise 1s cubic-bezier(.2, .8, .2, 1) both .05s;
}
.panels .p {
  flex: none; width: var(--pw); height: auto; border-radius: calc(var(--pw) * .06);
  box-shadow: 0 0 0 1px rgba(242, 106, 18, .5), 0 0 14px rgba(219, 80, 0, .55), 0 0 44px rgba(219, 80, 0, .25);
}
@keyframes rise { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 22px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; cursor: pointer;
  transition: background-color .2s, box-shadow .25s, border-color .2s;
}
.btn:hover { background: var(--raised); box-shadow: 0 0 0 4px rgba(255, 255, 255, .06); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); box-shadow: 0 0 24px rgba(219, 80, 0, .45); }

.block { padding-top: clamp(72px, 9vw, 120px); scroll-margin-top: calc(8px - clamp(72px, 9vw, 120px)); }
.head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.head h2 { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; letter-spacing: -0.03em; }
.count { font-size: clamp(30px, 3.4vw, 42px); font-weight: 600; letter-spacing: -0.03em; color: var(--accent); line-height: 1.1; }

/* Module categories */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px 18px 20px; }
.cat header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cat .ico { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.cat h3 { font-size: 19px; letter-spacing: -0.02em; }
.cat .n { margin-left: auto; min-width: 30px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); font-size: 13px; font-weight: 600; line-height: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.cat ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cat li {
  padding: 5px 11px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 500; line-height: 1.3; cursor: default; letter-spacing: -0.005em;
  transition: background-color .15s, border-color .15s;
}
.cat li:hover, .cat li.on { background: #26262a; border-color: #34343a; }
.cat li:focus-visible { outline-offset: 1px; }

/* Hover card for module descriptions */
.tip {
  position: fixed; z-index: 40; max-width: min(300px, calc(100vw - 24px)); padding: 9px 13px;
  background: var(--menu); border: 1px solid var(--line); border-radius: 14px;
  font-size: 13.5px; line-height: 1.4; font-weight: 500; pointer-events: none;
  animation: tip-in .16s ease-out both;
}
.tip.closing { animation: tip-out .12s ease-in both; }
@keyframes tip-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes tip-out { from { opacity: 1; } to { opacity: 0; transform: translateY(4px); } }
.tip b { display: block; font-weight: 600; margin-bottom: 2px; color: var(--accent-hi); }

/* Screenshots: one gallery, Apple style */
.gallery { --sw: min(var(--shell), calc(100vw - 2 * var(--pad) - 48px), calc((100svh - 330px) * 16 / 9)); --gap: 20px; }
.g-track {
  display: flex; gap: var(--gap); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  margin: 0 calc(50% - 50vw); padding: 0 calc((100vw - var(--sw)) / 2) 4px; scroll-padding: 0 calc((100vw - var(--sw)) / 2);
  scrollbar-width: none; -webkit-overflow-scrolling: touch; outline: none;
}
.g-track::-webkit-scrollbar { display: none; }
.g-track:focus-visible .g-slide.on img { outline: 2px solid var(--accent); outline-offset: 3px; }
.g-slide { flex: 0 0 var(--sw); margin: 0; scroll-snap-align: center; scroll-snap-stop: always; opacity: .4; transition: opacity .5s ease; cursor: pointer; }
.g-slide.on { opacity: 1; cursor: zoom-in; }
.g-slide img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); background: #0b0b0c; -webkit-user-drag: none; }
.g-slide figcaption { padding: 14px 2px 0; font-size: 17px; font-weight: 600; letter-spacing: -0.016em; }
.g-nav { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 28px; }
.g-dots, .g-play { height: 56px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.g-dots { display: flex; align-items: center; padding: 0 14px; }
.g-dot { display: grid; place-items: center; height: 40px; padding: 0 6px; border: 0; background: none; cursor: pointer; }
.g-dot span { position: relative; display: block; width: 8px; height: 8px; border-radius: 4px; background: rgba(245, 245, 247, .38); overflow: hidden; transition: width .5s cubic-bezier(.32, .72, 0, 1), background-color .3s; }
.g-dot:hover span { background: rgba(245, 245, 247, .62); }
.g-dot.on span { width: 48px; background: rgba(245, 245, 247, .38); }
.g-dot span::after { content: ""; position: absolute; inset: 0; background: var(--text); border-radius: inherit; transform: scaleX(0); transform-origin: 0 50%; }
.g-dot.on span::after { transform: none; }
.gallery.playing .g-dot.on span::after { animation: g-fill var(--dur, 5s) linear both; }
.gallery.held .g-dot.on span::after { animation-play-state: paused; }
@keyframes g-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.g-play { display: grid; place-items: center; width: 56px; padding: 0; cursor: pointer; transition: background-color .2s, box-shadow .2s; }
.g-play:hover { background: var(--raised); box-shadow: 0 0 0 4px rgba(255, 255, 255, .06); }
.g-play svg { width: 20px; height: 20px; fill: var(--text); }
.g-play .i-play, .gallery.playing .g-play .i-pause { display: inline; }
.g-play .i-pause, .gallery.playing .g-play .i-play { display: none; }

.lightbox { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100dvh; margin: 0; }
.lightbox::backdrop { background: #000; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; animation: lb-in .2s ease-out both; }
.lightbox.closing { animation: lb-out .16s ease-in both; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lb-out { from { opacity: 1; } to { opacity: 0; } }
.lightbox img { max-width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)); max-height: calc(100dvh - 96px); width: auto; border-radius: 16px; border: 1px solid var(--line); }
.lightbox .close { position: fixed; top: calc(env(safe-area-inset-top) + 14px); right: calc(env(safe-area-inset-right) + 14px); width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 22px; line-height: 1; cursor: pointer; }

/* Download */
.dl { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 14px; align-items: stretch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; }
.release h3 { font-size: 26px; letter-spacing: -0.025em; }
.release > p { margin: 6px 0 0; font-size: 15px; }
.release .file { margin-top: 20px; width: 100%; height: 50px; font-size: 15px; }
.release .file span { font-weight: 500; opacity: .85; font-size: 13px; }
.steps { margin: 22px 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { position: relative; padding-left: 36px; font-size: 15px; line-height: 1.45; counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; line-height: 22px; text-align: center; }
.steps a, .help a { text-decoration-color: rgba(255, 255, 255, .4); text-underline-offset: 2px; }
.cmds { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
.cmd { padding: 18px 18px 18px 22px; }
.cmd-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cmd-head h3 { font-size: 18px; letter-spacing: -0.02em; }
.tag { height: 22px; padding: 0 9px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); font-size: 12px; font-weight: 500; line-height: 20px; }
.copy { margin-left: auto; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color .2s, box-shadow .2s, color .2s; }
.copy:hover { box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); background: #26262a; }
.copy.done { color: #fff; background: var(--accent); border-color: var(--accent); }
pre { margin: 0; padding: 14px 16px; background: #000; border: 1px solid var(--line); border-radius: var(--r-inner); overflow-x: auto; -webkit-overflow-scrolling: touch; }
pre code { font-size: 14px; line-height: 1.5; white-space: pre; }
.help h3 { font-size: 18px; margin-bottom: 6px; }
.help p { margin: 0; font-size: 15px; }

/* Footer: a small pill with the licence and links */
.end { padding: 0 16px calc(env(safe-area-inset-bottom) + 22px); margin-top: clamp(80px, 9vw, 140px); }
.foot {
  display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 24px);
  margin: 0 auto; padding: 6px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 500;
}
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 1099px) {
  .dl { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 56px; text-align: center; }
  .hero-text { display: flex; flex-direction: column; align-items: center; }
  .lede { margin-left: auto; margin-right: auto; }
  .cta, .stats { justify-content: center; }
  .stage { --pw: min(150px, 15.4vw); perspective-origin: 50% 40%; }
  .stage::before { inset: 5% 0 0; }
}
@media (max-width: 760px) {
  :root { --pad: 16px; }
  .nav { gap: 0; padding: 0 5px; }
  .nav a { padding: 0 10px; font-size: 13.5px; }
  .nav .wide { display: none; }
  .hero { padding-top: calc(env(safe-area-inset-top) + 92px); }
  .cats { grid-template-columns: 1fr; gap: 10px; }
  .cat { padding: 16px 16px 18px; }
  .gallery { --sw: calc(100vw - 2 * var(--pad) - 24px); --gap: 10px; }
  .g-slide img { border-radius: 12px; }
  .g-slide figcaption { font-size: 15px; padding-top: 10px; }
  .g-nav { margin-top: 20px; gap: 10px; }
  .g-dots, .g-play { height: 48px; }
  .g-play { width: 48px; }
  .g-dots { padding: 0 10px; }
  .g-dot.on span { width: 36px; }
  .card { padding: 20px; }
  .cmd { padding: 16px; }
  pre code { font-size: 12.5px; white-space: pre-wrap; word-break: break-all; }
}
@media (max-width: 400px) {
  .nav a { padding: 0 8px; font-size: 13px; }
  .nav .brand { padding: 0 8px 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .panels { animation: none; }
  .g-slide, .g-dot span { transition: none; }
}
