@font-face {
  font-family: Inter;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/inter-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Inter;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/inter-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

:root {
  --background: #f6f4fa;
  --foreground: #1a1426;
  --primary: #2e1a52;
  --secondary: #ebe6f4;
  --accent: #efeaf7;
  --muted: #6b6380;
  --border: #e3ddee;
  --ring: #7c5cc4;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

body {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.5;
  color: var(--foreground);
  background: radial-gradient(ellipse 80% 50% at 50% -10%, #e2d8f5 0%, transparent 70%) no-repeat var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img,
svg {
  display: block;
}

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

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  stroke-width: 1.75;
}

/* Layout */

.shell {
  display: flex;
  flex-direction: column;
  max-width: 56rem;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 1rem;
}

.header {
  padding: 1.25rem 0;
}

.brand {
  display: inline-flex;
  padding: 0.25rem 0;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--primary);
}

.brand svg {
  width: 2.25rem;
  height: 2.25rem;
  stroke: currentColor;
}

.main {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 2rem 0;
}

.footer {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.25rem 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer a {
  padding: 0.75rem 0;
}

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

.label {
  margin-top: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 3rem;
  padding: 0 1.75rem;
  border: 0;
  border-radius: 9999px;
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s;
}

.btn:active {
  transform: scale(0.96);
}

/* Icons at the edge of a pill read too far in, pull them toward the edge */
.btn > .icon:last-child {
  margin-right: -0.25rem;
}

.btn > :first-child:is(.icon, .swap) {
  margin-left: -0.25rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.1);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--primary) 90%, transparent);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--primary);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--secondary) 80%, transparent);
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
}

.btn-ghost:hover {
  background: var(--accent);
}

.btn-sm {
  position: relative;
  height: 2.25rem;
  padding: 0 1rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
}

/* Extend the touch target to 44px without changing the look */
.btn-sm::before {
  content: '';
  position: absolute;
  inset: -0.25rem 0;
}

/* Home */

.hero {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.lineup {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bottle {
  animation: float 6s ease-in-out infinite;
}

.bottle img {
  width: 100%;
  aspect-ratio: 1;
  filter: drop-shadow(0 20px 13px rgb(0 0 0 / 0.03)) drop-shadow(0 8px 5px rgb(0 0 0 / 0.08));
}

.bottle-center {
  position: relative;
  z-index: 1;
  width: 11rem;
}

.bottle-left,
.bottle-right {
  width: 8rem;
}

.bottle-left {
  margin-right: -3.5rem;
  animation-delay: -2s;
}

.bottle-right {
  margin-left: -3.5rem;
  animation-delay: -4s;
}

.bottle-left img,
.bottle-right img {
  transform-origin: bottom;
}

.bottle-left img {
  animation: fan-left 0.9s var(--ease-out) 0.2s both;
}

.bottle-right img {
  animation: fan-right 0.9s var(--ease-out) 0.2s both;
}

.hero-title {
  margin-top: 1.5rem;
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-wrap: balance;
  color: var(--primary);
}

.hero-text {
  max-width: 36rem;
  margin-top: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  text-wrap: pretty;
  color: var(--muted);
}

.hero .btn {
  margin-top: 2.5rem;
}

/* Finder */

.finder {
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
}

.progress {
  display: flex;
  gap: 0.375rem;
}

.seg {
  flex: 1;
  height: 0.25rem;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--primary) 15%, transparent);
}

.seg-done {
  background: var(--primary);
}

.step-count {
  margin-top: 2.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.question {
  margin-top: 0.5rem;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.options {
  display: grid;
  gap: 0.75rem;
  margin-top: 2rem;
}

.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 0.875rem;
  background: #fff;
  font-weight: 500;
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgb(0 0 0 / 0.05);
  transition: box-shadow 0.15s, transform 0.15s;
}

.option:hover {
  box-shadow: 0 0 0 1px var(--ring), 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.option:active {
  transform: scale(0.99);
}

.option .icon {
  color: var(--muted);
  transition: transform 0.15s, color 0.15s;
}

.option:hover .icon {
  color: var(--primary);
  transform: translateX(2px);
}

.back {
  margin: 1.5rem 0 0 -0.75rem;
}

/* Result */

.result-hero {
  display: grid;
  overflow: hidden;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 0 0 1px var(--border), 0 20px 25px -5px rgb(46 26 82 / 0.05), 0 8px 10px -6px rgb(46 26 82 / 0.05);
}

.result-hero > img {
  width: 100%;
  max-width: 16rem;
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 1.5rem;
}

.result-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

.pill .icon {
  width: 0.875rem;
  height: 0.875rem;
}

.result-title {
  margin-top: 1rem;
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--primary);
}

.reasons {
  display: grid;
  gap: 0.625rem;
  margin-top: 0.75rem;
  list-style: none;
}

.reasons li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}

.reasons .icon {
  margin-top: 0.25rem;
  stroke-width: 1.5;
  color: var(--ring);
}

.result-body .btn {
  margin-top: 2.5rem;
}

.alts-label {
  margin-top: 3.5rem;
}

.alts {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.alt {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.875rem;
  background: #fff;
  box-shadow: 0 0 0 1px var(--border);
  transition: box-shadow 0.15s;
}

.alt:hover {
  box-shadow: 0 0 0 1px var(--ring), 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.alt img {
  width: 5rem;
  aspect-ratio: 1;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.alt:hover img {
  transform: scale(1.03);
}

.alt-body {
  flex: 1;
}

.alt-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.alt-name {
  font-weight: 600;
}

.alt-pct {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.meter {
  height: 0.375rem;
  margin-top: 0.5rem;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.meter > div {
  height: 100%;
  border-radius: 9999px;
  background: var(--primary);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 3rem;
}

.swap {
  display: grid;
}

.swap > .icon {
  grid-area: 1 / 1;
  transition: opacity 0.2s, scale 0.2s, filter 0.2s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

#share .i-check,
#share.copied .i-share {
  opacity: 0;
  scale: 0.25;
  filter: blur(4px);
}

#share.copied .i-check {
  opacity: 1;
  scale: 1;
  filter: none;
}

/* Breakpoints */

@media (min-width: 640px) {
  .shell {
    padding: 0 1.5rem;
  }
  .main {
    padding: 3rem 0;
  }
  .bottle-center {
    width: 15rem;
  }
  .bottle-left,
  .bottle-right {
    width: 11rem;
  }
  .bottle-left {
    margin-right: -5rem;
  }
  .bottle-right {
    margin-left: -5rem;
  }
  .hero-title {
    font-size: 3.75rem;
    line-height: 1;
  }
  .question {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
  .result-body {
    padding: 2.5rem;
  }
  .result-title {
    font-size: 3rem;
    line-height: 1;
  }
  .alts {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  .alt {
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
  }
  .alt img {
    width: 100%;
  }
  .alt-body {
    margin-top: 1rem;
  }
}

@media (min-width: 768px) {
  .result-hero {
    grid-template-columns: 1fr 1fr;
  }
  .result-hero > img {
    max-width: 24rem;
  }
  .result-body {
    padding-left: 0.5rem;
  }
}

/* Motion */

/* Cross-document crossfade between pages; the progress bar morphs in place */
@view-transition {
  navigation: auto;
}

.progress {
  view-transition-name: progress;
}

.rise {
  animation: rise 0.35s var(--ease-out) both;
}

.hero-title {
  animation-delay: 0.1s;
}

.hero-text {
  animation-delay: 0.2s;
}

.hero .btn {
  animation-delay: 0.3s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes fan-left {
  from {
    opacity: 0;
    transform: translateX(45%) scale(0.9);
  }
  to {
    transform: rotate(-7deg);
  }
}

@keyframes fan-right {
  from {
    opacity: 0;
    transform: translateX(-45%) scale(0.9);
  }
  to {
    transform: rotate(7deg);
  }
}

@keyframes float {
  50% {
    transform: translateY(-10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation: none !important;
    transition: none !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
