:root {
  --bg: #122126;
  --ink: #f6f1e7;
  --muted: #b7c4bc;
  --accent: #f0a05a;
  --card: #1c3036;
  --line: rgba(255, 255, 255, 0.16);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: "Be Vietnam Pro", "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(920px 520px at 8% -12%, rgba(240, 160, 90, 0.2), transparent 56%),
    radial-gradient(760px 480px at 112% 0%, rgba(46, 196, 182, 0.18), transparent 52%),
    radial-gradient(680px 420px at 50% 120%, rgba(70, 110, 220, 0.16), transparent 48%),
    var(--bg);
}

button, strong, p, h1, h2, h3, a { font: inherit; }

a { color: inherit; }

button {
  cursor: pointer;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

button:disabled {
  cursor: default;
  opacity: 0.38;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.app {
  width: min(860px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 4px 8px 8px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.logo {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50% 50% 50% 12px;
  transform: rotate(-35deg);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.8), transparent 28%),
    linear-gradient(160deg, #7af0df, #2aa7ff 55%, #3a5bff);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28), 0 8px 18px rgba(0, 0, 0, 0.25);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav strong {
  min-width: 4.5rem;
  text-align: center;
  font-weight: 700;
}

.nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  line-height: 1;
}

.nav button .icon {
  width: 18px;
  height: 18px;
  display: block;
}

#mute .icon-off,
#expand .icon-shrink { display: none; }

#mute.is-muted .icon-on { display: none; }

#mute.is-muted .icon-off { display: block; }

#expand.is-expanded .icon-expand { display: none; }

#expand.is-expanded .icon-shrink { display: block; }

.status, .moves {
  text-align: center;
  color: var(--muted);
}

.status {
  min-height: 1.4em;
  margin: 18px 0 0;
}

.board {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 18px 10px;
  min-height: 280px;
  padding: 12px 0 8px;
}

.tube {
  --glass-inset: 13px;
  --glass-border: 3px;
  --glass-radius: 23px;
  --liquid-top: 14px;
  position: relative;
  width: 72px;
  height: 250px;
  padding: 18px 0 22px;
  border: 0;
  background: transparent;
  transform-origin: 50% 72%;
  transition: transform 0.48s cubic-bezier(0.2, 1.2, 0.32, 1);
}

.tube.selected {
  z-index: 2;
  transform: translateY(-22px);
}

.tube.pouring {
  z-index: 3;
  transform: translateY(-36px) rotate(var(--tilt, -20deg));
  transform-origin: 50% 28%;
}

.tube.receiving { transform: translateY(3px); }

.tube.selected .seg:first-child {
  transform-origin: center bottom;
  animation: slosh 0.55s ease;
}

.tube.shake { animation: shake 280ms ease; }

.mouth {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: 7px;
  right: 7px;
  height: 16px;
  border: 3px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(8, 14, 16, 0.45);
}

.tube.done .mouth {
  background: linear-gradient(#f0c39a, #c4845a);
}

.tube.done .mouth::after {
  content: "✓";
  position: absolute;
  inset: -3px 0 auto;
  text-align: center;
  color: #fff8ef;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
}

.glass {
  position: absolute;
  left: var(--glass-inset);
  right: var(--glass-inset);
  top: 32px;
  bottom: 26px;
  overflow: hidden;
  border: var(--glass-border) solid rgba(255, 255, 255, 0.62);
  border-top: 0;
  border-radius: 0 0 var(--glass-radius) var(--glass-radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.05), 0 16px 24px rgba(0, 0, 0, 0.28);
}

.tube.selected .glass,
.tube.hint .glass {
  box-shadow:
    0 0 0 3px var(--glow, var(--accent)),
    inset 0 0 14px rgba(255, 255, 255, 0.05),
    0 16px 24px rgba(0, 0, 0, 0.28);
}

.segments {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.seg {
  width: 100%;
  height: calc(var(--n) * 25%);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.2), transparent 24% 68%, rgba(255, 255, 255, 0.28)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 28%),
    var(--c);
}

.segments.flowing .seg {
  transition: height var(--pour, 0.55s) cubic-bezier(0.33, 0, 0.2, 1);
}

.seg.grow { animation: grow 160ms ease-out; }

.seg:first-child {
  border-top-left-radius: 50% var(--liquid-top);
  border-top-right-radius: 50% var(--liquid-top);
}

.seg:last-child {
  border-bottom-left-radius: calc(var(--glass-radius) - var(--glass-border));
  border-bottom-right-radius: calc(var(--glass-radius) - var(--glass-border));
}

.shine {
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 18px;
  width: 6px;
  border-radius: 8px;
  background: linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.05));
  pointer-events: none;
}

.index {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.toolbar button {
  min-width: 104px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.92rem;
}

#hint {
  background: var(--accent);
  color: #2a160c;
  border-color: transparent;
  font-weight: 700;
}

.moves { margin: 10px 0 0; }

#fx {
  position: fixed;
  inset: 0;
  z-index: 15;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: visible;
}

.stream {
  stroke-dasharray: 10 14;
  animation: flow 0.28s linear infinite;
  filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.25));
}

body.stage-open { overflow: hidden; }

body.stage-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 27;
  background: rgba(6, 10, 12, 0.78);
}

.stage.is-expanded {
  position: fixed;
  z-index: 28;
  inset: 16px;
  width: auto;
  margin: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(700px 320px at 50% 0%, rgba(46, 196, 182, 0.16), transparent 60%),
    #122126;
}

.stage.is-expanded .board {
  min-height: 460px;
  padding-top: 54px;
}

.stage.is-expanded .tube {
  width: 84px;
  height: 292px;
  --glass-inset: 14px;
  --glass-radius: 28px;
}

@media (max-width: 720px) {
  .stage.is-expanded { inset: 8px; }
  .stage.is-expanded .tube {
    width: 62px;
    height: 220px;
    --glass-inset: 11px;
    --glass-radius: 20px;
  }
}

body.stage-open #fx { z-index: 29; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 10, 12, 0.64);
}

.modal[hidden] { display: none; }

.card {
  position: relative;
  width: min(440px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.card p, .card li { color: var(--muted); line-height: 1.45; }

.card ol { margin: 0; padding-left: 1.2rem; }

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.modal-actions button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
}

.modal-actions .primary {
  background: var(--accent);
  color: #2a160c;
  border-color: transparent;
  font-weight: 700;
}

#confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

#confetti i {
  position: absolute;
  top: -16px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  animation: fall 1.15s ease-in forwards;
}

@keyframes grow {
  from { transform: scaleY(0.55); }
  to { transform: scaleY(1); }
}

@keyframes slosh {
  0% { transform: scaleX(0.82); }
  55% { transform: scaleX(1.08); }
  100% { transform: scaleX(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-5px); }
  60% { transform: translateX(5px); }
}

@keyframes flow {
  to { stroke-dashoffset: -52; }
}

@keyframes fall {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateY(78vh) rotate(160deg); opacity: 0; }
}

.skip {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 40;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #2a160c;
  transform: translateY(-160%);
}

.skip:focus { transform: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(18, 33, 38, 0.92);
  backdrop-filter: blur(12px);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.site-brand .logo {
  width: 28px;
  height: 28px;
}

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

.site-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
}

.site-nav a:hover { background: rgba(255, 255, 255, 0.06); }

.hero, .copy, .site-footer {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
}

.hero { padding: 12px 0 8px; text-align: center; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.lede {
  margin: 16px auto 0;
  max-width: 40rem;
  color: #d5ddd8;
  font-size: 1.05rem;
  line-height: 1.6;
}

.chips, .highlights {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.highlights {
  gap: 10px;
  text-align: left;
}

.highlights li {
  flex: 1 1 200px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: #d5ddd8;
  line-height: 1.45;
}

.stage {
  width: min(980px, calc(100% - 24px));
  margin: 28px auto 10px;
  padding: 18px 12px 8px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(8, 16, 18, 0.35);
}

.stage-intro { text-align: center; }

.stage-intro h2 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.stage,
.copy section,
.cta {
  scroll-margin-top: 76px;
}

.copy section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.page {
  width: min(760px, calc(100% - 32px));
  margin: 28px auto 0;
}

.page h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.page .meta {
  margin: 0 0 8px;
  color: var(--muted);
}

.page .copy {
  width: 100%;
  margin: 0;
}

/* .copy a { color: var(--accent); } */

.copy h2 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.copy h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.copy p, .copy li, .site-footer p {
  color: #d5ddd8;
  line-height: 1.65;
}

.copy p { margin: 0 0 12px; }

.copy ul, .steps { margin: 0; padding-left: 1.2rem; }

.copy li + li { margin-top: 8px; }

.steps { list-style: none; padding: 0; }

.steps li {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.steps p { margin: 0; }

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 700;
}

.faq details p { margin: 0 0 14px; }

.cta { text-align: center; }

.cta-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #2a160c;
  font-weight: 700;
  text-decoration: none;
}

.site-footer {
  padding: 28px 0 40px;
  text-align: center;
}

.site-footer nav {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
}

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

@media (max-width: 720px) {
  .site-nav a { padding: 8px 8px; }
  .tube {
    width: 58px;
    height: 214px;
    --glass-inset: 11px;
    --glass-radius: 18px;
  }
  .toolbar button { min-width: 0; }
  .hero h1 { font-size: 2.5rem; }
}

@media (max-width: 420px) {
  .tube {
    width: 48px;
    height: 186px;
    --glass-inset: 9px;
    --glass-radius: 15px;
    --liquid-top: 8px;
  }
}

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