/* SPATIAL Wine. Plain CSS, no build step. Without script the page is the same story as still pictures, the three
   wines and the casket; with script and WebGL (html.walk) the first five beats share one sticky stage that film.js draws. */

@font-face { font-family: "Fraunces"; src: url(fonts/fraunces-latin-standard-normal.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url(fonts/fraunces-latin-standard-italic.woff2) format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Hanken"; src: url(fonts/hanken-grotesk-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --umber: #1B1610;
  --umber-2: #241C14;
  --cellar: #2E2117;
  --olive: #2F3A1E;
  --wine: #5A1424;
  --wine-hi: #74203A;
  --ivory: #F4EFE4;
  --ivory-2: #E6DCC8;
  --gold: #B09052;
  --gold-hi: #D2B272;
  --straw: #E9CF96;
  --rose: #E6A79A;
  --mute: #B7AB97;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Hanken", "Hanken Grotesk", system-ui, sans-serif;
  --focus: var(--gold-hi);
  --gut: clamp(16px, 4vw, 64px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--umber); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 17px/1.6 var(--sans); color: var(--ivory); background: var(--umber); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; margin: 0; font-variation-settings: "SOFT" 50, "WONK" 0; }
h1 em, h2 em, h3 em { font-style: italic; font-weight: 300; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 50; padding: 12px 16px; background: var(--ivory); color: var(--umber); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; --focus: var(--wine); }

.eyebrow { font: 600 12px/1.2 var(--sans); letter-spacing: 0.24em; text-transform: uppercase; color: #E2C68C; }

/* Buttons: square shouldered, never a pill. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 26px; border: 1px solid transparent; border-radius: 2px;
  font: 600 13px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-solid { background: var(--ivory); color: var(--umber); }
.btn-solid:hover { background: #fff; }
.btn-line { border-color: rgba(244, 239, 228, 0.7); background: rgba(27, 22, 16, 0.25); color: var(--ivory); }
.btn-line:hover { background: rgba(244, 239, 228, 0.14); border-color: var(--ivory); }
.btn-line[aria-pressed="true"] { background: var(--ivory); color: var(--umber); border-color: var(--ivory); }
.btn-small { min-height: 44px; padding: 0 16px; font-size: 12px; letter-spacing: 0.12em; }

/* The bar. */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: 64px; padding: 0 var(--gut);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  transition: background-color 0.35s;
}
.bar::before { content: ""; position: absolute; inset: 0 0 -40px; z-index: -1; pointer-events: none; background: linear-gradient(180deg, rgba(14, 10, 6, 0.82), rgba(14, 10, 6, 0.6) 60%, rgba(14, 10, 6, 0)); transition: opacity 0.35s; }
.bar.solid { background: rgba(27, 22, 16, 0.78); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.bar.solid::before { opacity: 0; }
.mark { display: inline-flex; align-items: center; min-height: 44px; font: 500 15px/1 var(--serif); letter-spacing: 0.32em; text-decoration: none; }
.nav { display: flex; gap: clamp(4px, 2vw, 28px); }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font: 600 12px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; color: var(--ivory-2); }
.nav a:hover { color: #fff; }
html:not(.js) .bar { position: absolute; }

/* ---------------------------------------------------------------------------------------------------- the walk */
.film { position: relative; }
.plate, .gl, .vignette, .hint { display: none; }
.walk .film { height: 620vh; }
.walk .stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--umber); }
.walk .plate { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.walk .gl { display: block; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.6s; touch-action: pan-y; }
.walk .gl.on { opacity: 1; }
.walk .vignette { display: block; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 60% 45%, rgba(0, 0, 0, 0) 55%, rgba(10, 7, 4, 0.55)); }

/* A scroll cue: a short line drawn downwards, only on the opening frame. */
.walk .hint { display: block; position: absolute; left: 50%; bottom: 22px; width: 1px; height: 46px; margin-left: -0.5px; overflow: hidden; background: rgba(244, 239, 228, 0.22); pointer-events: none; transition: opacity 0.4s; }
.walk .hint span { position: absolute; left: 0; top: 0; width: 1px; height: 100%; background: var(--ivory); transform: translateY(-100%); animation: cue 2.4s cubic-bezier(.6, 0, .3, 1) infinite; }
.walk .hint.gone { opacity: 0; }
@keyframes cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* The beats. Each holds its words; with script they sit on the stage and app.js sets --o (0 to 1). */
.beat { position: relative; }
.beat .copy { max-width: 33rem; }
.beat h1 { font-size: clamp(44px, 7.4vw, 112px); line-height: 0.94; margin: 18px 0 20px; font-weight: 350; }
.beat h2 { font-size: clamp(38px, 5.2vw, 78px); line-height: 0.98; margin: 16px 0 18px; font-weight: 350; }
.beat p:not(.eyebrow) { font-size: clamp(16px, 1.25vw, 19px); color: var(--ivory-2); max-width: 30rem; }
.beat .lede { color: var(--ivory); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.beat .btn-small { margin-top: 24px; }

html:not(.walk) .beat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: var(--gut); padding: 120px var(--gut) 72px; min-height: 80vh; border-bottom: 1px solid rgba(244, 239, 228, 0.1); }
html:not(.walk) .beat .still { width: 100%; height: auto; max-height: 70vh; object-fit: contain; order: 2; }
html:not(.walk) .b1 .still, html:not(.walk) .b4 .still { object-fit: cover; border-radius: 2px; }
/* A beat that is not up keeps its words for screen readers (the story reads in order) but not its controls. */
.walk .beat { position: absolute; inset: 0; display: flex; align-items: center; padding: 96px var(--gut) 72px; pointer-events: none; opacity: var(--o, 0); }
.walk .beat:not(.live) :is(a, button) { visibility: hidden; }
.walk .beat .still { display: none; }
.walk .beat .copy { pointer-events: auto; transform: translateY(calc((1 - var(--o, 0)) * 18px)); }
/* The words' side of the picture is darkened, so they hold on bright leaves, sky and stone. */
.walk .beat::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(14, 10, 6, 0.86) 0, rgba(14, 10, 6, 0.74) 26%, rgba(14, 10, 6, 0.4) 44%, rgba(14, 10, 6, 0) 60%); }
.walk .beat .copy { position: relative; }
.walk .b1 { align-items: flex-end; padding-bottom: clamp(72px, 12vh, 140px); }
.walk .b1 .copy { max-width: 40rem; }

@media (max-width: 760px) {
  html:not(.walk) .beat { grid-template-columns: 1fr; padding-top: 96px; }
  html:not(.walk) .beat .still { order: 0; max-height: 48vh; }
  .walk .beat { align-items: flex-end; padding: 80px 16px 40px; }
  .walk .beat::before { background: linear-gradient(180deg, rgba(14, 10, 6, 0) 30%, rgba(14, 10, 6, 0.78) 52%, rgba(14, 10, 6, 0.9) 100%); }
  .walk .b1 { padding-bottom: 48px; }
  .beat h1 { font-size: clamp(46px, 13vw, 64px); }
  .beat h2 { font-size: clamp(36px, 10vw, 48px); }
  .actions { margin-top: 22px; }
  .actions .btn { flex: 1 1 auto; padding: 0 16px; }
  .nav a:first-child { display: none; }
}

/* ---------------------------------------------------------------------------------------------- the collection */
.collection {
  position: relative; padding: clamp(88px, 8vw, 112px) var(--gut) clamp(72px, 9vw, 120px);
  background: radial-gradient(90% 70% at 30% 40%, #3A2A1C, var(--umber) 70%);
}
.collection:focus, .casket:focus { outline: none; }
.col-head { margin-bottom: 28px; }
.casket-head { max-width: 40rem; margin-bottom: clamp(32px, 4vw, 56px); }
.col-head h2, .casket-head h2 { font-size: clamp(38px, 5vw, 72px); line-height: 1; margin: 16px 0 16px; font-weight: 350; }
.col-head p:not(.eyebrow), .casket-head p:not(.eyebrow) { color: var(--ivory-2); max-width: 32rem; }

.explorer { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 72px); align-items: center; }
.bottle-stage { position: relative; height: min(86vh, 820px); min-height: 420px; }
.bottle-stage::after { content: ""; position: absolute; left: 50%; bottom: 3%; width: 46%; height: 26px; transform: translateX(-50%); z-index: 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0)); pointer-events: none; }
.bottle-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; cursor: grab; touch-action: pan-y; display: none; }
.bottle-stage canvas:active { cursor: grabbing; }
.bottle-still { position: absolute; left: 50%; bottom: 4%; height: 90%; width: auto; transform: translateX(-50%); z-index: 1; transition: opacity 0.5s; }
.explorer.in3d .bottle-stage canvas { display: block; }
.explorer.in3d .bottle-still { opacity: 0; }
.drag-hint { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); z-index: 2; font: 600 11px/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute); display: none; }
.explorer.in3d .drag-hint { display: block; }

.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 32px; }
.tabs button {
  display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 12px; border: 1px solid rgba(244, 239, 228, 0.22); border-radius: 2px;
  background: rgba(244, 239, 228, 0.03); color: var(--ivory-2); font: 600 13px/1.2 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; text-align: left; cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.tabs button img { width: auto; height: 48px; flex: none; }
.tabs button small { display: block; font-weight: 500; letter-spacing: 0.14em; color: var(--mute); margin-top: 3px; }
.tabs button:hover { border-color: rgba(244, 239, 228, 0.5); color: var(--ivory); }
.tabs button[aria-selected="true"] { border-color: var(--gold-hi); background: rgba(176, 144, 82, 0.14); color: var(--ivory); }
html:not(.js) .tabs { display: none; }
html:not(.js) .wine + .wine { margin-top: 48px; padding-top: 40px; border-top: 1px solid rgba(244, 239, 228, 0.14); }

.wine h3 { font-size: clamp(30px, 3.2vw, 46px); line-height: 1.05; font-weight: 350; }
.wine h3 span { display: block; font-style: italic; font-weight: 300; color: var(--gold-hi); }
.study { margin-top: 10px; color: var(--ivory-2); font-family: var(--serif); font-style: italic; font-size: 20px; }
.turn { display: flex; gap: 8px; margin-top: 24px; }
html:not(.js) .turn { display: none; }
.facts { margin: 28px 0 0; display: grid; gap: 0; border-top: 1px solid rgba(244, 239, 228, 0.16); }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(244, 239, 228, 0.16); }
.facts dt { font: 600 12px/1.4 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.facts dd { margin: 0; text-align: right; }
.price { margin: 24px 0 16px; font-family: var(--serif); font-size: 24px; }
.labels { margin-top: 28px; }
.labels summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; font: 600 12px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ivory-2); }
.labels div { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.labels img { width: 100%; height: auto; display: block; }

@media (max-width: 860px) {
  .explorer { grid-template-columns: 1fr; gap: 20px; }
  .panel { display: contents; }
  .col-head { order: -1; margin-bottom: 0; }
  .bottle-stage { height: 62vh; min-height: 380px; }
  .tabs button { flex-direction: column; align-items: flex-start; gap: 6px; font-size: 12px; }
  .tabs button img { height: 40px; }
}

/* ---------------------------------------------------------------------------------------------------- the casket */
.casket {
  position: relative; padding: clamp(80px, 10vw, 140px) var(--gut) clamp(80px, 10vw, 140px);
  background: radial-gradient(80% 60% at 60% 55%, #3B2A1D, #1F1812 60%, var(--umber));
}
.casket-stage {
  position: relative; display: grid; grid-template-columns: minmax(0, 0.55fr) minmax(0, 1fr); gap: clamp(16px, 4vw, 64px); align-items: end;
  max-width: 1180px; margin: 0 auto; user-select: none; -webkit-user-select: none;
}
.box-wrap { position: relative; grid-column: 2; grid-row: 1; aspect-ratio: 1100 / 1151; width: min(100%, calc(76vh * 1100 / 1151)); justify-self: center; }
.casket-stage .box, .casket-stage .box-full, .casket-stage .lip { display: block; width: 100%; height: auto; }
.js .casket-stage .box, .js .casket-stage .lip, .in-box, .straw { position: absolute; inset: 0; }
.casket-stage .box-full { display: none; }
html:not(.js) .casket-stage { display: block; max-width: 640px; }
html:not(.js) .casket-stage .box, html:not(.js) .casket-stage .lip, html:not(.js) .shelf { display: none; }
html:not(.js) .casket-stage .box-full { display: block; }
html:not(.js) .casket-controls { display: none; }
.in-box, .straw { pointer-events: none; }
.in-box .bot, .straw { pointer-events: none; }
.in-box .bot { pointer-events: auto; cursor: grab; }
.casket-stage .lip { pointer-events: none; z-index: 3; }
.in-box { z-index: 2; }
.straw { z-index: 4; overflow: visible; }
.straw i { position: absolute; width: 2px; height: 14px; border-radius: 1px; background: var(--straw); opacity: 0; }
.box-wrap.over::after { content: ""; position: absolute; inset: 30% 6% 18%; z-index: 5; pointer-events: none; border: 1px solid rgba(233, 207, 150, 0.6); border-radius: 2px; box-shadow: inset 0 0 60px rgba(233, 207, 150, 0.18); }

.shelf { position: relative; grid-column: 1; grid-row: 1; display: flex; justify-content: center; align-items: flex-end; gap: 6%; height: 100%; padding-bottom: 7%; }
.shelf::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6.5%; height: 10px; border-radius: 2px; background: linear-gradient(180deg, #5A4330, #2A1E14); box-shadow: 0 14px 24px rgba(0, 0, 0, 0.5); }
.bot { display: block; height: auto; touch-action: none; -webkit-user-drag: none; }
.shelf .bot { width: 27%; position: relative; z-index: 1; cursor: grab; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.45)); transition: opacity 0.3s; }
.shelf .bot.gone { opacity: 0; visibility: hidden; }
.bot.held { position: fixed; z-index: 30; cursor: grabbing; pointer-events: none; filter: drop-shadow(0 30px 24px rgba(0, 0, 0, 0.5)); }
.in-box .bot { position: absolute; }

.casket-controls { max-width: 1180px; margin: clamp(28px, 4vw, 48px) auto 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 48px; align-items: start; }
.place { display: flex; flex-wrap: wrap; gap: 8px; }
.casket-status { grid-column: 1; color: var(--ivory-2); min-height: 1.6em; }
.set { grid-column: 2; grid-row: 1 / span 2; padding: 24px; border: 1px solid rgba(233, 207, 150, 0.4); border-radius: 2px; background: rgba(27, 22, 16, 0.5); }
.set[hidden] { display: none; }
.set-line { font-family: var(--serif); font-size: 22px; line-height: 1.3; }
.set .price { margin: 12px 0 18px; }
.note { margin-top: 12px; font-size: 14px; color: var(--mute); }
.note:empty { display: none; }

@media (max-width: 860px) {
  .casket-stage { grid-template-columns: 1fr; }
  .box-wrap { grid-column: 1; grid-row: 1; }
  .shelf { grid-row: 2; height: auto; min-height: 0; padding: 12px 0 7%; gap: 10%; }
  .shelf .bot { width: 15%; }
  .casket-controls { grid-template-columns: 1fr; }
  .set { grid-column: 1; grid-row: auto; }
}

/* ---------------------------------------------------------------------------------------------------- the foot */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 32px var(--gut) 40px; border-top: 1px solid rgba(244, 239, 228, 0.12); color: var(--mute); font-size: 14px; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ivory-2); }

@media (prefers-reduced-motion: reduce) {
  .walk .hint span { animation: none; transform: none; }
  .btn, .tabs button { transition: none; }
}
