/* Base: reset, type scale, buttons and shared bits. Brand colours and fonts are in brand/brand.css. */

:root {
  /* Type scale (the classic 12–72 scale) */
  --step--2: 0.75rem;   /* 12 */
  --step--1: 0.875rem;  /* 14 */
  --step-0: 1rem;       /* 16 */
  --step-1: 1.125rem;   /* 18 */
  --step-2: 1.3125rem;  /* 21 */
  --step-3: 1.5rem;     /* 24 */
  --step-4: 2.25rem;    /* 36 */
  --step-5: 3rem;       /* 48 */
  --step-6: 3.75rem;    /* 60 */

  --gutter: 24px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--color-paper);
}

body {
  margin: 0;
  min-height: 100vh; /* older browsers */
  min-height: 100svh;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-kerning: normal;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--color-accent); /* coral shows on white and on the navy panel */
  outline-offset: 3px;
}

[tabindex="-1"]:focus { outline: none; }

.screen { min-height: 100vh; min-height: 100svh; }

/* Buttons */
.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 0 28px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  font: 600 var(--step-1) / 1 var(--font-text);
  letter-spacing: 0.01em;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.2s, opacity 0.2s, transform 0.15s var(--ease-out);
}

.button:active:not(:disabled) { transform: scale(0.985); }
.button:disabled { cursor: default; opacity: 0.45; }

.button-primary {
  background: var(--color-brand);
  color: var(--color-on-brand);
}

.button-primary:active:not(:disabled) { background: var(--color-brand-deep); }

.button-quiet {
  background: transparent;
  border-color: var(--color-ink);
  color: var(--color-ink);
}

/* Logo, or the brand name set as text until a logo file is added */
.logo { height: 28px; width: auto; }

.logo-text {
  display: inline-block;
  height: auto;
  font: 600 var(--step-1) / 1 var(--font-text);
  letter-spacing: 0.02em;
}

.fine-print {
  font-size: var(--step--2);
  line-height: 1.55;
  color: var(--color-ink-soft);
  max-width: 44ch;
}

/* Load and content errors */
.screen-message {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: calc(var(--safe-top) + 32px) var(--gutter) 32px;
  max-width: 640px;
}

.message-text { font-size: var(--step-1); max-width: 40ch; }

.message-details {
  font-size: var(--step--1);
  color: var(--color-ink-soft);
  padding-left: 1.2em;
}

.noscript { padding: 32px var(--gutter); }
