/*
 * Fonts, reset, typography, page background and small layout helpers.
 * Colours and sizes come from tokens.css.
 */

/*
 * Self-hosted fonts (no third-party font service; CSP allows fonts only from
 * our own server). Both are under the SIL Open Font License 1.1, with no
 * Reserved Font Name: see static/fonts/OFL-*.txt.
 *
 *   Inter 4.1 (Rasmus Andersson): everything on screen since direction D
 *   (18/11/2026): opsz 14 at 400 (text), 500 and 600; "Inter Display" (opsz
 *   32, 800) and Literata 3 (TypeTogether) stay for the printed poster only
 *   (businesses/posters.py) and are no longer loaded by the pages.
 *
 * Built from google/fonts (ofl/inter at 0b58fb3, ofl/literata at 4e5f06d) with
 * fonttools 4.60.1: one static instance per weight, subset to Latin-1, monotonic
 * Greek (U+0370-03FF, every letter with tonos and dialytika), punctuation, euro
 * sign and arrows. Polytonic Greek is not needed for a booking UI and is left out;
 * any character outside the subset falls back to the system font.
 *
 *   fonttools varLib.instancer "Inter[opsz,wght].ttf" opsz=14 wght=600 --static -o inter-600.ttf
 *   fonttools subset inter-600.ttf --flavor=woff2 --no-hinting --desubroutinize \
 *     --layout-features=calt,ccmp,kern,liga,locl,mark,mkmk,case,tnum \
 *     --unicodes=U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0301,U+0308,U+0370-03FF,U+2000-206F,U+20AC,U+2122,U+2190-2193,U+2212,U+2215,U+2713,U+FEFF,U+FFFD
 *   (the same for wght=400 and 500; opsz=32 wght=800, and Literata opsz=12 wght=400 / 700)
 */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-regular.50eb0ecd8ca4.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/inter-medium.a1d7abbdf477.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-semibold.0af932b648c2.woff2") format("woff2");
}

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

* {
  margin: 0;
}

html {
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + var(--space-6));
  /* The scroll bar's room is always kept: a long page and a short one are
     laid out the same, nothing moves or resizes between them. */
  scrollbar-gutter: stable;
}

/* On a computer the whole interface grows a step with the screen (sizes are
   in rem): 16px up to 1440px wide, 17px, then 18px from 1920px. */
@media (min-width: 90rem) {
  html {
    font-size: 106.25%;
  }
}

@media (min-width: 120rem) {
  html {
    font-size: 112.5%;
  }
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

/*
 * Page background: a cool off-white (navy in the dark theme) with soft,
 * blurred light, so the glass has something to show: the shop's colour on
 * its pages, the platform's violet, cyan and pink on its own (--glow-a..c,
 * tokens.css). Plain gradients (already soft) instead of a blur filter,
 * fixed to the screen. Not parallax: it never moves at a different speed.
 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(55vmax 45vmax at 8% -6%, var(--glow-a), transparent 70%),
    radial-gradient(45vmax 38vmax at 100% 30%, var(--glow-b), transparent 70%),
    radial-gradient(60vmax 40vmax at 30% 110%, var(--glow-c), transparent 70%);
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent-fill);
  color: var(--on-accent-fill);
}

/* --- Typography ------------------------------------------------------------ */
h1,
h2,
h3,
h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-3xl);
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  letter-spacing: -0.015em;
}

h4 {
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
}

p,
li {
  text-wrap: pretty;
}

strong,
b {
  font-weight: 600;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentColor;
}

small,
.text-muted {
  color: var(--text-muted);
}

.lead {
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 38em;
}

.label {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1.3;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* --- Focus: visible for keyboard use, in the shop's accent ------------------ */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* --- Accessibility helpers ------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font: 600 var(--text-sm) / 1.2 var(--font-sans);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* --- Layout helpers -------------------------------------------------------- */
.page {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: max(var(--space-4), env(safe-area-inset-left));
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap, var(--space-4));
}

.stack--lg {
  --stack-gap: var(--space-8);
}

.stack--sm {
  --stack-gap: var(--space-2);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, var(--space-3));
}

/* Windows high contrast and similar modes: let the system colours win. */
@media (forced-colors: active) {
  body::before {
    display: none;
  }
}
