/* ─────────────────────────────────────────────────────────────────────────────
   Accessibility adjustments and the cookie notice.

   Loaded last on purpose. Everything below either draws the two pieces of
   furniture the shell carries — the accessibility menu and the cookie notice —
   or redefines the theme's own custom properties for a visitor who asked for a
   different palette. Because the palette is nothing but those properties, an
   adjustment reaches the art direction, the commerce pages and the console
   stylesheet alike without any of them knowing about it.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── The accessibility menu ───────────────────────────────────────────────────
   A <details> element: it opens by keyboard and without JavaScript, and the
   browser gives it the disclosure semantics rather than us imitating them. */

.a11y-widget {
  position: fixed;
  inset-block-end: var(--corner-inset);
  inset-inline-start: var(--corner-inset);
  /* Above the notice, so the trigger is never the thing that gets covered. */
  z-index: 160;
}

.a11y-widget__details { position: relative; }

.a11y-widget__trigger {
  /* A summary keeps its disclosure semantics only while it is a list item:
     given display:grid or flex, browsers stop exposing the expanded state.
     So the marker goes and the glyph is centred inside the box instead. */
  display: list-item;
  list-style: none;
  position: relative;
  width: var(--corner-trigger);
  height: var(--corner-trigger);
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  box-shadow: 0 6px 24px color-mix(in srgb, var(--ink) 22%, transparent);
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}
.a11y-widget__trigger::-webkit-details-marker { display: none; }
.a11y-widget__trigger::marker { content: ""; }
.a11y-widget__trigger:hover { background: var(--paper); color: var(--ink); }
.a11y-widget__glyph {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.9rem;
  height: 1.9rem;
  fill: currentColor;
}

.a11y-widget__count {
  position: absolute;
  inset-block-start: -0.35rem;
  inset-inline-end: -0.35rem;
  min-width: 1.35rem;
  padding: 0.1rem 0.3rem;
  border: 1px solid var(--ink);
  border-radius: 1rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.a11y-panel {
  position: absolute;
  inset-block-end: calc(100% + 0.75rem);
  inset-inline-start: 0;
  width: min(21rem, calc(100vw - 1.5rem));
  max-height: min(38rem, calc(100svh - 7rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 1.1rem;
  padding: 1.3rem;
  background: var(--paper);
  border: 1px solid var(--hairline);
  box-shadow: 0 18px 50px color-mix(in srgb, var(--ink) 20%, transparent);
}

.a11y-panel__title {
  font-family: var(--display);
  font-size: var(--step-1);
  line-height: 1.1;
}
.a11y-panel__group { display: grid; gap: 0.55rem; }
.a11y-panel__heading {
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--taupe);
}

.a11y-steps { display: flex; align-items: center; gap: 0.6rem; }
.a11y-step {
  min-width: var(--touch);
  min-height: var(--touch);
  padding: 0.3rem 0.9rem;
  font: inherit;
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--control-line);
  cursor: pointer;
}
.a11y-step:hover:not(:disabled) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.a11y-step:disabled { opacity: 0.45; cursor: not-allowed; }
.a11y-steps__value {
  min-width: 4ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.a11y-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
.a11y-option {
  display: flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-size: var(--step--1);
  text-align: start;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--control-line);
  cursor: pointer;
}
.a11y-option:hover { border-color: var(--ink); }
.a11y-option[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
/* The pressed state must survive a palette the page does not control. */
.a11y-option[aria-pressed="true"]::before {
  content: "✓";
  margin-inline-end: 0.4rem;
  font-size: 0.85em;
}

.a11y-panel__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding-block-start: 0.9rem;
  border-block-start: 1px solid var(--hairline-faint);
  font-size: var(--step--1);
}
/* A link on its own line, not one inside a sentence, so it carries a target of
   its own rather than the height of the type. */
.a11y-panel__foot a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
}

@media (max-width: 30rem) {
  .a11y-panel { width: min(20rem, calc(100vw - 1.5rem)); }
  .a11y-options { grid-template-columns: 1fr; }
}

/* ── The cookie notice ────────────────────────────────────────────────────── */

.consent {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 150;
  max-height: 70svh;
  overflow-y: auto;
  background: var(--paper);
  border-block-start: 1px solid var(--hairline);
  box-shadow: 0 -12px 40px color-mix(in srgb, var(--ink) 14%, transparent);
}

.consent__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem clamp(1.5rem, 4vw, 3.5rem);
  padding-block: 1.1rem;
  /* Room for the accessibility trigger, which sits in this corner. */
  padding-inline-start: max(var(--gutter), 5rem);
}

.consent__text { display: grid; gap: 0.4rem; max-width: 72ch; }
.consent__title {
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--taupe);
}
.consent__text p { font-size: var(--step--1); line-height: 1.7; }

.consent__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; }
/* Accepting and refusing are the same button at the same weight. */
.consent__actions .btn { padding-inline: 1.6rem; }
.consent__manage {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  font-size: var(--step--1);
}

@media (max-width: 62rem) {
  .consent__inner {
    grid-template-columns: 1fr;
    align-items: start;
    /* Stacked, the buttons run the full width, so the trigger is given room
       below them rather than beside them. */
    padding-inline-start: var(--gutter);
    padding-block-end: calc(var(--corner-inset) + var(--corner-trigger) + var(--corner-gap));
  }
  /* With the pause control up, the corner stack is that much taller, and the
     buttons have to clear the top of it rather than the trigger alone. */
  body:has(.motion-toggle:not([hidden])) .consent__inner {
    padding-block-end: calc(
      var(--corner-inset) + var(--corner-trigger) + var(--corner-gap) +
      var(--corner-toggle) + var(--corner-gap)
    );
  }
  .consent__actions .btn { flex: 1 1 12rem; }
}

/* A fixed bar covers the end of the page; give it back while it stands. */
body.has-consent-notice { padding-block-end: clamp(9rem, 20vh, 15rem); }

/* ── The preference pages ─────────────────────────────────────────────────── */

.section-block { display: grid; gap: 1rem; margin-block-start: clamp(2.5rem, 5vw, 4rem); }
.section-block h2 { font-family: var(--display); font-size: var(--step-2); line-height: 1.1; }

.register { display: grid; gap: 2.5rem; margin-block-start: 1rem; }
.register__group { display: grid; gap: 0.7rem; }
.register__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  font-size: var(--step-1);
}
.register__summary { max-width: 68ch; color: var(--ink-soft); }
.register__table { font-size: var(--step--1); }
.register__table th[scope="row"] { white-space: nowrap; vertical-align: top; }
.register__table code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.consent-form, .a11y-form { margin-block-start: 1.5rem; }
.consent-form__row, .a11y-form__row { margin-block-end: 1.1rem; }
.consent-form__row .field__hint, .a11y-form__row .field__hint { margin-inline-start: 1.9rem; }
.consent-form__record { font-size: var(--step--1); }
/* A disabled tick says "you cannot change this"; the pill says why. */
.consent-form__always { margin-inline-start: 0.6rem; font-size: 0.72em; }

/* An email address is one long word; at 200 % text it has to be allowed to
   break, or the row it sits in cannot shrink to a narrow screen. */
.contact-facts > div { flex-wrap: wrap; }
.contact-facts dd { min-width: 0; overflow-wrap: anywhere; }
.a11y-form__scales { display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; }

/* ─────────────────────────────────────────────────────────────────────────────
   The adjustments themselves.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Text size ────────────────────────────────────────────────────────────────
   Set on the root, so every rem in the type scale follows and the layout
   reflows the same way it does for a browser zoom. */
.a11y-scale-110 { font-size: 110%; }
.a11y-scale-125 { font-size: 125%; }
.a11y-scale-150 { font-size: 150%; }
.a11y-scale-175 { font-size: 175%; }
.a11y-scale-200 { font-size: 200%; }

/* ── Increased contrast ───────────────────────────────────────────────────── */
.a11y-scheme-contrast {
  --paper: #FFFFFF;
  --paper-warm: #FFFFFF;
  --surface: #FFFFFF;
  --champagne: #FFFFFF;
  --ink: #000000;
  --ink-soft: #000000;
  --taupe: #2B2B26;
  --gold: #4A3A16;
  --gold-lift: #4A3A16;
  --hairline: #000000;
  --hairline-faint: #55554C;
  --control-line: #000000;
  --critical: #8A0000;
  --positive: #14532D;
}
.a11y-scheme-contrast :is(.btn, .control, .a11y-option, .a11y-step, .pill) { border-width: 2px; }
.a11y-scheme-contrast .cinema__light { display: none; }

/* ── Dark background ──────────────────────────────────────────────────────── */
.a11y-scheme-dark {
  color-scheme: dark;
  --paper: #0C0C0B;
  --paper-warm: #1A1813;
  --surface: #17150F;
  --champagne: #1A1813;
  --ink: #FFFFFF;
  --ink-soft: #E9E7DE;
  --taupe: #C6C3B4;
  --gold: #E0C48C;
  --gold-lift: #F0DFB6;
  --hairline: #57544A;
  --hairline-faint: #3A3833;
  --control-line: #C6C3B4;
  --critical: #FF9E8C;
  --positive: #7FD8A6;
}
/* Two places paint a colour of their own rather than a token. */
.a11y-scheme-dark .cinema--fearless .cinema__atmosphere {
  background: radial-gradient(ellipse at 74% 46%, #2A2318 0%, #16130D 38%, var(--cinema-background) 76%);
}
.a11y-scheme-dark .flask__plate { background: var(--surface); }
.a11y-scheme-dark .cinema__light { opacity: 0.4; }

/* ── Greyscale ────────────────────────────────────────────────────────────── */
.a11y-scheme-mono {
  --paper: #FFFFFF;
  --paper-warm: #F0F0F0;
  --surface: #FAFAFA;
  --champagne: #F0F0F0;
  --ink: #111111;
  --ink-soft: #333333;
  --taupe: #5A5A5A;
  --gold: #4D4D4D;
  --gold-lift: #8C8C8C;
  --hairline: #B4B4B4;
  --hairline-faint: #D8D8D8;
  --control-line: #6B6B6B;
  --critical: #262626;
  --positive: #262626;
}
.a11y-scheme-mono :is(img, video, canvas, svg, .studio-bottle, .cinema__atmosphere) { filter: grayscale(1); }
.a11y-scheme-mono :is(.field__error, .form-error) { font-weight: 600; }

/* ── Highlighted links ────────────────────────────────────────────────────── */
.a11y-links :is(main, header, footer, .a11y-panel, .consent) a {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 0.2em;
  outline: 1px solid currentColor;
  outline-offset: 3px;
}
.a11y-links .skip-link { outline-color: var(--paper); }

/* ── Readable typeface ────────────────────────────────────────────────────────
   The three display faces are replaced at the token, so headings, body and
   editorial italics all follow, and the italic is straightened. */
.a11y-font {
  --display: Arial, "Helvetica Neue", system-ui, sans-serif;
  --lede: Arial, "Helvetica Neue", system-ui, sans-serif;
  --grotesk: Arial, "Helvetica Neue", system-ui, sans-serif;
}
.a11y-font :is(.lede, em, i, blockquote, .cinema__chapter em) { font-style: normal; }
.a11y-font :is(h1, h2, h3, .wordmark, .footer__signature) { letter-spacing: 0.01em; }

/* ── Increased spacing ────────────────────────────────────────────────────────
   The values WCAG 2.1 asks a page to survive (1.4.12), offered as a choice
   rather than left to a browser extension. Elements that set their own
   letter-spacing keep it; inheritance only reaches the ones that do not. */
.a11y-spacing body {
  line-height: 1.9 !important;
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}
.a11y-spacing :is(p, li, dd, dt) { line-height: 1.9 !important; }
.a11y-spacing :is(p, ul, ol) { margin-block-end: 2em; }

/* ── Emphasised focus ─────────────────────────────────────────────────────────
   The one place a colour is not taken from the theme. This ring has to be
   unmistakable on paper, on the champagne band and on a dark scheme alike, so
   it is a fixed red against a fixed yellow rather than a palette colour that
   changes underneath it. */
.a11y-focus :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 4px solid #B10000;
  outline-offset: 3px;
  box-shadow: 0 0 0 8px #FFD400;
  border-radius: 0;
}

/* ── Large cursor ─────────────────────────────────────────────────────────────
   Served inline as a data URI: the security policy allows no image from
   anywhere but this origin, and a cursor is an image. */
.a11y-cursor,
.a11y-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M8 4l26 20-11 2 6 13-5 2-6-13-10 8z' fill='%23fff' stroke='%23000' stroke-width='2.4' stroke-linejoin='round'/%3E%3C/svg%3E") 6 4, auto;
}
.a11y-cursor :is(a, button, summary, label, [role="button"], input[type="submit"]) {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M17 4c-2.2 0-4 1.8-4 4v16l-4-4c-1.6-1.6-4.2-1.6-5.8 0-1.6 1.6-1.6 4.2 0 5.8l11 13c1 1.2 2.5 1.9 4 1.9h12c3.3 0 6-2.7 6-6V22c0-2.2-1.8-4-4-4-.7 0-1.4.2-2 .5V17c0-2.2-1.8-4-4-4-.8 0-1.5.2-2.1.6C23.7 12 22 11 20 11c-.7 0-1.4.2-2 .5V8c0-2.2-1.8-4-4-4z' fill='%23fff' stroke='%23000' stroke-width='2.4' stroke-linejoin='round'/%3E%3C/svg%3E") 14 4, pointer;
}

/* ── Stopped motion ───────────────────────────────────────────────────────────
   The same removal the reduced-motion query performs, chosen by hand. The
   home page's scroll film is stopped by the controller, not by CSS, because
   its frames are drawn on a canvas. */
.a11y-motion *,
.a11y-motion *::before,
.a11y-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
.a11y-motion { scroll-behavior: auto !important; }

/* ── Print and forced colours ─────────────────────────────────────────────── */
@media print {
  .a11y-widget, .consent { display: none !important; }
  body.has-consent-notice { padding-block-end: 0; }
}

@media (forced-colors: active) {
  .a11y-widget__trigger, .a11y-panel, .consent, .a11y-option, .a11y-step { border: 1px solid; }
  .a11y-option[aria-pressed="true"] { forced-color-adjust: none; }
}
