/* The wall: a gallery of lit niches in dark basalt (after the "lit stone niches" reference the user chose). */

:root { --bg: #0b0a09; --room: #0b0a09; --ink: #ece8e2; --muted: #a29d96; }
body { background: var(--bg); }

/* ---------- Header: the name top-left, one pill of links in the middle ---------- */
.top {
  position: absolute; inset: 0 0 auto 0; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 16px;
  padding: 18px var(--margin);
}
.top__brand { display: grid; justify-items: start; text-decoration: none; min-height: 44px; align-content: center; }
.top__name { font-weight: 500; letter-spacing: 0.32em; text-transform: uppercase; font-size: var(--step-small); }
.top__sub { color: var(--muted); font-size: var(--step-small); }
.top__pill {
  display: flex; align-items: center; gap: 4px;
  padding: 4px; background: rgba(20, 18, 16, 0.72); border-radius: 999px;
}
.top__pill a, .top__bag {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  font-size: var(--step-small); text-decoration: none; color: var(--ink); background: none; border: 0;
}
.top__pill a:hover { background: rgba(255, 255, 255, 0.08); }
.top__bag[disabled] { color: var(--muted); cursor: not-allowed; }
.top__bag span { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 8px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; }
@media (max-width: 760px) {
  .top { grid-template-columns: 1fr auto; }
  .top__pill a[href="#wall"] { display: none; }
}

/* ---------- The wall ---------- */
.wall { position: relative; height: 100svh; min-height: 620px; overflow: hidden; background: #030303; }
.stage { background: url('../assets/img/wall/wall-dim.webp') 0 0 / 2560px 1440px; }
.wall__frame { position: absolute; inset: 0; }
.stage { position: absolute; left: 0; top: 0; width: 2560px; height: 1440px; transform-origin: 0 0; }
.stage__lit { position: absolute; inset: 0; width: 2560px; height: 1440px; max-width: none; }
.niche { position: absolute; inset: 0; pointer-events: none; }
.niche__dim {
  position: absolute; background-image: url('../assets/img/wall/wall-dim.webp');
  background-size: 2560px 1440px; opacity: 0; transition: opacity 0.45s ease;
}
.niche__bottle, .niche__mirror { position: absolute; max-width: none; transition: opacity 0.45s ease; }
.motion .niche__dim { animation: lights-on 0.9s ease-out backwards; animation-delay: calc(var(--n, 0) * 140ms + 250ms); }
.motion .niche__bottle { animation: bottle-in 0.9s ease-out backwards; animation-delay: calc(var(--n, 0) * 140ms + 250ms); }
.motion .wall__words > * { animation: words-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards; animation-delay: calc(var(--w, 0) * 100ms + 150ms); }
@keyframes lights-on { from { opacity: 1; } to { opacity: 0; } }
@keyframes bottle-in { from { opacity: 0.35; } to { opacity: 1; } }
@keyframes words-in { from { opacity: 0; transform: translate3d(0, 18px, 0); } to { opacity: 1; transform: none; } }
.niche__mirror {
  transform: scaleY(-1); opacity: 0.2;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 55%);
  mask-image: linear-gradient(to top, #000 0%, transparent 55%);
}
.niche__hit {
  position: absolute; pointer-events: auto; cursor: pointer;
  background: none; border: 0; padding: 0;
}
.niche__hit:focus-visible { outline: 4px solid var(--ink); outline-offset: 8px; }
.niche__label {
  position: absolute; transform: translateX(-50%); text-align: center; white-space: nowrap;
  font-size: 26px; line-height: 1.3; opacity: 0; transition: opacity 0.35s ease;
}
.niche__label b { display: block; font-family: var(--display); font-weight: 400; font-size: 40px; }
.niche__label span { color: var(--muted); }
/* Pointing at one niche: it stays lit, the others dim. */
.stage.is-pointing .niche:not(.is-on) .niche__dim { opacity: 1; }
.stage.is-pointing .niche:not(.is-on) .niche__bottle { opacity: 0.38; }
.stage.is-pointing .niche:not(.is-on) .niche__mirror { opacity: 0.06; }
.stage .niche.is-on .niche__label { opacity: 1; }
.still .niche__dim, .still .niche__bottle, .still .niche__mirror, .still .niche__label { transition: none; }

.wall__words { position: absolute; left: var(--margin); bottom: 34px; z-index: 2; max-width: 34ch; }
.wall__title { font-size: var(--step-head); line-height: 1.02; }
.wall__title em, .foot__name em, .product__name em { font-style: italic; color: #d9b98a; }
.wall__sub { margin-top: 12px; color: var(--ink); }
@media (min-width: 761px) and (max-height: 800px) { .wall__title { font-size: 3rem; } .wall__sub { max-width: 30ch; } }
.wall__hint { position: absolute; right: var(--margin); bottom: 38px; z-index: 2; color: var(--muted); font-size: var(--step-small); }

/* Phones: the niches as a grid of cards, each its own lit niche. */
.wall__grid { display: none; }
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .wall { height: auto; min-height: 0; padding: 100px var(--margin) 40px; }
  .wall__frame, .wall__hint { display: none; }
  .wall__words { position: static; max-width: none; }
  .wall__title { font-size: 40px; }
  .wall__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
  .card { position: relative; }
  .card button { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
  .card__niche { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; background: #141210; }
  .card__niche > img:first-child { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--crop, 50% 60%); }
  .card__bottle { position: absolute; left: 50%; bottom: var(--shelf, 22%); height: var(--h, 46%); width: auto; max-width: none; transform: translateX(-50%); }
  .card__name { display: block; margin-top: 8px; font-family: var(--display); font-size: var(--step-lead); line-height: 1.15; }
  .card__meta { display: block; color: var(--muted); font-size: var(--step-small); min-height: 22px; }
}

/* ---------- The product view ---------- */
.product {
  position: fixed; inset: 0; z-index: 50;
  display: grid; grid-template-columns: minmax(340px, 38%) 1fr;
  background: #0b0a09;
}
.product[hidden] { display: none; }
.product__text { align-self: safe center; max-height: 100svh; overflow-y: auto; padding: 96px var(--margin) 40px calc(var(--margin) + 2vw); max-width: 560px; }
.product__x { display: none; }
.product__meta { color: var(--muted); font-size: var(--step-small); letter-spacing: 0.08em; }
.product__name { margin-top: 10px; font-size: var(--step-head); line-height: 1; }
.product__line { margin-top: 18px; max-width: 38ch; }
.product__notes { display: grid; grid-template-columns: 5.5em 1fr; gap: 8px 18px; margin-top: 28px; }
.product__notes dt { color: var(--muted); font-size: var(--step-small); padding-top: 3px; }
.product__notes dd { margin: 0; }
.product__buy { margin-top: 30px; }
.product__price { font-family: var(--display); font-size: var(--step-lead); }
.product__price .sample { font-family: var(--text); }
.product__sizes { border: 0; padding: 0; margin: 14px 0 0; }
.product__sizes div { display: flex; flex-wrap: wrap; gap: 8px; }
.product__sizes label { position: relative; }
.product__sizes input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.product__sizes span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; background: #1a1815; }
.product__sizes input:checked + span { background: var(--ink); color: #0b0a09; font-weight: 500; }
.product__sizes input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.product__bag { margin-top: 18px; }
.product__demo { margin-top: 10px; font-size: var(--step-small); }
.product__demo a { display: inline-flex; min-height: 44px; align-items: center; }
.product__nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 30px; }
.product__back, .product__pager button {
  min-height: 44px; min-width: 44px; padding: 0 14px; border: 0; background: #1a1815; color: var(--ink); cursor: pointer; font-size: var(--step-body);
}
.product__back:hover, .product__pager button:hover { background: #2a2622; }
.product__pager { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.product__view { position: relative; overflow: hidden; }
.closeup { position: absolute; left: 0; top: 0; width: 1600px; height: 2000px; transform-origin: 0 0; }
.closeup__niche { position: absolute; inset: 0; width: 1600px; height: 2000px; max-width: none; }
.closeup__bottle, .closeup__mirror { position: absolute; max-width: none; }
.closeup__mirror {
  transform: scaleY(-1); opacity: 0.16;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 45%);
  mask-image: linear-gradient(to top, #000 0%, transparent 45%);
}
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .product__x { display: inline-flex; align-items: center; position: fixed; right: var(--margin); top: 14px; z-index: 3; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: rgba(20, 18, 16, 0.8); color: var(--ink); font-size: var(--step-small); cursor: pointer; }
  .product__text { max-height: none; overflow: visible; }
  .product { grid-template-columns: 1fr; grid-template-rows: 58svh auto; overflow-y: auto; }
  .product__view { grid-row: 1; }
  .product__text { grid-row: 2; padding: 24px var(--margin) 40px; max-width: none; }
  .product__name { font-size: 38px; }
}

/* ---------- The finder (from the first version), on the wall's ground ---------- */
.finder { position: relative; isolation: isolate; padding: 16svh var(--margin); }
.finder__room { position: absolute; inset: 0; z-index: -1; background: var(--result, var(--bg)); opacity: 0; transition: opacity 0.6s ease; }
.finder.has-result .finder__room { opacity: 1; }
.still .finder__room { transition: none; }
.finder__title { font-family: var(--text); font-weight: 400; font-size: var(--step-lead); line-height: 1.2; }
.finder__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; margin-top: 72px; }
.finder__notes { grid-column: 1 / span 9; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; margin: 0; }
.finder__group { border: 0; padding: 0; margin: 0; min-width: 0; }
.finder__group legend { padding: 0; margin-bottom: 1.25em; font-size: var(--step-body); color: var(--ink); }
.finder__note {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0;
  border: 0; background: none; text-align: left; cursor: pointer;
  font-size: var(--step-body); line-height: 1.25; color: var(--muted);
}
.finder__note:hover, .finder__note[aria-pressed='true'] { color: var(--ink); }
.finder__note[aria-pressed='true'] { font-weight: 500; }
.finder__note[aria-pressed='true']::after { content: ''; width: 8px; height: 8px; margin-left: 10px; background: var(--ink); }
.finder__result { grid-column: 10 / -1; align-self: start; position: sticky; top: 22svh; }
.finder__result h3 { font-family: var(--display); font-weight: 400; font-size: var(--step-lead); line-height: 1.15; margin-bottom: 10px; }
.finder__result p + p { margin-top: 10px; }
.finder__result .button { margin-top: 22px; min-width: 0; width: 100%; }
.finder__foot { margin-top: 56px; font-size: var(--step-small); max-width: 60ch; }
@media (max-width: 1000px) and (min-width: 761px) {
  .finder__notes { grid-column: 1 / -1; }
  .finder__result { grid-column: 1 / -1; position: static; margin-top: 48px; }
}
@media (max-width: 760px) {
  .finder { padding: 12svh var(--margin); }
  .finder__grid { display: block; margin-top: 40px; }
  .finder__notes { display: grid; grid-template-columns: 1fr; row-gap: 32px; }
  .finder__group { display: flex; flex-wrap: wrap; column-gap: 22px; }
  .finder__group legend { width: 100%; margin-bottom: 6px; }
  .finder__note { width: auto; min-width: 44px; line-height: 1.4; }
  .finder__result { position: sticky; bottom: 0; top: auto; margin: 36px calc(-1 * var(--margin)) 0; padding: 18px var(--margin) 22px; background: #1a1815; }
}

/* ---------- Footer ---------- */
.foot { padding: 12svh var(--margin) 40px; background: #070706; }
.foot__row { display: flex; justify-content: space-between; align-items: end; gap: 32px; flex-wrap: wrap; }
.foot__name { font-size: var(--step-head); line-height: 1; }
.foot__links { display: grid; }
.foot__links a { display: inline-flex; min-height: 44px; align-items: center; }
.foot__legal { margin-top: 28px; max-width: 60ch; color: #d8d3cc; }
.foot__legal + .foot__legal { margin-top: 12px; }

/* Reveals for the words on the wall. */
.wall__words > :nth-child(2) { --w: 1; }
