/* Hold and pour: an invented olive oil. Holding the table tips the bottle: the oil inside stays level, runs out of the
   neck once it reaches it and falls in a stream that the pointer aims; the bowl fills and ripples where the stream
   lands, and what misses it ends on the board. A round cursor says what to do and stretches when it moves fast. */
:root {
  --green: #233220;         /* the page */
  --green-deep: #1a2618;    /* behind the table */
  --bone: #f2ecdf;          /* text, the board, the glass highlights */
  --ink: #15130f;           /* the engraving's lines */
  --oil: #d8b13a;           /* the oil */
  --muted: rgba(242, 236, 223, 0.66);
  --edge: clamp(18px, 3.4vw, 52px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--green);
  color: var(--bone);
  font-family: 'Instrument Sans Variable', 'Instrument Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------------------------------------------------------------- the bar */
.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px var(--edge);
  background: linear-gradient(to bottom, rgba(35, 50, 32, 0.96), rgba(35, 50, 32, 0));
}

.brand {
  font-family: 'Young Serif', Georgia, serif;
  font-size: 21px;
}

.bar__nav {
  display: flex;
  gap: clamp(16px, 2.4vw, 32px);
  font-size: 13px;
  font-weight: 560;
  letter-spacing: 0.02em;
}

.bar__nav a {
  transition: color 0.25s ease;
}

@media (hover: hover) {
  .bar__nav a:hover {
    color: var(--oil);
  }
}

/* ---------------------------------------------------------------- the page */
.page {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
  min-height: 100svh;
}

.copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 120px var(--edge) 9vh;
}

.kicker {
  margin: 0 0 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--oil);
}

.title {
  margin: 0;
  font-family: 'Young Serif', Georgia, serif;
  font-weight: 400;
  font-size: clamp(40px, 4.9vw, 78px);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.note {
  max-width: 34ch;
  margin: 26px 0 0;
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.55;
  color: var(--muted);
}

.pour {
  align-self: flex-start;
  min-height: 52px;
  margin-top: 30px;
  padding: 0 26px;
  font: inherit;
  font-size: 14px;
  font-weight: 620;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--bone);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease;
}

@media (hover: hover) {
  .pour:hover {
    background: var(--oil);
    transform: scale(1.04);
  }
}

.pour:active {
  transform: scale(0.96);
}

.pour:focus-visible,
.bar a:focus-visible {
  outline: 2px solid var(--oil);
  outline-offset: 4px;
}

/* ---------------------------------------------------------------- the table */
.stage {
  position: relative;
  min-height: 100svh;
  background: var(--green-deep);
  cursor: grab;
  touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.stage.is-holding {
  cursor: grabbing;
}

.stage__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.served {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5.5%;
  margin: 0;
  font-family: 'Young Serif', Georgia, serif;
  font-size: clamp(22px, 2.4vw, 34px);
  text-align: center;
  color: var(--ink);
  pointer-events: none;
}

.hint {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 22px;
  margin: 0;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--bone);
  border-radius: 999px;
  transform: translateX(-50%);
  pointer-events: none;
}

/* ---------------------------------------------------------------- the cursor */
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10;
  width: 104px;
  height: 104px;
  margin: -52px 0 0 -52px;
  pointer-events: none;
  display: none;
}

.cursor__disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--bone);
  border: 3px solid var(--ink);
  will-change: transform;
}

.cursor__text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-stretch: 90%;
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  color: var(--ink);
}

/* ---------------------------------------------------------------- phones */
@media (max-width: 820px) {
  .page {
    grid-template-columns: 1fr;
  }

  .copy {
    padding: 104px var(--edge) 28px;
    justify-content: flex-start;
  }

  .title {
    font-size: clamp(36px, 10vw, 56px);
  }

  .stage {
    min-height: 0;
    height: 78svh;
  }
}

/* schermi stretti e non alti (la casella dell'anteprima sul telefono, il Playground sul telefono): il testo si stringe
   in cima e il tavolo prende tutto il resto della pagina, così bottiglia e ciotola si vedono senza scorrere */
@media (max-width: 820px) and (max-height: 760px) {
  .bar {
    padding: 12px var(--edge);
  }

  .brand {
    font-size: 18px;
    white-space: nowrap;
  }

  .bar__nav {
    gap: 14px;
    font-size: 12px;
    white-space: nowrap;
  }

  .page {
    grid-template-rows: auto minmax(0, 1fr);
    height: 100svh;
    min-height: 0;
  }

  .copy {
    padding: 54px var(--edge) 12px;
  }

  .pour {
    min-height: 40px;
    margin-top: 12px;
    padding: 0 20px;
    font-size: 13px;
  }

  .stage {
    height: auto;
  }

  .hint {
    bottom: 12px;
    padding: 8px 14px;
    font-size: 11px;
  }
}

/* e sulla casella bassa restano solo il titolo, più piccolo, e il pulsante */
@media (max-width: 820px) and (max-height: 520px) {
  .kicker,
  .note {
    display: none;
  }

  .title {
    font-size: clamp(22px, 6.4vw, 34px);
  }
}

@media (hover: none), (pointer: coarse) {
  .hint {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pour,
  .bar__nav a {
    transition: none;
  }
}
