/* Tokens, reset, shared type and controls.
   Scrolling is left entirely to the browser: no smooth scrolling, no snapping,
   no scroll or wheel listeners anywhere on the site. */

:root {
  color-scheme: light dark;

  /* Label colours, sampled from the tin artwork. These never change with the theme. */
  --label-ink: #1c1a17;
  --label-cream: #fde3b2;
  --label-red: #c8120a;
  --label-yellow: #fcb302;
  --label-green: #1d5f3e;
  --on-colour: #fff3d6;
  --wall: #fdd490;
  --peach: #f6dcbb;
  --ministry: #174b36;
  --ministry-cream: #fff0c8;
  --gold: #eeb640;

  /* Paper colours. These follow the visitor's light or dark setting. */
  --paper: #faf3e2;
  --paper-shade: #efe1bf;
  --ink: #1c1a17;
  --ink-soft: #4d483e;
  --red: #b8170e;
  --rule: #c5b891;
  --focus: #1c1a17;

  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --gutter: clamp(1.25rem, 4.2vw, 4.5rem);
  --max: 84rem;

  /* Print grain: a fine speckle laid over the flat colours so they sit with the painted artwork. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.1 0 0 0 0 0.09 0.8 0 0 0 -0.4'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23g)'/%3E%3C/svg%3E");
  /* The small fish stamped on the Five-Tin Plan box, used as a separator. */
  --fish: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 20'%3E%3Cpath d='M0 10C7 2 21 0 32 7l11-7v20l-11-7C21 20 7 18 0 10Z'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #232b27;
    --paper-shade: #38423a;
    --ink: #f8efdb;
    --ink-soft: #d7d4c0;
    --red: #ff8a6d;
    --rule: #546058;
    --focus: #f8efdb;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Keeps in-page link targets clear of the sticky header. Jumps stay instant. */
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image: var(--grain);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 400;
  font-stretch: 100%;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--label-yellow);
  color: var(--label-ink);
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

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

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* Layout helper */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

/* The wordmark: SO in ink, VIET in red, as on the tins. */
.wordmark {
  font-family: var(--sans);
  font-style: italic;
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -0.05em;
  line-height: 0.9;
  white-space: nowrap;
}

.wordmark b {
  font-weight: inherit;
  color: var(--red);
}

/* Slogans: heavy condensed capitals, set like a wall poster. */
.slogan {
  font-family: var(--sans);
  font-weight: 900;
  font-stretch: 62%;
  letter-spacing: -0.012em;
  line-height: 0.86;
  text-transform: uppercase;
}

/* Ministry headings: condensed and upright, like a notice on a canteen wall. */
.notice {
  font-family: var(--sans);
  font-weight: 800;
  font-stretch: 66%;
  letter-spacing: -0.012em;
  line-height: 0.96;
}

.lede {
  font-size: clamp(1.125rem, 1.02rem + 0.45vw, 1.375rem);
  line-height: 1.45;
}

/* Controls */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.7rem 1.4rem;
  border: 0;
  border-radius: 3px;
  background: var(--label-red);
  color: var(--on-colour);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s ease, translate 0.08s ease;
}

.button:active {
  translate: 0 2px;
}

.button--small {
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
}

.button--gold {
  background: var(--gold);
  color: var(--label-ink);
}

@media (hover: hover) {
  .button:hover {
    background: #a30d06;
  }

  .button--gold:hover {
    background: #f8c95f;
  }
}

.text-link {
  font-weight: 700;
}

/* "Coming soon" marker for the shop, set like a small rubber stamp. */
.soon-tag {
  display: inline-block;
  margin: 0.15rem 0 0.15rem 0.35rem;
  padding: 0.14rem 0.45rem 0.08rem;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  font-size: 0.8125rem;
  font-weight: 800;
  font-stretch: 75%;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
  rotate: -2deg;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--label-ink);
  color: var(--on-colour);
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
}

/* Holds shared SVG definitions (the stamp's ink filter); takes up no room. */
.svg-defs {
  position: absolute;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Reduced motion. Visitors whose device asks for less motion still get the page's life,
   without anything travelling: movement is switched off and fades are kept.
   Each stylesheet ends with its own block that does this for its parts. */
@keyframes appear {
  from {
    opacity: 0;
  }
}
