/* ==========================================================================
   The Whiskey Advent Calendar -- shared stylesheet
   Ledger / logbook aesthetic. Plain CSS, no build step, no framework.
   ========================================================================== */

:root {
  --bg: #EFE6D3;
  --surface: #E5D8B9;
  --surface-2: #DCCBA3;
  --ink: #241A12;
  --ink-muted: #5C4F3D;
  --ink-faint: #8A7A5D;
  --accent: #A85A2A;
  --accent-strong: #8A461E;
  --accent-2: #B9852E;
  --rule: #C9B78E;
  --rule-strong: #B09F73;
  --glass: #C97A3A;
  --glass-dark: #8F4F22;
  --card-back: #241A12;
  --card-back-ink: #EFE6D3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1B1410;
    --surface: #241C15;
    --surface-2: #2E2318;
    --ink: #EFE6D3;
    --ink-muted: #B8A888;
    --ink-faint: #8A7A5D;
    --accent: #DE9350;
    --accent-strong: #EAAA6C;
    --accent-2: #E8B65A;
    --rule: #4A3C2C;
    --rule-strong: #5C4B36;
    --glass: #E8A34F;
    --glass-dark: #B5722C;
    --card-back: #0F0B08;
    --card-back-ink: #EFE6D3;
  }
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.65;
  margin: 0;
  padding: 0 1.5rem 6rem;
}

.wrap { max-width: 46rem; margin: 0 auto; }
.wrap-wide { max-width: 60rem; margin: 0 auto; }

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  text-wrap: balance;
  color: var(--ink);
  letter-spacing: -0.01em;
}

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

.mono {
  font-family: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--accent-strong);
  font-weight: 600;
}

/* ---------- Site nav ---------- */
.sitenav {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.4rem 0 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
}
.sitenav .brand {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.sitenav .brand:hover { color: var(--accent-strong); }
.sitenav .links {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.sitenav .links a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--ink-muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 0.2rem;
}
.sitenav .links a:hover,
.sitenav .links a[aria-current="page"] {
  color: var(--accent-strong);
  border-color: var(--accent);
}

/* Hamburger toggle -- hidden above 720px, shown below */
.navtoggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 40px;
  padding: 0.4rem 0.7rem;
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.navtoggle:hover { border-color: var(--accent); color: var(--accent-strong); }

@media (max-width: 720px) {
  .navtoggle { display: inline-flex; }
  .sitenav .links {
    display: none;
    flex-direction: column;
    width: 100%;
    flex-basis: 100%;
    gap: 0;
    order: 3;
    border-top: 1px solid var(--rule);
    margin-top: 0.6rem;
    padding-top: 0.2rem;
  }
  .sitenav .links.open { display: flex; }
  .sitenav .links a {
    width: 100%;
    padding: 0.9rem 0.1rem;
    border-bottom: 1px solid var(--rule);
  }
  .sitenav .links a:last-child { border-bottom: none; }
}

/* ---------- Focus visibility ---------- */
.sitenav .links a:focus-visible,
.navtoggle:focus-visible,
.teaser:focus-visible,
table.ledger th.sortable:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.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 ---------- */
.masthead {
  max-width: 46rem;
  margin: 0 auto;
  padding: 4rem 0 3rem;
  text-align: left;
  border-bottom: 3px double var(--rule-strong);
}
.masthead.wide { max-width: 60rem; }
.masthead .eyebrow { display: block; margin-bottom: 1.1rem; }
.masthead h1 {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.05;
  margin: 0 0 1rem;
  font-optical-sizing: auto;
}

/* Hero glow + entrance -- home page masthead only */
.masthead.hero {
  position: relative;
  overflow: hidden;
}
.masthead.hero::before {
  content: "";
  position: absolute;
  top: -12rem;
  left: 50%;
  transform: translateX(-50%);
  width: 56rem;
  height: 32rem;
  background: radial-gradient(ellipse at center, var(--accent-2) 0%, transparent 68%);
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}
.masthead.hero > * { position: relative; z-index: 1; }

@media (prefers-reduced-motion: no-preference) {
  .masthead.hero .eyebrow,
  .masthead.hero h1,
  .masthead.hero .dek,
  .masthead.hero .lede {
    animation: hero-rise 0.7s ease both;
  }
  .masthead.hero h1 { animation-delay: 0.06s; }
  .masthead.hero .dek { animation-delay: 0.16s; }
  .masthead.hero .lede { animation-delay: 0.26s; }
}
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.masthead .dek {
  font-size: 1.15rem;
  color: var(--ink-muted);
  font-style: italic;
  margin: 0 0 2rem;
  max-width: 34rem;
}
.masthead .lede {
  font-size: 1.05rem;
  max-width: 40rem;
}
.masthead .lede strong { color: var(--accent-strong); font-weight: 600; }

/* ---------- Sections ---------- */
section { max-width: 46rem; margin: 0 auto; padding: 3.5rem 0; }
section.wide { max-width: 60rem; }
section + section { border-top: 1px solid var(--rule); }

section > .eyebrow { display: block; margin-bottom: 0.6rem; }
section > h2 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  margin: 0 0 1.4rem;
}
section > p.section-intro {
  color: var(--ink-muted);
  max-width: 38rem;
  margin: -0.6rem 0 2rem;
}

blockquote {
  margin: 1.6rem 0;
  padding: 0.2rem 0 0.2rem 1.3rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--ink);
  font-size: 1.05rem;
}
blockquote cite {
  display: block;
  font-style: normal;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 0.5rem;
}

/* ---------- Status strip ---------- */
.status-strip {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1rem 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--rule);
}
.status-strip strong { color: var(--accent-strong); }
.status-strip span:not(:last-child)::after { content: " \00b7 "; color: var(--ink-faint); }

/* ---------- Sponsor logos ---------- */
.sponsor-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.sponsor-row a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 11.5rem;
  height: 5.5rem;
  background: var(--card-back);
  border: 1px solid var(--rule-strong);
  padding: 1rem 1.2rem;
  transition: border-color 0.15s ease;
}
.sponsor-row a:hover, .sponsor-row a:focus-visible {
  border-color: var(--accent);
  outline: none;
}
.sponsor-row a:focus-visible { box-shadow: 0 0 0 2px var(--accent-2); }
.sponsor-row img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}
/* Bardstown's logo is mid-gray + gold, not pure white like the others --
   reads noticeably dimmer against the dark card, so give it a lift. */
.sponsor-row img.sponsor-logo-brighten {
  filter: brightness(1.35) contrast(1.1);
}
@media (max-width: 560px) {
  .sponsor-row { gap: 0.7rem; }
  .sponsor-row a { width: 8.5rem; height: 4.2rem; padding: 0.7rem 0.9rem; }
}

/* ---------- Countdown ---------- */
.countdown {
  margin: 2.2rem 0 0.5rem;
  padding: 1.6rem 1.8rem;
  background: var(--surface);
  border: 1px solid var(--rule);
}
.countdown .eyebrow { display: block; margin-bottom: 0.9rem; }
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.countdown-grid .cd {
  background: var(--surface);
  padding: 1rem 0.8rem;
  text-align: center;
}
.countdown-grid .cd .n {
  font-family: 'Fraunces', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
  display: block;
  line-height: 1;
}
.countdown-grid .cd .l {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  display: block;
  margin-top: 0.5rem;
}
.countdown .note {
  margin-top: 1rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-faint);
}

/* ---------- Stat tiles ---------- */
.stat-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin: 1rem 0 2.5rem;
}
@media (max-width: 480px) {
  .stat-rail { grid-template-columns: repeat(2, 1fr); }
}
.stat {
  background: var(--bg);
  padding: 1.3rem 1.2rem;
  border-top: 2px solid var(--accent-2);
}
.stat .n {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
  display: block;
  line-height: 1;
}
.stat .l {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  display: block;
  margin-top: 0.5rem;
}

/* ---------- How it works ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.8rem 2.2rem;
  margin-top: 1.5rem;
}
.step .num {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--accent-2);
  display: block;
  margin-bottom: 0.5rem;
}
.step h3 { font-size: 1.05rem; margin: 0 0 0.4rem; }
.step p { margin: 0; color: var(--ink-muted); font-size: 0.95rem; }

/* ---------- Teaser cards ---------- */
.teaser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.teaser {
  display: block;
  text-decoration: none;
  padding: 1.6rem 1.7rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.teaser:hover { border-color: var(--accent); }
.teaser .eyebrow { display: block; margin-bottom: 0.6rem; }
.teaser h3 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.teaser p { margin: 0; color: var(--ink-muted); font-size: 0.92rem; }
.teaser .go {
  display: inline-block;
  margin-top: 0.9rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-strong);
}

/* ---------- Charts ---------- */
.chart-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin: 1rem 0 1.5rem;
}
@media (max-width: 640px) { .chart-pair { grid-template-columns: 1fr; } }
.chart-block h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--ink-muted);
  margin: 0 0 0.9rem;
}
.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-svg .gridline { stroke: var(--rule); stroke-width: 1; }
.chart-svg .axis-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  fill: var(--ink-faint);
}
.chart-svg .line { fill: none; stroke: var(--accent-2); stroke-width: 2.5; }
.chart-svg .dot { fill: var(--bg); stroke: var(--accent-2); stroke-width: 2.5; cursor: pointer; }
.chart-svg .dot:hover, .chart-svg .dot:focus { stroke: var(--accent-strong); outline: none; }
.chart-svg .val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  fill: var(--ink);
  text-anchor: middle;
}
.chart-note {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin-top: 0.8rem;
}

/* ---------- Gap / disclosure note ---------- */
.gap-note {
  padding: 1rem 1.3rem;
  background: var(--surface);
  border-left: 4px solid var(--accent-2);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--ink-muted);
  line-height: 1.6;
  margin: 0 0 2rem;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin-top: 1rem; }
table.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.ledger caption { text-align: left; margin-bottom: 0.8rem; }
table.ledger th, table.ledger td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
table.ledger thead th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  border-bottom: 2px solid var(--rule-strong);
  font-weight: 600;
}
table.ledger td.num, table.ledger th.num {
  font-family: 'IBM Plex Mono', monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
table.ledger td.wrap-cell, table.ledger th.wrap-cell { white-space: normal; }
table.ledger tbody tr:hover { background: var(--surface); }
table.ledger th.sortable {
  cursor: pointer;
  user-select: none;
}
table.ledger th.sortable:hover { color: var(--accent-strong); }
table.ledger th.sortable .arrow {
  display: inline-block;
  margin-left: 0.3rem;
  color: var(--accent-2);
}
table.ledger .rank {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--ink-faint);
}
@media (max-width: 720px) {
  table.ledger th, table.ledger td { padding: 0.8rem 0.9rem; }
}

/* ---------- Extremes ---------- */
.extremes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.extreme-card {
  padding: 1.5rem 1.7rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--accent-2);
}
.extreme-card .eyebrow { display: block; margin-bottom: 0.7rem; }
.extreme-card .n {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
  display: block;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.extreme-card .d { font-size: 0.95rem; color: var(--ink); margin: 0; }
.extreme-card .m {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 0.4rem;
}

/* ---------- Chapters (timeline) ---------- */
.chapters { position: relative; margin-top: 1rem; }
.chapter {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1.5rem;
  padding: 1.8rem 0;
  border-top: 1px solid var(--rule);
  position: relative;
}
.chapter:first-child { border-top: none; }
.chapter .yr {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.9rem;
  color: var(--accent-strong);
  line-height: 1;
  padding-top: 0.15rem;
}
.chapter .yr small {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  font-weight: 400;
  margin-top: 0.35rem;
  text-transform: uppercase;
}
.chapter h3 { margin: 0 0 0.3rem; font-size: 1.25rem; }
.chapter .meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  margin-bottom: 0.7rem;
}
.chapter .meta span:not(:last-child)::after { content: " \00b7 "; }
.chapter p { margin: 0.5rem 0; }
.chapter blockquote { margin: 0.9rem 0 0.2rem; font-size: 0.98rem; }

@media (max-width: 640px) {
  .chapter { grid-template-columns: 1fr; gap: 0.5rem; }
  .chapter .yr {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding-top: 0;
  }
  .chapter .yr small { margin-top: 0; }
}

/* ---------- Traditions ---------- */
.lore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1.8rem 2.2rem;
  margin-top: 1.5rem;
}
.lore-item .eyebrow { font-size: 0.65rem; }
.lore-item h3 { font-size: 1.05rem; margin: 0.35rem 0 0.4rem; }
.lore-item p { margin: 0; color: var(--ink-muted); font-size: 0.95rem; }
.lore-item p strong { color: var(--ink); font-weight: 600; }

/* ---------- Roster ---------- */
.roster { margin-top: 1.5rem; border-top: 1px solid var(--rule); }
.roster-row {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 560px) { .roster-row { grid-template-columns: 1fr; gap: 0.3rem; } }
.roster-row .name { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.05rem; }
.roster-row .role {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-strong);
  display: block;
  margin-top: 0.15rem;
}
.roster-row .desc { color: var(--ink-muted); font-size: 0.95rem; margin: 0; }

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 1.5rem;
}
.roster-grid .note { grid-column: 1 / -1; padding: 1rem; color: var(--ink-faint); background: var(--bg); }
.roster-chip {
  background: var(--bg);
  color: inherit;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  border: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.roster-chip:hover, .roster-chip:focus-visible {
  background: var(--surface);
  outline: none;
}
.roster-chip:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.roster-chip .name { font-family: 'Fraunces', serif; font-weight: 500; font-size: 0.98rem; display: flex; flex-direction: column; gap: 0.15rem; }
.roster-chip .yrs {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
}
.roster-chip .loc {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ---------- Bottle history modal ---------- */
.bottle-modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 11, 8, 0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; z-index: 100;
}
.bottle-modal {
  background: var(--bg); border: 1px solid var(--rule-strong);
  max-width: 32rem; width: 100%; max-height: 80vh; overflow-y: auto;
  padding: 1.6rem 1.8rem;
}
.bottle-modal-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 2px solid var(--rule-strong); padding-bottom: 0.9rem; margin-bottom: 1rem;
}
.bottle-modal-head h3 { margin: 0; font-size: 1.3rem; }
.bottle-modal-head .sub {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.3rem; display: block;
}
.bottle-modal-close {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; background: none;
  border: 1px solid var(--rule-strong); color: var(--ink-muted); padding: 0.3rem 0.7rem;
  cursor: pointer; border-radius: 999px; flex-shrink: 0;
}
.bottle-modal-close:hover, .bottle-modal-close:focus-visible { border-color: var(--accent); color: var(--accent-strong); }
.collision-note {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; color: var(--ink-faint);
  background: var(--surface); border-left: 3px solid var(--accent); padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
}
.bottle-list { list-style: none; margin: 0; padding: 0; }
.bottle-list li { border-bottom: 1px solid var(--rule); }
.bottle-list li:last-child { border-bottom: none; }
.bottle-row-btn {
  all: unset; box-sizing: border-box; display: flex; width: 100%;
  justify-content: space-between; gap: 1rem; align-items: baseline;
  padding: 0.7rem 0.1rem; font: inherit; color: inherit; cursor: pointer;
}
.bottle-row-btn:hover, .bottle-row-btn:focus-visible { color: var(--accent-strong); }
.bottle-row-btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.bottle-list .byear {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; color: var(--accent-strong);
  font-weight: 600; flex-shrink: 0;
}
.bottle-list .bdrink { font-family: 'Lora', serif; font-size: 0.92rem; flex: 1; text-align: left; }

/* ---------- Bottle tasting cards (roster modal) ---------- */
.bottle-card-view { display: none; }
.bottle-card-view.showing { display: block; }
.bottle-list-view.hidden { display: none; }

.bottle-card-back-nav {
  all: unset; box-sizing: border-box; cursor: pointer; display: block;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--ink-muted); margin-bottom: 1rem;
}
.bottle-card-back-nav:hover, .bottle-card-back-nav:focus-visible { color: var(--accent-strong); }
.bottle-card-back-nav:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.bottle-card-single { max-width: 21rem; margin: 0 auto; }

.tcard-flip {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  perspective: 1600px;
}
@supports not (aspect-ratio: 4 / 5) {
  .tcard-flip { height: 0; padding-top: 125%; }
}
/* Which face shows is driven by `visibility`, swapped at the halfway point
   of the flip (when the card is edge-on), NOT by backface-visibility --
   iOS Safari mis-renders backface-visibility here and leaves the front
   face's stats blank. The easing must stay symmetric (ease-in-out) so the
   time midpoint is also the 90-degree point. */
.tcard-flip .face {
  all: unset;
  box-sizing: border-box;
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  font: inherit; text-align: left; cursor: pointer;
  border-radius: 2px;
  transform: rotateY(0deg);
  visibility: visible;
  transition: transform 0.6s ease-in-out, visibility 0s linear 0.3s;
}
.tcard-flip .face-back { transform: rotateY(180deg); visibility: hidden; }
.tcard.flipped .tcard-flip .face-front { transform: rotateY(180deg); visibility: hidden; pointer-events: none; }
.tcard.flipped .tcard-flip .face-back { transform: rotateY(360deg); visibility: visible; }
.tcard:not(.flipped) .tcard-flip .face-back { pointer-events: none; }
.tcard-flip .face:focus-visible { outline: 2px solid var(--glass); outline-offset: 3px; }

/* Front face: the stats -- this is what you see first.
   Selectors are `.tcard-flip .face-*` on purpose: they must outrank the
   `.tcard-flip .face { all: unset }` reset above, or the card loses its
   background/padding/color (invisible values in light mode). */
.tcard-flip .face-front {
  background: var(--card-back);
  color: var(--card-back-ink);
  padding: 1.5rem 1.6rem 1.3rem;
}
.face-front .bname {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.4rem; line-height: 1.2;
  margin: 0 0 0.25rem; text-align: center;
}
.face-front .bdist {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--glass); margin-bottom: 1.2rem; display: block;
}
.back-stats {
  display: grid; grid-template-columns: max-content max-content; gap: 1rem 1.6rem;
}
.back-stats .k {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.66rem; color: #B8A888;
  display: block; text-transform: uppercase; letter-spacing: 0.04em;
}
.back-stats .v {
  font-family: 'IBM Plex Mono', monospace; font-size: 1.05rem;
  color: var(--card-back-ink); font-weight: 600;
}
.face-front .tc-tap {
  margin-top: auto; font-family: 'IBM Plex Mono', monospace; font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: 0.05em; color: #B8A888;
}

/* Back face: the bottle photo (placeholder for now) */
.tcard-flip .face-back {
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  align-items: center; justify-content: center; padding: 1.5rem;
}
.tcard-flip .face-back:hover, .tcard-flip .face-back:focus-visible { border-color: var(--accent); }
.face-back .tc-icon { width: 42%; height: auto; }
.face-back .tc-photo {
  max-width: 100%; max-height: 85%; width: auto; height: auto;
  object-fit: contain; border-radius: 2px;
}
.face-back .tc-photo-note {
  margin-top: 0.9rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); text-align: center;
}
.face-back .tc-tap {
  margin-top: 0.7rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint);
}

@media (prefers-reduced-motion: reduce) {
  .tcard-flip .face { transition: none; }
}

/* ---------- Contact ---------- */
.email-link {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  color: var(--accent-strong);
  border-bottom: 1px solid var(--accent);
}
.empty-note { color: var(--ink-faint); font-style: italic; padding: 1.2rem !important; }

/* ---------- Search ---------- */
.search-box { margin-top: 1rem; }
.search-input {
  width: 100%;
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  padding: 0.9rem 1rem;
  background: var(--bg);
  color: var(--ink);
  border: 2px solid var(--rule-strong);
  border-radius: 0;
}
.search-input:focus-visible {
  outline: none;
  border-color: var(--accent);
}
.search-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 0.8rem;
  letter-spacing: 0.02em;
}
.search-results { margin-top: 0.8rem; }
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.result-row .rname { font-family: 'Lora', serif; font-size: 1rem; }
.result-row .rmeta {
  font-size: 0.68rem;
  color: var(--accent-strong);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Quotes wall ---------- */
.quote-wall { margin-top: 1rem; }
.plaque {
  padding: 1.6rem 1.8rem;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  margin-bottom: 1.3rem;
}
.plaque p {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.5;
  margin: 0 0 0.6rem;
  color: var(--ink);
}
.plaque cite {
  font-family: 'IBM Plex Mono', monospace;
  font-style: normal;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

footer.sitefoot {
  max-width: 60rem;
  margin: 0 auto;
  padding-top: 3rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-faint);
  text-align: left;
  border-top: 1px solid var(--rule);
  margin-top: 2rem;
  padding-top: 1.5rem;
}
footer.sitefoot a { color: var(--ink-faint); }
footer.sitefoot a:hover { color: var(--accent-strong); }

/* ---------- Home page: centered layout ---------- */
body.home { text-align: center; }
body.home .masthead .dek,
body.home .masthead .lede,
body.home section > p.section-intro {
  margin-left: auto;
  margin-right: auto;
}
body.home footer.sitefoot { text-align: center; }
