/* Weinliste — chalk wall + cellar. Tokens first, then structure. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Switzer";
  src: url("fonts/switzer-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Switzer";
  src: url("fonts/switzer-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* colour — the whitewashed cellar wall the bottles were shot against */
  --paper: #efeae1;
  --paper-sunk: #e7e1d6;
  --ink: #211d19;
  --ink-soft: #544a40;
  --rule: #cfc6b6;
  --rule-soft: #dcd4c6;
  --accent: #7a2231;
  --accent-deep: #5e1926;
  --on-accent: #fbf8f3;

  /* type */
  --font-display: "Fraunces", Georgia, serif;
  --font-text: "Switzer", "Avenir Next", sans-serif;
  --t-sm: 0.82rem;
  --t-base: 1rem;
  --t-md: 1.2rem;
  --t-lg: 1.44rem;
  --t-xl: 1.73rem;
  --t-2xl: 2.07rem;
  --t-3xl: 2.49rem;

  /* space — 4px base */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-micro: 160ms;
  --dur-elem: 240ms;

  --stage-h: 260px;
  --measure: 62ch;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  scroll-padding-top: var(--s-6);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.55;
  text-wrap: pretty;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  text-wrap: balance;
  margin: 0;
}

a {
  color: inherit;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.shell {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--s-5);
}

/* ---------- masthead ---------- */

.masthead {
  padding-block: var(--s-7) var(--s-6);
  border-bottom: 1px solid var(--rule);
}

.masthead__title {
  font-size: clamp(2.07rem, 7vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: 14ch;
}

.masthead__lead {
  margin: var(--s-4) 0 0;
  max-width: var(--measure);
  color: var(--ink-soft);
}

.howto {
  margin-top: var(--s-6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4) var(--s-5);
}

.howto__text {
  margin: 0;
  max-width: 46ch;
}

.howto__text strong {
  font-weight: 600;
}

/* ---------- WhatsApp actions ---------- */

.wa {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 44px;
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: var(--t-base);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  transition:
    background-color var(--dur-micro) var(--ease-out),
    color var(--dur-micro) var(--ease-out);
}

.wa:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.wa:active {
  background: var(--accent-deep);
  color: var(--on-accent);
}

.wa--solid {
  background: var(--accent);
  color: var(--on-accent);
}

.wa--solid:hover {
  background: var(--accent-deep);
}

.wa__icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: currentColor;
}

/* ---------- region index ---------- */

.index {
  padding-block: var(--s-5);
  border-bottom: 1px solid var(--rule);
}

.index__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s-5);
}

/* padded to a 44px touch target without adding visible chrome */
.index__link {
  display: inline-block;
  padding-block: 0.65rem;
  text-decoration: none;
  color: var(--ink-soft);
  text-underline-offset: 4px;
  transition: color var(--dur-micro) var(--ease-out);
}

.index__link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.index__count {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  margin-left: 0.35em;
}

/* ---------- region ---------- */

.region {
  padding-block: var(--s-8) var(--s-4);
}

.region__head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--ink);
}

.region__name {
  font-size: var(--t-xl);
  letter-spacing: -0.01em;
}

.region__sub {
  grid-column: 1 / -1;
  grid-row: 2;
  color: var(--ink-soft);
  font-size: var(--t-sm);
  margin: var(--s-1) 0 0;
}

.region__count {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  color: var(--ink-soft);
  font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin: 0;
}

.rack {
  list-style: none;
  margin: 0;
  padding: var(--s-6) 0 0;
  display: grid;
  gap: var(--s-6);
}

/* ---------- one bottle ---------- */

/* Phone: the bottle stands beside its facts, so a 1:4 bottle silhouette does
   not leave two thirds of the row empty. From 680px up it moves on top. */
.wine {
  display: grid;
  grid-template-columns: 104px 1fr;
  column-gap: var(--s-5);
  align-items: start;
  min-width: 0;
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--rule-soft);
}

.wine__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wine__stage {
  position: relative;
  height: var(--stage-h);
}

/* layered contact + ambient shadow on the shelf line */
.wine__stage::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  translate: -50% 0;
  width: 78%;
  height: 18px;
  background:
    radial-gradient(
      ellipse 34% 46% at 50% 100%,
      rgb(33 29 25 / 34%),
      rgb(33 29 25 / 0) 70%
    ),
    radial-gradient(
      ellipse 62% 90% at 50% 100%,
      rgb(33 29 25 / 12%),
      rgb(33 29 25 / 0) 72%
    );
  pointer-events: none;
}

.wine__stage img {
  position: relative;
  z-index: 1;
  display: block;
  height: 100%;
  width: 100%;
  object-fit: contain;
  object-position: bottom center;
  transition: translate var(--dur-elem) var(--ease-out);
}

.wine:hover .wine__stage img {
  translate: 0 -4px;
}

.wine__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  font-variant-numeric: tabular-nums;
}

.wine__nr {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--accent);
}

.wine__price {
  font-size: var(--t-base);
  font-weight: 600;
}

.wine__title {
  margin-top: var(--s-1);
  font-size: var(--t-md);
  line-height: 1.25;
}

.wine__producer {
  display: block;
  font-family: var(--font-text);
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  margin-bottom: 0.15em;
}

/* Facts are separated by space alone — no punctuation to dangle at a line
   end when the row wraps. */
.wine__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15em 1.15em;
  margin: var(--s-2) 0 0;
  font-size: var(--t-sm);
  color: var(--ink-soft);
}

.wine__note {
  margin: var(--s-3) 0 var(--s-4);
  font-size: var(--t-sm);
  line-height: 1.6;
}

.wine__cta {
  align-self: start;
}

/* reserved and sold — reserved may still come back, so it stays in colour and
   keeps its price readable; sold is finished and reads that way. */

.wine--reserved .wine__stage img {
  opacity: 0.6;
}

.wine--sold .wine__stage img {
  filter: grayscale(1);
  opacity: 0.4;
}

.wine--sold .wine__price {
  text-decoration: line-through;
  color: var(--ink-soft);
  font-weight: 400;
}

.wine__state {
  align-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: var(--t-base);
  cursor: not-allowed;
}

.wine__state--reserved {
  border-style: dashed;
  color: var(--ink);
}

/* ---------- colophon ---------- */

.colophon {
  margin-top: var(--s-9);
  padding-block: var(--s-7) var(--s-8);
  background: var(--paper-sunk);
  border-top: 1px solid var(--rule);
}

.colophon__grid {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.colophon h2 {
  font-size: var(--t-md);
  margin-bottom: var(--s-2);
}

.colophon p {
  margin: 0 0 var(--s-3);
  color: var(--ink-soft);
  font-size: var(--t-sm);
  max-width: 42ch;
}

.colophon a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.colophon .wa {
  margin-bottom: var(--s-3);
}

.colophon__alt {
  margin-bottom: 0;
}

.colophon__stamp {
  max-width: none;
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
  font-size: var(--t-sm);
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 680px) {
  :root {
    --stage-h: 300px;
  }

  .rack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-8) var(--s-5);
    padding-top: var(--s-7);
  }

  /* Bottle on top, standing on the shelf line, facts underneath. */
  .wine {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 0;
    border-bottom: 0;
  }

  .wine__body {
    flex: 1;
  }

  /* equal-height cells in a grid row: push every button onto one line */
  .wine__cta,
  .wine__state {
    margin-top: auto;
  }

  .wine__stage {
    border-bottom: 1px solid var(--rule);
    margin-bottom: var(--s-4);
  }
}

@media (min-width: 1120px) {
  :root {
    --stage-h: 340px;
  }

  .rack {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s-9) var(--s-5);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}
