/* Coffee shop: one-page site */

/* ------------------------------------------------------------------
   COLOUR TOKENS
   Two brand colours carry the whole site:
     Inkwell  (dark base)  -> owns every page background
     Au Lait  (light base) -> owns the type and the drawn line
   Everything below the two bases is worked out from them, so changing
   a base changes the whole site.
   ------------------------------------------------------------------ */
:root {
  /* The two bases */
  --inkwell: #2c3639;
  --inkwell-rgb: 44 54 57;    /* same colour, written so it can be faded */
  --au-lait: #dcd7c9;
  --au-lait-rgb: 220 215 201; /* same colour, written so it can be faded */

  /* Backgrounds: Inkwell and its shades */
  --bg: var(--inkwell);                                        /* the page */
  --bg-deep: color-mix(in srgb, var(--inkwell) 80%, black);    /* a darker band */
  --bg-raised: color-mix(in srgb, var(--inkwell) 92%, var(--au-lait)); /* a lifted panel */

  /* Type: Au Lait, full and faded */
  --text: var(--au-lait);                    /* headings and body, contrast 8.6:1 */
  --text-soft: rgb(var(--au-lait-rgb) / 0.7); /* small notes, contrast 5.1:1 */

  /* The drawn line: Au Lait, full and faded */
  --line: var(--au-lait);
  --line-soft: rgb(var(--au-lait-rgb) / 0.22);

  /* The accent: a sun yellow for the script word, the price and the flame.
     It has to show on every one of the bold background colours. */
  --accent: #ffc83d;

  /* ----------------------------------------------------------------
     FONT TOKENS (loaded from Google Fonts in index.html)
       Lora        -> display: headlines and big words
       DM Sans     -> small text: body, labels, buttons
       Caveat      -> one small handwritten accent word, never whole sentences
                      (was Sacramento: too thin to read)
     ---------------------------------------------------------------- */
  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --font-text: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-script: "Caveat", "Segoe Print", cursive;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-optical-sizing: auto;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
}

/* The script accent word. Script faces run small, so it is sized up. */
.accent {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 1.6em;
  line-height: 1;
}

::selection {
  background: var(--au-lait);
  color: var(--inkwell);
}

/* ------------------------------------------------------------------
   HERO
   Layers, back to front, in this exact order:
     1. the background image   one leaf pattern per drink
     2. the giant product word fitted to the screen width by script.js
     3. the hand               one picture
     4. the drink              its own cut-out, seated in the hand's grip
   Then the words: the script accent over the drink's top corner, and
   the tagline, description and price down the left side.

   The hand and every drink share one canvas (1744 x 2336), so stacking
   them puts the drink exactly in the grip. script.js sets --hand-h
   (the canvas height in pixels) and --drink-top / --drink-right (where
   the current drink's ink starts, as fractions of that canvas).

   Everything that animates here moves with transform and opacity only.
   Nothing is repainted while it moves.
   ------------------------------------------------------------------ */
.hero {
  --hero-pad: clamp(1.5rem, 5vw, 5rem);   /* space from the screen edges */
  --hand-h: 80vh;                         /* replaced by script.js */
  --drink-top: 0.16;                      /* replaced by script.js */
  --drink-right: 0.64;                    /* replaced by script.js */
  --hero-w: 100vw;                        /* replaced by script.js */
  --hero-h: 100vh;                        /* replaced by script.js */
  --wipe-d: 150vmax;                      /* replaced by script.js */
  --card: rgb(0 0 0 / 0.3);               /* dark glass behind small words: works on every colour */

  position: relative;
  isolation: isolate;
  height: 100vh;
  height: 100svh;
  min-height: 34rem;
  overflow: hidden;
  background: var(--bg);
  cursor: grab;
  touch-action: pan-y;          /* up and down still scrolls; sideways is ours */
  -webkit-user-select: none;
  user-select: none;
}

.hero.is-dragging {
  cursor: grabbing;
}

/* 1. The backgrounds.
   Each background sits inside its own giant circle (--wipe-d across,
   big enough to cover the whole screen when centred). To change
   background, the next circle TRAVELS in from one side while the picture
   inside it travels the opposite way by the same amount, so the picture
   stays still on screen and only the circle's edge is seen sweeping
   across. Two moves, no repainting. */
.hero__bgs {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--wipe-d);
  height: var(--wipe-d);
  margin: calc(var(--wipe-d) / -2) 0 0 calc(var(--wipe-d) / -2);
  border-radius: 50%;
  overflow: hidden;
  visibility: hidden;
  will-change: transform;
}

.hero__bg.is-on {
  visibility: visible;
}

/* the colour itself: bright at the top, sinking to near black at the bottom */
.hero__bg i {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: var(--hero-w);
  height: var(--hero-h);
  margin: calc(var(--hero-h) / -2) 0 0 calc(var(--hero-w) / -2);
  will-change: transform;
}

/* THE COLOUR WASH every section shares: its own colour (--c) at the top,
   sinking to near black at the bottom. Change the recipe here once. */
.hero__bg i,
.story,
.closing,
.opening {
  background: linear-gradient(180deg, var(--c) 0%, var(--c) 30%, color-mix(in srgb, var(--c) 24%, black) 100%);
}

/* 2. The giant product word. script.js sets font-size and top for each
      one, from measurements. Nothing here picks a size. */
.hero__words {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero__word {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10vw;               /* replaced by script.js */
  font-kerning: none;            /* each letter is its own piece, so the
                                    measuring in script.js turns pair-spacing off too */
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  /* tone on tone: a darker shade of whatever colour is behind it */
  color: rgb(0 0 0 / 0.2);
}

/* one letter */
.hero__ch {
  display: inline-block;
  white-space: pre;
  opacity: 0;
  will-change: transform, opacity;
}

.hero__word.is-on .hero__ch {
  opacity: 1;
}

/* an invisible mark that sits on the word's baseline, used for measuring */
.hero__word-base {
  display: inline-block;
  width: 0;
  height: 0;
}

/* 3 + 4. The hand rises from the bottom edge, centred; the drink sits on it */
.hero__stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  pointer-events: none;
}

.hero__hand {
  position: relative;
  flex: none;
  height: var(--hand-h);
  aspect-ratio: 1744 / 2336;
  will-change: transform;
}

/* Each picture is a photo plus a "mask": a second file that says which
   parts are see-through. */
.hero__base,
.hero__drink {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
}

.hero__base {
  -webkit-mask-image: url("assets/img/hero/hand-mask.png");
  mask-image: url("assets/img/hero/hand-mask.png");
}

.hero__drink--1 {
  -webkit-mask-image: url("assets/img/hero/drink-1-mask.png");
  mask-image: url("assets/img/hero/drink-1-mask.png");
}

.hero__drink--2 {
  -webkit-mask-image: url("assets/img/hero/drink-2-mask.png");
  mask-image: url("assets/img/hero/drink-2-mask.png");
}

.hero__drink--3 {
  -webkit-mask-image: url("assets/img/hero/drink-3-mask.png");
  mask-image: url("assets/img/hero/drink-3-mask.png");
}

.hero__drink--4 {
  -webkit-mask-image: url("assets/img/hero/drink-4-mask.png");
  mask-image: url("assets/img/hero/drink-4-mask.png");
}

.hero__drink--5 {
  -webkit-mask-image: url("assets/img/hero/drink-5-mask.png");
  mask-image: url("assets/img/hero/drink-5-mask.png");
}

.hero__drink {
  opacity: 0;
  will-change: transform, opacity;
}

.hero__drink.is-on {
  opacity: 1;
}

/* The small accent word, in the script font, over the drink's top right
   corner. Its place comes from the drink's measured ink. */
.hero__accent {
  position: absolute;
  z-index: 5;
  left: calc(var(--drink-right) * 100%);
  top: calc(var(--drink-top) * 100%);
  margin: 0;
  transform: translate(-38%, -62%) rotate(-8deg);
  font-family: var(--font-script);
  font-size: max(2rem, calc(var(--hand-h) * 0.09));
  line-height: 1;
  white-space: nowrap;
  color: var(--accent);
  text-shadow: 0 2px 10px rgb(0 0 0 / 0.35);
}

/* Tagline, description and price, down the left side */
.hero__copy {
  position: absolute;
  z-index: 4;
  left: var(--hero-pad);
  bottom: clamp(1.25rem, 4vh, 2.5rem);
  /* never wider than the gap between the left edge and the fingers */
  width: min(24rem, calc(50vw - var(--hand-h) * 0.14 - var(--hero-pad) - 1.5rem));
  padding: 1.25rem 1.75rem 1.5rem;
  border-radius: 1.25rem;
  background: var(--card);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  container-type: inline-size;
  cursor: auto;
}

/* which drink we are on: 01 / 05 */
.hero__count {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
}

.hero__count span {
  color: var(--text);
}

.hero__tagline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.375rem, 9cqw, 2rem);
  line-height: 1.15;
  color: var(--text);
}

.hero__note {
  margin: 0.625rem 0 0;
  min-height: 3.2em;            /* room for two lines, so the card keeps its size */
  font-size: 1rem;
  color: var(--text-soft);
}

/* on a narrow card the longer notes run to three lines */
@container (max-width: 19rem) {
  .hero__note {
    min-height: 4.8em;
  }
}

/* the price with the Order button beside it */
.hero__buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
}

.hero__price {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.hero__order {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;          /* big enough for a thumb */
  padding: 0 1.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--inkwell);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}

.hero__order:focus-visible {
  outline: 2px solid var(--line);
  outline-offset: 3px;
}

/* the drink's full name, for screen readers only */
.hero__title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Arrows and dots, bottom centre */
.hero__nav {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: clamp(1.25rem, 4vh, 2.5rem);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem;
  border-radius: 999px;
  background: var(--card);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: auto;
}

.hero__arrow {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: none;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.hero__arrow:hover {
  background: rgb(var(--au-lait-rgb) / 0.12);
  border-color: var(--line);
}

.hero__arrow svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero__dots {
  display: flex;
  align-items: center;
}

/* Each dot is a button: big enough to tap, small to look at */
.hero__dot {
  position: relative;
  width: 1.5rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.hero__dot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  margin: -0.25rem 0 0 -0.25rem;
  border-radius: 50%;
  background: var(--line-soft);
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.hero__dot:hover::before {
  background: rgb(var(--au-lait-rgb) / 0.55);
}

.hero__dot.is-on::before {
  background: var(--line);
  transform: scale(1.5);
}

.hero__arrow:focus-visible,
.hero__dot:focus-visible {
  outline: 2px solid var(--line);
  outline-offset: 2px;
}

/* "Scroll, drag or use the arrow keys", bottom right */
.hero__hint {
  position: absolute;
  z-index: 4;
  right: var(--hero-pad);
  bottom: clamp(1.25rem, 4vh, 2.5rem);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--card);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* a short drawn line before the words */
.hero__hint::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: var(--line);
}

/* Phones and tall, narrow windows: the words card sits across the bottom,
   over the forearm, with the arrows and dots under it */
@media (max-width: 860px), (max-aspect-ratio: 1/1) {
  .hero {
    --hero-pad: 1rem;
  }

  .hero__copy {
    left: var(--hero-pad);
    right: var(--hero-pad);
    bottom: calc(var(--hero-pad) + 4.25rem);
    width: auto;
    padding: 0.875rem 1.25rem 1.125rem;
  }

  .hero__count {
    margin-bottom: 0.25rem;
  }

  .hero__tagline {
    font-size: 1.375rem;
  }

  .hero__note {
    margin-top: 0.375rem;
    min-height: 2.9em;
    font-size: 0.9375rem;
    line-height: 1.45;
  }

  .hero__buy {
    margin-top: 0.5rem;
  }

  .hero__price {
    font-size: 1.25rem;
  }

  .hero__nav {
    bottom: var(--hero-pad);
  }

  .hero__hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__arrow,
  .hero__dot::before {
    transition: none;
  }
}

/* ------------------------------------------------------------------
   HERO: the fingers in front
   The same hand photo once more, on top of the drink, shown only where
   the fingertips and thumb cross a drink. Order inside the hand box:
   hand, drink, fingers, accent word.
   ------------------------------------------------------------------ */
.hero__fingers {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image: url("assets/img/hero/fingers-mask.png");
  -webkit-mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-image: url("assets/img/hero/fingers-mask.png");
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
}

/* ------------------------------------------------------------------
   HERO: beans and ice cubes flying round the drink
   Each one is placed inside the hand's box: --x and --y are its place,
   --w its width, all as shares of that box, --r its tilt. They drift
   gently up and down, each at its own pace. The first five sit behind
   the hand and drink; the ones marked "front" pass in front.
   Ice cubes only show while a cold drink is up (script.js adds is-cold).
   ------------------------------------------------------------------ */
.hero__bit {
  position: absolute;
  z-index: -1;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: auto;
  transform: rotate(var(--r));
  animation: bit-float var(--t, 5s) ease-in-out var(--d, 0s) infinite alternate;
  /* each one leaves a moment after the last: 0 to 0.12s, worked out from its own pace */
  --pop: calc((var(--t, 5s) - 4.6s) * 0.06);
  /* the way back OUT of the drink when it lands: a quick pop that overshoots and settles */
  transition:
    opacity 0.2s ease var(--pop),
    scale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) var(--pop),
    left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) var(--pop),
    top 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) var(--pop);
  will-change: transform, opacity;
}

.hero__bit--ice {
  opacity: 0;
}

.hero.is-cold .hero__bit--ice {
  opacity: 1;
}

/* While the drink is changing (script.js adds is-swapping until the new
   one lands): they shrink away where they are, then wait, unseen, at
   the middle of the cup, ready to burst out. */
.hero.is-swapping .hero__bit {
  left: 46%;
  top: 30%;
  scale: 0;
  opacity: 0;
  transition: opacity 0.18s ease-in, scale 0.18s ease-in, left 0s 0.18s, top 0s 0.18s;
}

.hero__bit--1 { --x: 14%; --y: 9%;  --w: 9%;   --r: -20deg; --t: 5.2s; }
.hero__bit--2 { --x: 25%; --y: 2%;  --w: 7%;   --r: 35deg;  --t: 6.1s; --d: -2s; }
.hero__bit--3 { --x: 71%; --y: 45%; --w: 10%;  --r: 15deg;  --t: 4.6s; --d: -1s; z-index: 4; }
.hero__bit--4 { --x: 82%; --y: 35%; --w: 6%;   --r: 70deg;  --t: 5.8s; --d: -3s; }
.hero__bit--5 { --x: 7%;  --y: 22%; --w: 5.5%; --r: -50deg; --t: 6.6s; --d: -4s; }
.hero__bit--6 { --x: 88%; --y: 1%;  --w: 11%;  --r: 12deg;  --t: 5.5s; --d: -2.5s; }
.hero__bit--7 { --x: 4%;  --y: 36%; --w: 10%;  --r: -18deg; --t: 4.9s; --d: -1.5s; z-index: 4; }
.hero__bit--8 { --x: 84%; --y: 21%; --w: 8%;   --r: 28deg;  --t: 6.3s; --d: -0.5s; }

@keyframes bit-float {
  from { transform: translateY(-7%) rotate(var(--r)); }
  to   { transform: translateY(7%) rotate(calc(var(--r) + 8deg)); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__bit {
    animation: none;
    transition: none;
  }
}

/* ------------------------------------------------------------------
   HERO: the signature line
   ONE line, drawn twice. The back copy is the whole line and sits
   behind the hand and drink (but in front of the giant word). The front
   copy is the very same line on top of the hand, clipped to a small
   window over the wrist, so the line goes behind the drink, comes round,
   and crosses in front of the wrist with no join anywhere.
   script.js writes the path, the window and the stroke width.
   ------------------------------------------------------------------ */
.hero__line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.hero__line--back {
  z-index: 1;      /* after the words in the page, so it draws over the giant word */
}

.hero__line--front {
  z-index: 3;      /* over the hand (2), under the cards and buttons (4) */
}

.hero__line path {
  fill: none;
  stroke: var(--line);
  stroke-width: var(--line-w, 5px);
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------------
   CLOSING PANEL
   The flame is five circles, wide at the bottom and narrower going up.
   A blur plus a hard edge (the #flame-fuse filter in index.html) melts
   them into one shape. script.js sways the bottom circle and makes each
   circle above follow the one below it, a little late and a little wider.
   ------------------------------------------------------------------ */
.closing {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(1.5rem, 4vh, 3rem);
  padding: clamp(3rem, 8vh, 6rem) clamp(1.5rem, 5vw, 5rem);
  overflow: hidden;
  --c: #c62a1c;         /* this section's colour: red, behind the yellow flame */
  text-align: center;
}

.closing__flame {
  position: relative;
  z-index: 0;
  width: min(30vh, 56vw);   /* a little smaller than before, to leave room for the order details */
  aspect-ratio: 3 / 5;
  filter: url(#flame-fuse);
}

.closing__blob {
  position: absolute;
  left: 50%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 65%, #fff1b8 0%, var(--accent) 55%, #f08a24 100%);
  will-change: transform;
}

.closing__blob--1 { width: 78%; margin-left: -39%; bottom: 0; }
.closing__blob--2 { width: 62%; margin-left: -31%; bottom: 22%; }
.closing__blob--3 { width: 46%; margin-left: -23%; bottom: 42%; }
.closing__blob--4 { width: 31%; margin-left: -15.5%; bottom: 59%; }
.closing__blob--5 { width: 17%; margin-left: -8.5%; bottom: 74%; }

/* the words sit on top of everything in this panel */
.closing__words {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  --gap: clamp(1.5rem, 4vh, 2.5rem);
  gap: var(--gap);
}

.closing__headline {
  font-size: clamp(2.5rem, 7vw, 6rem);
  color: var(--text);
}

.closing__headline .accent {
  font-size: 1.15em;
  color: var(--accent);
}

.closing__button {
  padding: 1.25rem 3.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--au-lait);
  color: var(--inkwell);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  will-change: transform;
}

/* one line on how ordering works, tucked up under the headline; white, because cream on red is too faint this small */
.closing__lead {
  margin: calc(var(--gap) * -0.55) 0 0;
  color: #fff;
  font-size: 1.125rem;
  text-wrap: balance;       /* no single word left alone on the second line */
}

/* phone, address and hours under the button: three labelled columns */
.closing__details {
  display: flex;
  justify-content: center;
  margin: 0;
  color: #fff;
  font-family: var(--font-text);
}

.closing__details div {
  padding: 0 1.75rem;
}

.closing__details div + div {
  border-left: 1px solid rgb(255 255 255 / 0.3);
}

.closing__details dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.closing__details dd {
  margin: 0.3rem 0 0;
  font-size: 1.0625rem;
}

.closing__details a {
  color: inherit;
}

/* the opening and closing times, set apart from the days */
.closing__details b {
  margin-left: 0.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* on a phone the three stack */
@media (max-width: 760px) {
  .closing__details {
    flex-direction: column;
    gap: 0.9rem;
  }

  .closing__details div + div {
    border-left: 0;
  }
}

.closing__button:focus-visible {
  outline: 2px solid var(--line);
  outline-offset: 4px;
}

.closing__defs {
  position: absolute;
}

/* ------------------------------------------------------------------
   LAST SECTION: the mural
   The mural picture fills the screen and stays still. A circle follows
   the cursor and shows a moving version of the SAME picture inside it.
   Built from movement only: the circle travels, and the picture inside
   it travels the opposite way by the same amount, so it stays lined up
   with the still picture underneath. script.js does the following.
   ------------------------------------------------------------------ */
.mural {
  --lens-d: 220px;      /* the circle's resting size: replaced by script.js */
  --mural-w: 100vw;     /* replaced by script.js */
  --mural-h: 100vh;     /* replaced by script.js */

  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 30rem;
  overflow: hidden;
  background: var(--bg-deep);
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.mural__still {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* the circle */
.mural__lens {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--lens-d);
  height: var(--lens-d);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 4px var(--line), 0 18px 50px rgb(0 0 0 / 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  will-change: transform;
}

.mural.is-live .mural__lens {
  opacity: 1;
}

/* the moving picture inside the circle, as big as the whole section */
.mural__inside {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--mural-w);
  height: var(--mural-h);
  transform-origin: 0 0;
  will-change: transform;
}

.mural__moving,
.mural__film {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Until the film exists, the circle shows the same picture a little
   brighter and a little closer, like a magnifying glass. Kept gentle:
   the picture is already bright, and stronger values wash it out. */
.mural__moving {
  filter: saturate(1.1) brightness(1.1);
}

.mural__film {
  display: none;
}

.mural.has-film .mural__film {
  display: block;
}

.mural.has-film .mural__moving {
  display: none;
}

/* ------------------------------------------------------------------
   Small fixes from the site review
   ------------------------------------------------------------------ */

/* the words in the card can be selected and copied again */
.hero__copy {
  -webkit-user-select: text;
  user-select: text;
}

/* phones: say that the drinks can be swiped (the bottom-right hint is hidden there) */
@media (max-width: 860px), (max-aspect-ratio: 1/1) {
  .hero__count::after {
    content: "\00a0\00a0\00b7\00a0\00a0swipe or use the arrows";
    letter-spacing: 0.08em;
  }
}

/* ------------------------------------------------------------------
   STORY SECTION
   The figure on one side, the words on the other, and the line doing
   the depth trick a second time around the figure.
   Layer order, back to front:
     background, line behind, figure, line in front, words on top.
   "In front of the figure" never means "in front of the words".
   ------------------------------------------------------------------ */
.story {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(4rem, 10vh, 7rem) clamp(1.5rem, 6vw, 6rem);
  overflow: hidden;
  --c: #1b62c4;         /* this section's colour: blue, so the orange figure stands out */
  --text: #fff;         /* plain white here: cream on bright blue is too faint for small words */
  --text-soft: #fff;
}

.story__line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.story__line path {
  fill: none;
  stroke: var(--line);
  stroke-width: var(--story-line-w, 5px);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.story__line--back {
  z-index: 0;
}

.story__figure {
  position: relative;
  z-index: 1;
  justify-self: center;
  display: block;
  width: auto;
  height: min(78vh, 46rem);
  max-width: 100%;
  object-fit: contain;
  will-change: transform;
}

.story__line--front {
  z-index: 2;
}

/* the words sit on top of everything */
.story__words {
  position: relative;
  z-index: 3;
  max-width: 30rem;
  will-change: transform;
}

.story__kicker {
  margin: 0 0 0.25rem;
  font-family: var(--font-script);
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1;
  color: var(--accent);
}

.story__headline {
  font-size: clamp(2rem, 4.2vw, 3.5rem);
  color: var(--text);
}

.story__words p:not(.story__kicker) {
  margin: 1.25rem 0 0;
  font-size: 1.0625rem;
  color: var(--text-soft);
}

/* Phones and narrow windows: figure on top, words underneath */
@media (max-width: 860px) {
  .story {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding: 4rem 1.5rem;
  }

  .story__figure {
    height: 54vh;
  }

  .story__words {
    max-width: none;
  }
}

/* the figure is a photo plus a "mask" file that says which parts are see-through */
.story__figure {
  -webkit-mask-image: url("assets/img/figure-mask.png");
  -webkit-mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-image: url("assets/img/figure-mask.png");
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
}

/* ------------------------------------------------------------------
   THE OPENING
   A full-screen layer on top of the whole site. Inside it, back to front:
     the flat colour, the last-frame picture with the hole, the film,
     then the two buttons.
   script.js runs the sequence and removes the layer when it is over.
   ------------------------------------------------------------------ */
.opening {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  --c: #c62a1c; /* the film's own red, so nothing dark flashes before it loads */
}

/* the page does not scroll while the opening is up */
html.is-opening,
html.is-opening body {
  overflow: hidden;
}

.opening__fill,
.opening__card,
.opening__film {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.opening__card,
.opening__film {
  object-fit: cover;
}

.opening__fill {
  z-index: 1;
  opacity: 0;
}

.opening__card {
  z-index: 2;
  visibility: hidden;
  will-change: transform;
}

.opening__film {
  z-index: 3;
}

.opening__start {
  position: absolute;
  z-index: 4;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-text);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.opening__start {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 1.25rem 3rem;
  background: var(--au-lait);
  color: var(--inkwell);
  font-size: 1.0625rem;
}

.opening__start:focus-visible {
  outline: 2px solid var(--line);
  outline-offset: 3px;
}

.opening [hidden] {
  display: none;
}
