/* wine shelf. same page as the chairs and the mugs: white, my handwriting,
   one blue, and the sidebar on the left. Nothing uppercased, nothing boxed. */

@font-face {
  font-family: "Hand of Jen";
  src: url("fonts/hand-of-jen.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Titles are set in Big Caslon, the face my name is in on jenf.vercel.app.
   Big Caslon ships with macOS; Libre Caslon Text is the free webfont that
   stands in for it everywhere else, which is the same pairing jenf uses. */
@font-face {
  font-family: "Caslon Web";
  src: url("fonts/libre-caslon-text.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  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: "Caslon Web";
  src: url("fonts/libre-caslon-text-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --muted: #1a1a1a;
  --soft: #b4b4b4;
  --faint: #e6e6e6;
  --accent: #002FA7;      /* Klein blue: ready, prices, the things that matter */
  --warm: #c2452f;        /* terracotta: drink up */
  --oak: #d9b98a;
  --sidebar-w: 236px;
  --hand: "Hand of Jen", "SF Mono", ui-monospace, monospace;
  --display: "Big Caslon", "Caslon Web", "Iowan Old Style", Georgia, serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: var(--hand);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
/* a press should be felt, not just registered */
.tab, .filter-btn, .sort-btn, .liked-btn, .room-btn, .link-btn, .dish, .primary-btn, .viewer-close, .viewer-back {
  transition: color 140ms ease, border-color 140ms ease, transform 140ms var(--ease-out);
}
.tab:active, .filter-btn:active, .sort-btn:active, .liked-btn:active, .room-btn:active,
.link-btn:active, .dish:active, .primary-btn:active, .viewer-close:active, .viewer-back:active { transform: scale(0.97); }
b, strong { font-weight: 700; }

/* ---------- sidebar ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg);
  z-index: 10;
  overflow-y: auto;
  scrollbar-width: none;            /* Firefox */
  -ms-overflow-style: none;         /* old Edge */
}
.sidebar::-webkit-scrollbar { width: 0; height: 0; }
.brand { line-height: 1.25; }
.site-title { font-family: var(--display); font-size: 24px; font-weight: 400; letter-spacing: 0; }
.byline { color: var(--muted); }
.byline a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--faint); }
.byline a:hover { color: var(--ink); border-bottom-color: var(--ink); }

.tabs { display: flex; gap: 14px; }
.tab { font-family: var(--display); font-size: 17px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); font-weight: 700; }

.search-wrap {
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--ink); padding-bottom: 6px;
}
.search-icon { color: var(--soft); font-size: 12px; }
.search-wrap input { border: 0; outline: 0; width: 100%; font: inherit; color: var(--ink); background: transparent; border-radius: 0; }
.search-wrap input::placeholder { color: var(--soft); }

.filter-group { border-top: 1px solid var(--faint); padding-top: 12px; }
.group-toggle {
  display: flex; align-items: baseline; gap: 8px; width: 100%;
  border: 0; background: none; color: var(--ink);
  cursor: pointer; padding: 0; text-align: left;
}
.group-title { font-family: var(--display); font-size: 17px; font-weight: 400; }
.group-value { font-family: var(--display); color: var(--muted); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.group-chev { color: var(--muted); width: 10px; text-align: center; }
.group-chev::before { content: "+"; }
.filter-group.open .group-chev::before { content: "\2013"; }
.filter-list { list-style: none; }
.filter-group:not(.open) .filter-list { display: none; }
.filter-group .filter-list { margin-top: 8px; }
.filter-list li { margin-bottom: 3px; }
.filter-btn, .sort-btn {
  border: 0; background: none; color: var(--muted);
  cursor: pointer; padding: 0; text-align: left;
}
.filter-btn:hover, .sort-btn:hover { color: var(--ink); }
.filter-btn.is-active, .sort-btn.is-active { color: var(--ink); }

.liked-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; color: var(--muted);
  cursor: pointer; padding: 0; text-align: left;
}
.liked-btn:hover { color: var(--ink); }
.liked-btn.is-on { color: var(--accent); }
.room-btn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; text-align: left; }
.room-btn:hover { color: var(--ink); }
.link-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--muted); border-bottom: 1px solid var(--faint); line-height: 1.1;
}
.link-btn:hover { color: var(--ink); border-bottom-color: var(--ink); }
.fine { color: var(--muted); font-size: 13px; line-height: 1.4; }
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }

/* ---------- status dots, the whole legend ----------
   ready is the blue. drink up is the terracotta. hold is an empty ring.
   past is ink. */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: 1px; }
.dot.ready { background: var(--accent); }
.dot.drink-up { background: var(--warm); }
.dot.hold { background: none; border: 1.5px solid var(--ink); }
.dot.past { background: var(--ink); }

/* ---------- main ---------- */
main { margin-left: var(--sidebar-w); }
.view[hidden] { display: none; }

.ledger {
  padding: 28px 40px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.ledger b { color: var(--ink); font-weight: 400; }
.ledger .up { color: var(--accent); }
.ledger .down { color: var(--warm); }
.ledger .stat { display: inline-block; margin-right: 26px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  padding: 20px 40px 90px;
  column-gap: 24px;
  row-gap: 34px;
}

.bottle {
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
  transition: transform 180ms var(--ease-out);
}
.bottle:active { transform: scale(0.99); }
.bottle-img-wrap {
  position: relative;
  height: 270px; width: 100%;
  display: flex; align-items: flex-end; justify-content: center;
}
.bottle-svg { height: 100%; width: auto; display: block; overflow: visible; }
.bottle-photo { object-fit: contain; object-position: bottom; mix-blend-mode: multiply; max-width: 100%; }
.bottle-meta { text-align: center; margin-top: 10px; line-height: 1.35; }
.b-name { font-family: var(--display); font-weight: 400; font-size: 17px; }
.b-sub { color: var(--muted); font-size: 14px; }
.b-line { font-size: 13px; margin-top: 4px; }
.b-line .dot { margin-right: 4px; }
.b-price { color: var(--accent); margin-top: 3px; }
.b-qty { color: var(--muted); font-size: 13px; margin-left: 4px; }
.mine-tag { color: var(--muted); font-size: 12px; }

/* ---------- the verbs ----------
   Hover (or focus, or the idle breath) plays what you would do with the
   bottle: pour, decant, swirl, chill, pop, sip. Origin is the base for
   anything that tilts, so it pivots the way a bottle in a hand does. */
.bottle-img-wrap .bottle-svg { transform-origin: 50% 96%; }

@media (prefers-reduced-motion: no-preference) {
  [data-verb="pour"]:hover .bottle-svg,   [data-verb="pour"].sit .bottle-svg   { animation: v-pour 900ms cubic-bezier(0.3, 1.2, 0.4, 1); }
  [data-verb="decant"]:hover .bottle-svg, [data-verb="decant"].sit .bottle-svg { animation: v-decant 1700ms ease-in-out; }
  [data-verb="swirl"]:hover .bottle-svg,  [data-verb="swirl"].sit .bottle-svg  { animation: v-swirl 1000ms ease-in-out; }
  [data-verb="chill"]:hover .bottle-svg,  [data-verb="chill"].sit .bottle-svg  { animation: v-chill 600ms ease-in-out; }
  [data-verb="pop"]:hover .bottle-svg,    [data-verb="pop"].sit .bottle-svg    { animation: v-pop 750ms cubic-bezier(0.3, 1.6, 0.4, 1); }
  [data-verb="sip"]:hover .bottle-svg,    [data-verb="sip"].sit .bottle-svg    { animation: v-sip 1500ms ease-in-out; }
  [data-verb="chill"]:hover .bottle-shine, [data-verb="chill"].sit .bottle-shine { animation: v-frost 600ms ease-in-out; }

  [data-verb="pour"].breath .bottle-svg   { animation: b-tilt 1800ms ease-in-out; }
  [data-verb="decant"].breath .bottle-svg { animation: b-tilt 2400ms ease-in-out; }
  [data-verb="swirl"].breath .bottle-svg  { animation: b-swirl 2000ms ease-in-out; }
  [data-verb="chill"].breath .bottle-svg  { animation: v-chill 900ms ease-in-out; }
  [data-verb="pop"].breath .bottle-svg    { animation: b-pop 1400ms ease-in-out; }
  [data-verb="sip"].breath .bottle-svg    { animation: b-tilt 2200ms ease-in-out; }
}
@keyframes v-pour {
  0% { transform: none; }
  40% { transform: rotate(-16deg) translateY(-2%); filter: drop-shadow(0 8px 8px rgba(0,0,0,0.14)); }
  70% { transform: rotate(-12deg) translateY(-1%); }
  100% { transform: none; }
}
@keyframes v-decant {
  0% { transform: none; }
  30% { transform: rotate(-24deg) translateY(-3%); filter: drop-shadow(0 10px 10px rgba(0,0,0,0.16)); }
  70% { transform: rotate(-22deg) translateY(-3%); filter: drop-shadow(0 10px 10px rgba(0,0,0,0.16)); }
  100% { transform: none; }
}
@keyframes v-swirl {
  0% { transform: none; }
  20% { transform: rotate(-3deg) translateX(-2%); }
  45% { transform: rotate(3deg) translateX(2%); }
  70% { transform: rotate(-2deg) translateX(-1%); }
  100% { transform: none; }
}
@keyframes v-chill {
  0%, 100% { transform: none; }
  15% { transform: translateX(-1.5px); }
  30% { transform: translateX(1.5px); }
  45% { transform: translateX(-1.2px); }
  60% { transform: translateX(1.2px); }
  75% { transform: translateX(-0.6px); }
}
@keyframes v-frost { 0%, 100% { fill-opacity: 0.2; } 50% { fill-opacity: 0.85; } }
@keyframes v-pop {
  0% { transform: none; }
  35% { transform: translateY(-7%) rotate(2deg); filter: drop-shadow(0 12px 10px rgba(0,0,0,0.12)); }
  65% { transform: translateY(1%) rotate(-1deg); }
  100% { transform: none; }
}
@keyframes v-sip {
  0%, 100% { transform: none; }
  25% { transform: rotate(-9deg); }
  50% { transform: rotate(-2deg); }
  75% { transform: rotate(-8deg); }
}
@keyframes b-tilt { 0%, 100% { transform: none; } 50% { transform: rotate(-5deg); } }
@keyframes b-swirl { 0%, 100% { transform: none; } 30% { transform: rotate(-1.5deg); } 70% { transform: rotate(1.5deg); } }
@keyframes b-pop { 0%, 100% { transform: none; } 50% { transform: translateY(-2.5%); } }

.empty { grid-column: 1 / -1; color: var(--muted); padding-top: 40px; }

/* ---------- the rack ---------- */
.rack-tools {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap;
  padding: 28px 40px 8px; color: var(--muted); font-size: 14px;
}
.rack-sorts { display: inline-flex; gap: 12px; align-items: baseline; }
.rack-right { display: inline-flex; gap: 16px; align-items: baseline; }
.rack { padding: 8px 40px 80px; overflow-x: auto; }

/* the wall unit, after Christopher Deam's CCD shelf: a thin oak box with the
   grain running along the boards and up the sides, one open slot per row, a
   shelf between rows, aluminium tracks, and a laminate sliding door for every
   bay. The doors share a track so they overlap. The oak is drawn: an SVG
   turbulence filter stretched along the grain and mapped onto oak tones. */
.unit {
  --fr: 16px; --sh: 12px;
  --oak-h: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'900'%20height%3D'160'%3E%3Cfilter%20id%3D'g'%20x%3D'0'%20y%3D'0'%20width%3D'100%25'%20height%3D'100%25'%20color-interpolation-filters%3D'sRGB'%3E%3CfeTurbulence%20type%3D'fractalNoise'%20baseFrequency%3D'0.0035%200.16'%20numOctaves%3D'4'%20seed%3D'7'%2F%3E%3CfeColorMatrix%20type%3D'matrix'%20values%3D'.33%20.33%20.33%200%200%20.33%20.33%20.33%200%200%20.33%20.33%20.33%200%200%200%200%200%200%201'%2F%3E%3CfeComponentTransfer%3E%3CfeFuncR%20type%3D'linear'%20slope%3D'2.4'%20intercept%3D'-.7'%2F%3E%3CfeFuncG%20type%3D'linear'%20slope%3D'2.4'%20intercept%3D'-.7'%2F%3E%3CfeFuncB%20type%3D'linear'%20slope%3D'2.4'%20intercept%3D'-.7'%2F%3E%3C%2FfeComponentTransfer%3E%3CfeComponentTransfer%3E%3CfeFuncR%20type%3D'table'%20tableValues%3D'0.73%200.92'%2F%3E%3CfeFuncG%20type%3D'table'%20tableValues%3D'0.55%200.82'%2F%3E%3CfeFuncB%20type%3D'table'%20tableValues%3D'0.35%200.66'%2F%3E%3C%2FfeComponentTransfer%3E%3C%2Ffilter%3E%3Crect%20width%3D'100%25'%20height%3D'100%25'%20filter%3D'url(%23g)'%2F%3E%3C%2Fsvg%3E");
  --oak-v: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'160'%20height%3D'900'%3E%3Cfilter%20id%3D'g'%20x%3D'0'%20y%3D'0'%20width%3D'100%25'%20height%3D'100%25'%20color-interpolation-filters%3D'sRGB'%3E%3CfeTurbulence%20type%3D'fractalNoise'%20baseFrequency%3D'0.16%200.0035'%20numOctaves%3D'4'%20seed%3D'11'%2F%3E%3CfeColorMatrix%20type%3D'matrix'%20values%3D'.33%20.33%20.33%200%200%20.33%20.33%20.33%200%200%20.33%20.33%20.33%200%200%200%200%200%200%201'%2F%3E%3CfeComponentTransfer%3E%3CfeFuncR%20type%3D'linear'%20slope%3D'2.4'%20intercept%3D'-.7'%2F%3E%3CfeFuncG%20type%3D'linear'%20slope%3D'2.4'%20intercept%3D'-.7'%2F%3E%3CfeFuncB%20type%3D'linear'%20slope%3D'2.4'%20intercept%3D'-.7'%2F%3E%3C%2FfeComponentTransfer%3E%3CfeComponentTransfer%3E%3CfeFuncR%20type%3D'table'%20tableValues%3D'0.73%200.92'%2F%3E%3CfeFuncG%20type%3D'table'%20tableValues%3D'0.55%200.82'%2F%3E%3CfeFuncB%20type%3D'table'%20tableValues%3D'0.35%200.66'%2F%3E%3C%2FfeComponentTransfer%3E%3C%2Ffilter%3E%3Crect%20width%3D'100%25'%20height%3D'100%25'%20filter%3D'url(%23g)'%2F%3E%3C%2Fsvg%3E");
  --oak-b: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'900'%20height%3D'160'%3E%3Cfilter%20id%3D'g'%20x%3D'0'%20y%3D'0'%20width%3D'100%25'%20height%3D'100%25'%20color-interpolation-filters%3D'sRGB'%3E%3CfeTurbulence%20type%3D'fractalNoise'%20baseFrequency%3D'0.0035%200.16'%20numOctaves%3D'4'%20seed%3D'5'%2F%3E%3CfeColorMatrix%20type%3D'matrix'%20values%3D'.33%20.33%20.33%200%200%20.33%20.33%20.33%200%200%20.33%20.33%20.33%200%200%200%200%200%200%201'%2F%3E%3CfeComponentTransfer%3E%3CfeFuncR%20type%3D'linear'%20slope%3D'2.4'%20intercept%3D'-.7'%2F%3E%3CfeFuncG%20type%3D'linear'%20slope%3D'2.4'%20intercept%3D'-.7'%2F%3E%3CfeFuncB%20type%3D'linear'%20slope%3D'2.4'%20intercept%3D'-.7'%2F%3E%3C%2FfeComponentTransfer%3E%3CfeComponentTransfer%3E%3CfeFuncR%20type%3D'table'%20tableValues%3D'0.81%200.94'%2F%3E%3CfeFuncG%20type%3D'table'%20tableValues%3D'0.68%200.87'%2F%3E%3CfeFuncB%20type%3D'table'%20tableValues%3D'0.5%200.75'%2F%3E%3C%2FfeComponentTransfer%3E%3C%2Ffilter%3E%3Crect%20width%3D'100%25'%20height%3D'100%25'%20filter%3D'url(%23g)'%2F%3E%3C%2Fsvg%3E");
  position: relative; min-width: 720px; max-width: 1160px; margin: 30px auto 0;
  padding: var(--fr);
  background: var(--oak-h) center / 900px 160px;
  border-radius: 1px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), inset 0 -1px 0 rgba(0,0,0,0.18);
}
.unit::before, .unit::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: var(--fr); z-index: 8;
  background: var(--oak-v) center / 160px 900px;
}
.unit::before { left: 0; box-shadow: inset -1px 0 0 rgba(0,0,0,0.14), inset 1px 0 0 rgba(255,255,255,0.35); }
.unit::after { right: 0; box-shadow: inset 1px 0 0 rgba(0,0,0,0.14), inset -1px 0 0 rgba(255,255,255,0.2); }
.unit-row {
  position: relative; height: 178px; overflow: hidden;
  background: var(--oak-b) center / 900px 160px;
  box-shadow:
    inset 0 18px 20px -14px rgba(0,0,0,0.38), inset 0 -5px 8px -6px rgba(0,0,0,0.16),
    inset 4px 0 8px -6px rgba(0,0,0,0.3), inset -4px 0 8px -6px rgba(0,0,0,0.3);
}
.bays { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.bay {
  display: flex; align-items: flex-end; justify-content: center; gap: 4px; padding: 0 14px 8px;
  min-width: 0;
}
.shelf {
  position: relative; z-index: 9; height: var(--sh);
  background: var(--oak-h) center / 900px 160px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), inset 0 -1px 0 rgba(0,0,0,0.22), 0 3px 4px -2px rgba(0,0,0,0.25);
}
.track {
  position: absolute; left: 0; right: 0; height: 3px; z-index: 5;
  background: linear-gradient(#f4f5f6, #b9bdc2 60%, #8f949a);
}
.track-top { top: 0; } .track-bottom { bottom: 0; }
.slot {
  position: relative; height: 150px; flex: 1 1 0; min-width: 0;
  display: flex; align-items: flex-end; justify-content: center;
  cursor: grab; touch-action: none; user-select: none;
  transition: transform 200ms var(--ease-out);
}
.slot::after {
  content: ""; position: absolute; left: 12%; right: 12%; bottom: -4px; height: 7px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0,0,0,0.2), rgba(0,0,0,0));
}
.slot .bottle-svg { height: 100%; width: auto; max-width: 100%; display: block; transform-origin: 50% 96%; }
.slot .bottle-photo { object-fit: contain; object-position: bottom; }
/* the stripe.press pull: a bottle comes toward you on hover */
@media (hover: hover) and (pointer: fine) {
  .slot:hover { transform: translateY(-5px) scale(1.05); z-index: 2; }
}
.slot.dragging { transition: none; z-index: 5; cursor: grabbing; }
.slot.dragging .bottle-svg { filter: drop-shadow(0 10px 10px rgba(0,0,0,0.22)); }
/* a door: flat laminate on a track, one bay wide, in front of everything */
.door {
  position: absolute; top: 3px; bottom: 3px; left: 0; width: calc(100% / 3); z-index: 6;
  cursor: grab; touch-action: none; user-select: none;
  background-color: var(--c);
  background-image: linear-gradient(90deg, rgba(255,255,255,0.10), rgba(255,255,255,0) 30%, rgba(0,0,0,0.10));
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.14),
    2px 0 4px -3px rgba(0,0,0,0.18), -2px 0 4px -3px rgba(0,0,0,0.14);
  transition: transform 380ms var(--ease-in-out);
}
.door.sliding { transition: none; cursor: grabbing; }
.rack-tip {
  position: fixed; z-index: 30; pointer-events: none;
  background: rgba(255,255,255,0.96); border: 1px solid var(--faint); border-radius: 999px;
  padding: 3px 12px; font-size: 13px; white-space: nowrap; color: var(--ink);
}
.rack-tip[hidden] { display: none; }

/* ---------- tonight ---------- */
.tonight { padding: 28px 40px 90px; max-width: 980px; }
.tonight-title { font-family: var(--display); font-size: 24px; font-weight: 400; margin-bottom: 14px; }
.dishes { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 30px; }
.dish {
  border: 1px solid var(--faint); border-radius: 999px; background: none;
  padding: 4px 13px; cursor: pointer; color: var(--muted); font-size: 14px;
}
.dish:hover { color: var(--ink); border-color: var(--ink); }
.dish.is-on { color: var(--accent); border-color: var(--accent); }
.picks-head { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.pick { display: grid; grid-template-columns: 120px 1fr; column-gap: 26px; align-items: end; margin-bottom: 30px; cursor: pointer; }
.pick-stage { height: 200px; display: flex; align-items: flex-end; justify-content: center; }
.pick-stage .bottle-svg { height: 100%; width: auto; transform-origin: 50% 96%; }
.pick-body { padding-bottom: 6px; }
.pick-rank { color: var(--muted); font-size: 13px; }
.pick-name { font-family: var(--display); font-weight: 400; font-size: 21px; }
.pick-sub { color: var(--muted); font-size: 14px; }
.pick-why { margin-top: 6px; }
.pick-how { color: var(--muted); font-size: 14px; margin-top: 2px; }
.pick-how b { color: var(--accent); font-weight: 400; }
.also-head { color: var(--muted); font-size: 14px; margin: 34px 0 8px; }
.also { list-style: none; }
.also li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--faint); cursor: pointer; }
.also li:hover .also-name { color: var(--accent); }
.also-name { font-family: var(--display); font-weight: 400; }
.also-sub { color: var(--muted); font-size: 14px; }
.also-right { margin-left: auto; font-size: 13px; white-space: nowrap; }

/* ---------- viewer ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 50;
  background: var(--stage, #fff); color: var(--ink);
  display: grid; grid-template-columns: minmax(280px, 42%) 1fr;
  overflow-y: auto;
}
.viewer[hidden] { display: none; }
/* on a dark flood everything goes to white, the way the type does on stripe.press */
.viewer { --muted: var(--ink); --accent: var(--ink); --warm: var(--ink); --faint: color-mix(in srgb, var(--ink) 22%, transparent); }
.viewer.is-dark { --ink: #fff; }
.viewer-sub, .viewer-verb, .viewer-pairs, .tl-years, .ledger-table td:first-child, .ledger-table td.num small { }
.viewer .tl-bar { background: color-mix(in srgb, var(--ink) 20%, transparent); }
.viewer .tl-window { background: color-mix(in srgb, var(--ink) 55%, transparent); }
.viewer .tl-late { background: color-mix(in srgb, var(--ink) 30%, transparent); }
.viewer .tl-peak, .viewer .tl-now { background: var(--ink); }
.viewer .dot { background: var(--ink); }
.viewer-back {
  position: fixed; top: 18px; left: 26px; z-index: 60;
  border: 0; background: none; cursor: pointer; font-size: 15px; color: var(--ink);
}
.viewer-back:hover { text-decoration: underline; }
.viewer-close {
  position: fixed; top: 14px; right: 22px; z-index: 60;
  border: 0; background: none; font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer;
}
.viewer-close:hover { color: var(--ink); }
.viewer-stage { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; justify-content: center; padding: 48px 20px; perspective: 1400px; }
/* the bottle sits a little turned, the way the book does when it lands */
.viewer-bottle { transform-style: preserve-3d; transform: rotateY(-14deg) rotateX(3deg) rotateZ(-2deg); transform-origin: 50% 50%; filter: drop-shadow(10px 16px 20px rgba(0,0,0,0.16)); will-change: transform; }
.viewer-stage .bottle-svg { height: min(84vh, 720px); width: auto; transform-origin: 50% 96%; }
.viewer-meta { padding: 72px 64px 80px 12px; max-width: 560px; }
.viewer-title { font-family: var(--display); font-size: 32px; font-weight: 400; line-height: 1.15; }
.viewer-sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
.viewer-status { margin-top: 18px; font-size: 17px; }
.viewer-status .dot { margin-right: 6px; }
.viewer-verb { color: var(--muted); font-size: 14px; }
.viewer-verb b { color: var(--ink); font-weight: 400; }

.timeline { margin-top: 18px; }
.tl-bar { position: relative; height: 6px; background: var(--faint); border-radius: 3px; }
.tl-window { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 35%, white); border-radius: 3px; }
.tl-late { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--warm) 40%, white); border-radius: 0 3px 3px 0; }
.tl-peak { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--accent); }
.tl-now { position: absolute; top: -7px; width: 2px; height: 20px; background: var(--ink); }
.tl-now::after {
  content: "now"; position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: var(--ink);
}
.tl-years { display: flex; justify-content: space-between; margin-top: 22px; font-size: 12px; color: var(--muted); }
.tl-years b { font-weight: 400; color: var(--ink); }

.ledger-table { width: 100%; border-collapse: collapse; margin-top: 26px; font-size: 15px; }
.ledger-table td { padding: 5px 0; border-top: 1px solid var(--faint); vertical-align: baseline; }
.ledger-table td:first-child { color: var(--muted); width: 45%; }
.ledger-table td.num { text-align: right; color: var(--accent); }
.ledger-table td.num small { color: var(--muted); font-size: 12px; margin-left: 6px; }
.ledger-table .down { color: var(--warm); }
.viewer-note { margin-top: 26px; }
.viewer-pairs { margin-top: 18px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.viewer-pairs b { color: var(--ink); font-weight: 400; }
.viewer-actions { margin-top: 26px; display: flex; gap: 18px; font-size: 14px; }

/* ---------- panels: add a bottle, about ---------- */
.panel { position: fixed; inset: 0; z-index: 55; background: var(--bg); overflow-y: auto; }
.panel[hidden] { display: none; }
.panel-inner { max-width: 560px; margin: 0 auto; padding: 72px 24px 80px; }
.panel-title { font-family: var(--display); font-size: 26px; font-weight: 400; margin-bottom: 18px; }

.drop {
  display: block; margin: 0 0 18px;
  border: 1px dashed var(--soft); border-radius: 2px; padding: 44px 20px; text-align: center;
  color: var(--muted); cursor: pointer;
}
.drop { transition: border-color 140ms ease, color 140ms ease; }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--accent); }
.drop input { display: none; }
.adder-preview { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.adder-preview img { width: 120px; height: 160px; object-fit: cover; border-radius: 2px; border: 1px solid var(--faint); }
.adder-status { color: var(--muted); font-size: 14px; line-height: 1.5; }
.adder-status b { color: var(--ink); font-weight: 400; }
.read-text { color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 8px; max-height: 5.6em; overflow: hidden; }
.candidates { list-style: none; margin-top: 14px; }
.candidates li {
  display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--faint); cursor: pointer;
}
.candidates li:hover .cand-name, .candidates li.is-on .cand-name { color: var(--accent); }
.cand-name { font-family: var(--display); font-weight: 400; }
.cand-sub { color: var(--muted); font-size: 14px; }
.cand-score { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.adder-search { margin-top: 18px; }
/* rows from the shelf reader: tick, name, year, confidence */
.candidates li.scan-row { display: grid; grid-template-columns: auto 1fr 84px auto; gap: 4px 12px; align-items: center; cursor: default; }
.scan-row .cand-name { color: var(--ink); }
.scan-main { display: flex; flex-direction: column; min-width: 0; }
.scan-match { color: var(--muted); font-size: 12px; }
.scan-check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.scan-year { font: inherit; font-size: 14px; color: var(--ink); border: 0; border-bottom: 1px solid var(--faint); background: none; width: 84px; padding: 2px 0; outline: 0; }
.scan-year:focus { border-bottom-color: var(--ink); }
#read-foot .primary-btn { margin-right: 14px; }
.adder-form { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field span { color: var(--muted); font-size: 13px; }
.field input, .field select {
  font: inherit; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--ink); padding: 4px 0; outline: 0; border-radius: 0;
}
.field input:focus { border-bottom-color: var(--accent); }
.field-wide { grid-column: 1 / -1; }
.primary-btn {
  grid-column: 1 / -1; justify-self: start; margin-top: 8px;
  border: 1px solid var(--ink); background: none; padding: 6px 16px; border-radius: 999px; cursor: pointer;
}
.primary-btn:hover { border-color: var(--accent); color: var(--accent); }
.primary-btn:disabled { color: var(--muted); border-color: var(--faint); cursor: default; }
.adder-note { color: var(--muted); font-size: 13px; margin-top: 14px; line-height: 1.5; }

/* ---------- phones ---------- */
@media (max-width: 720px) {
  .sidebar { position: static; width: auto; gap: 14px; overflow: visible; }
  .sidebar-footer { margin-top: 0; }
  main { margin-left: 0; }
  .ledger { padding: 8px 20px 0; }
  .grid { padding: 8px 20px 60px; grid-template-columns: repeat(2, 1fr); column-gap: 16px; row-gap: 28px; }
  .bottle-img-wrap { height: 170px; }
  .rack-tools, .rack, .tonight { padding-left: 20px; padding-right: 20px; }
  .viewer { grid-template-columns: 1fr; }
  .viewer-stage { position: static; height: 46vh; padding: 40px 20px 0; }
  .viewer-stage .bottle-svg { height: 100%; }
  .viewer-meta { padding: 20px 20px 60px; }
  .pick { grid-template-columns: 80px 1fr; column-gap: 16px; }
  .pick-stage { height: 130px; }
  .adder-form { grid-template-columns: 1fr; }
}

/* Reduced motion keeps what explains and drops what only moves. */
@media (prefers-reduced-motion: reduce) {
  .slot:hover, .bottle:active, .tab:active, .filter-btn:active, .sort-btn:active,
  .liked-btn:active, .room-btn:active, .link-btn:active, .dish:active,
  .primary-btn:active, .viewer-close:active, .viewer-back:active { transform: none; }
  .door { transition-duration: 1ms; }
  .viewer-bottle { transform: none; }
}
