/* 1svc.io: the Banana apps' own palettes (packages/themes/src/palettes.ts in
   Banana Messenger, dark mode), with everything rounder and the panels made
   of frosted glass. Classic Banana Dark by default; the flavor bubbles set
   data-theme on <html>. Unprefixed CSS, no build step. */

@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url('/fonts/fredoka.woff2') format('woff2');
}

:root {
  --bg: #181818;
  --raised: #282828;
  --text: #f0f0f0;
  --primary: #ffe200;
  --primary-dark: #e6b800;
  --on-primary: #181818;
  --secondary: #bd8745;
  --link: #00ff77;

  --muted: color-mix(in srgb, var(--text) 68%, var(--bg));
  --line: color-mix(in srgb, var(--text) 12%, var(--bg));
  --soft: color-mix(in srgb, var(--primary) 14%, var(--bg));
  --round: 'Fredoka', ui-rounded, 'SF Pro Rounded', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, Ubuntu, sans-serif;
  --width: 1040px;
  --squish: cubic-bezier(0.34, 1.56, 0.64, 1);
  --tween: 0.45s cubic-bezier(0.22, 1, 0.36, 1);

  /* Frosted glass: a see-through tint, a blur of what's behind it, a bright
     rim and a sheen across the top left corner. */
  --glass: color-mix(in srgb, var(--raised) 46%, transparent);
  --glass-thick: color-mix(in srgb, var(--raised) 60%, transparent);
  --glass-thin: color-mix(in srgb, var(--raised) 24%, transparent);
  --glass-rim: color-mix(in srgb, var(--text) 16%, transparent);
  --frost: blur(22px) saturate(1.6);
  /* How far out of focus the bubbles behind the page are. */
  --bg-blur: 16px;
  --sheen: linear-gradient(
    135deg,
    rgb(255 255 255 / 0.09),
    rgb(255 255 255 / 0.02) 34%,
    transparent 58%
  );
  color-scheme: dark;
}

[data-theme='split'] {
  --bg: #21161a;
  --raised: #342429;
  --text: #fff0f5;
  --primary: #ff80aa;
  --primary-dark: #e65a8c;
  --on-primary: #21161a;
  --secondary: #ffe28c;
  --link: #8cdcff;
}
[data-theme='jungle'] {
  --bg: #0e1c14;
  --raised: #182c20;
  --text: #e6f5e8;
  --primary: #8ce65a;
  --primary-dark: #5abe3c;
  --on-primary: #0e1c14;
  --secondary: #ffd60a;
  --link: #78dcff;
}
[data-theme='bluejava'] {
  --bg: #101424;
  --raised: #1c223a;
  --text: #e6ecff;
  --primary: #78b4ff;
  --primary-dark: #508ce6;
  --on-primary: #101424;
  --secondary: #ffdc5a;
  --link: #96ffdc;
}
[data-theme='sunset'] {
  --bg: #20121e;
  --raised: #341c2e;
  --text: #ffece1;
  --primary: #ff963c;
  --primary-dark: #f0643c;
  --on-primary: #20121e;
  --secondary: #ff5aa0;
  --link: #ffdc64;
}
[data-theme='plantain'] {
  --bg: #120020;
  --raised: #230a37;
  --text: #ebe4ff;
  --primary: #9b7de8;
  --primary-dark: #785ac8;
  --on-primary: #120020;
  --secondary: #ffd700;
  --link: #78dcc8;
}
[data-theme='matcha'] {
  --bg: #141e16;
  --raised: #202e24;
  --text: #e8f5ea;
  --primary: #7ec99a;
  --primary-dark: #509b64;
  --on-primary: #141e16;
  --secondary: #f5e6c8;
  --link: #96dcff;
}
[data-theme='foster'] {
  --bg: #1a1000;
  --raised: #2c1c08;
  --text: #fff0d2;
  --primary: #c8750a;
  --primary-dark: #a55505;
  --on-primary: #1a1000;
  --secondary: #ffdc78;
  --link: #ffaa50;
}
[data-theme='cotton'] {
  --bg: #1a0c20;
  --raised: #2c1636;
  --text: #f8f0ff;
  --primary: #dca0f0;
  --primary-dark: #b978d2;
  --on-primary: #1a0c20;
  --secondary: #a0f0d8;
  --link: #78c8ff;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--ui);
  overflow-x: hidden;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--round);
  font-weight: 700;
  line-height: 1.1;
  text-wrap: balance;
}

p,
ul {
  margin: 0;
}
ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--link);
}

:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
  border-radius: 12px;
}

.hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 20;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}
.skip:focus {
  top: 12px;
}

/* ---------- Behind everything: a wash of the theme's colors and floating
   bubbles, both a little out of focus, as if seen through frosted glass ---------- */

.bubbles {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(
      60% 55% at 8% 0%,
      color-mix(in srgb, var(--primary) 15%, transparent),
      transparent 70%
    ),
    radial-gradient(
      50% 50% at 100% 35%,
      color-mix(in srgb, var(--secondary) 13%, transparent),
      transparent 70%
    ),
    radial-gradient(
      55% 50% at 30% 100%,
      color-mix(in srgb, var(--link) 9%, transparent),
      transparent 70%
    );
}
.bubbles span {
  position: absolute;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgb(255 255 255 / 0.2), transparent 22%),
    radial-gradient(
      circle at 34% 30%,
      color-mix(in srgb, var(--c) 44%, transparent),
      color-mix(in srgb, var(--c) 14%, transparent) 62%,
      transparent 72%
    );
  /* On each bubble, not on the whole layer, so the blur is drawn once and
     only moved after that. */
  filter: blur(var(--bg-blur));
  /* Parallax. site.js keeps --sy (how far the page is scrolled) and --mx and
     --my (where the cursor is, -1 to 1) on .bubbles; --d is how near this
     bubble is, so near ones drift further. It's `translate`, which adds to
     the `transform` the float animation is using. */
  translate: calc(var(--mx, 0) * var(--d, 0.5) * -10px)
    calc(var(--sy, 0) * var(--d, 0.5) * -0.07px + var(--my, 0) * var(--d, 0.5) * -10px);
  animation: float var(--t, 22s) ease-in-out infinite alternate;
}
.bubbles span:nth-child(1) {
  --c: var(--primary);
  --s: 400px;
  --d: 1;
  left: -130px;
  top: 40px;
}
.bubbles span:nth-child(2) {
  --c: var(--secondary);
  --t: 27s;
  --s: 280px;
  --d: 0.8;
  right: -80px;
  top: 200px;
}
.bubbles span:nth-child(3) {
  --c: var(--link);
  --t: 19s;
  --s: 120px;
  --d: 0.5;
  left: 12%;
  top: 60%;
}
.bubbles span:nth-child(4) {
  --c: var(--primary);
  --t: 31s;
  --s: 210px;
  --d: 0.7;
  right: 9%;
  top: 68%;
}
.bubbles span:nth-child(5) {
  --c: var(--secondary);
  --t: 24s;
  --s: 72px;
  --d: 0.35;
  left: 4%;
  top: 86%;
}
.bubbles span:nth-child(6) {
  --c: var(--link);
  --t: 29s;
  --s: 48px;
  --d: 0.25;
  right: 24%;
  top: 11%;
}
.bubbles span:nth-child(7) {
  --c: var(--primary);
  --t: 17s;
  --s: 34px;
  --d: 0.2;
  left: 27%;
  top: 17%;
}
.bubbles span:nth-child(8) {
  --c: var(--secondary);
  --t: 21s;
  --s: 90px;
  --d: 0.4;
  left: 46%;
  top: 90%;
}

@keyframes float {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(22px, -48px, 0) scale(1.08);
  }
}

/* ---------- Top bar ---------- */

.top {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(var(--width), calc(100% - 24px));
  margin: 12px auto 0;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--glass-rim);
  border-radius: 999px;
  background: var(--sheen), var(--glass-thick);
  backdrop-filter: var(--frost);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.12),
    0 10px 30px rgb(0 0 0 / 0.28);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font: 700 22px var(--round);
  text-decoration: none;
}
.brand img {
  width: 40px;
  height: 40px;
  transition: transform 0.4s var(--squish);
}
.brand:hover img {
  transform: rotate(-14deg) scale(1.12);
}
.top nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.top nav a {
  padding: 7px 16px;
  border-radius: 999px;
  color: var(--muted);
  font: 600 16px var(--round);
  text-decoration: none;
}
.top nav a:hover {
  background: var(--soft);
  color: var(--text);
}

/* ---------- Hero ---------- */

.hero {
  width: min(var(--width), calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 28px;
  text-align: center;
}
/* The banana, sitting in a glossy bubble. */
.halo {
  position: relative;
  display: grid;
  place-items: center;
  width: 196px;
  height: 196px;
  margin: 0 auto 26px;
  border: 2px solid color-mix(in srgb, var(--primary) 40%, transparent);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 22%, rgb(255 255 255 / 0.3), transparent 20%),
    radial-gradient(
      circle at 50% 40%,
      color-mix(in srgb, var(--primary) 30%, var(--bg)),
      color-mix(in srgb, var(--primary) 8%, var(--bg)) 75%
    );
  box-shadow:
    inset 0 -14px 26px rgb(0 0 0 / 0.22),
    0 24px 50px color-mix(in srgb, var(--primary) 20%, transparent);
  animation: bob 5s ease-in-out infinite alternate;
}
.halo img {
  width: 168px;
  height: 168px;
  filter: drop-shadow(0 10px 12px rgb(0 0 0 / 0.35));
}
@keyframes bob {
  to {
    transform: translateY(-10px) rotate(-3deg);
  }
}
.hero h1 {
  max-width: 14ch;
  margin: 0 auto;
  font-size: clamp(42px, 7.4vw, 80px);
  letter-spacing: -0.01em;
}
.pop {
  color: var(--primary);
}
.lede {
  max-width: 54ch;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 21px);
  text-wrap: pretty;
}

/* ---------- Sections ---------- */

.section {
  width: min(var(--width), calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0;
}

/* ---------- App cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.card {
  --c: var(--primary);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 1px solid var(--glass-rim);
  border-radius: 40px;
  background-color: var(--glass);
  background-image: var(--sheen);
  backdrop-filter: var(--frost);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.12),
    0 18px 40px rgb(0 0 0 / 0.24),
    0 0 0 0 transparent;
  transition:
    transform var(--tween),
    background-color var(--tween),
    border-color var(--tween),
    box-shadow var(--tween);
}
.card[data-app='wow'] {
  --c: var(--secondary);
}
.card[data-app='torrent'] {
  --c: var(--link);
}
.card:not(.soon):hover {
  transform: translateY(-6px) rotate(-0.5deg);
  border-color: color-mix(in srgb, var(--c) 55%, var(--glass-rim));
  background-color: color-mix(in srgb, var(--c) 8%, var(--glass));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.18),
    0 28px 54px rgb(0 0 0 / 0.32),
    0 0 0 8px color-mix(in srgb, var(--c) 10%, transparent);
}
.card:nth-child(even):not(.soon):hover {
  transform: translateY(-6px) rotate(0.5deg);
}
.card.soon {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--c) 40%, var(--glass-rim));
  background-color: var(--glass-thin);
  box-shadow: none;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 18px 18px;
}
.app-icon {
  width: 76px;
  height: 76px;
  margin: -34px 0 12px;
  position: relative;
  filter: drop-shadow(0 10px 14px rgb(0 0 0 / 0.4));
  transition: transform 0.4s var(--squish);
}
.card:hover .app-icon {
  transform: rotate(-6deg) scale(1.08);
}
.card[data-app='wow'] .app-icon {
  border-radius: 18px;
}
/* The sound app has no icon yet: a note in a bubble stands in. */
.app-icon.note {
  display: grid;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
  border-radius: 24px;
  background: radial-gradient(
    circle at 30% 22%,
    color-mix(in srgb, var(--c) 46%, var(--bg)),
    color-mix(in srgb, var(--c) 16%, var(--bg)) 72%
  );
  color: var(--c);
}
.host {
  color: var(--c);
  font: 600 15px var(--round);
  letter-spacing: 0.02em;
}
.card h3 {
  margin-top: 2px;
  font-size: 30px;
}
.about {
  margin-top: 10px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  text-wrap: pretty;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0 22px;
}
.tags li {
  padding: 4px 12px;
  border: 1px solid color-mix(in srgb, var(--c) 26%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 9%, transparent);
  color: color-mix(in srgb, var(--text) 86%, var(--c));
  font-size: 13.5px;
  font-weight: 600;
}

/* The button, as wide as the card. Only the button is the link: the card
   around it lifts on hover but isn't clickable. */
.go {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  gap: 8px;
  margin-top: auto;
  padding: 13px 22px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 82%, #000));
  color: var(--on-primary);
  font: 600 18px var(--round);
  text-decoration: none;
  box-shadow:
    inset 0 2px 0 rgb(255 255 255 / 0.45),
    inset 0 -3px 0 rgb(0 0 0 / 0.14),
    0 5px 0 color-mix(in srgb, var(--c) 45%, #000),
    0 14px 26px color-mix(in srgb, var(--c) 22%, transparent);
  transition:
    transform 0.25s var(--squish),
    filter 0.25s ease,
    box-shadow 0.25s ease;
}
/* A streak of light that crosses the button when the pointer arrives. It
   snaps back unseen when the pointer leaves. */
.go::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 36%, rgb(255 255 255 / 0.5) 50%, transparent 64%);
  transform: translateX(-110%);
  pointer-events: none;
}
.go svg {
  transition: transform 0.3s var(--squish);
}
.go:hover {
  transform: translateY(-3px);
  filter: brightness(1.1) saturate(1.1);
  box-shadow:
    inset 0 2px 0 rgb(255 255 255 / 0.55),
    inset 0 -3px 0 rgb(0 0 0 / 0.14),
    0 8px 0 color-mix(in srgb, var(--c) 45%, #000),
    0 20px 36px color-mix(in srgb, var(--c) 40%, transparent);
}
.go:hover::after {
  transform: translateX(110%);
  transition: transform 0.7s ease;
}
.go:hover svg {
  transform: translateX(5px);
}
.go:active {
  transform: translateY(4px);
  filter: brightness(0.97);
  box-shadow:
    inset 0 2px 0 rgb(255 255 255 / 0.45),
    inset 0 -3px 0 rgb(0 0 0 / 0.14),
    0 1px 0 color-mix(in srgb, var(--c) 45%, #000),
    0 6px 12px color-mix(in srgb, var(--c) 18%, transparent);
  transition-duration: 0.08s;
}
.go:focus-visible {
  outline-offset: 5px;
}
.badge {
  align-self: stretch;
  margin-top: auto;
  padding: 12px 22px;
  text-align: center;
  border: 2px dashed color-mix(in srgb, var(--c) 60%, transparent);
  border-radius: 999px;
  color: var(--c);
  font: 600 18px var(--round);
}

/* ---------- The little scene on top of each card ----------
   The app icon overlaps a scene's bottom left corner, so scenes keep their
   last 30px clear. */

.scene {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 180px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
  border-radius: 30px;
  background:
    radial-gradient(
      120% 110% at 18% 0%,
      color-mix(in srgb, var(--c) 24%, transparent),
      color-mix(in srgb, var(--c) 5%, transparent) 72%
    ),
    color-mix(in srgb, var(--bg) 58%, transparent);
  box-shadow: inset 0 2px 10px rgb(0 0 0 / 0.22);
}
.scene b,
.scene em,
.scene i {
  font: inherit;
}

/* Messenger: a chat. */
.chat {
  gap: 8px;
  padding: 0 22px 30px;
}
.bubble {
  padding: 7px 15px;
  font: 500 15.5px var(--round);
  box-shadow: 0 4px 10px rgb(0 0 0 / 0.18);
  animation: pop 0.5s var(--squish) backwards;
}
.bubble.in {
  align-self: flex-start;
  border-radius: 18px 18px 18px 6px;
  background: var(--raised);
  color: var(--text);
}
.bubble.out {
  align-self: flex-end;
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 84%, #000));
  color: var(--on-primary);
  animation-delay: 0.25s;
}
.bubble.dots {
  display: flex;
  gap: 5px;
  padding: 13px 15px;
  animation-delay: 0.5s;
}
.dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: hop 1.2s ease-in-out infinite;
}
.dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}
@keyframes hop {
  0%,
  60%,
  100% {
    transform: none;
  }
  30% {
    transform: translateY(-5px);
  }
}

/* WoW: a damage meter. */
.meter {
  gap: 7px;
  padding: 0 20px 30px;
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: var(--w);
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--k), color-mix(in srgb, var(--k) 78%, #000));
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 0.35);
  color: var(--on-primary);
  font: 600 13px var(--round);
  white-space: nowrap;
  animation: tick var(--t) ease-in-out infinite alternate;
}
.bar:nth-child(1) {
  --w: 100%;
  --k: var(--primary);
  --t: 2.6s;
}
.bar:nth-child(2) {
  --w: 86%;
  --k: var(--secondary);
  --t: 3.4s;
}
.bar:nth-child(3) {
  --w: 68%;
  --k: var(--link);
  --t: 2.2s;
}
.bar:nth-child(4) {
  --w: 46%;
  --k: color-mix(in srgb, var(--primary) 50%, var(--link));
  --t: 3s;
}
.bar em {
  opacity: 0.75;
}
@keyframes tick {
  to {
    width: calc(var(--w) - 7%);
  }
}

/* Torrent: downloads filling up. */
.loads {
  gap: 14px;
  padding: 0 22px 30px;
}
.load {
  display: flex;
  align-items: center;
  gap: 12px;
}
.load i {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--k), color-mix(in srgb, var(--k) 78%, #000));
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 0.4);
}
.load i::before {
  content: '';
  margin-left: 3px;
  border: 6px solid transparent;
  border-left: 10px solid var(--on-primary);
  border-right: 0;
}
.track {
  flex: 1;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 12%, var(--bg));
  box-shadow: inset 0 2px 3px rgb(0 0 0 / 0.3);
}
.track b {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--k), color-mix(in srgb, var(--k) 78%, #000));
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 0.4);
  transform-origin: left;
  animation: fill var(--t) cubic-bezier(0.4, 0, 0.3, 1) infinite;
}
.load:nth-child(1) {
  --k: var(--link);
}
.load:nth-child(1) b {
  animation: none;
}
.load:nth-child(2) {
  --k: var(--primary);
  --t: 7s;
}
.load:nth-child(3) {
  --k: var(--secondary);
  --t: 11s;
}
@keyframes fill {
  from {
    transform: translateX(-96%);
  }
  80%,
  to {
    transform: none;
  }
}

/* Sound Creator: a piano roll. Twelve rows fill the scene, one for each note
   of an octave, top (B) to bottom (C). */
.roll {
  --row: 15px;
  flex-direction: row;
  justify-content: flex-start;
}
.keys {
  flex: none;
  width: 40px;
  background:
    repeating-linear-gradient(rgb(0 0 0 / 0.28) 0 1px, transparent 1px var(--row)),
    linear-gradient(
      #f4f1e8 calc(var(--row) * 0) calc(var(--row) * 1),
      #2a2a2a calc(var(--row) * 1) calc(var(--row) * 2),
      #f4f1e8 calc(var(--row) * 2) calc(var(--row) * 3),
      #2a2a2a calc(var(--row) * 3) calc(var(--row) * 4),
      #f4f1e8 calc(var(--row) * 4) calc(var(--row) * 5),
      #2a2a2a calc(var(--row) * 5) calc(var(--row) * 6),
      #f4f1e8 calc(var(--row) * 6) calc(var(--row) * 7),
      #f4f1e8 calc(var(--row) * 7) calc(var(--row) * 8),
      #2a2a2a calc(var(--row) * 8) calc(var(--row) * 9),
      #f4f1e8 calc(var(--row) * 9) calc(var(--row) * 10),
      #2a2a2a calc(var(--row) * 10) calc(var(--row) * 11),
      #f4f1e8 calc(var(--row) * 11) calc(var(--row) * 12)
    );
  box-shadow: inset -4px 0 6px rgb(0 0 0 / 0.25);
}
.grid {
  position: relative;
  flex: 1;
  background:
    repeating-linear-gradient(
      90deg,
      color-mix(in srgb, var(--text) 9%, transparent) 0 1px,
      transparent 1px 12.5%
    ),
    repeating-linear-gradient(
      color-mix(in srgb, var(--text) 5%, transparent) 0 1px,
      transparent 1px var(--row)
    );
}
.grid i {
  position: absolute;
  left: var(--x);
  top: calc(var(--y) * var(--row) + 1px);
  width: var(--w);
  height: calc(var(--row) - 2px);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--k), color-mix(in srgb, var(--k) 78%, #000));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4);
}
.grid i:nth-child(1) {
  --y: 8;
  --x: 4%;
  --w: 13%;
  --k: var(--primary);
}
.grid i:nth-child(2) {
  --y: 6;
  --x: 17.5%;
  --w: 9%;
  --k: var(--primary);
}
.grid i:nth-child(3) {
  --y: 4;
  --x: 27%;
  --w: 14%;
  --k: var(--primary);
}
.grid i:nth-child(4) {
  --y: 6;
  --x: 42%;
  --w: 8%;
  --k: var(--primary);
}
.grid i:nth-child(5) {
  --y: 3;
  --x: 52%;
  --w: 15%;
  --k: var(--link);
}
.grid i:nth-child(6) {
  --y: 1;
  --x: 67.5%;
  --w: 9%;
  --k: var(--link);
}
.grid i:nth-child(7) {
  --y: 3;
  --x: 77%;
  --w: 8%;
  --k: var(--link);
}
.grid i:nth-child(8) {
  --y: 4;
  --x: 85.5%;
  --w: 11%;
  --k: var(--link);
}
.grid i:nth-child(9) {
  --y: 10;
  --x: 15%;
  --w: 33%;
  --k: var(--secondary);
}
.grid i:nth-child(10) {
  --y: 9;
  --x: 52%;
  --w: 44%;
  --k: var(--secondary);
}
/* The playhead. */
.grid b {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--text);
  box-shadow: 0 0 12px var(--text);
  animation: play 6s linear infinite;
}
@keyframes play {
  to {
    left: 100%;
  }
}

/* ---------- Flavors ---------- */

.flavor-card {
  padding: 48px 28px 44px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--glass-rim));
  border-radius: 44px;
  background:
    radial-gradient(
      120% 90% at 50% 0%,
      color-mix(in srgb, var(--primary) 16%, transparent),
      transparent 70%
    ),
    var(--glass);
  backdrop-filter: var(--frost);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.12),
    0 18px 40px rgb(0 0 0 / 0.24);
  text-align: center;
}
.flavor-card h2 {
  font-size: clamp(32px, 4.6vw, 48px);
}
.sub {
  max-width: 46ch;
  margin: 12px auto 0;
  color: var(--muted);
  text-wrap: pretty;
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px 10px;
  max-width: 760px;
  margin: 34px auto 0;
}
.swatches button {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 132px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 15px/1.2 var(--round);
  cursor: pointer;
}
/* A glossy ball in the theme's main color, with its second color orbiting. */
.swatches button::before {
  content: '';
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgb(255 255 255 / 0.75), transparent 24%),
    radial-gradient(circle at 80% 82%, var(--dot2) 0 22%, transparent 23%), var(--dot);
  box-shadow:
    inset 0 -8px 12px rgb(0 0 0 / 0.22),
    0 8px 18px color-mix(in srgb, var(--dot) 30%, transparent);
  outline: 3px solid transparent;
  outline-offset: 5px;
  transition:
    transform 0.4s var(--squish),
    outline-color 0.2s ease;
}
.swatches button:hover {
  color: var(--text);
}
.swatches button:hover::before {
  transform: translateY(-4px) scale(1.1);
}
.swatches button:active::before {
  transform: scale(0.92);
}
.swatches button[aria-pressed='true'] {
  color: var(--text);
  font-weight: 600;
}
.swatches button[aria-pressed='true']::before {
  outline-color: var(--dot);
}
.swatches button:focus-visible {
  outline-offset: 6px;
  border-radius: 20px;
}
[data-pick='classic'] {
  --dot: #ffe200;
  --dot2: #bd8745;
}
[data-pick='split'] {
  --dot: #ff80aa;
  --dot2: #ffe28c;
}
[data-pick='jungle'] {
  --dot: #8ce65a;
  --dot2: #ffd60a;
}
[data-pick='bluejava'] {
  --dot: #78b4ff;
  --dot2: #ffdc5a;
}
[data-pick='sunset'] {
  --dot: #ff963c;
  --dot2: #ff5aa0;
}
[data-pick='plantain'] {
  --dot: #9b7de8;
  --dot2: #ffd700;
}
[data-pick='matcha'] {
  --dot: #7ec99a;
  --dot2: #f5e6c8;
}
[data-pick='foster'] {
  --dot: #c8750a;
  --dot2: #ffdc78;
}
[data-pick='cotton'] {
  --dot: #dca0f0;
  --dot2: #a0f0d8;
}

/* ---------- Footer ---------- */

.foot {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(var(--width), calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 56px;
  color: var(--muted);
  font-size: 14.5px;
  text-align: center;
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.foot a {
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--muted);
  font: 500 15.5px var(--round);
  text-decoration: none;
}
.foot a:hover {
  background: var(--soft);
  color: var(--text);
}

/* ---------- Small screens ---------- */

@media (max-width: 800px) {
  .cards {
    grid-template-columns: 1fr;
  }
  .hero {
    padding-top: 40px;
  }
  .section {
    padding: 32px 0;
  }
  .card {
    border-radius: 34px;
  }
  .scene {
    border-radius: 25px;
  }
  .flavor-card {
    padding: 38px 16px 34px;
    border-radius: 34px;
  }
}

@media (max-width: 480px) {
  .halo {
    width: 156px;
    height: 156px;
  }
  .halo img {
    width: 132px;
    height: 132px;
  }
  .card h3 {
    font-size: 27px;
  }
  .swatches {
    gap: 20px 2px;
  }
  .swatches button {
    width: 104px;
    font-size: 14px;
  }
  .swatches button::before {
    width: 56px;
    height: 56px;
  }
}

/* No blur behind (older browsers), or the person asked for less see-through:
   the glass turns nearly solid, so text never sits on a busy background. */
@supports not (backdrop-filter: blur(1px)) {
  :root {
    --glass: color-mix(in srgb, var(--raised) 94%, transparent);
    --glass-thick: color-mix(in srgb, var(--raised) 96%, transparent);
    --glass-thin: color-mix(in srgb, var(--raised) 70%, transparent);
  }
}
@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass: var(--raised);
    --glass-thick: var(--raised);
    --glass-thin: color-mix(in srgb, var(--raised) 70%, var(--bg));
    --frost: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  /* A hovered card stays where it is and only its colors fade. */
  .card:not(.soon):hover,
  .card:nth-child(even):not(.soon):hover {
    transform: none;
  }
  .card {
    transition:
      background-color 0.2s ease,
      border-color 0.2s ease,
      box-shadow 0.2s ease !important;
  }
}
