/* Fonts */
@font-face {
  font-family: "Allo";
  src: url("../fonts/AlloVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Allo Fallback";
  src: local("Arial");
  size-adjust: 104%;
  ascent-override: 92%;
  descent-override: 24%;
  line-gap-override: 0%;
}

/* Tokens */
:root {
  --board: #0e0e0f;
  --band: #1a1a1a;
  --slab: #242426;
  --ink: #f2f2ef;
  --ink-60: color-mix(in srgb, var(--ink) 60%, transparent);
  --ink-40: color-mix(in srgb, var(--ink) 40%, transparent);
  --ink-15: color-mix(in srgb, var(--ink) 15%, transparent);
  --line: color-mix(in srgb, var(--ink) 12%, transparent);
  --lime: #c5f82a;
  --on-lime: #0e0e0f;
  --signal: var(--lime);
  --beta-bg: #0e0e0f;
  --beta-ring: 0 0 0 1px color-mix(in srgb, #c5f82a 35%, transparent);
  --shadow: 0 40px 80px -40px #000000;
  --focus: #f2f2ef;
  color-scheme: dark;

  --font: "Allo", "Allo Fallback", system-ui, sans-serif;
  --impact: clamp(2.9375rem, min(calc(0.043rem + 11.064vw), calc(4.519rem + 4.207vw)), 11.25rem);
  --h1: clamp(2.5rem, min(calc(0.904rem + 5.106vw), calc(3.946rem + 3.036vw)), 7.375rem);
  --h2: clamp(2rem, min(calc(1.202rem + 2.553vw), calc(2.866rem + 1.351vw)), 4.5rem);
  --h3: clamp(1.375rem, min(calc(1.176rem + 0.638vw), calc(1.509rem + 0.446vw)), 2.25rem);
  --lead-l: clamp(1.375rem, calc(1.254rem + 0.518vw), 1.875rem);
  --lead: clamp(0.9375rem, min(calc(0.85rem + 0.32vw), calc(1.009rem + 0.161vw)), 1.25rem);
  --text: clamp(0.875rem, calc(0.809rem + 0.213vw), 1rem);
  --small: clamp(0.8125rem, calc(0.779rem + 0.106vw), 0.875rem);
  --meta: clamp(0.8125rem, calc(0.76rem + 0.12vw), 0.9375rem);
  --logo-h: clamp(1.5625rem, min(calc(1.229rem + 1.667vw), calc(1.484rem + 0.851vw)), 2.25rem);

  --pad-x: clamp(1.25rem, calc(0.718rem + 1.702vw), 2.25rem);
  --pad-y: calc(var(--pad-x) * 0.72);
  --header-h: calc(var(--logo-h) + var(--pad-y) * 2);
  --footer-h: calc(1.5rem + var(--pad-y) * 2);
  --gap-l: clamp(2rem, min(calc(1.202rem + 2.553vw), calc(3.036rem + 0.714vw)), 4.5rem);
  --gap: clamp(1.25rem, min(calc(1.051rem + 0.638vw), calc(1.464rem + 0.179vw)), 2rem);
  --coin: clamp(6rem, min(calc(3.34rem + 8.511vw), calc(9.643rem + 1.786vw)), 14rem);
  --wrap: 100rem;

  --r-card: 20px;
  --r-inner: 14px;
  --r-pill: 999px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.2, 1);
  --ease-hop: cubic-bezier(0.3, 0.7, 0.4, 1);
  --ease-pop: cubic-bezier(0.24, 1.34, 0.38, 1);
  --ease-blur: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-focus: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-link: cubic-bezier(0.625, 0.05, 0, 1);
  --ease-toggle: cubic-bezier(0.35, 1, 0.6, 1);
  --ease-toggle-dot: cubic-bezier(0.35, 1.5, 0.6, 1);
  --dur-fast: 160ms;
  --dur-base: 240ms;

  --btn-size: clamp(0.8125rem, min(calc(0.746rem + 0.2128vw), calc(0.8571rem + 0.0893vw)), 1rem);
  --btn-padding: 0.9em 1.75rem;
  --btn-color: var(--on-lime);
  --btn-background: var(--lime);
  --btn-focus: var(--focus);
  --btn-radius: 2.5em;
  --btn-focus-inset: -0.25em;
}
:root[data-theme="light"] {
  --board: #f2f2f2;
  --band: #ffffff;
  --slab: #e7e7e9;
  --ink: #0e0e0f;
  --on-lime: #0e0e0f;
  --signal: #0e0e0f;
  --beta-bg: #0e0e0f;
  --beta-ring: none;
  --shadow: 0 40px 80px -44px color-mix(in srgb, #0e0e0f 45%, transparent);
  --focus: #0e0e0f;
  --btn-edge: inset 0 0 0 1px #0e0e0f;
  --tag-bg: #0e0e0f;
  --tag-ink: #c5f82a;
  color-scheme: light;
}
.only-light { display: none !important; }
:root[data-theme="light"] .only-light { display: block !important; }
:root[data-theme="light"] .only-dark { display: none !important; }
html.is-theming, html.is-theming * { transition: background-color 400ms var(--ease-toggle), color 400ms var(--ease-toggle), border-color 400ms var(--ease-toggle), box-shadow 400ms var(--ease-toggle), fill 400ms var(--ease-toggle) !important; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 400ms; animation-timing-function: var(--ease-toggle); }
html { -webkit-tap-highlight-color: transparent; }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--board); -webkit-text-size-adjust: 100%; }
body {
  position: relative;
  min-height: 100svh;
  margin: 0;
  background: var(--board);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text);
  font-variation-settings: "ROND" 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; overflow-wrap: break-word; }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.02em; line-height: 1; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--lime); color: var(--on-lime); }
.c-wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--pad-x)); margin: 0 auto; padding: 0 var(--pad-x); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.impact, .h1, .h2, .h3 { font-weight: 650; letter-spacing: -0.02em; }
.impact { font-size: var(--impact); line-height: 0.92; }
.h1 { font-size: var(--h1); line-height: 1; }
.h2 { font-size: var(--h2); }
.h3 { font-size: var(--h3); line-height: 1.15; }
.lead { color: var(--ink-60); font-size: var(--lead); line-height: 1.4; }
.paragraph { color: var(--ink-60); }
.paragraph a { position: relative; color: var(--ink); text-decoration: none; }
.paragraph a::before { content: ""; position: absolute; bottom: -0.125em; left: 0; width: 100%; height: 1px; background-color: currentColor; transform: scaleX(1) rotate(0.001deg); transform-origin: left center; transition: transform 0.735s var(--ease-link); }
@media (hover: hover) and (pointer: fine) {
  .paragraph a:hover::before { transform: scaleX(0) rotate(0.001deg); transform-origin: right center; }
}
.paragraph a:focus-visible::before { transform: scaleX(1); }
.small { color: var(--ink-60); font-size: var(--small); }
.meta { color: var(--ink-60); font-size: var(--meta); font-weight: 500; letter-spacing: -0.005em; line-height: 1.4; }

/* Skip link */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--btn-radius);
  background: var(--btn-background);
  color: var(--btn-color);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus-visible { transform: none; outline: 2px solid var(--focus); outline-offset: 3px; }

/* Focus */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* Buttons */
.btn, button:not(:disabled) { cursor: pointer; }
.btn {
  position: relative;
  display: inline-grid;
  padding: 0;
  outline-style: none;
  border: 0;
  background-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  color: var(--btn-color);
  font-size: var(--btn-size);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn::after {
  content: "";
  position: absolute;
  inset: var(--btn-focus-inset);
  z-index: 1;
  display: block;
  border-radius: var(--btn-radius);
  pointer-events: none;
  transition: box-shadow 0.3s var(--ease-focus);
}
.btn:focus-visible { outline: none; }
.btn:focus-visible::after { box-shadow: 0 0 0 0.125em var(--btn-focus); }
.btn .inner {
  display: flex;
  grid-area: 1 / 1;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  width: 100%;
  height: 100%;
  padding: var(--btn-padding);
  border-radius: var(--btn-radius);
  background-color: var(--btn-background);
  box-shadow: var(--btn-edge, none);
  pointer-events: none;
}
.btn-ghost { --btn-edge: none; }
.btn-ghost { --btn-color: var(--ink); --btn-background: var(--slab); }
@media (forced-colors: active) {
  .btn .inner { border: 1px solid ButtonText; }
  .btn:focus-visible::after { outline: 2px solid Highlight; }
}

/* Logo */
.logo { display: block; flex: none; overflow: visible; color: var(--ink); }
.logo .body { fill: currentColor; stroke: currentColor; stroke-width: 6; stroke-linejoin: round; }
.logo .cut { fill: var(--logo-ground, var(--board)); }
.logo .dot { fill: var(--lime); }
:root[data-theme="light"] .logo:not(.edge) .dot { stroke: currentColor; stroke-width: 3.5; }

/* Coin */
.coin {
  --logo-edge: color-mix(in srgb, currentColor 55%, var(--logo-ground, var(--board)));
  position: relative;
  display: block;
  flex: none;
  width: var(--coin);
  height: var(--coin);
  color: var(--ink);
  perspective: 900px;
}
[data-coin] { width: var(--coin); height: var(--coin); }
.coin .turn { position: absolute; inset: 0; transform-style: preserve-3d; }
.coin .turn > .logo { position: absolute; inset: 0; width: 100%; height: 100%; }
.coin .face { backface-visibility: hidden; }
.coin .edge .cut { display: none; }
.coin .edge .body, .coin .edge .dot { fill: var(--logo-edge); stroke: var(--logo-edge); }
.coin .turn.is-flip { animation: coin-turn 950ms var(--ease-in-out); }
.coin.is-idle .turn { animation: coin-idle 6s var(--ease-in-out) infinite; }
.coin.is-paused .turn { animation-play-state: paused; }
.coin.has-party { cursor: pointer; -webkit-user-select: none; user-select: none; }
.coin.has-party.is-hop { animation: coin-hop 560ms var(--ease-hop); }
.coin.has-spin { cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.coin.has-spin.is-held { cursor: grabbing; }
@keyframes coin-turn { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
@keyframes coin-idle { 0%, 70% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }
@keyframes coin-hop {
  0% { transform: none; }
  22% { transform: translateY(-14px) rotate(calc(var(--side, 1) * -7deg)); }
  48% { transform: translateY(-6px) rotate(calc(var(--side, 1) * 4deg)); }
  66% { transform: translateY(0) rotate(calc(var(--side, 1) * -1.5deg)) scale(1.04, 0.95); }
  82% { transform: rotate(calc(var(--side, 1) * 0.6deg)); }
  100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .coin .turn.is-flip, .coin.is-idle .turn, .coin.has-party.is-hop { animation: none; }
}

/* Text blur */
[data-text-blur] .word { display: inline-block; white-space: nowrap; }
[data-text-blur] .bit { display: inline-block; margin: -0.15em -0.12em -0.3em; padding: 0.15em 0.12em 0.3em; }
[data-text-blur].is-playing .bit { animation: text-blur var(--blur-dur, 900ms) var(--ease-blur) var(--d, 0ms) backwards; }
@keyframes text-blur { from { opacity: 0; filter: blur(8px); translate: 0 0.3em; } }
html[data-reveal-pending] [data-text-blur]:not(.is-ready) { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  [data-text-blur].is-playing .bit { animation: none; }
}

/* Reveal */
html[data-reveal-pending] [data-reveal], html[data-reveal-ready] [data-reveal]:not(.is-revealed) { opacity: 0; }
@media (scripting: none) {
  html[data-reveal-pending] [data-reveal], html[data-reveal-pending] [data-text-blur]:not(.is-ready) { opacity: 1; }
}
[data-reveal].is-revealed { animation: reveal-up 0.7s var(--ease-blur) var(--reveal-delay, 0ms) backwards; }
@keyframes reveal-up { from { opacity: 0; translate: 0 16px; filter: blur(4px); } }
@media (prefers-reduced-motion: reduce) {
  [data-reveal].is-revealed { animation: none; }
}

/* Stickers */
[data-stickers-init] { -webkit-user-select: none; user-select: none; touch-action: manipulation; isolation: isolate; }
[data-stickers-init] .sources { position: absolute; inset: 0; visibility: hidden; pointer-events: none; }
[data-stickers-init] .sticker { display: block; width: 1em; max-width: none; height: auto; font-size: clamp(6em, 4em + 9vw, 14em); }
[data-stickers-init] .sticker.is-large { width: 1.125em; }
[data-stickers-init] .sticker.is-small { width: 0.9em; }
[data-stickers-item] {
  position: absolute;
  z-index: -1;
  display: block;
  max-width: none;
  filter: none;
  transform: translate(-50%, -50%) rotate(var(--sticker-rotation));
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  [data-stickers-status="active"] { animation: sticker-press 240ms cubic-bezier(0.2, 0.65, 0.3, 1) both; }
}
[data-stickers-status="not-active"] { animation: sticker-remove 250ms both; }
@keyframes sticker-remove {
  0% { transform: var(--sticker-exit-transform); opacity: 1; animation-timing-function: ease-out; }
  28% { transform: var(--sticker-exit-transform) scale(1.045); opacity: 1; animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  100% { transform: var(--sticker-exit-transform) scale(0.86); opacity: 0; }
}
@keyframes sticker-press {
  from { transform: translate(-50%, calc(-50% - 0.25em)) rotate(var(--sticker-rotation)) scale(1.08); filter: drop-shadow(0 0.3em 0.25em #00000040); }
  to { transform: translate(-50%, -50%) rotate(var(--sticker-rotation)) scale(1); filter: drop-shadow(0 0 0 #00000000); }
}

/* Header */
.site-header { position: absolute; inset: 0 0 auto; z-index: 20; }
.site-header .c-wrap, .site-footer .c-wrap { max-width: none; }
.site-header .c-wrap { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); }
.site-header .home { display: inline-flex; align-items: center; gap: calc(var(--logo-h) * 0.3); min-height: 24px; color: var(--ink); text-decoration: none; }
.site-header .home .logo { width: var(--logo-h); height: var(--logo-h); }
.site-header .home .name { font-size: calc(var(--logo-h) * 0.6); font-weight: 650; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.beta { display: inline-flex; align-items: center; height: 1.7em; padding: 0 0.65em; border-radius: var(--r-pill); background: var(--beta-bg); box-shadow: var(--beta-ring); color: var(--lime); font-size: max(0.6875rem, calc(var(--logo-h) * 0.34)); font-weight: 600; letter-spacing: 0.02em; line-height: 1; }
.site-header .btn { --btn-padding: 0.8em 1.4em; }
.site-header .end { display: flex; align-items: center; gap: 16px; }
.site-header .free { white-space: nowrap; }

/* Theme switch */
.theme { --theme-h: clamp(26px, calc(17px + 0.6vw), 34px); position: absolute; top: 50%; left: 50%; display: inline-flex; gap: 2px; padding: clamp(3px, calc(1px + 0.12vw), 4px); border-radius: var(--r-pill); background: var(--ink-15); translate: -50% -50%; }
.theme button { display: grid; place-items: center; width: calc(var(--theme-h) * 1.16); height: var(--theme-h); padding: 0; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-60); cursor: pointer; transition: background-color 0.4s var(--ease-toggle), color 0.4s var(--ease-toggle), box-shadow 0.4s var(--ease-toggle); }
.theme button svg { width: calc(var(--theme-h) * 0.58); height: calc(var(--theme-h) * 0.58); fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.theme button[aria-checked="true"] { background: var(--board); color: var(--ink); box-shadow: 0 1px 3px color-mix(in srgb, #000000 18%, transparent); }
.theme button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .theme button:not([aria-checked="true"]):hover { color: var(--ink); }
}
@media (forced-colors: active) {
  .theme button[aria-checked="true"] { outline: 2px solid Highlight; }
}

/* Toggle */
.toggle-switch { position: relative; display: flex; align-items: center; gap: 0.625em; min-height: 24px; font-weight: 500; line-height: 1.5; cursor: pointer; }
.toggle-switch .option { color: var(--ink); transition: color 0.4s var(--ease-toggle); }
.toggle-switch .option:last-of-type { color: var(--ink-60); }
.toggle-switch .switch { display: flex; flex-shrink: 0; width: 2em; height: 1.25em; border-radius: 2em; background-color: var(--ink-15); transition: background-color 0.4s var(--ease-toggle); }
.toggle-switch .dot { width: 1em; height: 1em; margin-top: 0.125em; margin-left: 0.125em; border-radius: 50%; background-color: var(--ink); transition: transform 0.4s var(--ease-toggle-dot), background-color 0.4s var(--ease-toggle); }
.toggle-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; appearance: none; cursor: pointer; }
.toggle-switch:has(input:checked) .switch { background-color: var(--ink); }
.toggle-switch:has(input:checked) .dot { background-color: var(--board); transform: translateX(0.75em); }
.toggle-switch:has(input:checked) .option { color: var(--ink); }
.toggle-switch:has(input:checked) .option:first-of-type { color: var(--ink-60); }
.toggle-switch:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 6px; border-radius: 6px; }

/* Underline link */
.underline { position: relative; text-decoration: none; }
.underline::before { content: ""; position: absolute; bottom: -0.125em; left: 0; width: 100%; height: 1px; background-color: currentColor; transform: scaleX(0) rotate(0.001deg); transform-origin: right center; transition: transform 0.735s var(--ease-link); }
@media (hover: hover) and (pointer: fine) {
  .underline:hover::before { transform: scaleX(1) rotate(0.001deg); transform-origin: left center; }
}
.underline:focus-visible::before { transform: scaleX(1); transform-origin: left center; }

/* Footer */
.site-footer { position: relative; z-index: 20; pointer-events: none; }
.site-footer .c-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--footer-h); }
.site-footer a, .site-footer button { pointer-events: auto; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 0; padding: 0; list-style: none; }
.site-footer a { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; color: var(--ink); text-decoration: none; }
.site-footer a .label { position: relative; }
.site-footer a svg { width: 0.7em; height: 0.7em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: translate 0.735s var(--ease-link); }
@media (hover: hover) and (pointer: fine) {
  .site-footer a:hover svg { translate: 1.5px -1.5px; }
}
body:has(main > .is-screen) .site-footer { position: absolute; inset: auto 0 0; }

/* Shell responsive */
@media (max-width: 767px) {
  .site-header .home .name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 479px) {
  .site-header .free { display: none; }
}
@media (hover: hover) and (pointer: fine) {
  .site-footer a:hover .underline::before { transform: scaleX(1) rotate(0.001deg); transform-origin: left center; }
}
.site-footer a:focus-visible .underline::before { transform: scaleX(1); transform-origin: left center; }

/* Close */
.close-btn { position: absolute; top: clamp(12px, 1.6vw, 24px); right: clamp(12px, 1.6vw, 24px); z-index: 8; display: inline-grid; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: var(--small); font-weight: 500; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.close-btn .inner { display: flex; align-items: center; gap: 4px; pointer-events: none; }
.close-btn .circle { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--slab); transition: background-color var(--dur-base) ease; }
.close-btn .circle svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.close-btn .pill { display: grid; place-items: center; height: 36px; padding: 0 14px; border-radius: 10px; background: var(--slab); transition: background-color var(--dur-base) ease; }
@media (hover: hover) and (pointer: fine) {
  .close-btn:hover .circle, .close-btn:hover .pill { background: color-mix(in srgb, var(--ink) 16%, var(--band)); }
}
.close-btn:focus-visible { outline: none; }
.close-btn:focus-visible .pill, .close-btn:focus-visible .circle { box-shadow: 0 0 0 2px var(--focus); }
@media (forced-colors: active) {
  .close-btn .circle, .close-btn .pill { border: 1px solid ButtonText; }
}

@media (max-width: 399px) {
  .site-header .end { display: none; }
  .site-header .theme { right: var(--pad-x); left: auto; translate: 0 -50%; }
}
