@import url("assets/r3/type.css");

:root {
  --ink: #141217;
  --ink-2: #3b3840;
  --muted: #6b6770;
  --line: rgba(20, 18, 23, .1);
  --line-2: rgba(20, 18, 23, .2);
  --bg: #ffffff;
  --bg-2: #f4f4f6;
  --bg-3: #ebebef;
  --wine: #6b1736;
  --wine-2: #561129;
  --wine-soft: #f7eef1;
  --display: "Geologica", "Commissioner", system-ui, sans-serif;
  --font: "Commissioner", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gut: max(16px, env(safe-area-inset-left));
  --wrap: 1240px;
  --side: max(var(--gut), calc((100% - var(--wrap)) / 2));
  --ease: cubic-bezier(.2, .7, .1, 1);
  --bar-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 12px); }
body {
  margin: 0; background: var(--bg); color: var(--ink); overflow-x: hidden;
  font: 400 17px/1.55 var(--font); -webkit-font-smoothing: antialiased;
  padding-top: var(--bar-h);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }
h1[tabindex="-1"]:focus, main:focus { outline: none; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -80px; z-index: 60; background: var(--wine); color: #fff; padding: 10px 14px; border-radius: 8px; font-weight: 500; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- type ---------- */
.display, .display-md, .display-sm, .eyebrow, .slab-title, .use-k, .d-title, .fact-q {
  font-family: var(--display); font-variation-settings: "SHRP" 0, "CRSV" 0;
}
.display, .display-md, .display-sm { margin: 0; text-wrap: balance; color: var(--ink); }
.display { font-size: clamp(42px, 5.6vw, 84px); line-height: .98; font-weight: 560; letter-spacing: -.045em; font-variation-settings: "SHRP" 40, "CRSV" 0; }
.display-md { font-size: clamp(32px, 3.4vw, 48px); line-height: 1.04; font-weight: 540; letter-spacing: -.035em; }
.display-sm { font-size: clamp(28px, 3vw, 42px); line-height: 1.06; font-weight: 540; letter-spacing: -.035em; }
.eyebrow { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--wine); }
.label { font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.fine { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

/* ---------- controls ---------- */
/* Each glass control is one volume: fill, refracting backdrop (glass.js), a single specular rim that fades along the edge, and a soft shadow.
   Where glass.js can tone the backdrop (.tone-live), the primary's colour comes from the scene mapped onto a wine ramp, its rim is lit by a light that follows the pointer, and no fixed sheen sits on top;
   elsewhere it falls back to a darkened backdrop under a dense ruby fill. */
:root {
  --bw-fill: rgba(98, 18, 49, .86);
  --bw-fill-h: rgba(106, 23, 54, .88);
  --bw-veil: transparent;
  --bw-veil-h: rgba(255, 255, 255, .025);
  --bw-rim-live: rgba(255, 255, 255, .12);
  --bw-optic: blur(4px) saturate(1.2) brightness(.55);
  --bw-shadow: 0 3px 10px -4px rgba(30, 20, 25, .18);
  --bw-shadow-a: 0 1px 4px -2px rgba(30, 20, 25, .18);
  --bw-rim: rgba(255, 255, 255, .12);
  --bq-fill: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .62)), rgba(244, 243, 246, .3);
  --bq-fill-h: linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .72)), rgba(244, 243, 246, .3);
  --bq-optic: blur(12px) saturate(1.4) brightness(1.04);
  --bq-fg: var(--wine-2);
  --bq-shadow: 0 1px 2px rgba(20, 18, 23, .07), 0 6px 14px -9px rgba(64, 12, 32, .3);
  --bq-shadow-sm: 0 1px 2px rgba(20, 18, 23, .07), 0 6px 14px -9px rgba(64, 12, 32, .32);
  --bq-rim: linear-gradient(128deg, #fff 0%, rgba(255, 255, 255, .3) 24%, rgba(255, 255, 255, 0) 46%, rgba(255, 255, 255, 0) 60%, rgba(107, 23, 54, .1) 82%, rgba(255, 255, 255, .9) 100%);
  --bp-fill: linear-gradient(180deg, rgba(107, 23, 54, .16), rgba(107, 23, 54, .08)), rgba(255, 255, 255, .5);
  --bp-shadow: inset 0 2px 6px -2px rgba(74, 14, 36, .42), inset 0 0 0 1px rgba(107, 23, 54, .22);
  --b-fx: block;
}
/* Three materials for every button family: toned wine glass (primary), clear glass (secondary and tertiary: buttons, icon buttons, text commands,
   zoom, picks, dishes, tabs, choices) and the pressed wine lens for any pressed, selected or expanded state. Size and shape follow each layout. */
.btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 0; text-decoration: none; background: none; white-space: nowrap;
  font: 500 16px/1 var(--font); transition: color .15s, background .2s, box-shadow .2s var(--ease), transform .12s var(--ease);
}
:is(.btn, .icon-btn, .link-btn, .zoom, .pick, .dish, .tabs [role="tab"], .glass-choice button, .fact-q button)::before {
  content: ""; display: var(--b-fx); position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: var(--rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.btn::after {
  content: ""; display: var(--b-fx); position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(34% 90% at var(--gx, 26%) var(--gy, 0%), rgba(255, 255, 255, var(--glint, .3)), rgba(255, 255, 255, 0) 70%);
  opacity: .8; transition: opacity .2s;
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: scale(.98); }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 17px; }
.btn-wine {
  --optic: var(--bw-optic); --rim: var(--bw-rim); --glint: 0; --tone: wine; --tone-optic: brightness(1); --spec: 0; --frost: #5e1130;
  --matte: 1; --frost-flat: 1; --dome: 0; --frost-a: 0; --frost-blur: 4;
  color: #fff; font-weight: 600; background: var(--bw-fill); box-shadow: var(--bw-shadow);
  -webkit-backdrop-filter: var(--optic); backdrop-filter: var(--optic);
}
.btn-quiet, .icon-btn, .link-btn, .zoom, .pick, .dish, .tabs [role="tab"], .glass-choice button, .fact-q button {
  --optic: var(--bq-optic); --rim: var(--bq-rim); --glint: .4; --spec: .15; --frost: #f4f3f6;
  --matte: 1; --dome: 0; --frost-a: .78; --frost-blur: 12;
  position: relative; border: 0; color: var(--bq-fg); background: var(--bq-fill); box-shadow: var(--bq-shadow);
  -webkit-backdrop-filter: var(--optic); backdrop-filter: var(--optic);
  transition: color .15s, background .2s, box-shadow .2s var(--ease), transform .12s var(--ease);
}
.link-btn, .zoom, .pick, .dish, .tabs [role="tab"], .glass-choice button, .fact-q button { box-shadow: var(--bq-shadow-sm); }
.lens-live { -webkit-backdrop-filter: var(--lens-optic); backdrop-filter: var(--lens-optic); }
.btn-wine.tone-live { --rim: var(--bw-rim-live); background: var(--bw-veil); }
/* No specular bloom on a matte primary, including hover and press. */
.btn-wine::after { content: none; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; gap: 8px; }
.btn-sm svg { width: 18px; height: 18px; }
@media (hover: hover) {
  .btn:hover::after { opacity: 1; }
  .btn-wine:not([aria-pressed="true"]):hover { background: var(--bw-fill-h); }
  .btn-wine.tone-live:not([aria-pressed="true"]):hover { background: var(--bw-veil-h); }
  :is(.btn-quiet, .icon-btn, .link-btn, .zoom, .pick, .dish, .tabs [role="tab"], .glass-choice button, .fact-q button):not([aria-pressed="true"], [aria-selected="true"], [aria-expanded="true"], :disabled):hover { background: var(--bq-fill-h); }
}
.btn-wine:not([aria-pressed="true"]):active { box-shadow: var(--bw-shadow-a); }
:is(.btn, .link-btn, .zoom, .pick, .dish, .tabs [role="tab"], .glass-choice button, .fact-q button)[aria-pressed="true"], .tabs [role="tab"][aria-selected="true"], :is(.fact-q button, .link-btn)[aria-expanded="true"] { --rim: none; color: var(--wine); background: var(--bp-fill); box-shadow: var(--bp-shadow); }
.btn[aria-pressed="true"]::after { content: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
@media (pointer: coarse) { .btn-sm { min-height: 44px; } }
/* frosted solid glass: no backdrop-filter support, or system reduced transparency unless "Прозрачные" was chosen.
   Nothing shows through, but the volume keeps its lit rim, inner reflections, light pooled at the base and the shadow. */
:root {
  --bw-solid: #651632;
  --bw-solid-h: #6b1937;
  --bw-solid-shadow: 0 3px 10px -4px rgba(30, 20, 25, .18);
  --bq-solid: radial-gradient(120% 100% at 24% -30%, #fff, rgba(255, 255, 255, 0) 62%), linear-gradient(180deg, #f6f5f8 0%, #ebeaef 100%);
  --bq-solid-h: radial-gradient(120% 100% at 24% -30%, #fff, rgba(255, 255, 255, 0) 66%), linear-gradient(180deg, #f9f8fa 0%, #efeef2 100%);
  --bq-solid-shadow: inset 0 1px 0 #fff, inset 0 -2px 3px -2px rgba(107, 23, 54, .14), 0 1px 2px rgba(20, 18, 23, .08), 0 10px 22px -12px rgba(64, 12, 32, .36);
  --bq-solid-shadow-sm: inset 0 1px 0 #fff, inset 0 -1px 2px -1px rgba(107, 23, 54, .14), 0 1px 2px rgba(20, 18, 23, .08), 0 6px 14px -9px rgba(64, 12, 32, .34);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --bw-fill: var(--bw-solid); --bw-fill-h: var(--bw-solid-h); --bw-optic: none; --bw-shadow: var(--bw-solid-shadow); --bq-fill: var(--bq-solid); --bq-fill-h: var(--bq-solid-h); --bq-optic: none; --bq-shadow: var(--bq-solid-shadow); --bq-shadow-sm: var(--bq-solid-shadow-sm); }
}
@media (prefers-reduced-transparency: reduce) {
  html:not([data-glass="on"]) { --bw-fill: var(--bw-solid); --bw-fill-h: var(--bw-solid-h); --bw-optic: none; --bw-shadow: var(--bw-solid-shadow); --bq-fill: var(--bq-solid); --bq-fill-h: var(--bq-solid-h); --bq-optic: none; --bq-shadow: var(--bq-solid-shadow); --bq-shadow-sm: var(--bq-solid-shadow-sm); }
}
/* "Плотные": flat fills, chosen explicitly */
/* frost-live: glass.js paints the opaque frosted face and the lit, bending rim itself, so the solid fill steps aside */
.btn-wine.frost-live { box-shadow: var(--bw-shadow); }
:is(.btn-quiet, .icon-btn, .link-btn, .zoom, .pick, .dish, .tabs [role="tab"], .glass-choice button, .fact-q button).frost-live, :is(.btn-quiet, .icon-btn, .link-btn, .zoom, .pick, .dish, .tabs [role="tab"], .glass-choice button, .fact-q button).frost-live:hover { background: none; box-shadow: var(--bq-shadow); }
:is(.link-btn, .zoom, .pick, .dish, .tabs [role="tab"], .glass-choice button, .fact-q button).frost-live { box-shadow: var(--bq-shadow-sm); }
@media (hover: hover) { :is(.btn-quiet, .icon-btn, .link-btn, .zoom, .pick, .dish, .tabs [role="tab"], .glass-choice button, .fact-q button).frost-live:not([aria-pressed="true"], [aria-selected="true"], [aria-expanded="true"], :disabled):hover { background: rgba(255, 255, 255, .26); } }
html[data-glass="off"] { --bw-fill: var(--wine); --bw-fill-h: var(--wine-2); --bw-optic: none; --bw-shadow: none; --bw-shadow-a: none; --bq-fill: var(--bg-2); --bq-fill-h: var(--bg-3); --bq-fg: var(--ink); --bq-optic: none; --bq-shadow: none; --bq-shadow-sm: none; --bp-fill: var(--wine-soft); --bp-shadow: none; --b-fx: none; }
@media (prefers-contrast: more) {
  :root:root { --bw-fill: var(--wine); --bw-fill-h: var(--wine-2); --bw-optic: none; --bw-shadow: 0 0 0 1px var(--ink); --bw-shadow-a: inset 0 0 0 2px #fff, 0 0 0 2px var(--ink); --bq-fill: #fff; --bq-fill-h: #fff; --bq-fg: var(--ink); --bq-optic: none; --bq-shadow: inset 0 0 0 1px var(--ink); --bq-shadow-sm: inset 0 0 0 1px var(--ink); --bp-fill: #fff; --bp-shadow: inset 0 0 0 2px var(--wine); --b-fx: none; }
}

.tlink {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none;
  color: var(--wine); font: 500 16px/1.3 var(--font); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px;
}
.tlink svg, .link-btn svg { width: 18px; height: 18px; transition: transform .15s var(--ease); }
@media (hover: hover) {
  .tlink:hover { text-decoration-thickness: 2px; }
  .tlink:hover svg { transform: translateX(2px); }
}
/* tertiary command: a compact clear-glass capsule; removing is neutral ink, not the wine of an invitation */
.link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; font: 500 15px/1.2 var(--font); white-space: nowrap; }
.link-btn:is([data-fk^="rm:"], [data-fk^="hist:"], [data-fk^="cmprm:"], [data-fk="clear"]) { color: var(--ink-2); }
@media (hover: hover) { .link-btn:is([data-fk^="rm:"], [data-fk^="hist:"], [data-fk^="cmprm:"], [data-fk="clear"]):hover { color: #a2313b; } }
@media (pointer: coarse) { .link-btn { min-height: 44px; } }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; border: 0; }
.icon-btn svg { width: 20px; height: 20px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1.2 var(--font); white-space: nowrap; color: var(--ink-2); }
.tag-likely { color: var(--wine); }
.tag-likely::before, .tag-choice::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-choice { color: var(--ink); }
.tag-choice::before { background: none; box-shadow: inset 0 0 0 1.5px currentColor; }
.tag-example { color: var(--ink-2); background: var(--bg-2); padding: 3px 7px; border-radius: 5px; }

/* ---------- liquid glass navigation: one floating capsule over the page, never a full-width bar ---------- */
:root {
  --lg-fill: linear-gradient(180deg, rgba(255, 255, 255, .36), rgba(255, 255, 255, .14));
  --lg-optic: blur(5px) saturate(1.9) brightness(1.04);
  --lg-depth: 0 1px 2px rgba(20, 18, 23, .06), 0 14px 34px -16px rgba(64, 12, 32, .34);
  --lg-rim: linear-gradient(100deg, #fff 0%, rgba(255, 255, 255, .25) 14%, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0) 72%, rgba(107, 23, 54, .08) 88%, rgba(255, 255, 255, .85) 100%);
}
:root {
  --lg-solid: radial-gradient(120% 140% at 20% -40%, #fff, rgba(255, 255, 255, 0) 60%), linear-gradient(180deg, #fbfafc, #f1f0f4);
  --lg-solid-depth: inset 0 1px 0 #fff, inset 0 -1px 2px rgba(107, 23, 54, .07), 0 1px 2px rgba(20, 18, 23, .07), 0 14px 34px -16px rgba(64, 12, 32, .38);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { :root { --lg-fill: var(--lg-solid); --lg-optic: none; --lg-depth: var(--lg-solid-depth); } }
@media (prefers-reduced-transparency: reduce) { html:not([data-glass="on"]) { --lg-fill: var(--lg-solid); --lg-optic: none; --lg-depth: var(--lg-solid-depth); } }
/* This browser system mode can report reduced transparency, so the fixed nav keeps a denser native matte frost there; unsupported, "off" and high contrast stay solid. */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  @media (prefers-reduced-transparency: reduce) and (not (prefers-contrast: more)) {
    html:not([data-glass="on"]):not([data-glass="off"]) { --lg-fill: linear-gradient(180deg, rgba(255, 255, 255, .46), rgba(255, 255, 255, .30)); --lg-optic: blur(10px) saturate(1.5); }
    @media (min-width: 761px) {
      /* Let the capsule blur the actual page, rather than the white scrim behind it. */
      html:not([data-glass="on"]):not([data-glass="off"]) .bar::before { opacity: 0; }
    }
  }
}
html[data-glass="off"] { --lg-fill: #fff; --lg-optic: none; }
.bar {
  position: fixed; z-index: 40; top: 0; left: 0; right: 0; height: calc(var(--bar-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top); pointer-events: none;
}
.bar::before {
  content: ""; position: absolute; inset: 0 0 -14px; pointer-events: none; transition: opacity .25s;
  background: linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .34) 60%, rgba(255, 255, 255, 0));
}
.bar.over-hero::before { opacity: 0; }
.bar-in { position: relative; height: var(--bar-h); margin: 0 var(--side); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bar-glass { display: none; }
.mark {
  position: relative; display: inline-flex; align-items: center; gap: 3px; min-height: 44px; text-decoration: none; color: var(--ink);
  font: 600 18px/1 var(--display); letter-spacing: -.03em; font-variation-settings: "SHRP" 40;
}
.mark-symbol { width: 28px; height: 28px; flex: none; }
.nav { display: flex; gap: 2px; }
.nav a {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  text-decoration: none; font-size: 15px; font-weight: 500; color: var(--ink-2); transition: color .15s, background-color .15s;
}
.nav a svg { width: 18px; height: 18px; }
@media (hover: hover) { .nav a:hover:not([aria-current="page"]) { color: var(--ink); background: rgba(255, 255, 255, .5); } }
.nav a[aria-current="page"] { color: var(--wine); background: rgba(107, 23, 54, .09); }
.bar-in::before, .mark::before, .nav::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; background: var(--lg-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.bar-in::after, .mark::after, .nav::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120px 30px at var(--gx, 18%) 0%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0));
}
@media (min-width: 761px) {
  :root { --bar-h: 72px; }
  .bar-in {
    --optic: var(--lg-optic);
    width: max-content; max-width: calc(100% - 2 * var(--gut)); height: 56px; margin: 10px auto 0; padding: 0 6px 0 24px; gap: 24px;
    border-radius: 999px; pointer-events: auto;
    /* Keep scrolling backdrop damage off the navigation's text surface. */
    transform: translateZ(0);
  }
  .bar-glass {
    display: block; position: absolute; inset: 0; z-index: -1;
    pointer-events: none; border-radius: inherit;
    background: var(--lg-fill); box-shadow: var(--lg-depth);
    -webkit-backdrop-filter: var(--optic); backdrop-filter: var(--optic);
    transform: translateZ(0);
  }
  .mark::before, .mark::after, .nav::before, .nav::after { content: none; }
}
@media (prefers-contrast: more) {
  :root { --lg-fill: #fff; --lg-optic: none; --lg-depth: 0 0 0 1px var(--ink); }
  .bar::before { background: #fff; opacity: 1; }
  .bar-in::before, .bar-in::after, .mark::before, .mark::after, .nav::before, .nav::after { content: none; }
}
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 5px; background: var(--wine); color: #fff; font: 600 12px/20px var(--font); text-align: center; }

.update {
  position: sticky; top: var(--bar-h); z-index: 35; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--side); background: var(--wine-soft); color: var(--wine); font-size: 15px;
}
.update p { margin: 0; }

/* ---------- routes ---------- */
main { outline: none; }
.route { min-height: calc(100svh - var(--bar-h)); }
.no-script { margin: 24px var(--side); padding: 16px; background: var(--bg-2); }
/* interior heads: large display type on white, and a faded crop of the same photographed light as the home page at the right */
.page-head { position: relative; isolation: isolate; padding: 64px var(--side) 36px; display: grid; gap: 12px; justify-items: start; }
.page-head > p { margin: 0; max-width: 62ch; }
.page-head > .eyebrow { margin-bottom: -2px; }
.page-head .display-md { font-size: clamp(40px, 4.6vw, 68px); line-height: .98; font-weight: 560; letter-spacing: -.045em; font-variation-settings: "SHRP" 40, "CRSV" 0; }
.page-head::before {
  content: ""; position: absolute; z-index: -1; top: calc(var(--bar-h) * -1); right: 0; bottom: -24px; width: min(64%, 980px); pointer-events: none;
  background: url("assets/revision2/wine-light.jpg") 16% 88% / 1560px auto no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 34%, #000 70%), linear-gradient(180deg, #000 58%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 34%, #000 70%), linear-gradient(180deg, #000 58%, transparent);
  mask-composite: intersect;
}
.route[data-route="wines"] .page-head::before, .route[data-route="assistant"] .page-head::before { background: url("assets/revision2/pairing-white.jpg") 0% 94% / 1500px auto no-repeat; }
.route[data-route="compare"] .page-head::before { background-position: 100% 44%; background-size: 1180px auto; opacity: .55; }
.route[data-route="compare"] .page-head { padding-top: 44px; padding-bottom: 22px; gap: 8px; }
.page-body { padding: 16px var(--side) 88px; }

/* ---------- home ---------- */
.hero {
  position: relative; display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); align-items: center; gap: 40px;
  min-height: min(880px, 100svh); padding: calc(var(--bar-h) + 32px) var(--side) 56px; margin-top: calc(var(--bar-h) * -1);
  background: linear-gradient(180deg, #fff 0%, #f8f8fa 100%);
}
.hero-copy { display: grid; justify-items: start; gap: 22px; max-width: 600px; position: relative; z-index: 1; }
.lede { margin: 0; font-size: clamp(18px, 1.4vw, 20px); line-height: 1.5; color: var(--ink-2); max-width: 36ch; }
.hero-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 6px; }
/* A faint neutral cast shadow behind the desktop actions gives their frost a real backdrop.
   It has no layout size; the hero photograph and button coordinates stay unchanged. */
@media (min-width: 761px) {
  .hero-act { position: relative; z-index: 0; }
  .hero-act::before {
    content: ""; position: absolute; z-index: -1; pointer-events: none;
    inset: -26px auto -30px -36px; width: 340px;
    background: linear-gradient(15deg,
      transparent 39%, rgba(20, 18, 23, 0) 43%, rgba(20, 18, 23, .28) 48%,
      rgba(20, 18, 23, .28) 52%, rgba(20, 18, 23, 0) 57%, transparent 61%);
    -webkit-mask-image: radial-gradient(ellipse 68% 70% at 50% 50%, #000 30%, transparent 70%);
    mask-image: radial-gradient(ellipse 68% 70% at 50% 50%, #000 30%, transparent 70%);
  }
}
.scope { margin: 0; font-size: 14px; color: var(--muted); max-width: 44ch; }

/* The slab: a clear rim of --bevel px that refracts the very same photo, and a lightly frosted centre that keeps it visible behind sharp HTML text. */
.stage { --photo-pos: 78% 50%; position: relative; margin: 0; height: clamp(460px, 70svh, 700px); border-radius: 24px; overflow: hidden; background: #fff; }
.stage-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--photo-pos); }
.slab {
  --r: 30px; --bevel: 22px;
  position: absolute; left: 6%; bottom: 7%; width: min(448px, 78%); border-radius: var(--r); overflow: hidden; isolation: isolate;
  box-shadow: 0 2px 4px rgba(20, 18, 23, .08), 0 36px 64px -30px rgba(52, 8, 24, .55), 0 14px 28px -18px rgba(107, 23, 54, .36);
}
.slab-optic { position: absolute; inset: 0; }
.slab-optic img {
  position: absolute; max-width: none; width: var(--sw, 100%); height: var(--sh, 100%); left: var(--sx, 0); top: var(--sy, 0);
  object-fit: cover; object-position: var(--photo-pos);
}
/* the frost has no edge of its own: it fades out across the inner part of the rim, so the only frame is the outer glass edge */
.slab-frost {
  --fe: calc(var(--bevel) * .9);
  position: absolute; inset: calc(var(--bevel) * .45); border-radius: calc(var(--r) - var(--bevel) * .45);
  background:
    radial-gradient(70% 60% at 72% 34%, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 72%),
    linear-gradient(180deg, rgba(255, 255, 255, .58), rgba(255, 255, 255, .5));
  -webkit-backdrop-filter: blur(12px) saturate(1.8); backdrop-filter: blur(12px) saturate(1.8);
  -webkit-mask:
    linear-gradient(90deg, transparent, #000 var(--fe), #000 calc(100% - var(--fe)), transparent),
    linear-gradient(180deg, transparent, #000 var(--fe), #000 calc(100% - var(--fe)), transparent);
  -webkit-mask-composite: source-in;
  mask:
    linear-gradient(90deg, transparent, #000 var(--fe), #000 calc(100% - var(--fe)), transparent),
    linear-gradient(180deg, transparent, #000 var(--fe), #000 calc(100% - var(--fe)), transparent);
  mask-composite: intersect;
}
/* volume: soft bright upper-left and wine-dark lower-right thickness that fade inward, plus the specular glint; under the text */
.slab::before {
  content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(26% 20% at var(--gx, 14%) var(--gy, 3%), rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 70%),
    linear-gradient(150deg, rgba(255, 255, 255, .38) 0%, rgba(255, 255, 255, 0) 22%, rgba(107, 23, 54, 0) 78%, rgba(107, 23, 54, .16) 100%);
  box-shadow:
    inset 0 2px 1px -1px rgba(255, 255, 255, .95),
    inset 4px 7px var(--bevel) -6px rgba(255, 255, 255, .7),
    inset -4px -7px var(--bevel) -6px rgba(74, 14, 36, .3);
}
.slab::after {
  content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(128deg, #fff 0%, rgba(255, 255, 255, .35) 20%, rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, 0) 64%, rgba(255, 214, 226, .3) 84%, rgba(255, 255, 255, .9) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.slab-body { position: relative; z-index: 2; padding: calc(var(--bevel) + 12px) calc(var(--bevel) + 14px) calc(var(--bevel) + 10px); display: grid; gap: 14px; }
.slab-kicker { margin: 0; font-size: 13px; font-weight: 500; color: var(--wine); }
.slab-result { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 18px; align-items: start; }
.slab-ref { width: 50px; height: auto; mix-blend-mode: multiply; }
.slab-ref-fail {
  display: grid; place-items: center; width: 50px; aspect-ratio: 283 / 1000; border: 1px dashed rgba(20, 18, 23, .24); border-radius: 8px;
  background: rgba(255, 255, 255, .45); color: var(--ink-2); font: 400 11px/1.2 var(--font); text-align: center;
}
.slab-title { margin: 0; font: 560 26px/1.08 var(--display); letter-spacing: -.035em; }
.slab-sub { margin: 2px 0 10px; color: var(--ink-2); font-size: 15px; }
.slab-facts { margin: 0; }
.slab-facts div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-top: 1px solid rgba(20, 18, 23, .12); font-size: 14px; }
.slab-facts dt { color: var(--ink-2); }
.slab-facts dd { margin: 0; font-weight: 500; }
.slab-src { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
/* desktop: the photo is the whole hero, so the nav, both hero buttons and the card all sit over the same real light and wine */
@media (min-width: 981px) {
  .hero { min-height: max(680px, min(940px, 100svh)); background: #fff; isolation: isolate; }
  .stage { --photo-pos: 86% 62%; position: absolute; inset: 0; z-index: 0; height: auto; border-radius: 0; }
  .stage::after { content: ""; position: absolute; inset: auto 0 0; height: 14%; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff); }
  .slab { --bevel: 16px; z-index: 2; left: auto; right: max(var(--side), 4vw); bottom: 15%; width: min(440px, 33vw); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .slab-frost { background: rgba(255, 255, 255, .94); } }
/* reduced transparency: the face turns to dense frost, the clear rim still carries the photo, light and thickness */
@media (prefers-reduced-transparency: reduce) {
  html:not([data-glass="on"]) .slab-frost {
    background: radial-gradient(70% 60% at 72% 34%, #fff, rgba(255, 255, 255, 0) 72%), linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(250, 249, 251, .94));
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}
html[data-glass="off"] .slab-frost { inset: 0; border-radius: 0; background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; -webkit-mask: none; mask: none; }
html[data-glass="off"] .slab-optic { filter: none !important; }
html[data-glass="off"] .slab::before { content: none; }
@media (prefers-contrast: more) {
  .slab-frost { inset: 0; border-radius: 0; background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; -webkit-mask: none; mask: none; }
  .slab-optic { filter: none !important; }
  .slab::before { content: none; }
  .slab::after { background: var(--ink); padding: 2px; }
}

.after { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; padding: 96px var(--side); }
.after-photo { position: relative; margin: 0; border-radius: 20px; overflow: hidden; }
.after-photo img { width: 100%; height: clamp(300px, 34vw, 460px); object-fit: cover; object-position: 70% 50%; }
/* a failed decorative photo keeps its box but never shows the browser's broken-image icon or alt text */
.img-failed { visibility: hidden; }
.after-photo:has(> .img-failed) { background: var(--bg-2); }
.after-body { display: grid; gap: 24px; }
.uses { display: grid; border-top: 1px solid var(--ink); }
.use { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 20px; padding: 18px 0; text-decoration: none; border-bottom: 1px solid var(--line); }
.use-k { font-size: 22px; font-weight: 540; letter-spacing: -.03em; color: var(--ink); grid-row: span 2; display: inline-flex; align-items: center; gap: 8px; align-self: start; }
.use-k svg { width: 20px; height: 20px; flex: none; color: var(--wine); transition: transform .15s var(--ease); }
.use-t { color: var(--ink-2); font-size: 16px; max-width: 40ch; }
.use-n { font-size: 14px; color: var(--wine); }
.use-n:empty { display: none; }
@media (hover: hover) { .use:hover .use-k { color: var(--wine); } .use:hover .use-k svg { transform: translateX(3px); } }

/* ---------- scanner ---------- */
.disclosure { color: var(--ink-2); }
.offline { color: var(--wine); font-weight: 500; }
.scanner-shell { padding: 0 var(--side) 72px; }
#scanner { display: block; width: 100%; height: 560px; border: 0; background: #fff; }
.scanner-fail { margin: 12px 0 0; }
body.scanner-modal .bar { z-index: 1; }
body.scanner-modal #scanner { position: relative; z-index: 45; }
/* glass.js filter definitions only; keep the appended svg out of the line flow */
svg.control-optics { position: absolute; top: 0; left: 0; width: 0; height: 0; overflow: hidden; pointer-events: none; }

/* ---------- tabs, collection shelf, history timeline ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tabs [role="tab"] { min-height: 44px; padding: 0 18px; border-radius: 999px; font-size: 16px; font-weight: 500; color: var(--ink-2); }
.tabs [role="tab"] b { font-weight: 500; color: var(--muted); margin-left: 4px; }
.tabs [role="tab"][aria-selected="true"] b { color: inherit; }
[role="tabpanel"]:focus-visible { outline-offset: 6px; }

/* a bottle on its own lit plinth: shared by the shelf, compare, facts and detail */
:root {
  --plinth: radial-gradient(58% 42% at 50% 18%, #fff, rgba(255, 255, 255, 0) 72%), linear-gradient(180deg, #f7f6f8 0%, #eceaef 100%);
  --plinth-floor: radial-gradient(closest-side, rgba(52, 12, 28, .2), rgba(52, 12, 28, 0));
}
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.row-thumb { width: 64px; height: 96px; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); background: var(--bg-2); border-radius: 8px; padding: 6px; }
.row-thumb img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
.row-main { display: grid; gap: 3px; min-width: 0; }
.row-title { margin: 0; font: 540 19px/1.25 var(--display); letter-spacing: -.02em; }
.row-title a { text-decoration: none; }
@media (hover: hover) { .row-title a:hover { color: var(--wine); } }
.row-meta { margin: 0; color: var(--ink-2); font-size: 15px; }
.row-note { margin: 0; color: var(--muted); font-size: 14px; }
.row-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; }

.shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 44px 28px; }
.shelf .row { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; align-items: start; gap: 16px; padding: 0; border: 0; }
.shelf .row-thumb {
  position: relative; isolation: isolate; overflow: hidden; width: 100%; height: clamp(280px, 25vw, 340px); padding: 30px 24px 36px;
  border-radius: 20px; background: var(--plinth);
}
.shelf .row-thumb::after { content: ""; position: absolute; z-index: -1; left: 26%; right: 26%; bottom: 24px; height: 18px; background: var(--plinth-floor); }
.shelf .row-thumb img { transition: transform .45s var(--ease); }
@media (hover: hover) { .shelf .row:hover .row-thumb img { transform: translateY(-5px); } }
.shelf .row-main { gap: 5px; }
.shelf .row-title { font-size: 22px; line-height: 1.12; letter-spacing: -.03em; text-wrap: balance; }
.shelf .row-acts { grid-column: auto; justify-content: flex-start; gap: 8px; }
.shelf-sm { grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 36px 24px; }
.shelf-sm .row-thumb { height: 220px; padding: 22px 18px 28px; border-radius: 16px; }
.shelf-sm .row-thumb::after { bottom: 18px; height: 14px; }
.shelf-sm .row-title { font-size: 18px; }
.examples { margin-top: 80px; padding-top: 28px; border-top: 1px solid var(--line); }
/* with nothing saved yet, the catalogue shelf follows the empty state as its continuation */
.page-body:has([role="tabpanel"]:not([hidden]) > .empty) .examples { margin-top: 36px; padding-top: 0; border-top: 0; }
.examples h2.label { margin: 0 0 24px; font: 540 26px/1.15 var(--display); letter-spacing: -.03em; color: var(--ink); }

.hist { list-style: none; margin: 0; padding: 0; }
/* a readable column keeps each «Убрать» beside its wine */
.hist, #pane-history .hist-tools { max-width: 860px; }
.hist > li { position: relative; display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 0 44px; align-items: start; padding: 14px 0; }
.hist > li::before { content: ""; position: absolute; left: 141px; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.hist > li:first-child::before { top: 30px; }
.hist > li:last-child::before { bottom: calc(100% - 30px); }
.hist > li::after { content: ""; position: absolute; left: 137px; top: 26px; width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px var(--wine); }
.hist > li.same-day::after { width: 7px; height: 7px; left: 138px; top: 27px; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.hist time { display: grid; padding-top: 14px; text-align: right; line-height: 1.25; }
.hist-day { font: 540 15px/1.25 var(--display); letter-spacing: -.01em; color: var(--ink); }
.hist-time { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.same-day .hist-day { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hist-wines { display: grid; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.hist > li:last-child .hist-wines { border-bottom: 0; }
.hist-wines > .muted { padding: 10px 0; }
.hist-wine { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: center; }
.hist-thumb { width: 36px; height: 54px; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); padding: 3px; border-radius: 6px; background: var(--plinth); }
.hist-thumb img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
.hist-thumb .muted { font-size: 0; }
.hist-wines a { font: 540 17px/1.3 var(--display); letter-spacing: -.02em; text-decoration: none; }
@media (hover: hover) { .hist-wines a:hover { color: var(--wine); } }
.hist > li > .link-btn { margin-top: 12px; min-height: 34px; padding: 0 12px; font-size: 14px; }
.hist-tools { display: flex; align-items: center; gap: 12px; justify-content: flex-end; padding: 0 0 12px; }

.empty { padding: 40px 0; display: grid; gap: 10px; justify-items: start; }
.empty h2 { margin: 0; font: 540 26px/1.15 var(--display); letter-spacing: -.03em; }
.empty p { margin: 0; color: var(--ink-2); max-width: 46ch; }
.empty .acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 8px; }
/* an empty collection rests on the photographed table, the same light the home page ends with */
[role="tabpanel"] .empty {
  min-height: 220px; align-content: center; padding: 36px clamp(28px, 4vw, 52px); border-radius: 24px; gap: 10px;
  background:
    linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, .97) 42%, rgba(255, 255, 255, .62) 66%, rgba(255, 255, 255, .24) 100%),
    url("assets/revision2/wine-light.jpg") 100% 30% / 64% auto no-repeat;
  box-shadow: inset 0 0 0 1px var(--line);
}
#pane-history .empty { background-position: 0 0, 100% 72%; }
[role="tabpanel"] .empty h2 { font-size: clamp(26px, 2.3vw, 32px); letter-spacing: -.035em; }

/* the Abrau packshot carries a wide white margin; only that margin is taken up, so its bottle stands at the height of its neighbours */
:is(.row-thumb, .cmp-thumb, .ctx-img, .hist-thumb, .pick) img:is([src$="/abrau-dyurso-imperatorskoe-bryut-shardone-beloe-12.jpg"], [src$="media/abrau.jpg"]) { scale: 1.26; }

/* ---------- compare: chooser in a side panel, bottles lead the table ---------- */
.cmp-layout { display: grid; gap: 32px; }
.picker { display: grid; gap: 22px; align-content: start; }
.pick-status { margin: 0; display: grid; gap: 10px; font-size: 15px; color: var(--ink-2); }
.pick-status strong { color: var(--wine); font-weight: 500; }
.pick-meter { display: flex; gap: 6px; }
.pick-meter i { width: 28px; height: 4px; border-radius: 2px; background: var(--line-2); transition: background .25s var(--ease); }
.pick-meter i.on { background: var(--wine); }
.pick-group h2 { margin: 0 0 10px; }
.pick-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.pick {
  display: inline-flex; align-items: center; gap: 12px; min-height: 60px; max-width: 320px; padding: 6px 14px 6px 6px;
  border-radius: 14px; color: var(--ink); text-align: left;
}
.pick img { width: 34px; height: 48px; padding: 2px; border-radius: 8px; object-fit: contain; mix-blend-mode: multiply; }
.pick-text { display: grid; min-width: 0; line-height: 1.2; }
.pick-text b { font-weight: 500; font-size: 15px; overflow-wrap: anywhere; }
.pick-text small { color: var(--muted); font-size: 13px; }
.pick[aria-pressed="true"] small { color: var(--wine); }
.pick:disabled { opacity: .45; cursor: not-allowed; }
.pick-more { margin-top: 8px; }
.pick-no-photo { flex: none; width: 34px; min-height: 48px; display: grid; place-items: center; text-align: center; color: var(--muted); font: 400 11px/1.2 var(--font); }
.pick-unavailable { color: var(--ink-2); font-size: 14px; }
.pick-unavailable p { margin: 0 0 8px; }
.pick-unavailable .link-btn { max-width: 100%; white-space: normal; text-align: left; }
@media (min-width: 981px) {
  .cmp-layout { grid-template-columns: 300px minmax(0, 1fr); gap: 48px; align-items: start; }
  .picker {
    padding: 22px 18px; border-radius: 22px; background: linear-gradient(180deg, #f8f7f9, #f1f0f3);
  }
  .pick-list { flex-direction: column; flex-wrap: nowrap; }
  .pick { width: 100%; max-width: none; }
  #cmp-out { min-width: 0; }
}

.cmp { width: 100%; border-collapse: separate; border-spacing: 0; display: grid; }
.cmp thead, .cmp tbody { display: grid; }
.cmp tr { display: grid; grid-template-columns: minmax(110px, .5fr) repeat(var(--n), minmax(0, 1fr)); column-gap: 24px; }
.cmp th, .cmp td { text-align: left; vertical-align: top; padding: 13px 0; font-weight: 400; min-width: 0; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
.cmp thead { border-bottom: 1px solid var(--ink); }
.cmp thead th { padding: 0 0 18px; }
.cmp thead th { display: grid; }
/* titles wrap to different heights; the remove buttons still share one baseline */
.cmp-col { display: grid; grid-template-rows: auto 1fr auto; gap: 10px; justify-items: start; align-items: start; height: 100%; }
.cmp-thumb {
  position: relative; isolation: isolate; width: 100%; height: 176px; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  padding: 16px 16px 22px; border-radius: 18px; background: var(--plinth); margin-bottom: 2px;
}
.cmp-thumb::after { content: ""; position: absolute; z-index: -1; left: 30%; right: 30%; bottom: 14px; height: 12px; background: var(--plinth-floor); }
.cmp-thumb img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
.cmp-thumb > :not(img) { place-self: center; font-size: 14px; }
.cmp-col a { font: 540 19px/1.15 var(--display); letter-spacing: -.025em; text-decoration: none; text-wrap: balance; }
@media (hover: hover) { .cmp-col a:hover { color: var(--wine); } }
.cmp-col .link-btn { min-height: 32px; padding: 0 12px; font-size: 14px; }
.cmp tbody tr { border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 var(--line); }
.cmp tbody th { color: var(--muted); font-size: 15px; }
.cmp td { font-size: 16px; }
.cmp td.same { color: var(--wine); }
.cmp .na { color: var(--muted); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 3px 8px; border-radius: 5px; background: var(--bg-2); font-size: 14px; line-height: 1.35; }
.chip.same { background: var(--wine-soft); color: var(--wine); }

.cmp-empty { padding: 8px 0 0; gap: 12px; }
.cmp-missing { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 20px; color: var(--ink-2); font-size: 15px; }
.cmp-missing p { margin: 0; max-width: 60ch; }

.food { display: grid; gap: 14px; padding-top: 40px; }
.food-head { display: flex; align-items: center; gap: 10px; }
.food-head h2 { margin: 0; font: 540 28px/1.15 var(--display); letter-spacing: -.03em; }
.food-head svg { color: var(--wine); }
.dish-row { display: flex; flex-wrap: wrap; gap: 6px; }
.dish { min-height: 40px; padding: 0 14px; border-radius: 999px; color: var(--ink); font-size: 15px; }
@media (pointer: coarse) { .dish { min-height: 44px; } }
.food-results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 24px; }
.food-results li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 12px; align-content: start; padding: 14px 0; border-top: 1px solid var(--line); }
.food-results .mark-cell { grid-row: span 2; color: var(--muted); font-weight: 600; }
.food-results .yes .mark-cell { color: var(--wine); }
.food-results .near .mark-cell { color: var(--ink-2); }
.food-results b { font-weight: 500; }
.food-results small { color: var(--ink-2); font-size: 14px; }
.food-note { margin: 0; font-size: 14px; color: var(--muted); max-width: 70ch; }

/* ---------- source facts: the wine stays in view, answers read as an editorial list ---------- */
.ast { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 64px; padding: 16px var(--side) 88px; align-items: start; }
.ast-context { position: sticky; top: calc(var(--bar-h) + 20px); display: grid; gap: 18px; }
.ast-context .field { padding-top: 14px; }
.ctx { display: grid; gap: 18px; }
.ctx-img {
  position: relative; isolation: isolate; height: clamp(200px, 27svh, 260px); display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  padding: 20px 20px 28px; border-radius: 20px; background: var(--plinth);
}
.ctx-img::after { content: ""; position: absolute; z-index: -1; left: 30%; right: 30%; bottom: 18px; height: 14px; background: var(--plinth-floor); }
.ctx-img img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
.ctx-body { display: grid; gap: 6px; justify-items: start; }
.ctx-body h2 { margin: 0; font: 560 clamp(24px, 2.2vw, 30px)/1.1 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.ctx-body p { margin: 0; font-size: 14px; color: var(--muted); }
.field { display: grid; gap: 6px; padding-top: 18px; border-top: 1px solid var(--line); }
.field select { min-height: 48px; border: 0; border-radius: 12px; background: var(--bg-2); padding: 0 12px; font-size: 16px; max-width: 100%; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--ink); }
.fact { padding: 5px 0; }
.fact:first-child { padding-top: 10px; }
:root {
  --fq-fill: linear-gradient(180deg, rgba(255, 255, 255, .74), rgba(249, 248, 250, .6));
  --fq-fill-h: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(248, 246, 249, .76));
  --fq-open: linear-gradient(180deg, rgba(107, 23, 54, .07), rgba(107, 23, 54, .04)), rgba(255, 255, 255, .6);
  --fq-shadow: inset 0 0 0 1px rgba(20, 18, 23, .055), 0 1px 2px rgba(20, 18, 23, .04);
  --fq-shadow-open: inset 0 0 0 1px rgba(107, 23, 54, .13);
}
html[data-glass="off"] { --fq-fill: var(--bg-2); --fq-fill-h: var(--bg-3); --fq-open: var(--wine-soft); --fq-shadow: none; --fq-shadow-open: none; }
@media (prefers-contrast: more) { :root:root { --fq-fill: #fff; --fq-fill-h: #fff; --fq-open: #fff; --fq-shadow: inset 0 0 0 1px var(--ink); --fq-shadow-open: inset 0 0 0 2px var(--wine); } }
.fact-q { margin: 0; font-size: clamp(21px, 1.9vw, 26px); font-weight: 520; letter-spacing: -.025em; }
/* a question is a quiet matte row: a thin translucent surface without rim or bevel; the shared glass engine leaves it alone */
.facts .fact-q button {
  --b-fx: none; --optic: none; --matte: 0; --frost: ;
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; padding: 16px 18px;
  border-radius: 14px; color: var(--ink); text-align: left; font: inherit; letter-spacing: inherit;
  background: var(--fq-fill); box-shadow: var(--fq-shadow); -webkit-backdrop-filter: var(--bq-optic); backdrop-filter: var(--bq-optic);
}
.facts .fact-q button[aria-expanded="true"] { color: var(--wine); background: var(--fq-open); box-shadow: var(--fq-shadow-open); border-radius: 14px 14px 4px 4px; }
.fact-q button svg { width: 22px; height: 22px; color: var(--muted); transition: transform .25s var(--ease), color .15s; }
.fact-q button[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--wine); }
@media (hover: hover) { .facts .fact-q button:not([aria-expanded="true"]):hover { color: var(--wine); background: var(--fq-fill-h); } .fact-q button:hover svg { color: var(--wine); } }
.facts .fact-q button:focus-visible { outline-offset: 2px; }
.fact-off { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; min-height: 68px; padding: 20px 18px; flex-wrap: wrap; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.fact-off .fact-q { color: var(--muted); font-weight: 460; }
.fact-off span { font-size: 14px; color: var(--muted); }
.fact-a { padding: 18px 18px 22px; display: grid; gap: 14px; max-width: 62ch; }
.fact-a > p:first-child { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; color: var(--ink); }
.fact-a p { margin: 0; }
.fact-src { font-size: 14px; color: var(--muted); }
.fact-src a { color: var(--wine); }

/* ---------- detail: photo and reference as one gallery, the card as editorial type ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 64px; padding: 40px var(--side) 88px; align-items: start; }
.d-media { position: sticky; top: calc(var(--bar-h) + 20px); display: grid; gap: 14px; }
.d-pair { display: grid; grid-template-columns: repeat(var(--panes, 1), minmax(0, 1fr)); gap: 14px; }
.d-pane { position: relative; margin: 0; display: grid; gap: 10px; }
.d-pane .d-img {
  position: relative; isolation: isolate; height: clamp(360px, 64svh, 640px); border-radius: 22px; background: var(--plinth);
  display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); padding: 36px 28px 44px;
}
.d-pane .d-img img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
/* the user's photo is shown whole on a light neutral mat, never blended and never on a black field */
.d-pane.mine .d-img { background: linear-gradient(180deg, #efeef2, #e6e4e9); padding: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.d-pane.mine .d-img img { mix-blend-mode: normal; border-radius: 10px; }
.d-img > :not(img), .v-img > :not(img), .ctx-img > :not(img), .row-thumb > :not(img) { place-self: center; }
.d-pane figcaption { font-size: 14px; color: var(--muted); padding-left: 4px; }
.d-pane.mine figcaption { color: var(--wine); font-weight: 500; }
.zoom {
  position: absolute; right: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink);
}
.zoom svg { width: 16px; height: 16px; }
@media (pointer: coarse) { .zoom { min-height: 44px; } }
.d-note { margin: 0; padding-left: 4px; font-size: 14px; color: var(--ink-2); max-width: 60ch; }
.d-info { display: grid; gap: 18px; align-content: start; padding-top: 4px; }
.back { justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.back svg { width: 18px; height: 18px; transition: transform .15s var(--ease); }
@media (hover: hover) { .back:hover { color: var(--wine); } .back:hover svg { transform: translateX(-2px); } }
.d-title { margin: 0; font-size: clamp(36px, 4vw, 60px); line-height: .98; font-weight: 560; letter-spacing: -.045em; text-wrap: balance; font-variation-settings: "SHRP" 40, "CRSV" 0; }
.d-verdict { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 52ch; }
.d-facts { margin: 6px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.d-facts > div { display: grid; gap: 4px; align-content: start; padding: 16px 16px 16px 0; border-bottom: 1px solid var(--line); }
.d-facts > div:last-child { grid-column: 1 / -1; }
.d-facts dt { color: var(--muted); font-size: 14px; }
.d-facts dd { margin: 0; font: 540 19px/1.3 var(--display); letter-spacing: -.02em; }
.d-facts dd .chips { margin-top: 4px; font-family: var(--font); letter-spacing: 0; }
.d-facts .na { font: 400 16px/1.4 var(--font); letter-spacing: 0; color: var(--muted); }
.d-desc { margin: 4px 0 0; color: var(--ink-2); max-width: 60ch; font-size: 17px; line-height: 1.65; }
.d-desc-src { margin: -8px 0 0; font-size: 13px; color: var(--muted); }
.d-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-top: 6px; }
.d-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; }

.viewer { border: 0; border-radius: 22px; padding: 0; width: min(1080px, calc(100vw - 32px)); max-height: calc(100svh - 32px); box-shadow: 0 40px 90px -40px rgba(30, 6, 16, .6); }
.viewer::backdrop { background: rgba(20, 18, 23, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.viewer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 16px 4px 24px; }
.viewer-title { margin: 0; font: 560 22px/1.2 var(--display); letter-spacing: -.03em; }
.viewer-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; padding: 12px 16px 18px; }
.viewer-body figure { margin: 0; display: grid; gap: 8px; }
.viewer-body .v-img { height: min(72svh, 680px); display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); padding: 24px; background: var(--plinth); border-radius: 16px; }
.viewer-body .mine .v-img { background: linear-gradient(180deg, #efeef2, #e6e4e9); padding: 12px; }
.viewer-body .v-img img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
.viewer-body .mine .v-img img { mix-blend-mode: normal; border-radius: 10px; }
.viewer-body figcaption { font-size: 14px; color: var(--muted); padding-left: 4px; }
.viewer-body .mine figcaption { color: var(--wine); font-weight: 500; }

/* ---------- footer, toast ---------- */
.site-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 24px var(--side) calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-foot p { margin: 0; }
.glass-pref summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; }
.glass-choice { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.glass-choice button { min-height: 40px; padding: 0 14px; border-radius: 999px; color: var(--ink-2); font-size: 14px; }

.toast {
  position: fixed; z-index: 70; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px);
  display: flex; align-items: center; gap: 12px; max-width: min(560px, calc(100vw - 32px)); padding: 10px 10px 10px 16px;
  border-radius: 10px; background: var(--ink); color: #fff; font-size: 15px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.warn { background: var(--wine); }
.toast p { margin: 0; padding: 6px 0; }
/* on the opaque dark sheet there is nothing to refract: clear glass is a light fill, a lit top rim and a faint edge */
.toast-act, .toast-x {
  border: 0; color: #fff; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .34), inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.toast-act { min-height: 36px; padding: 0 14px; font-weight: 500; white-space: nowrap; }
.toast-x { width: 36px; height: 36px; display: grid; place-items: center; }
@media (hover: hover) { :is(.toast-act, .toast-x):hover { background: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, .16)); } }
html[data-glass="off"] :is(.toast-act, .toast-x) { background: rgba(255, 255, 255, .16); box-shadow: none; }
@media (prefers-contrast: more) { :is(.toast-act, .toast-x) { background: none; box-shadow: inset 0 0 0 1px #fff; } }
.toast-x svg { width: 18px; height: 18px; }

/* ---------- motion: restrained arrival and route continuity ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: arrive .5s var(--ease) both; }
  .slab { animation: settle .6s var(--ease) both; }
  .hero-copy > :nth-child(2) { animation-delay: .04s; }
  .hero-copy > :nth-child(3) { animation-delay: .08s; }
  .hero-copy > :nth-child(4), .hero-copy > :nth-child(5) { animation-delay: .12s; }
  .slab { animation-delay: .14s; }
  /* an opacity animation on the row would make it the backdrop root and hide the scene from the toned buttons */
  .hero-copy > .hero-act { animation-name: rise; }
  .hero-act > .btn { animation: fade-in .5s var(--ease) .12s backwards; }
  /* interiors arrive once when their route is shown; re-rendered lists inside never replay it */
  .page-head > * { animation: arrive .5s var(--ease) both; }
  .page-head > :nth-child(2) { animation-delay: .04s; }
  .page-head > :nth-child(n+3) { animation-delay: .08s; }
  .page-head::before { animation: fade-in .9s var(--ease) both; }
  /* Keep opacity off ancestors of backdrop-filter controls: a retained opacity animation creates a backdrop root. */
  .page-head > .tabs { animation-name: rise; }
  :is(.page-body, .scanner-shell, .ast, .detail) { animation: rise .55s var(--ease) .1s both; }
  /* Release the full shelf's identity transform after arrival, rather than retaining a scrolling surface below the fixed glass. */
  .route[data-route="wines"] .page-body { animation-fill-mode: backwards; }
  @keyframes arrive { from { opacity: 0; transform: translateY(8px); } }
  @keyframes rise { from { transform: translateY(8px); } }
  @keyframes fade-in { from { opacity: 0; } }
  @keyframes settle { from { opacity: 0; } }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
  ::view-transition-group(wine-ref) { animation-duration: .34s; animation-timing-function: var(--ease); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}

/* ---------- narrow ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 36px; min-height: 0; padding-bottom: 48px; }
  .stage { height: clamp(420px, 60svh, 560px); }
  .after { grid-template-columns: 1fr; gap: 28px; }
  .detail { grid-template-columns: 1fr; gap: 28px; padding-top: 20px; }
  .d-media { position: static; }
  .ast { grid-template-columns: 1fr; gap: 24px; }
  .ast-context { position: static; }
}
@media (max-width: 760px) {
  :root { --bar-h: 56px; }
  body { font-size: 16px; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  /* the bar itself stays unfiltered: a filtered ancestor would become the containing block of the fixed bottom nav */
  .bar-in { justify-content: center; margin: 0 var(--gut); }
  .mark, .nav { pointer-events: auto; background: var(--lg-fill); -webkit-backdrop-filter: var(--lg-optic); backdrop-filter: var(--lg-optic); box-shadow: var(--lg-depth); }
  .mark { padding: 0 18px; border-radius: 999px; font-size: 17px; }
  .bar-in::before, .bar-in::after { content: none; }
  .nav {
    position: fixed; z-index: 40; left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right));
    bottom: calc(8px + env(safe-area-inset-bottom)); justify-content: space-between; gap: 2px; padding: 5px; border-radius: 30px;
  }
  .nav a { flex: 1; min-width: 0; flex-direction: column; gap: 2px; min-height: 56px; padding: 4px 2px; border-radius: 25px; font-size: 12px; justify-content: center; }
  .nav .count { position: absolute; top: 3px; left: calc(50% + 8px); min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .update { flex-wrap: wrap; }
  .page-head { padding-top: 24px; }
  .hero { padding-top: calc(var(--bar-h) + 24px); }
  .stage { height: 500px; margin: 0 calc(var(--gut) * -1); border-radius: 0; }
  /* the stage photo rises under the action row: the bowl's rim and the wine's edge run behind the buttons and on into the card below; text above stays on white */
  .hero-act { order: 1; }
  .stage { --photo-pos: max(100%, -473px) 0; z-index: 0; height: 744px; margin-top: -289px; }
  .stage::before { content: ""; position: absolute; inset: 0 0 auto; z-index: 1; height: 205px; pointer-events: none; background: linear-gradient(180deg, #fff 150px, rgba(255, 255, 255, 0)); }
  .slab { z-index: 2; --r: 26px; --bevel: 16px; left: 12px; right: 12px; bottom: 34px; width: auto; }
  .use { grid-template-columns: 1fr; }
  .use-k { grid-row: auto; }
  .row { grid-template-columns: 56px minmax(0, 1fr); }
  .row-thumb { width: 56px; height: 84px; }
  .row-acts { grid-column: 2; justify-content: flex-start; }
  .hist > li { grid-template-columns: minmax(0, 1fr) auto; }
  .hist time { grid-column: 1 / -1; }
  .cmp tr { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); column-gap: 12px; }
  .cmp tbody th { grid-column: 1 / -1; padding: 12px 0 0; font-size: 14px; }
  .cmp tbody td { padding: 4px 0 12px; }
  .cmp thead .corner { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cmp-thumb { height: 150px; padding: 14px 10px 20px; border-radius: 14px; }
  .cmp-thumb::after { bottom: 12px; height: 10px; }
  .cmp-col a { font-size: 15px; }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 14px; }
  .shelf .row-thumb { height: 230px; padding: 20px 12px 26px; border-radius: 16px; }
  .shelf .row-thumb::after { bottom: 16px; height: 12px; }
  .shelf .row-title { font-size: 18px; }
  .hist > li::before, .hist > li::after { content: none; }
  .hist time { display: flex; gap: 8px; align-items: baseline; padding-top: 4px; text-align: left; }
  .same-day .hist-day { position: static; width: auto; height: auto; clip: auto; }
  .hist > li > .link-btn { margin-top: 0; }
  .page-head::before { width: 100%; opacity: .55; }
  .ast { gap: 28px; }
  .ctx { grid-template-columns: 112px minmax(0, 1fr); align-items: center; }
  .ctx-img { height: 168px; padding: 14px 10px 18px; border-radius: 16px; }
  .ctx-img::after { bottom: 12px; height: 10px; }
  .d-facts > div { grid-template-columns: 1fr; gap: 2px; }
  .d-pane .d-img { height: 300px; padding: 12px; }
  .site-foot { padding-bottom: 24px; }
}
