/* Palette. The greens are BuhoGO's documented brand colours (primary #15DE72,
   secondary #059573) and the light background is the app's own canvas colour,
   so the site and the wallet read as one product. */
:root {
  color-scheme: light;
  --bg: #faf7ef;
  --bg-deep: #efeade;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #fdfcf8;
  --surface-muted: #f0ece1;
  --text: #14201a;
  --text-soft: #5d6b63;
  --text-faint: #8a948d;
  --border: rgba(20, 32, 26, 0.12);
  --border-strong: rgba(20, 32, 26, 0.2);
  --accent: #15de72;
  --accent-bright: #3ae98c;
  --accent-deep: #059573;
  --accent-ink: #04291a;
  --shadow: 0 26px 70px rgba(9, 46, 31, 0.17);
  --shadow-soft: 0 12px 34px rgba(9, 46, 31, 0.1);
  /* The phone screen's fill. BuhoGO's own canvas colour, so the letterboxed
     slivers above and below a screenshot read as part of the screen. */
  --app-canvas: #faf7ef;
  --phone-body: #171c19;
  --radius-lg: 26px;
  --radius-md: 17px;
  --radius-sm: 11px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* Dark palette. Declared twice on purpose:
   1. behind prefers-color-scheme, so the OS preference still works with no JS;
   2. behind [data-theme="dark"], so an explicit choice from the header toggle
      wins over the OS either way.
   The :not([data-theme="light"]) guard lets an explicit "light" choice beat a
   dark OS. Keep the two blocks in sync. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101413;
    --bg-deep: #090c0b;
    --surface: rgba(28, 34, 31, 0.78);
    --surface-solid: #191e1c;
    --surface-muted: #232a26;
    --text: #eef3ef;
    --text-soft: #a8b3ac;
    --text-faint: #79837c;
    --border: rgba(255, 255, 255, 0.11);
    --border-strong: rgba(255, 255, 255, 0.2);
    --shadow: 0 28px 76px rgba(0, 0, 0, 0.42);
    --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.26);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101413;
  --bg-deep: #090c0b;
  --surface: rgba(28, 34, 31, 0.78);
  --surface-solid: #191e1c;
  --surface-muted: #232a26;
  --text: #eef3ef;
  --text-soft: #a8b3ac;
  --text-faint: #79837c;
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.2);
  --shadow: 0 28px 76px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.26);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(circle at 78% 16%, rgba(21, 222, 114, 0.13), transparent 25rem),
    radial-gradient(circle at 12% 88%, rgba(5, 149, 115, 0.11), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.84' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
  content: "";
  opacity: 0.32;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 72%, transparent);
  outline-offset: 3px;
}

.site-shell {
  display: grid;
  grid-template-rows: 74px minmax(0, 1fr) 86px 42px;
  width: 100%;
  max-width: 1600px;
  height: 100vh;
  height: 100svh;
  margin: 0 auto;
  padding: 0 clamp(20px, 3.1vw, 54px);
  overflow: hidden;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 11px;
  font-size: 17px;
  font-weight: 730;
  letter-spacing: -0.025em;
}

.brand-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  background: #10201f;
  box-shadow: var(--shadow-soft);
}

.brand-icon img {
  width: 31px;
  height: 31px;
  object-fit: cover;
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  box-shadow: 0 8px 28px rgba(9, 46, 31, 0.045);
  backdrop-filter: blur(18px);
}

.primary-nav a {
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
  transition: background 160ms ease, color 160ms ease;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: 0 4px 14px rgba(9, 46, 31, 0.07);
}

.nav-icon,
.swipe-hint {
  display: none;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 14px;
}

/* Hidden until theme.js resolves a theme onto <html>. Without JS the toggle
   cannot work, so it should not be there to click. */
.theme-toggle {
  display: none;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}

:root[data-theme] .theme-toggle {
  display: grid;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Show the mode you would switch *to*, matching the aria-label. */
:root[data-theme="light"] .theme-icon-sun,
:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

.header-source {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
  transition: color 160ms ease;
}

.header-source:hover {
  color: var(--text);
}

.header-source svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.home-main {
  display: grid;
  grid-template-columns: minmax(350px, 1fr) minmax(420px, 0.95fr);
  align-items: center;
  min-height: 0;
  gap: clamp(26px, 4.8vw, 82px);
  padding: clamp(24px, 4.2vh, 58px) 0 clamp(18px, 3vh, 38px);
}

.hero-copy {
  position: relative;
  z-index: 4;
  align-self: center;
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 17px;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow > span {
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.hero-copy h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(44px, 4.1vw, 72px);
  font-weight: 710;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.hero-copy h1 span {
  color: var(--text-soft);
  font-weight: 480;
}

.hero-lede {
  max-width: 550px;
  margin: 23px 0 0;
  color: var(--text-soft);
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 27px;
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.1;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 27px rgba(21, 222, 114, 0.24);
}

.button-primary:hover {
  background: var(--accent-bright);
  box-shadow: 0 14px 32px rgba(21, 222, 114, 0.31);
}

.button-secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
  backdrop-filter: blur(16px);
}

.button-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-solid);
}

#primary-download {
  justify-content: flex-start;
  min-width: 242px;
  padding: 9px 16px 9px 10px;
}

.button-platform {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 9px;
  background: rgba(4, 41, 26, 0.12);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

#primary-download strong,
#primary-download small {
  display: block;
}

#primary-download small {
  margin-top: 4px;
  color: color-mix(in srgb, var(--accent-ink) 72%, transparent);
  font-size: 10px;
  font-weight: 620;
}

.release-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-deep);
  box-shadow: 0 0 0 4px rgba(5, 149, 115, 0.16);
}

/* The four wallet backends, each with its own mark. The logos are supplied by
   four different projects and three of them are dark-on-transparent, so every
   mark sits on a small white tile rather than on the pill itself. That keeps
   all four legible in dark mode without per-logo overrides. */
.backend-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.backend-pills li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.backend-pills img {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  padding: 3px;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
}

.showcase {
  position: relative;
  min-width: 0;
  align-self: stretch;
}

.showcase-glow {
  position: absolute;
  top: 14%;
  right: 5%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(21, 222, 114, 0.19);
  filter: blur(80px);
  opacity: 0.65;
  pointer-events: none;
}

.screenshot-stage {
  position: absolute;
  inset: 1% 0 50px;
  perspective: 1400px;
}

/* A phone rather than a window. The height drives the size and the width
   follows from the 9:19.5 body ratio, so the fan always fits the stage. */
.screen-card {
  position: absolute;
  top: 0;
  left: 50%;
  height: min(100%, 640px);
  width: auto;
  aspect-ratio: 9 / 19.5;
  margin: 0;
  padding: 5px;
  border-radius: 34px;
  background: var(--phone-body);
  box-shadow: var(--shadow);
  cursor: pointer;
  transform-origin: center;
  transition: transform 680ms cubic-bezier(.2, .75, .2, 1), opacity 480ms ease, filter 480ms ease;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 30px;
  background: var(--app-canvas);
}

/* The screenshots are captured without OS chrome and are each a slightly
   different ratio, so `contain` guarantees none is ever cropped. The leftover
   slivers land on the app's own canvas colour. */
.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.phone-camera {
  position: absolute;
  top: 9px;
  left: 50%;
  z-index: 2;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #05090a;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: translateX(-50%);
}

/* Volume rocker and power button. */
.screen-card::before,
.screen-card::after {
  position: absolute;
  right: -2px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #2c332f;
  content: "";
}

.screen-card::before {
  top: 17%;
  height: 5%;
}

.screen-card::after {
  top: 25%;
  height: 9%;
}

.screen-card figcaption {
  position: absolute;
  bottom: -30px;
  left: 50%;
  z-index: 2;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 8px;
  white-space: nowrap;
  letter-spacing: 0.05em;
  transform: translateX(-50%);
  transition: opacity 240ms ease;
}

/* The active phone is already named by .showcase-meta. */
.screen-card[data-position="active"] figcaption {
  opacity: 0;
}

.screen-card[data-position="active"] {
  z-index: 3;
  opacity: 1;
  transform: translateX(-50%) rotate(-1deg) scale(1);
  filter: saturate(1);
}

.screen-card[data-position="next"] {
  z-index: 2;
  opacity: 0.62;
  transform: translateX(28%) rotate(6.5deg) scale(0.85);
  filter: saturate(0.75) brightness(0.82);
}

.screen-card[data-position="previous"] {
  z-index: 1;
  opacity: 0.62;
  transform: translateX(-128%) rotate(-6.5deg) scale(0.85);
  filter: saturate(0.75) brightness(0.82);
}

/* Only reachable if a fourth screenshot is ever added: parked behind
   "previous" so it fades in from where the fan cycles toward. */
.screen-card[data-position="hidden"] {
  z-index: 0;
  opacity: 0;
  transform: translateX(-128%) rotate(-6.5deg) scale(0.85);
  pointer-events: none;
}

.showcase-meta {
  position: absolute;
  right: 2%;
  bottom: 2px;
  left: 2%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.showcase-meta > div:first-child span,
.showcase-meta > div:first-child strong {
  display: block;
}

.showcase-meta > div:first-child span {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.showcase-meta > div:first-child strong {
  margin-top: 2px;
  font-size: 12px;
}

.carousel-controls {
  display: flex;
  gap: 5px;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--border-strong);
  cursor: pointer;
  transition: width 200ms ease, background 200ms ease;
}

.carousel-dot.is-active {
  width: 22px;
  background: var(--accent);
}

.community-strip {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-width: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.community-label span,
.community-label small {
  display: block;
}

.community-label span {
  font-size: 12px;
  font-weight: 760;
}

.community-label small {
  margin-top: 1px;
  color: var(--text-faint);
  font-size: 10px;
}

.contributors-window {
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 7%, black 93%, transparent);
}

.contributors-track {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 8px;
}

.contributors-track.is-looping {
  animation: contributor-loop 32s linear infinite;
}

.contributors-window:hover .contributors-track.is-looping,
.contributors-window:focus-within .contributors-track.is-looping {
  animation-play-state: paused;
}

.contributor {
  display: flex;
  min-width: 156px;
  align-items: center;
  gap: 9px;
  padding: 7px 11px 7px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  transition: border-color 150ms ease, background 150ms ease;
}

.contributor:hover {
  border-color: var(--border-strong);
  background: var(--surface-solid);
}

.contributor img {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  background: var(--surface-muted);
}

.contributor span,
.contributor strong,
.contributor small {
  display: block;
  min-width: 0;
}

.contributor strong {
  max-width: 115px;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contributor small {
  margin-top: 1px;
  color: var(--text-faint);
  font-size: 8px;
}

/* Both rooms are equal citizens: the wallet's About screen links each one. */
.community-links {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.community-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.community-link svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  fill: currentColor;
}

.community-link:hover {
  border-color: var(--border-strong);
  background: var(--surface-solid);
  color: var(--text);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 9px;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  gap: 15px;
}

.site-footer a:hover {
  color: var(--text);
}

@keyframes contributor-loop {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - 4px)); }
}

/* Downloads */
.downloads-shell {
  grid-template-rows: 74px minmax(0, 1fr) 42px;
}

.downloads-main {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-height: 0;
  gap: 14px;
  padding: 20px 0 18px;
  overflow: auto;
  scrollbar-width: thin;
}

.downloads-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 34px;
}

.downloads-intro .eyebrow {
  margin-bottom: 5px;
}

.downloads-intro h1 {
  margin: 0;
  font-size: clamp(30px, 3vw, 47px);
  letter-spacing: -0.05em;
  line-height: 1;
}

.downloads-intro > p {
  max-width: 470px;
  margin: 0 0 2px;
  color: var(--text-soft);
  font-size: 13px;
}

.recommended-card {
  display: grid;
  grid-template-columns: 58px minmax(240px, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 92px;
  padding: 13px 17px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: var(--radius-md);
  background: linear-gradient(100deg, rgba(21, 222, 114, 0.12), color-mix(in srgb, var(--surface) 84%, transparent) 48%);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.recommended-mark {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(21, 222, 114, 0.35);
  border-radius: 14px;
  background: rgba(21, 222, 114, 0.12);
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

:root[data-theme="dark"] .recommended-mark {
  color: var(--accent);
}

.recommended-copy > span,
.panel-heading > div > span {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 720;
  letter-spacing: 0.13em;
}

.recommended-copy h2 {
  margin: 3px 0 2px;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.recommended-copy p {
  margin: 0;
  color: var(--text-soft);
  font-size: 10px;
}

.recommended-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.recommended-actions .button {
  min-height: 43px;
  white-space: nowrap;
}

/* Every way to get BuhoGO, side by side. The APK card is the only one whose
   label depends on the GitHub API, so it is the only one JS rewrites. */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 9px;
}

.channel-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

.channel-card:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: var(--surface-solid);
  transform: translateY(-2px);
}

.channel-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text-soft);
}

/* Google Play and Android ship as solid brand glyphs; the rest are outlines
   drawn to match the nav icons. */
.channel-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.channel-icon svg.icon-stroked {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.channel-copy {
  min-width: 0;
}

.channel-copy strong,
.channel-copy small {
  display: block;
}

.channel-copy strong {
  font-size: 12px;
  font-weight: 730;
  letter-spacing: -0.015em;
}

.channel-copy small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loading-pill,
.count-pill,
.format-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
}

.loading-pill {
  padding: 7px 11px;
}

.release-browser {
  display: grid;
  grid-template-columns: minmax(225px, 0.3fr) minmax(420px, 0.7fr);
  min-height: 260px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
}

.release-index,
.asset-panel {
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr);
  min-height: 0;
}

.release-index {
  border-right: 1px solid var(--border);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}

.panel-heading h2 {
  margin: 2px 0 0;
  font-size: 16px;
  letter-spacing: -0.025em;
}

.count-pill {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
}

.text-link {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.text-link:hover {
  color: var(--text);
}

.is-hidden {
  display: none !important;
}

.release-list,
.asset-list {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

.release-list {
  padding: 7px;
}

.release-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.release-option:hover {
  background: color-mix(in srgb, var(--surface-muted) 62%, transparent);
}

.release-option.is-selected {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  background: rgba(21, 222, 114, 0.1);
}

.release-version {
  font-size: 12px;
  font-weight: 730;
}

.release-meta {
  display: flex;
  align-items: center;
  gap: 7px;
}

.release-meta small {
  color: var(--text-faint);
  font-size: 8px;
}

.release-meta em {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(21, 222, 114, 0.14);
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 7px;
  font-style: normal;
  font-weight: 750;
  text-transform: uppercase;
}

:root[data-theme="dark"] .release-meta em {
  color: var(--accent);
}

.asset-list {
  padding: 8px;
}

.asset-row {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 73px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
}

.asset-row:last-child {
  border-bottom: 0;
}

.asset-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 800;
}

.asset-copy {
  min-width: 0;
}

.asset-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.asset-title-line h3 {
  margin: 0;
  font-size: 11px;
  letter-spacing: -0.01em;
}

.format-pill {
  padding: 2px 6px;
  font-size: 7px;
}

.asset-filename {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-facts {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 8px;
}

.digest-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  font-size: 8px;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
  cursor: pointer;
}

.digest-button:hover {
  color: var(--text);
}

.small-download {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-solid);
  color: var(--text);
  font-size: 9px;
  font-weight: 730;
  transition: border-color 150ms ease, transform 150ms ease;
}

.small-download:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.empty-message {
  margin: 0;
  padding: 28px;
  color: var(--text-soft);
  font-size: 12px;
  text-align: center;
}

.release-skeleton,
.asset-skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface-muted);
}

.release-skeleton::after,
.asset-skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.11), transparent);
  content: "";
  animation: loading 1.3s ease-in-out infinite;
  transform: translateX(-100%);
}

.release-skeleton {
  height: 51px;
  margin-bottom: 6px;
}

.asset-skeleton {
  height: 64px;
  margin-bottom: 8px;
}

@keyframes loading {
  to { transform: translateX(100%); }
}

@media (max-height: 820px) and (min-width: 921px) {
  .site-shell {
    grid-template-rows: 62px minmax(0, 1fr) 72px 34px;
  }

  .home-main {
    padding-top: 18px;
    padding-bottom: 15px;
  }

  .hero-copy h1 {
    font-size: clamp(40px, 3.6vw, 58px);
  }

  .hero-lede {
    margin-top: 17px;
  }

  .hero-actions {
    margin-top: 20px;
  }

  .backend-pills {
    margin-top: 16px;
  }

  .downloads-shell {
    grid-template-rows: 62px minmax(0, 1fr) 34px;
  }

  .downloads-main {
    gap: 10px;
    padding: 12px 0 10px;
  }

  .recommended-card {
    min-height: 78px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .release-index,
  .asset-panel {
    grid-template-rows: 58px minmax(0, 1fr);
  }

  .asset-row {
    min-height: 65px;
    padding-top: 7px;
    padding-bottom: 7px;
  }
}

@media (max-width: 1100px) {
  .home-main {
    grid-template-columns: minmax(300px, 1fr) minmax(320px, 0.85fr);
    gap: 24px;
  }

  .hero-copy h1 {
    font-size: clamp(40px, 4.8vw, 58px);
  }

  .community-strip {
    grid-template-columns: 170px minmax(0, 1fr);
  }

  .community-links {
    display: none;
  }
}

@media (max-width: 920px) {
  body {
    overflow: auto;
  }

  .site-shell,
  .downloads-shell {
    grid-template-rows: 66px auto auto auto;
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .primary-nav {
    position: fixed;
    right: 14px;
    bottom: 14px;
    left: 14px;
    z-index: 50;
    justify-content: space-evenly;
    max-width: calc(100vw - 28px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.18);
  }

  .primary-nav a {
    flex: 1 1 0;
    padding-right: 7px;
    padding-left: 7px;
    text-align: center;
  }

  .header-actions {
    grid-column: 2;
  }

  .home-main {
    grid-template-columns: 1fr;
    gap: 18px;
    min-width: 0;
    padding: 44px 0 20px;
  }

  .hero-copy {
    text-align: center;
  }

  .eyebrow,
  .hero-actions,
  .release-line,
  .backend-pills {
    justify-content: center;
  }

  .hero-lede {
    margin-right: auto;
    margin-left: auto;
  }

  .showcase {
    min-height: 560px;
  }

  .screenshot-stage {
    inset: 0 0 38px;
  }

  .showcase-meta {
    bottom: 0;
  }

  .community-strip {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 0;
  }

  .community-label {
    text-align: center;
  }

  .site-footer {
    min-height: 88px;
    padding: 18px 0 74px;
  }

  .downloads-main {
    gap: 16px;
    padding: 28px 0 20px;
    overflow: visible;
  }

  .downloads-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .recommended-card {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .recommended-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .release-browser {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .release-index {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .release-list {
    display: flex;
    overflow-x: auto;
  }

  .release-option {
    min-width: 190px;
  }

  .asset-list {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 580px) {
  body {
    background:
      radial-gradient(circle at 88% 5%, rgba(21, 222, 114, 0.16), transparent 18rem),
      radial-gradient(circle at 6% 56%, rgba(5, 149, 115, 0.1), transparent 20rem),
      var(--bg);
    overscroll-behavior-y: none;
  }

  .site-shell,
  .downloads-shell {
    width: 100%;
    padding-top: env(safe-area-inset-top, 0px);
    padding-right: 16px;
    padding-left: 16px;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 66px;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
  }

  .brand {
    gap: 10px;
    font-size: 16px;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .brand-icon img {
    width: 34px;
    height: 34px;
  }

  .header-actions {
    gap: 10px;
  }

  .header-source {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
  }

  /* The GitHub link collapses to an icon button here, so match the toggle's box
     to it. Deliberately no `display` here: that stays owned by the
     :root[data-theme] rule so the toggle remains hidden without JS. */
  .theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .header-source span {
    display: none;
  }

  .header-source svg,
  .theme-toggle svg {
    width: 18px;
    height: 18px;
  }

  .primary-nav {
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom, 10px));
    left: 12px;
    max-width: calc(100vw - 24px);
    min-height: 70px;
    gap: 3px;
    padding: 6px;
    border-color: var(--border-strong);
    border-radius: 22px;
    background: color-mix(in srgb, var(--surface-solid) 91%, transparent);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(24px) saturate(1.25);
  }

  .primary-nav a {
    display: flex;
    min-width: 0;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    padding: 5px 3px;
    border-radius: 17px;
    font-size: 9px;
    letter-spacing: 0.01em;
  }

  .primary-nav a:hover,
  .primary-nav a[aria-current="page"] {
    background: rgba(21, 222, 114, 0.14);
    color: var(--text);
    box-shadow: none;
  }

  .nav-icon {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
  }

  .nav-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .primary-nav a[aria-current="page"] .nav-icon {
    color: var(--accent-deep);
  }

  :root[data-theme="dark"] .primary-nav a[aria-current="page"] .nav-icon {
    color: var(--accent);
  }

  .home-main {
    gap: 28px;
    padding: 28px 0 24px;
  }

  .hero-copy {
    width: 100%;
    text-align: center;
  }

  .eyebrow {
    justify-content: center;
    margin-bottom: 15px;
    font-size: 8px;
    letter-spacing: 0.12em;
  }

  .hero-copy h1 {
    max-width: 100%;
    font-size: clamp(38px, 11.4vw, 50px);
    letter-spacing: -0.065em;
    line-height: 0.99;
  }

  .hero-copy h1 span {
    display: block;
    margin-top: 4px;
  }

  .hero-lede {
    max-width: 355px;
    margin-top: 19px;
    font-size: 14px;
    line-height: 1.58;
  }

  .hero-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
    margin-top: 24px;
  }

  #primary-download,
  .hero-actions .button-secondary {
    width: 100%;
    min-width: 0;
    border-radius: 17px;
  }

  #primary-download {
    min-height: 61px;
    padding: 10px 15px 10px 10px;
  }

  .hero-actions .button-secondary {
    min-height: 51px;
  }

  .button-platform {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 12px;
  }

  .release-line {
    justify-content: center;
    margin-top: 14px;
    font-size: 9px;
  }

  .backend-pills {
    width: 100%;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
  }

  .backend-pills li {
    padding: 4px 9px 4px 4px;
    font-size: 9px;
  }

  .backend-pills img {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .showcase {
    width: 100%;
    min-height: 520px;
    overflow: hidden;
  }

  .showcase-glow {
    top: 6%;
    right: 10%;
    width: 80%;
    opacity: 0.52;
    filter: blur(54px);
  }

  .screenshot-stage {
    inset: 0 0 44px;
    overflow: hidden;
    perspective: none;
    touch-action: pan-y pinch-zoom;
  }

  /* One phone at a time, sliding. The fan needs more width than a phone
     screen has. */
  .screen-card {
    height: min(100%, 470px);
    transition: transform 430ms cubic-bezier(.2, .75, .2, 1), opacity 300ms ease;
    filter: none;
  }

  .screen-card[data-position="active"] {
    z-index: 3;
    opacity: 1;
    transform: translateX(-50%) rotate(0deg) scale(1);
  }

  .screen-card[data-position="next"] {
    z-index: 2;
    opacity: 0;
    transform: translateX(90%) rotate(0deg) scale(1);
    filter: none;
  }

  .screen-card[data-position="previous"] {
    z-index: 1;
    opacity: 0;
    transform: translateX(-190%) rotate(0deg) scale(1);
    filter: none;
  }

  .screen-card[data-position="hidden"] {
    z-index: 0;
    opacity: 0;
    transform: translateX(-190%) scale(1);
    pointer-events: none;
  }

  .screen-card figcaption {
    display: none;
  }

  .showcase-meta {
    right: 0;
    bottom: 1px;
    left: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .showcase-meta > div:first-child {
    display: block;
    text-align: left;
  }

  .carousel-controls {
    justify-self: center;
  }

  .swipe-hint {
    display: block;
    justify-self: end;
    color: var(--text-faint);
    font-family: var(--mono);
    font-size: 7px;
  }

  .community-strip {
    gap: 15px;
    margin-top: 2px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    box-shadow: var(--shadow-soft);
  }

  .community-label {
    text-align: left;
  }

  .community-label span {
    font-size: 15px;
  }

  .community-label small {
    font-size: 10px;
  }

  .contributors-window {
    margin-right: -18px;
    overflow-x: auto;
    mask-image: none;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
  }

  .contributors-window::-webkit-scrollbar {
    display: none;
  }

  .contributors-track,
  .contributors-track.is-looping {
    gap: 8px;
    padding-right: 18px;
    animation: none;
  }

  .contributor {
    min-width: 164px;
    min-height: 54px;
    padding: 8px 12px 8px 8px;
    scroll-snap-align: start;
  }

  .contributor img {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .contributor strong {
    font-size: 11px;
  }

  .contributor small {
    font-size: 9px;
  }

  .community-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .community-link {
    min-height: 47px;
    justify-content: center;
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
    border-radius: 14px;
    background: rgba(21, 222, 114, 0.1);
    color: var(--text);
    font-size: 11px;
  }

  .site-footer {
    min-height: 112px;
    align-items: center;
    justify-content: center;
    padding: 22px 0 calc(92px + env(safe-area-inset-bottom, 0px));
    text-align: center;
  }

  .home-page .site-footer nav {
    display: none;
  }

  .downloads-main {
    gap: 17px;
    padding: 25px 0 calc(98px + env(safe-area-inset-bottom, 0px));
  }

  .downloads-intro {
    gap: 10px;
  }

  .downloads-intro .eyebrow {
    justify-content: flex-start;
    margin-bottom: 7px;
  }

  .downloads-intro h1 {
    font-size: clamp(36px, 10.8vw, 46px);
  }

  .downloads-intro > p {
    font-size: 13px;
    line-height: 1.55;
  }

  .recommended-card {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 14px;
    padding: 17px;
    border-radius: 21px;
    text-align: left;
  }

  .recommended-mark {
    width: 52px;
    height: 52px;
    margin: 0;
    border-radius: 15px;
  }

  .recommended-copy h2 {
    margin-top: 4px;
    font-size: 19px;
  }

  .recommended-copy p {
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.45;
  }

  .recommended-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .recommended-actions .button {
    width: 100%;
    min-height: 51px;
    border-radius: 15px;
  }

  .channel-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .channel-card {
    min-height: 66px;
    border-radius: 17px;
  }

  .release-browser {
    display: block;
    min-height: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .release-index {
    display: grid;
    grid-template-rows: auto auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    box-shadow: var(--shadow-soft);
  }

  .panel-heading {
    min-height: 65px;
    padding: 14px 16px;
  }

  .panel-heading h2 {
    font-size: 17px;
  }

  .release-list {
    display: flex;
    gap: 7px;
    padding: 9px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
  }

  .release-list::-webkit-scrollbar {
    display: none;
  }

  .release-option {
    min-width: 154px;
    min-height: 68px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    padding: 11px 12px;
    border-color: var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
    scroll-snap-align: start;
  }

  .release-option.is-selected {
    border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
    background: rgba(21, 222, 114, 0.12);
  }

  .release-version {
    font-size: 14px;
  }

  .release-meta {
    width: 100%;
    justify-content: space-between;
  }

  .asset-panel {
    display: grid;
    grid-template-rows: auto auto;
    margin-top: 17px;
  }

  .asset-heading {
    min-height: 62px;
    padding: 10px 2px;
    border-bottom: 0;
  }

  .asset-heading .text-link {
    font-size: 10px;
  }

  .asset-list {
    display: grid;
    gap: 10px;
    max-height: none;
    padding: 0;
    overflow: visible;
  }

  .asset-row {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    box-shadow: 0 8px 25px rgba(9, 46, 31, 0.06);
  }

  .asset-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .asset-title-line {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .asset-title-line h3 {
    font-size: 13px;
  }

  .asset-filename {
    margin-top: 5px;
    font-size: 8px;
  }

  .asset-facts {
    margin-top: 7px;
    font-size: 9px;
  }

  .digest-button {
    min-height: 22px;
    font-size: 9px;
  }

  .small-download {
    grid-column: 1 / -1;
    display: flex;
    min-height: 47px;
    align-items: center;
    justify-content: center;
    border-color: transparent;
    border-radius: 14px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 11px;
    text-align: center;
  }

  .downloads-page .site-footer {
    min-height: 106px;
    justify-content: center;
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }

  .downloads-page .site-footer nav {
    display: none;
  }
}

@media (max-width: 370px) {
  .site-shell,
  .downloads-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .hero-copy h1 {
    font-size: 36px;
  }

  .hero-lede {
    font-size: 13px;
  }

  .backend-pills li:last-child {
    display: none;
  }

  .showcase {
    min-height: 470px;
  }

  .screen-card {
    height: min(100%, 420px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
