:root {
  --mist: #d5ebe6;
  --foam: #f6fbfa;
  --ink: #143833;
  --tide: #1f6f68;
  --tide-ink: #1a564f;
  --straw: #f0ddb8;
  --straw-edge: #d7bc84;
  --voice: #c73448;
  --focus: #8d5b22;
  --line: rgba(20, 56, 51, 0.18);
  --stage-height: 220px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--mist);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--mist);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  font-size: 1.125rem;
  line-height: 1.45;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:focus {
  outline: none;
}

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

h1,
p {
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 700;
}

.wrap {
  width: min(100%, 32rem);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 22px 0;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.progress {
  height: 4px;
  margin: 0 0 16px;
  background: rgba(20, 56, 51, 0.12);
  border-radius: 99px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--tide);
}

.meta {
  color: var(--tide-ink);
  margin-bottom: 6px;
}

.lede {
  margin: 8px 0 0;
}

.stage {
  flex: 0 0 auto;
  margin: 14px 0 8px;
}

.scene {
  display: block;
  width: 100%;
  height: auto;
  color: var(--ink);
}

.stage.is-compact .scene {
  width: min(100%, 250px);
  margin: 0 auto;
}

.choices {
  margin-top: auto;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.lip {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.5;
  stroke-linecap: round;
}

.straw-shaft {
  stroke: #e4bc6a;
  stroke-width: 13;
  stroke-linecap: round;
}

.straw-shine {
  stroke: #fff8ea;
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.8;
}

.cup-wall {
  fill: rgba(246, 251, 250, 0.72);
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: round;
}

.cup-rim {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
}

.water-body {
  fill: var(--tide);
  opacity: 0.9;
}

.water-surface {
  fill: #b7e6df;
}

.glass-shine {
  fill: white;
  opacity: 0.38;
}

.bubble circle {
  fill: var(--foam);
}

.mark-half,
.mark-inch {
  opacity: 0;
}

.mark-line {
  stroke: var(--ink);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}

.mark-label {
  font-size: 13px;
  fill: var(--ink);
  font-family: "Atkinson Hyperlegible", sans-serif;
}

.scene[data-mode="setup"] .mark-half,
.scene[data-mode="straw"] .mark-half,
.scene[data-mode="straw"] .mark-inch {
  opacity: 1;
}

.straw-group,
.lip-lower {
  transition: transform 0.55s ease;
}

.scene.is-speaking .straw-group {
  transform: translate(26px, 14px);
}

.scene.is-speaking .lip-lower {
  transform: translateY(8px);
}

.bubble {
  opacity: 0;
}

.scene.is-armed .bubble {
  opacity: 0.4;
}

.pitch {
  height: 48px;
  margin: 2px 0 8px;
}

.pitch svg {
  display: block;
  width: 100%;
  height: 100%;
}

.pitch path {
  fill: none;
  stroke: var(--tide);
  stroke-width: 3.5;
  stroke-linecap: round;
}

.pitch.is-drawing path {
  stroke: var(--voice);
}

.reps {
  display: flex;
  gap: 10px;
  margin: 10px 0 4px;
  padding: 0;
  list-style: none;
}

.reps li {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--ink);
}

.reps li.is-done {
  background: var(--tide);
  border-color: var(--tide);
}

.reps li.is-now {
  background: var(--ink);
}

.voice-state {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-weight: 700;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--tide-ink);
}

.voice-state.is-on .dot {
  background: var(--voice);
  border-color: var(--voice);
}

.spoken {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 650;
  font-size: clamp(3rem, 14vw, 4.6rem);
  line-height: 1.05;
}

.spoken.is-long {
  font-size: clamp(1.85rem, 8vw, 2.7rem);
  line-height: 1.2;
}

.count {
  margin: 4px 0 0;
  font-size: 5.25rem;
  line-height: 0.85;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--voice);
}

.choice + .choice {
  border-top: 1px solid var(--line);
}

.choice-hit {
  display: block;
  width: 100%;
  padding: 18px 0 8px;
  border: 0;
  background: transparent;
  text-align: left;
}

.choice-title {
  display: block;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.15;
}

.choice-detail,
.choice-go {
  display: block;
  margin-top: 4px;
}

.choice-go {
  color: var(--tide-ink);
  font-weight: 700;
}

.dock {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0 calc(14px + env(safe-area-inset-bottom));
  background: var(--mist);
}

.primary {
  min-height: 58px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--foam);
  font-weight: 700;
  font-size: 1.15rem;
}

.ghost {
  min-height: 48px;
  padding: 8px 2px;
  border: 0;
  background: transparent;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.top .ghost {
  min-height: 44px;
  text-align: left;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
}

.top .ghost:last-child {
  text-align: right;
}

.ghost.slim {
  min-height: 36px;
  padding: 0 0 14px;
  text-align: left;
  text-decoration-thickness: 1px;
}

.chips {
  display: flex;
  gap: 8px;
}

.chips button {
  flex: 1;
  min-height: 46px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
}

.chips button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--foam);
}

@media (hover: hover) {
  .primary:hover {
    background: #0c2826;
  }

  .choice-hit:hover .choice-title {
    color: #0c2826;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .progress span {
    transition: width 0.35s ease;
  }

  .scene.is-live .bubble,
  .scene.is-demo .bubble {
    animation: rise 1.7s linear infinite;
  }

  .scene.is-demo .bubble {
    animation-duration: 2.5s;
  }

  .pitch.is-drawing path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw var(--hold, 4s) linear forwards;
  }
}

@media (prefers-reduced-motion: reduce) {
  .straw-group,
  .lip-lower,
  .progress span {
    transition: none;
  }

  .scene.is-live .bubble,
  .scene.is-demo .bubble,
  .scene.is-armed .bubble {
    opacity: 0.9;
  }
}

@keyframes rise {
  0% {
    transform: translateY(10px);
    opacity: 0;
  }

  20% {
    opacity: 0.95;
  }

  100% {
    transform: translateY(-32px);
    opacity: 0;
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
