/* ==========================================================================
   Panchayat Cafe & Snooker: landing page
   Every value below comes from DESIGN.md. Components use the token names.
   ========================================================================== */

@font-face {
  font-family: "Anek Latin";
  src: url("assets/fonts/anek-latin-variable.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Colour: each one has a single job (see DESIGN.md) */
  --night: #0F0F0F;        /* page background (client palette) */
  --coal: #202020;         /* panels, unlit surfaces (client palette) */
  --chalk: #F8F8F8;        /* text on dark (client palette) */
  --ash: #B9B9B4;          /* secondary text on dark */
  --neon: #5DD62C;         /* logo green, primary button (client palette) */
  --baize: #337418;        /* snooker cloth (client palette) */
  --baize-deep: #2A6114;   /* cloth shading */
  --bulb: #FFD98A;         /* warm light: bulbs, focus ring */
  --bulb-hot: #FFF6DC;     /* centre of a lit bulb */
  --wood: #5E3D23;         /* table rail */
  --unlit: #4A4A47;        /* outlines of things that are not on yet */
  --line: rgba(248, 248, 248, 0.14);
  --line-strong: rgba(248, 248, 248, 0.42);

  /* The six colours of snooker, one per outlet, plus the cue ball */
  --ball-yellow: #F2C230;
  --ball-green: #0E7C47;
  --ball-brown: #8A4B21;
  --ball-blue: #2F6FE0;
  --ball-pink: #F29ABF;
  --ball-black: #161616;
  --ball-cue: #F6F1E4;

  /* Type */
  --font: "Anek Latin", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --text-s: 0.9375rem;     /* 15 */
  --text-m: 1.0625rem;     /* 17 body */
  --text-l: 1.25rem;       /* 20 lead */
  --text-xl: 1.5rem;       /* 24 h3 */
  --text-2xl: 2rem;        /* 32 outlet numbers */
  --text-h2: clamp(2.25rem, 1.5rem + 3.2vw, 3.75rem);
  --text-h1: clamp(2.5rem, 1.2rem + 5vw, 4.5rem);
  --text-sign: clamp(3.5rem, 2rem + 6.5vw, 6.5rem);

  /* Space: 8px rhythm */
  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2rem;
  --s5: 3rem;
  --s6: 4rem;
  --s7: 6rem;
  --s8: 8rem;
  --page: 75rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --header-h: 4rem;

  /* Shape */
  --r-s: 0.375rem;
  --r-m: 1rem;
  --r-l: 2rem;
  --r-pill: 999px;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(env(safe-area-inset-top, 0px) + var(--header-h) + var(--s2));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--chalk);
  font-family: var(--font);
  font-size: var(--text-m);
  line-height: 1.55;
  font-weight: 400;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}

/* keeps the phone's status bar area the same colour as the sticky header */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--night);
  z-index: 10;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--bulb);
  outline-offset: 3px;
  border-radius: var(--r-s);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.page {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Type roles ---------- */

.display {
  font-stretch: 75%;
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

h1.display { font-size: var(--text-h1); }
h1[tabindex="-1"]:focus { outline: none; }
h2.display { font-size: var(--text-h2); }

.lead {
  font-size: var(--text-l);
  line-height: 1.5;
  color: var(--ash);
  max-width: 34rem;
  text-wrap: pretty;
}

/* ---------- Skip link ---------- */

.skip {
  position: fixed;
  left: var(--s2);
  top: calc(env(safe-area-inset-top, 0px) + var(--s2));
  z-index: 30;
  padding: 0.75rem 1.25rem;
  background: var(--chalk);
  color: var(--night);
  font-weight: 600;
  border-radius: var(--r-pill);
  text-decoration: none;
  transform: translateY(-300%);
}
.skip:focus { transform: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.5rem 1.75rem;
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:focus-visible { border-radius: var(--r-pill); }
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--neon); color: var(--night); }
.btn--primary:hover { background: var(--chalk); }

.btn--quiet { border-color: var(--line-strong); color: var(--chalk); background: transparent; }
.btn--quiet:hover { background: var(--chalk); border-color: var(--chalk); color: var(--night); }

.btn--small { min-height: 2.75rem; padding-inline: 1.25rem; font-size: var(--text-s); }

.link {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
}
.link:hover { color: var(--neon); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--night);
  border-bottom: 1px solid var(--line);
  opacity: var(--reveal, 1);
}

.site-header__row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-right: auto;
  color: var(--chalk);
  text-decoration: none;
}
.brand__mark { height: 2.25rem; width: auto; }

.nav { display: none; gap: var(--s1); }
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.75rem;
  color: var(--ash);
  font-size: var(--text-s);
  font-weight: 500;
  text-decoration: none;
}
.nav a:hover { color: var(--chalk); }

@media (min-width: 48rem) {
  .nav { display: flex; }
  .brand__mark { height: 2.5rem; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  padding-block: var(--s4) 4.5rem;
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
}

/* The café at night, across the top of the hero. --cafe is how bright its lights are (0 to 1). */
.hero__cafe {
  position: absolute;
  inset: 0 0 auto 0;
  height: 66%;
  z-index: -1;
  opacity: var(--cafe, 1);
  transition: opacity 0.16s linear;
}
.hero__cafe img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  filter: brightness(0.9);
}
/* scrim: clear near the top so the string lights show, solid by the time the words start */
.hero__cafe::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 15, 15, 0.3) 0%, rgba(15, 15, 15, 0.12) 20%, rgba(15, 15, 15, 0.34) 42%, rgba(15, 15, 15, 0.8) 64%, rgba(15, 15, 15, 0.95) 82%, var(--night) 100%);
}
/* during the intro the lights come on from left to right: --wipe runs 0 to 1 */
.intro-running .hero__cafe {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(var(--wipe, 1) * 135% - 35%), transparent calc(var(--wipe, 1) * 135%));
  mask-image: linear-gradient(90deg, #000 calc(var(--wipe, 1) * 135% - 35%), transparent calc(var(--wipe, 1) * 135%));
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 4vh, 2.75rem);
  text-align: center;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  opacity: var(--reveal, 1);
  transform: translateY(calc((1 - var(--reveal, 1)) * 0.875rem));
}
.hero__copy .lead { max-width: 40rem; text-wrap: balance; color: #D2D2CD; }
.hero__copy h1, .hero__copy .lead { text-shadow: 0 0 1.25rem rgba(15, 15, 15, 0.9); }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s2);
  margin-top: var(--s1);
}
.hero .btn--quiet { background: rgba(15, 15, 15, 0.6); }
.hero .btn--quiet:hover { background: var(--chalk); }

/* The sign: a long rectangular plate with a green frame, carrying our logo.
   On phones the plate is as wide as the screen allows. On wider screens it grows longer, not taller:
   change 2.75 below to make the rectangle longer or shorter (it is the plate's length divided by its height). */
.sign {
  --vh44: 44vh;
  --sign-h: min(calc((100vw - 2 * var(--gutter)) * 0.475), var(--vh44), 28rem);
  --sign-w: min(calc(100vw - 2 * var(--gutter)), calc(var(--sign-h) * 2.75));
  --pad: calc(var(--sign-h) * 0.11);                 /* air between the plate's edge and the art */
  --art-h: min(calc(var(--sign-h) * 0.8), calc((var(--sign-w) - 2 * var(--pad)) * var(--hw, 0.41)));
  --cup-w: calc(var(--art-h) * var(--cw, 0.74));     /* the cup's column */
  --word-w: calc(var(--art-h) * var(--ww, 1.65));    /* the word पंचायत */
  position: relative;
  width: var(--sign-w);
  height: var(--sign-h);
  flex: none;
}
@supports (height: 1svh) {
  .sign { --vh44: 44svh; }
}

.sign__stage {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}

.sign__body {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--sign-h) * 0.14);
  background: #121211;
}
/* the green frame, a little inside the plate's edge, and its glow */
.sign__body::before, .sign__body::after {
  content: "";
  position: absolute;
  inset: calc(var(--sign-h) * 0.045);
  border-radius: calc(var(--sign-h) * 0.1);
}
.sign__body::before { border: calc(var(--sign-h) * 0.0136) solid var(--neon); }
.sign__body::after {
  box-shadow: 0 0 calc(var(--sign-h) * 0.035) rgba(93, 214, 44, 0.55), inset 0 0 calc(var(--sign-h) * 0.035) rgba(93, 214, 44, 0.3);
  opacity: calc(var(--glow, 1) * 0.6);
}

/* The art comes in three pieces, all the same height:
   the cup's column, moved most of the way from the left border towards the word; the lettering;
   and THE on top, half-way between the ring and the word. */
.sign {
  --word-x: calc(var(--pad) + var(--cup-w) + (var(--sign-w) - 2 * var(--pad) - var(--cup-w) - var(--word-w)) / 2);   /* where the lettering starts */
  --cup-x: calc(var(--pad) + (var(--word-x) - var(--pad) - var(--cup-w)) * 0.65);   /* the cup: 0 = at the left border, 1 = touching the word */
  --ring-x: calc(var(--cup-x) + var(--art-h) * var(--rr, 0.71));                                                      /* the ring's right edge */
}
.sign__art {
  position: absolute;
  top: calc((var(--sign-h) - var(--art-h)) / 2);
  height: var(--art-h);
  color: var(--chalk);
  overflow: visible;
}
.sign__art--cup { left: var(--cup-x); width: var(--cup-w); }
.sign__art--let { left: var(--word-x); width: var(--word-w); }
.sign__art--the {
  left: calc((var(--ring-x) + var(--word-x)) / 2 - var(--art-h) * var(--tw, 0.7) / 2);
  width: calc(var(--art-h) * var(--tw, 0.7));
}
.sign__glow {
  position: absolute;
  inset: 0;
  filter: blur(calc(var(--sign-h) * 0.02)) saturate(1.3);
  opacity: calc(var(--glow, 1) * 0.5);
  pointer-events: none;
}
.pc-green { fill: var(--neon); }
.pc-green-line { stroke: var(--neon); fill: none; }

/* Controls that sit on the hero: skip, and the light switch */
.intro-skip, .switch {
  position: absolute;
  z-index: 5;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--night);
  color: var(--chalk);
  font: inherit;
  font-size: var(--text-s);
  font-weight: 500;
  cursor: pointer;
}
.intro-skip:hover { background: var(--chalk); border-color: var(--chalk); color: var(--night); }
.intro-skip:focus-visible, .switch:focus-visible { border-radius: var(--r-pill); }

.intro-skip { display: none; top: var(--s2); right: var(--gutter); opacity: calc(1 - var(--reveal, 0)); }
.intro-running .intro-skip { display: inline-flex; align-items: center; }

/* The light switch: turns the café's lights off and on */
.switch { display: none; left: var(--gutter); bottom: var(--s2); gap: 0.625rem; padding-left: 0.5rem; opacity: var(--reveal, 1); }
.js .switch { display: inline-flex; align-items: center; }
.switch:hover { border-color: var(--chalk); }
.switch__rocker {
  position: relative;
  width: 2.5rem;
  height: 1.5rem;
  border-radius: var(--r-pill);
  background: var(--bulb);
  box-shadow: 0 0 0.75rem rgba(255, 214, 130, 0.55);
  transition: background-color 0.15s ease;
  flex: none;
}
.switch__rocker::after {
  content: "";
  position: absolute;
  top: 0.1875rem;
  left: 1.1875rem;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: var(--night);
  transition: transform 0.15s ease;
}
.switch[aria-pressed="false"] .switch__rocker { background: var(--unlit); box-shadow: none; }
.switch[aria-pressed="false"] .switch__rocker::after { transform: translateX(-1rem); background: var(--chalk); }

/* Lights off: the café and the photos fall into shadow */
.lights-off { --glow: 0; --cafe: 0.16; }
.lights-off .shot img { filter: saturate(0.55) brightness(0.3); }

/* Before the intro starts: nothing but the plain dark screen */
.intro-pending { --reveal: 0; --glow: 0; --cafe: 0; }
.intro-pending .sign__stage { opacity: 0; }
.intro-pending .site-header, .intro-pending .hero__copy, .intro-pending .switch { pointer-events: none; }
.intro-running .site-header, .intro-running .hero__copy, .intro-running .switch { pointer-events: none; }

/* ---------- Sections ---------- */

.section { padding-block: var(--s7); }
.section__head {
  display: grid;
  gap: var(--s3);
  margin-bottom: var(--s5);
  max-width: 44rem;
}

@media (min-width: 64rem) {
  .section { padding-block: var(--s8); }
  .section__head { margin-bottom: var(--s6); }
}

/* Menu-card border: black diamonds on a green band, from the client's printed menu */
.diamonds {
  height: 0.875rem;
  background-color: var(--baize);
  background-image:
    linear-gradient(135deg, var(--night) 25%, transparent 25%),
    linear-gradient(225deg, var(--night) 25%, transparent 25%),
    linear-gradient(315deg, var(--night) 25%, transparent 25%),
    linear-gradient(45deg, var(--night) 25%, transparent 25%);
  background-size: 0.875rem 0.875rem;
  background-position: 0.4375rem 0;
  background-repeat: repeat-x;
}

/* ---------- Facts (what a Panchayat is) ---------- */

.facts {
  display: grid;
  gap: var(--s5) var(--s3);
  grid-template-columns: 1fr;
}

.fact { display: grid; gap: var(--s1); align-content: start; }
.fact h3 {
  margin-top: var(--s2);
  font-size: var(--text-xl);
  font-weight: 650;
  line-height: 1.2;
}
.fact > p { color: var(--ash); max-width: 30rem; }

.fact__media {
  position: relative;
  height: clamp(15rem, 30vw, 23rem);
  border-radius: var(--r-m);
  overflow: hidden;
  background: var(--coal);
}

@media (min-width: 48rem) {
  .facts { grid-template-columns: repeat(12, 1fr); }
  .fact:nth-child(4n + 1), .fact:nth-child(4n) { grid-column: span 5; }
  .fact:nth-child(4n + 2), .fact:nth-child(4n + 3) { grid-column: span 7; }
}

/* A photo, graded so phone pictures from different nights sit together */
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.25s ease;
}
.fact__media--tall { height: clamp(20rem, 40vw, 30rem); }
.shot--courtyard img { object-position: 50% 50%; }
.shot--seating img { object-position: 50% 64%; }
.shot--bluewall img { object-position: 50% 80%; }
.shot--corner img { object-position: 50% 62%; }
.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(15, 15, 15, 0) 45%, rgba(15, 15, 15, 0.5));
  box-shadow: inset 0 0 0 1px var(--line);
  pointer-events: none;
}

/* A small snooker table you can play: tap the cloth to send the cue ball that way */
.minitable {
  border: 0.75rem solid var(--wood);
  background: radial-gradient(120% 90% at 50% 0%, #36791B, var(--baize) 50%, var(--baize-deep));
  cursor: crosshair;
}
.minitable__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.minitable__controls { display: none; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); margin-top: var(--s1); }
.js .minitable__controls { display: flex; }
.minitable__status { color: var(--ash); font-size: var(--text-s); }

/* The live open sign */
.opensign {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: var(--s2);
  padding: var(--s4);
  box-shadow: inset 0 0 0 1px var(--line);
}
.opensign__text {
  display: grid;
  font-size: var(--text-sign);
  font-stretch: 75%;
  font-weight: 800;
  line-height: 0.9;
  color: var(--neon);
  text-shadow: 0 0 0.05em rgba(93, 214, 44, 0.85), 0 0 0.32em rgba(93, 214, 44, 0.42);
}
.opensign__status {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--chalk);
  font-weight: 500;
}
.opensign__status::before {
  content: "";
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 0.5rem rgba(93, 214, 44, 0.8);
  flex: none;
}
.opensign[data-state="closed"] .opensign__text {
  color: #47802F;          /* the tube with the power off: dim, but still 3.4:1 on the tile */
  text-shadow: none;
}
.opensign[data-state="closed"] .opensign__status::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--ash);
}

/* ---------- Outlets: a snooker table seen from above ---------- */

.table {
  position: relative;
  padding: clamp(0.75rem, 1.6vw, 1.125rem);
  border-radius: var(--r-l);
  background: linear-gradient(180deg, #6E4829, var(--wood) 30%, #4A2E18);
}
.table__cloth {
  position: relative;
  display: grid;
  border-radius: calc(var(--r-l) - 0.75rem);
  background: radial-gradient(120% 85% at 50% 0%, #36791B, var(--baize) 48%, var(--baize-deep));
  box-shadow: inset 0 0 0 0.375rem rgba(0, 0, 0, 0.2), inset 0 0 5rem rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.table__play { padding: clamp(2.75rem, 6vw, 4.5rem) clamp(1.25rem, 5vw, 4.5rem); min-width: 0; }

.pocket {
  position: absolute;
  width: 3rem;
  height: 3rem;
  margin: -1.5rem 0 0 -1.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, #000 55%, #1C1C1C);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}
.pocket--tl { left: 1.375rem; top: 1.375rem; }
.pocket--tr { left: calc(100% - 1.375rem); top: 1.375rem; }
.pocket--bl { left: 1.375rem; top: calc(100% - 1.375rem); }
.pocket--br { left: calc(100% - 1.375rem); top: calc(100% - 1.375rem); }
/* middle pockets sit on the long sides: left and right on a phone, top and bottom on a desktop */
.pocket--m1 { left: 0.75rem; top: 50%; }
.pocket--m2 { left: calc(100% - 0.75rem); top: 50%; }

/* The baulk end. On a phone it runs along the bottom; on a desktop, down the right side. */
.table__baulk {
  --mark: rgba(248, 248, 248, 0.26);
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 7.5rem;
  padding: 0 clamp(1.25rem, 5vw, 4.5rem) var(--s3);
  border-top: 2px solid var(--mark);
}
.dee {
  position: relative;
  flex: none;
  align-self: flex-start;
  width: 7rem;
  height: 3.5rem;
  margin-top: -2px;
  border: 2px solid var(--mark);
  border-top: 0;
  border-radius: 0 0 3.5rem 3.5rem;
}
.dee .ball {
  position: absolute;
  left: 50%;
  top: 0.5rem;
  width: 1.75rem;
  height: 1.75rem;
  margin-left: -0.25rem;
}
.table__next { display: grid; justify-items: start; }
.table__next .link { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: var(--text-s); font-weight: 600; }

.table__head { display: grid; gap: var(--s2); margin-bottom: var(--s5); }
.table__head p { font-size: var(--text-l); max-width: 30rem; }

.numeral {
  font-size: var(--text-2xl);
  font-stretch: 125%;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Each outlet is a ball on the cloth: its own round logo, with the facts beside it */
.spots { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
.spot {
  --d: 6.5rem;
  display: grid;
  grid-template-columns: var(--d) minmax(0, 1fr);
  column-gap: var(--s3);
  align-items: center;
}
.spot__ball {
  position: relative;
  display: block;
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  box-shadow: 0.25rem 0.75rem 1rem rgba(0, 0, 0, 0.45);
}
.spot__ball img { width: 100%; height: 100%; border-radius: 50%; }
/* a highlight and a shaded edge, so the flat logo reads as a ball */
.spot__ball::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.4) 0 4%, rgba(255, 255, 255, 0) 24%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.42) 100%);
  pointer-events: none;
}
.spot--soon .spot__ball { box-shadow: inset 0 0 0 2px rgba(248, 248, 248, 0.6); }
.spot--soon .spot__ball::after { content: none; }

.spot__text { display: grid; gap: 0.125rem; justify-items: start; min-width: 0; }
.spot__name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.125rem 0.75rem; }
.spot__city { font-size: var(--text-xl); font-weight: 650; line-height: 1.2; }
.spot__row { display: flex; align-items: center; gap: var(--s3); }
.spot__status { font-weight: 600; }
.spot__map { display: inline-flex; align-items: center; min-height: 2.75rem; min-width: 2.75rem; font-weight: 600; }
.table .link:hover { color: var(--chalk); text-decoration-thickness: 3px; }

/* The balls roll onto the cloth the first time the table comes into view (set up by the script) */
.table--armed .spot__ball { transform: translateX(-160%) rotate(-340deg); opacity: 0; }
.table--armed.is-in .spot__ball {
  transform: none;
  opacity: 1;
  transition: transform 1.05s cubic-bezier(0.2, 0.75, 0.25, 1), opacity 0.2s linear;
  transition-delay: calc(var(--i, 0) * 120ms);
}
.table--rolled .spot__ball { transition: transform 0.25s ease; }
.table--rolled .spot:hover .spot__ball { transform: rotate(-9deg) scale(1.05); }

.ball {
  --c: var(--ball-cue);
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.85) 0 7%, rgba(255, 255, 255, 0) 24%),
    radial-gradient(circle at 42% 38%, rgba(0, 0, 0, 0) 0 52%, rgba(0, 0, 0, 0.52) 100%),
    linear-gradient(var(--c), var(--c));
  box-shadow: 0.125rem 0.3rem 0.4rem rgba(0, 0, 0, 0.38);
  flex: none;
}
.ball--yellow { --c: var(--ball-yellow); }
.ball--green { --c: var(--ball-green); }
.ball--brown { --c: var(--ball-brown); }
.ball--blue { --c: var(--ball-blue); }
.ball--pink { --c: var(--ball-pink); }
.ball--black { --c: var(--ball-black); }
.ball--cue { --c: var(--ball-cue); }

@media (min-width: 48rem) {
  .pocket { width: 3.5rem; height: 3.5rem; margin: -1.75rem 0 0 -1.75rem; }
  .spots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5) var(--s4); }
}

/* from here the table lies on its side: baulk end on the right */
@media (min-width: 64rem) {
  .pocket--m1 { left: 50%; top: 0.875rem; }
  .pocket--m2 { left: 50%; top: calc(100% - 0.875rem); }

  .table__cloth { grid-template-columns: minmax(0, 1fr) clamp(11rem, 18%, 14rem); }
  .table__play { padding-right: clamp(1.5rem, 3vw, 3rem); }
  .spot { --d: 8rem; }
  .table__baulk {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--s4);
    min-height: 0;
    padding: 0 var(--s3) 0 0;
    border-top: 0;
    border-left: 2px solid var(--mark);
  }
  .dee {
    width: 5.5rem;
    height: 11rem;
    margin: 0 0 0 -2px;
    border: 2px solid var(--mark);
    border-left: 0;
    border-radius: 0 5.5rem 5.5rem 0;
  }
  .dee .ball { left: 1.5rem; top: 50%; margin: -1.6rem 0 0; }
  .table__next { padding-left: var(--s3); }
  .table__next .link { font-size: inherit; }
}

/* ---------- Franchise ---------- */

.franchise { border-top: 1px solid var(--line); }
.franchise__grid { display: grid; gap: var(--s6); }
.franchise__pitch { display: grid; gap: var(--s3); justify-items: start; align-content: start; }
.franchise__actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.franchise__note { color: var(--ash); font-size: var(--text-s); max-width: 26rem; }

.rack { display: flex; align-items: center; gap: 0.625rem; }
.rack .ball { width: 1.125rem; height: 1.125rem; box-shadow: none; }
.rack .ball--black { box-shadow: inset 0 0 0 1px rgba(248, 248, 248, 0.3); }
.rack .ball--cue {
  width: 2.5rem;
  height: 2.5rem;
  margin-left: 0.5rem;
  box-shadow: 0 0 1.5rem rgba(255, 214, 130, 0.35);
}

.spec { align-self: start; border-top: 1px solid var(--line); }
.spec__title {
  margin-bottom: var(--s2);
  font-size: var(--text-xl);
  font-weight: 650;
  line-height: 1.2;
}
.spec__row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: var(--s2);
  padding-block: var(--s2);
  border-bottom: 1px solid var(--line);
}
.spec__row dt { color: var(--ash); }
.spec__row dd { font-weight: 500; }

@media (min-width: 64rem) {
  .franchise__grid { grid-template-columns: 7fr 5fr; gap: var(--s7); align-items: start; }
}

/* ---------- Footer ---------- */

.site-footer { background: var(--night); }
.site-footer__row {
  display: grid;
  gap: var(--s4);
  padding-block: var(--s5) var(--s6);
}
.lockup { width: min(19rem, 82%); height: auto; color: var(--chalk); }
.site-footer__meta { display: grid; gap: var(--s1); color: var(--ash); }
.site-footer__meta a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--chalk); }

@media (min-width: 48rem) {
  .site-footer__row { grid-template-columns: 1fr auto; align-items: end; }
  .site-footer__meta { justify-items: end; text-align: right; }
}

/* ---------- Phones ---------- */

@media (max-width: 40rem) {
  .hero__cafe { height: 54%; }   /* on phones the headline sits higher, so the photo ends sooner */
}

@media (max-width: 26rem) {
  .hero { padding-top: var(--s2); }
  .hero__copy .lead { font-size: var(--text-m); }
  .site-header__row { gap: var(--s2); }
  .brand__mark { height: 2rem; }
  .site-header .btn--small { padding-inline: 1rem; }
  .hero__actions { flex-direction: column; align-self: stretch; }
  .spec__row { grid-template-columns: 6.25rem 1fr; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .hero__cafe, .shot img, .switch__rocker, .switch__rocker::after, .spot__ball { transition: none; }
  .btn:active { transform: none; }
}
