:root {
  --bg: #fbf7f0;
  --surface: #ffffff;
  --surface-2: #f5efe4;
  --text: #201a13;
  --muted: #6f6559;
  --line: #e5dccd;
  --accent: #b45309;
  --accent-ink: #7c3d06;
  --accent-soft: #fdf0d5;
  --sale: #b3261e;
  --good: #15803d;
  --warn: #b45309;
  --hot: #b3261e;
  --shadow: 0 1px 2px rgb(32 26 19 / 6%), 0 12px 32px rgb(32 26 19 / 8%);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141210;
    --surface: #1c1917;
    --surface-2: #262220;
    --text: #f5f0e9;
    --muted: #a8a29b;
    --line: #332d28;
    --accent: #f59e0b;
    --accent-ink: #fbbf24;
    --accent-soft: #3a2c12;
    --sale: #f87171;
    --good: #4ade80;
    --warn: #fbbf24;
    --hot: #f87171;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 16px 40px rgb(0 0 0 / 35%);
  }
}

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

/* Rising beer bubbles, revived from the 2015 page. Fixed layer behind all
   content; pointer-events off so it never intercepts clicks. */
.bubbles {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bubble {
  position: absolute;
  bottom: -14vmin;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    color-mix(in srgb, var(--accent) 52%, transparent),
    color-mix(in srgb, var(--accent) 18%, transparent) 72%
  );
  opacity: 0;
  animation: bubble-rise var(--duration) linear var(--delay) infinite;
  will-change: transform, opacity;
}

@keyframes bubble-rise {
  0% {
    transform: translate3d(0, 0, 0) scale(0.8);
    opacity: 0;
  }
  12% {
    opacity: var(--opacity);
  }
  82% {
    opacity: var(--opacity);
  }
  100% {
    transform: translate3d(var(--drift), -115vh, 0) scale(1.12);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bubbles {
    display: none;
  }
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.masthead,
main,
footer {
  position: relative;
  z-index: 1;
}

.masthead {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 20px 0;
}

.masthead nav {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.masthead a {
  color: var(--muted);
  text-decoration: none;
}

.masthead a:hover {
  color: var(--accent);
}

main {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 20px 72px;
  flex: 1;
}

.lede {
  max-width: 620px;
  margin-bottom: 28px;
}

.lede h1 {
  margin: 0 0 8px;
  font-size: clamp(2.6rem, 7vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.lede p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
}

.picker {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.picker label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.combo {
  position: relative;
}

.combo input {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  appearance: none;
}

.combo input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.combo input:focus {
  background: var(--surface);
  border-color: var(--accent);
}

#store-list {
  position: absolute;
  z-index: 10;
  inset: calc(100% + 6px) 0 auto 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

#store-list li {
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

#store-list li[aria-selected="true"],
#store-list li:hover {
  background: var(--accent-soft);
}

#store-list .city {
  font-weight: 600;
}

#store-list .where {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

#store-list .empty {
  color: var(--muted);
  cursor: default;
}

.hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.status {
  min-height: 1.5em;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.status.error {
  color: var(--sale);
}

.store-head {
  margin: 8px 0 16px;
}

.store-head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  letter-spacing: -0.01em;
  text-transform: capitalize;
}

.store-address {
  margin: 2px 0 0;
  color: var(--muted);
}

.meta {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

thead th {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-2);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--surface-2);
}

.num {
  text-align: right;
  white-space: nowrap;
}

.col-rank {
  width: 3.5em;
  color: var(--muted);
}

.beer-name {
  font-weight: 600;
  display: block;
}

.beer-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.badge.sale {
  background: color-mix(in srgb, var(--sale) 14%, transparent);
  color: var(--sale);
}

.abv {
  display: inline-block;
  min-width: 3.4em;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  text-align: center;
}

.abv[data-band="light"] {
  background: color-mix(in srgb, var(--good) 16%, transparent);
  color: var(--good);
}

.abv[data-band="mid"] {
  background: color-mix(in srgb, var(--warn) 18%, transparent);
  color: var(--warn);
}

.abv[data-band="strong"] {
  background: color-mix(in srgb, var(--hot) 18%, transparent);
  color: var(--hot);
}

.price {
  font-weight: 600;
  white-space: nowrap;
}

.price s {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}

.value {
  font-weight: 700;
  color: var(--accent-ink);
}

.value small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
}

.actions {
  margin: 16px 0 0;
}

.actions button {
  font: inherit;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
}

.actions button:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.about {
  margin-top: 28px;
  font-size: 14px;
  color: var(--muted);
  max-width: 680px;
}

.about summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.about p {
  margin: 10px 0 0;
}

footer {
  border-top: 1px solid var(--line);
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

footer p {
  margin: 0;
}

@media (max-width: 620px) {
  th,
  td {
    padding: 10px 6px;
  }

  thead th,
  thead th.num {
    white-space: normal;
  }

  .col-pack {
    display: none;
  }

  .abv {
    min-width: 0;
    padding: 2px 5px;
  }

  .col-rank {
    width: 2.2em;
  }

  .lede {
    margin-bottom: 20px;
  }

  #store-list li {
    flex-direction: column;
    gap: 0;
  }

  #store-list .where {
    text-align: left;
  }
}
