/* Shared design tokens and base components for every page of the demo.
   One theme, no external fonts, no network assets. A clean matchday
   programme: whitespace, one strong green, yellow only for the one thing
   that matters on a screen. Not the client's brand: no logos, no crests. */

:root {
  --ink: #10201a;
  --paper: #f6f3ea;
  --surface: #ffffff;
  --pitch: #0f6b46;
  --pitch-dark: #0a4a31;
  --accent: #f2c230;
  --danger: #c8372d;
  --muted: #5f6f67;
  --line: #d9d4c4;

  /* Text on --pitch. White is 6.5:1; this tint is 5:1, both pass AA. */
  --on-pitch: #ffffff;
  --on-pitch-muted: #d6e8de;

  /* Tag tints. Each text/background pair is above 7:1. */
  --ok-bg: #dff0e6;
  --warn-bg: #fbefc4;
  --warn-ink: #5c4300;
  --off-bg: #f6dedb;
  --off-ink: #8a2119;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --tap: 44px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.25rem; }

p { margin: 0; }

.num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--accent);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0.5rem 1.25rem;
  border: 2px solid var(--pitch);
  border-radius: 999px;
  background: var(--surface);
  color: var(--pitch-dark);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.btn--primary {
  background: var(--pitch);
  color: var(--on-pitch);
}

.btn--primary:hover:not(:disabled) {
  background: var(--pitch-dark);
  border-color: var(--pitch-dark);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn--ghost:hover:not(:disabled) {
  border-color: var(--pitch);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 1;
  background: var(--paper);
  border-color: var(--line);
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2em 0.75em;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.tag--ok   { background: var(--ok-bg);   border-color: var(--pitch);  color: var(--pitch-dark); }
.tag--warn { background: var(--warn-bg); border-color: var(--accent); color: var(--warn-ink); }
.tag--off  { background: var(--off-bg);  border-color: var(--danger); color: var(--off-ink); }

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

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

/* ---- Slides page (slides.html). Two layouts. Narrow or short windows (a phone,
   320 px, 200 % zoom) get a flowing page: the slide scrolls and its picture sits
   under the text. Wide landscape windows get the projector layout: sizes scale with
   the largest 16:9 area that fits, so 1920x1080 and a 1366x768 laptop share one look
   and a slide does not scroll. The type unit has a rem floor, so browser zoom
   enlarges it instead of cancelling out against the viewport width. ---- */

.deck-page {
  --u: max(min(1vw, 1.7778vh), 0.5rem);
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
}

.deck-page main {
  min-width: 0;
  min-height: 0;
}

/* The deck is the one scroller (it is what holds focus, so Space and PageDown scroll it) and one tab stop. */
.deck {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1rem 0;
}

/* The deck spans the viewport and its parent clips overflow, so an outer ring would be cut off. */
.deck:focus-visible {
  outline-offset: -3px;
}

.slide {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 1rem;
}

.slide[hidden] { display: none; }

.slide__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.slide__kicker {
  margin: 0;
  color: var(--pitch);
  font-size: clamp(0.95rem, calc(var(--u) * 1.5), 2rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.slide__status {
  font-size: clamp(0.95rem, calc(var(--u) * 1.6), 2.2rem);
}

.slide__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-content: start;
  min-height: 0;
}

.slide__text {
  display: grid;
  gap: calc(var(--u) * 1.5);
  align-content: center;
}

.slide__title {
  color: var(--pitch-dark);
  font-size: clamp(2rem, calc(var(--u) * 5), 6rem);
  overflow-wrap: anywhere;
}

.slide__label {
  margin: calc(var(--u) * 1) 0 0;
  color: var(--muted);
  font-size: clamp(0.9rem, calc(var(--u) * 1.3), 1.8rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.slide__message {
  margin-top: calc(var(--u) * -1);
  font-size: clamp(1.25rem, calc(var(--u) * 2.5), 3.5rem);
  line-height: 1.25;
}

.slide__quote {
  padding-left: calc(var(--u) * 2);
  border-left: calc(var(--u) * 0.5) solid var(--accent);
  font-size: clamp(1.1rem, calc(var(--u) * 1.9), 2.8rem);
  line-height: 1.4;
}

.slide__figure {
  position: relative;
  margin: 0;
  padding: calc(var(--u) * 1.5);
  min-height: 0;
  display: grid;
}

.picture {
  width: 100%;
  height: auto;
  max-height: calc(var(--u) * 34);
}

.slide__figure--shots { gap: 0.75rem; align-content: center; }

.shot { margin: 0; display: grid; gap: 0.35rem; }

/* Width fits the picture area; the height follows the file's own ratio, so nothing is stretched. */
.shot__image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
}

.shot__caption {
  color: var(--muted);
  font-size: clamp(0.9rem, calc(var(--u) * 1.3), 1.8rem);
  font-weight: 700;
}

.deck-nav {
  z-index: 2;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem 1rem;
  background: var(--paper);
}

.deck-nav__counter {
  min-width: 5ch;
  text-align: center;
  font-size: clamp(1rem, calc(var(--u) * 1.8), 2.4rem);
}

.deck-nav__notes { margin-left: auto; }

.notes {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 48rem);
  overflow-y: auto;
  padding: 1.25rem;
  padding-bottom: 9rem; /* clear of the nav (two rows here): the last line scrolls into view above it */
  background: var(--pitch-dark);
  color: var(--on-pitch);
  font-size: clamp(0.95rem, calc(var(--u) * 1.35), 1.8rem);
  box-shadow: -8px 0 24px rgba(16, 32, 26, 0.35);
}

.notes[hidden] { display: none; }
.notes__close { float: right; margin-left: 1rem; }
.notes h2 { margin-bottom: 1em; font-size: 1.6em; }
.notes h3 { margin: 1.2em 0 0.4em; color: var(--accent); font-size: 1.1em; }
.notes__slide { padding: 0.8em 1em; border-radius: 10px; background: var(--pitch); font-weight: 600; }
.notes__slide p { margin: 0 0 0.5em; }
.notes__slide p:last-child { margin: 0; }
.notes ul { margin: 0; padding-left: 1.2em; }
.notes li { margin-bottom: 0.4em; }

@media (min-width: 64rem) and (min-height: 40rem) and (min-aspect-ratio: 4/3) {
  .deck-page { overflow: hidden; }

  .deck { padding: calc(var(--u) * 3) calc(var(--u) * 5) 0; }
  .slide { gap: calc(var(--u) * 2); }
  .slide__head { gap: calc(var(--u) * 2); }

  .shot__image { max-height: calc(var(--u) * 24); }

  .slide__body {
    grid-template-columns: 5fr 6fr;
    gap: calc(var(--u) * 4);
    align-content: normal;
    align-items: center;
  }

  .deck-nav {
    position: relative;
    flex-wrap: nowrap;
    gap: calc(var(--u) * 1.5);
    padding: calc(var(--u) * 1.2) calc(var(--u) * 5) calc(var(--u) * 1.8);
  }

  .notes {
    width: min(44vw, 48rem);
    padding: calc(var(--u) * 2.5);
    padding-bottom: calc(var(--u) * 3 + 5rem);
  }
}

/* ---- Inline SVG pictures ---- */

.svg-zone { fill: none; stroke: var(--line); stroke-width: 3; stroke-dasharray: 10 8; }
.svg-box { stroke-width: 3; }
.svg-box--plain  { fill: var(--surface); stroke: var(--pitch); }
.svg-box--solid  { fill: var(--pitch); stroke: var(--pitch-dark); }
.svg-box--accent { fill: var(--accent); stroke: var(--ink); }
.svg-rule { stroke: var(--line); stroke-width: 3; }
.svg-arrow { stroke: var(--pitch-dark); stroke-width: 4; stroke-linecap: round; }
.svg-arrow--dashed { stroke-dasharray: 10 9; }
.svg-arrowhead { fill: var(--pitch-dark); }

.svg-text { fill: var(--ink); font: 600 22px var(--font); }
.svg-text--small { font-size: 18px; font-weight: 600; }
.svg-text--strong { font-weight: 800; }
.svg-text--solid { fill: var(--on-pitch); font-weight: 800; }
.svg-text--accent { fill: var(--ink); }
.svg-text--danger { fill: var(--danger); }

/* ---- Login and hub pages ---- */

.shell {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.shell--narrow { max-width: 26rem; }

.stack { display: grid; gap: 1.25rem; }
.stack--tight { gap: 0.6rem; }

.section-label {
  color: var(--muted);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field { display: grid; gap: 0.4rem; font-weight: 700; }

.field input {
  min-height: var(--tap);
  padding: 0.5rem 0.9rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.form-error, .problem { color: var(--danger); font-weight: 700; }

/* The event-processing check: a result line whose words, not its colour, carry the meaning. */
.probe-line { padding: 0.5rem 0.75rem; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 700; }
.probe-line:empty { padding: 0; border-width: 0; }
.probe-line--ok { background: var(--ok-bg); border-color: var(--pitch); color: var(--pitch-dark); }
.probe-line--warn { background: var(--warn-bg); border-color: var(--accent); color: var(--warn-ink); }
.probe-line--danger { background: var(--off-bg); border-color: var(--danger); color: var(--off-ink); }

.links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.links .btn { width: 100%; text-decoration: none; }
