/*
  The parts every page shares: page colours, top bar, menu, footer, buttons, choice chips and inputs.
  Colours, fonts and sizes come from tokens.css; nothing here has its own colour codes.
  Phones: below 860 px the top bar shrinks to logo + button + menu.
*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Links to a place on the page stop below the pinned top bar, not under it. */
  scroll-padding-top: var(--nz-topbar-height);
}

body {
  margin: 0;
  background: var(--nz-color-page);
  color: var(--nz-color-text);
  font-family: var(--nz-font-text);
  font-size: var(--nz-text-body);
  line-height: var(--nz-leading-body);
}

img {
  max-width: 100%;
}

a {
  color: var(--nz-color-text);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[draggable="true"]:focus-visible {
  outline: var(--nz-focus-ring);
  outline-offset: var(--nz-focus-offset);
}

.nz-container {
  max-width: var(--nz-container);
  margin: 0 auto;
  padding-left: var(--nz-gutter);
  padding-right: var(--nz-gutter);
}

/* Text only for screen readers. */
.nz-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Top bar ---------- */
/* The top bar stays pinned at the top while the page scrolls. */
.nz-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nz-color-page);
  border-bottom: 1px solid var(--nz-color-rule);
}

.nz-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--nz-space-5);
  padding-top: 20px;
  padding-bottom: 20px;
}

.nz-logo-link {
  display: block;
  line-height: 0;
  margin-right: auto;
}

.nz-logo-link img {
  width: var(--nz-logo-width-web);
  height: auto;
  display: block;
}

.nz-nav {
  display: flex;
  align-items: center;
  gap: var(--nz-space-6);
  font-size: var(--nz-text-small);
  font-weight: var(--nz-weight-semibold);
}

.nz-nav-links {
  display: flex;
  gap: var(--nz-space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nz-nav-links a {
  text-decoration: none;
}

.nz-nav-links a:hover,
.nz-nav-links a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.nz-language {
  display: flex;
  gap: var(--nz-space-1);
  font-size: var(--nz-text-caption);
  font-weight: var(--nz-weight-label);
  letter-spacing: 0.08em;
}

.nz-language button {
  min-height: var(--nz-target-min);
  min-width: 36px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--nz-color-text);
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.nz-language button[aria-pressed="true"] {
  border-bottom-color: var(--nz-color-text);
}

/* The dark pill: only in the top bar, so the terracotta button stays the one loud action. */
.nz-pill-dark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--nz-button-height-small);
  padding: 0 22px;
  border-radius: var(--nz-radius-pill);
  background: var(--nz-color-text);
  color: var(--nz-cream-on-dark);
  font-size: var(--nz-text-small);
  font-weight: var(--nz-weight-bold);
  text-decoration: none;
  white-space: nowrap;
}

.nz-menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--nz-target-min);
  height: var(--nz-target-min);
  flex: none;
  padding: 0;
  border: 1.5px solid var(--nz-frame);
  border-radius: 50%;
  background: transparent;
  color: var(--nz-color-text);
  cursor: pointer;
}

.nz-menu-button .nz-icon-close,
.nz-menu-button[aria-expanded="true"] .nz-icon-menu {
  display: none;
}

.nz-menu-button[aria-expanded="true"] .nz-icon-close {
  display: block;
}

@media (max-width: 859px) {
  .nz-topbar-inner {
    gap: 10px;
    padding: 10px var(--nz-gutter-phone);
  }

  .nz-logo-link img {
    width: var(--nz-logo-min-width);
  }

  .nz-pill-dark {
    min-height: var(--nz-target-min);
    padding: 0 16px;
    font-size: 0.875rem;
  }

  .nz-pill-dark svg {
    display: none;
  }

  .nz-menu-button {
    display: inline-flex;
  }

  /* On phones the links and the language switch live in the menu, which opens under the bar. */
  .nz-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--nz-space-5);
    padding: var(--nz-space-4) var(--nz-gutter-phone) var(--nz-space-6);
    background: var(--nz-color-page);
    border-bottom: 1px solid var(--nz-color-rule);
    box-shadow: var(--nz-shadow-menu);
  }

  .nz-nav.is-open {
    display: flex;
  }

  .nz-nav-links {
    flex-direction: column;
    gap: 0;
  }

  .nz-nav-links li {
    border-bottom: 1px solid var(--nz-color-rule);
  }

  .nz-nav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    font-family: var(--nz-font-display);
    font-size: var(--nz-text-h3-large);
    font-weight: var(--nz-weight-display);
  }

  .nz-nav-links a::after {
    content: "\2192";
    font-family: var(--nz-font-text);
    font-size: 1.25rem;
  }

  .nz-language {
    align-self: flex-start;
  }
}

/* ---------- Headings and small labels ---------- */
.nz-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: var(--nz-text-label);
  font-weight: var(--nz-weight-label);
  letter-spacing: var(--nz-tracking-label);
  text-transform: uppercase;
}

.nz-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--nz-color-accent);
}

.nz-display,
.nz-h1,
.nz-h2,
.nz-h3 {
  font-family: var(--nz-font-display);
  font-weight: var(--nz-weight-display);
  line-height: var(--nz-leading-heading);
  text-wrap: balance;
}

.nz-display em,
.nz-h1 em,
.nz-h2 em {
  color: var(--nz-color-accent);
  font-style: normal; /* the colour alone marks the word */
}

.nz-display {
  font-size: var(--nz-text-display);
  line-height: var(--nz-leading-display);
}

.nz-h1 {
  font-size: clamp(2.5rem, 5.5vw, var(--nz-text-h1));
}

.nz-h2 {
  font-size: var(--nz-text-h2);
}

.nz-h3 {
  font-size: var(--nz-text-h3);
  line-height: 1.2;
}

.nz-step-number {
  font-family: var(--nz-font-display);
  font-style: italic;
  color: var(--nz-peach);
  line-height: 0.9;
}

/* ---------- Buttons ---------- */
.nz-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: var(--nz-button-height);
  padding: 0 var(--nz-button-padding-x);
  border: none;
  border-radius: var(--nz-radius-pill);
  background: var(--nz-color-accent);
  color: var(--nz-color-on-accent);
  font-family: var(--nz-font-text);
  font-size: var(--nz-text-button);
  font-weight: var(--nz-weight-bold);
  text-decoration: none;
  box-shadow: var(--nz-shadow-primary);
  cursor: pointer;
}

.nz-button:hover {
  background: var(--nz-color-accent-pressed);
}

.nz-button.is-on-colour {
  background: var(--nz-cream-on-dark);
  color: var(--nz-color-accent);
  box-shadow: none;
}

.nz-button.is-secondary {
  min-height: var(--nz-button-height-small);
  padding: 0 24px;
  border: 1.5px solid var(--nz-frame);
  background: transparent;
  color: var(--nz-color-text);
  box-shadow: none;
}

.nz-button.is-secondary:hover {
  background: var(--nz-cream-deep);
}

.nz-button.is-small {
  min-height: var(--nz-button-height-small);
  padding: 0 24px;
}

.nz-button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* A plain underlined link that looks like a quiet button. */
.nz-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--nz-target-min);
  font-size: var(--nz-text-small);
  font-weight: var(--nz-weight-bold);
  text-underline-offset: 4px;
}

/* ---------- Checkboxes ---------- */
.nz-check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--nz-target-min);
  font-size: var(--nz-text-small);
  font-weight: var(--nz-weight-semibold);
  cursor: pointer;
}

.nz-check input {
  width: var(--nz-checkbox-size);
  height: var(--nz-checkbox-size);
  margin: 0;
  flex: none;
  accent-color: var(--nz-color-accent);
}

/* Two versions of one sentence: one for mouse and keyboard, one for touch screens. */
.nz-only-phone {
  display: none;
}

/* ---------- Choice chips ---------- */
.nz-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nz-chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--nz-target-min);
  padding: 0 20px;
  border-radius: var(--nz-radius-pill);
  border: 1.5px solid var(--nz-frame);
  background: transparent;
  color: var(--nz-color-text);
  font-family: var(--nz-font-text);
  font-size: var(--nz-text-small);
  font-weight: var(--nz-weight-bold);
  text-decoration: none;
  cursor: pointer;
}

.nz-chip:hover {
  background: var(--nz-cream-deep);
}

.nz-chip[aria-pressed="true"],
.nz-chip.is-selected {
  border-color: var(--nz-color-text);
  background: var(--nz-color-text);
  color: var(--nz-cream-on-dark);
}

.nz-chip.is-small {
  padding: 0 16px;
  font-size: var(--nz-text-caption);
}

/* ---------- Text inputs ---------- */
.nz-label {
  font-size: var(--nz-text-small);
  font-weight: var(--nz-weight-bold);
}

.nz-input {
  width: 100%;
  height: var(--nz-input-height);
  padding: 0 16px;
  border: var(--nz-input-border);
  border-radius: var(--nz-input-radius);
  background: var(--nz-color-surface);
  color: var(--nz-color-text);
  font-family: var(--nz-font-text);
  font-size: var(--nz-text-body);
}

.nz-input::placeholder {
  color: var(--nz-color-placeholder);
  opacity: 1;
}

.nz-input:focus,
.nz-input:focus-visible {
  outline: none;
  border: var(--nz-input-border-focus);
  box-shadow: 0 0 0 3px var(--nz-terracotta-light);
}

.nz-input-notes {
  display: flex;
  justify-content: space-between;
  gap: var(--nz-space-4);
  margin: 0;
  font-size: var(--nz-text-caption);
  line-height: 1.5;
}

.nz-input-count {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.nz-input-count.is-low {
  font-weight: var(--nz-weight-label);
}

/* ---------- Coloured full-width bands (home page, how to play, printables) ---------- */
.nz-band-section.is-paper {
  background: var(--nz-color-paper);
}

.nz-band-section.is-ink {
  background: var(--nz-ink);
  color: var(--nz-cream-on-dark);
}

.nz-band-section.is-ink .nz-kicker::before,
.nz-band-section.is-ink .nz-h1 em {
  background-color: var(--nz-peach);
  color: var(--nz-peach);
}

.nz-band-section.is-ink .nz-h1 em {
  background: none;
}

.nz-band-section.is-lilac {
  background: var(--nz-lilac);
}

.nz-band-section.is-lilac .nz-h2 em {
  color: var(--nz-terracotta-dark);
}

.nz-band-section.is-terracotta {
  background: var(--nz-color-accent);
  color: var(--nz-cream-on-dark);
}

/* ---------- Footer ---------- */
.nz-footer {
  border-top: 1px solid var(--nz-color-rule);
}

.nz-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--nz-space-5);
  flex-wrap: wrap;
  padding-top: 44px;
  padding-bottom: 44px;
}

.nz-footer-brand {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.nz-footer-brand img {
  width: 160px;
  height: auto;
  display: block;
}

.nz-footer-tagline {
  font-family: var(--nz-font-display);
  font-style: italic;
}

.nz-footer-note {
  margin: 0;
  font-size: var(--nz-text-caption);
}

.nz-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nz-space-5);
  font-size: var(--nz-text-small);
}

.nz-footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--nz-target-min);
}

@media (max-width: 859px) {
  .nz-only-laptop {
    display: none;
  }

  .nz-only-phone {
    display: inline;
  }

  .nz-container {
    padding-left: var(--nz-gutter-phone);
    padding-right: var(--nz-gutter-phone);
  }

  .nz-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
