/* ==========================================================================
   ORDINARY. shared system
   Tokens, the chip bar, the colour that follows you, the footer can.
   ========================================================================== */

:root {
  /* paint book (working values, see BRIEF.md) */
  --c-0000: #D49A3A; --c-0002: #E2BC55; --c-0003: #D0693A;
  --c-0004: #718A64; --c-0005: #A9452F; --c-0006: #2A2927;
  --cream: #EDE6DA;
  --paper: #F5F0E7;
  --ink: #1B1916;
  --ink-soft: #5B544A;
  --alu: #C9CCCF;
  --alu-ink: #121315;
  --steel: #1A1B1E;

  /* the colour you picked. site.js rewrites these two. */
  --accent: var(--c-0000);
  --accent-ink: var(--ink);
  --accent-hi: var(--c-0000); /* the same hue, lifted, for text on dark grounds */

  --sc-canvas: var(--cream);
  --sc-surface: var(--paper);
  --sc-ink: var(--ink);
  --sc-ink-soft: var(--ink-soft);
  --sc-accent: var(--accent);
  --sc-accent-ink: var(--accent-ink);
  --sc-font-display: "Montserrat", system-ui, sans-serif;
  --sc-font-text: "Montserrat", system-ui, sans-serif;
  --sc-font-mono: "Geist Mono", ui-monospace, monospace;
  --sc-shadow-color: 30 18% 20%;
  --sc-edge: inset 0 1px 0 rgb(255 255 255 / 0.5);

  --bar-h: 3.5rem;
  --cols: 12;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);
}

html { background: var(--cream); }
body {
  font-weight: 500;
  font-size: clamp(0.98rem, 0.94rem + 0.2vw, 1.08rem);
  background: var(--cream);
}
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--accent); border-radius: 2px; }
a { text-decoration-color: var(--accent); text-decoration-thickness: 0.18em; text-underline-offset: 0.2em; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ----------------------------------------------------------- type kit -- */
.mono, .label {
  font-family: var(--sc-font-mono);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
  line-height: 1.4;
}
.label { color: var(--ink-soft); }
.wordmark {
  font-family: var(--sc-font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.9;
  white-space: nowrap;
}
.wordmark .un { font-weight: 300; letter-spacing: -0.03em; }
.tracked { letter-spacing: 0.6em; margin-right: -0.6em; font-weight: 600; }
.display {
  font-family: var(--sc-font-display);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.lede { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem); line-height: 1.45; font-weight: 500; max-width: 34ch; text-wrap: pretty; }
.body { max-width: 58ch; line-height: 1.62; color: var(--ink-soft); text-wrap: pretty; }

/* buttons: square, like everything else on a paint card */
.btn {
  display: inline-flex; align-items: center; gap: 0.7em;
  min-height: 3rem; padding: 0 1.25rem;
  font-family: var(--sc-font-mono); font-weight: 500; font-size: 0.8rem;
  letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
  color: var(--ink); background: transparent;
  border: 1.5px solid currentColor;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), transform 120ms var(--ease);
}
.btn--fill { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
}
.btn .sw { width: 0.9em; height: 0.9em; background: var(--accent); outline: 1px solid color-mix(in oklab, var(--ink) 30%, transparent); }

/* the architectural grid: visible in the rules half, broken in the breach */
.rulegrid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  display: grid; grid-template-columns: repeat(6, 1fr);
  padding-inline: var(--sc-gutter);
  transition: opacity 400ms var(--ease);
}
.rulegrid i { border-left: 1px solid color-mix(in oklab, var(--ink) 7%, transparent); height: 100%; transform-origin: 50% 0; }
.rulegrid i:last-child { border-right: 1px solid color-mix(in oklab, var(--ink) 7%, transparent); }
html.is-breach .rulegrid { opacity: 0; }

/* ------------------------------------------------------------ chip bar -- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 80;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 1.5rem;
  padding-inline: var(--sc-gutter);
  color: var(--ink);
  background: color-mix(in oklab, var(--cream) 88%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  transition: background-color 300ms var(--ease), color 300ms var(--ease), border-color 300ms var(--ease);
}
.bar__mark { display: inline-flex; align-items: baseline; text-decoration: none; font-size: 1.12rem; }
.bar__mark .un {
  display: inline-block; overflow: hidden; max-width: 0; opacity: 0;
  transition: max-width 420ms var(--ease), opacity 260ms var(--ease);
}
html.is-breach .bar__mark .un, body.un-world .bar__mark .un { max-width: 1.6em; opacity: 1; }
.bar__nav { margin-left: auto; display: flex; gap: clamp(1rem, 2.2vw, 2.25rem); }
.bar__nav a {
  font-family: var(--sc-font-mono); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; padding-block: 0.5rem; position: relative;
}
.bar__nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.2rem; height: 3px;
  background: var(--accent); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 220ms var(--ease);
}
.bar__nav a[aria-current="page"]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { .bar__nav a:hover::after { transform: scaleX(1); } }
.bar__nav .un { font-weight: 300; }

.chip {
  display: inline-flex; align-items: stretch; height: 2.1rem;
  border: 1.5px solid currentColor; font-family: var(--sc-font-mono); font-size: 0.74rem; letter-spacing: 0.06em;
}
.chip__sw { width: 2.1rem; background: var(--accent); border-right: 1.5px solid currentColor; transition: background-color 260ms var(--ease); }
.chip__code { display: grid; place-items: center; padding: 0 0.6rem; min-width: 5.4rem; }
.bar__menu { display: none; font-family: var(--sc-font-mono); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; min-height: 2.75rem; padding: 0 0.25rem; }

/* picker popover, opened from the chip */
.picker {
  position: fixed; z-index: 90; top: calc(var(--bar-h) + 0.5rem); right: var(--sc-gutter);
  width: min(22rem, calc(100vw - 2rem));
  background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--ink);
  box-shadow: 0 18px 40px -12px hsl(var(--sc-shadow-color) / 0.35);
  padding: 1rem; display: grid; gap: 0.75rem;
  opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: 100% 0;
  pointer-events: none; visibility: hidden;
  transition: opacity 180ms var(--ease), transform 180ms var(--ease), visibility 0s 180ms;
}
.picker.is-open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.picker__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.picker__chip {
  display: grid; grid-template-rows: 3.4rem auto; text-align: left;
  border: 1.5px solid color-mix(in oklab, var(--ink) 18%, transparent); background: var(--cream);
  transition: transform 140ms var(--ease), border-color 140ms var(--ease);
}
.picker__chip span:first-child { background: var(--sw); }
.picker__chip span:last-child { padding: 0.35rem 0.45rem; font-family: var(--sc-font-mono); font-size: 0.68rem; line-height: 1.25; }
.picker__chip[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.picker__chip:active { transform: scale(0.97); }

/* mobile menu */
.menu {
  position: fixed; inset: 0; z-index: 85; background: var(--ink); color: var(--cream);
  display: grid; align-content: end; gap: 0.25rem; padding: calc(var(--bar-h) + 2rem) var(--sc-gutter) 2.5rem;
  clip-path: inset(0 0 100% 0); visibility: hidden;
  transition: clip-path 420ms var(--ease-io), visibility 0s 420ms;
}
.menu.is-open { clip-path: inset(0); visibility: visible; transition-delay: 0s; }
.menu a { font-family: var(--sc-font-display); font-weight: 800; font-size: clamp(2.6rem, 13vw, 4.5rem); line-height: 1; letter-spacing: -0.035em; text-decoration: none; padding-block: 0.12em; }
.menu a .un { font-weight: 300; }
.menu__strip { display: grid; grid-template-columns: repeat(6, 1fr); height: 0.9rem; margin-top: 1.5rem; }

@media (max-width: 860px) {
  .bar__nav { display: none; }
  .bar__menu { display: inline-flex; align-items: center; }
  .bar { gap: 0.75rem; }
  .bar .chip { margin-left: auto; }
  .chip__code { min-width: 4.8rem; }
  .bar.menu-open { background: var(--ink); color: var(--cream); border-color: transparent; }
}

/* breach mode: same bar, same links, darker metal */
html.is-breach .bar, body.un-world .bar {
  background: color-mix(in oklab, var(--alu-ink) 82%, transparent);
  color: #E9EAEC; border-bottom-color: rgb(255 255 255 / 0.1);
}

/* -------------------------------------------------------- footer can --
   The site always ends as a can: cream field with the mark, then your colour. */
.foot { position: relative; z-index: 2; }
.foot__top {
  background: var(--cream); color: var(--ink);
  padding: clamp(4rem, 10vw, 9rem) var(--sc-gutter) clamp(2.5rem, 6vw, 5rem);
  display: grid; justify-items: center; text-align: center; gap: 0.9rem;
  border-top: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
}
.foot__mark { font-size: clamp(3.2rem, 15vw, 15rem); letter-spacing: -0.045em; }
.foot__beer { font-size: clamp(0.9rem, 1.6vw, 1.5rem); }
.foot__field {
  background: var(--accent); color: var(--accent-ink);
  padding: clamp(2.5rem, 6vw, 5rem) var(--sc-gutter) 2rem;
  display: grid; gap: 2.5rem;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 900ms var(--ease-io), background-color 300ms var(--ease), color 300ms var(--ease);
}
.foot.is-in .foot__field { clip-path: inset(0); }
.foot__row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 2rem; align-items: start; }
.foot__code { font-family: var(--sc-font-display); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.6rem); letter-spacing: 0.04em; }
.foot__rule { width: 3rem; height: 3px; background: currentColor; margin-block: 0.9rem; }
.foot__links a { display: block; text-decoration: none; padding-block: 0.32rem; font-family: var(--sc-font-mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }
@media (hover: hover) and (pointer: fine) { .foot__links a:hover { text-decoration: underline; text-decoration-color: currentColor; text-decoration-thickness: 1.5px; } }
.foot__small { font-family: var(--sc-font-mono); font-size: 0.72rem; letter-spacing: 0.04em; opacity: 0.85; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; border-top: 1.5px solid currentColor; padding-top: 1rem; }
.foot a:focus-visible { outline-color: currentColor; box-shadow: none; }
@media (max-width: 760px) { .foot__row { grid-template-columns: 1fr 1fr; } .foot__row > :first-child { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .foot__field { clip-path: none; transition: none; } }

/* unORDINARY. footer: raw aluminium where the cream would be */
body.un-world .foot__top { background: #B9BDC1; color: var(--alu-ink); border-top-color: transparent; }

/* swatch strip, used as a divider-object (the paint library) */
.library { display: grid; grid-template-columns: repeat(6, 1fr); }
.library > * { aspect-ratio: 1 / 1.35; display: flex; flex-direction: column; justify-content: flex-end; padding: 0.6rem; font-family: var(--sc-font-mono); font-size: 0.72rem; letter-spacing: 0.05em; }

/* page shells for the secondary pages */
.page { padding-top: var(--bar-h); position: relative; z-index: 1; }
.wrap { width: 100%; max-width: 88rem; margin-inline: auto; padding-inline: var(--sc-gutter); }

/* reveal-on-entry (secondary pages use this rather than acts) */
[data-in] { opacity: 0; transform: translateY(14px); transition: opacity 620ms var(--ease), transform 620ms var(--ease); }
[data-in].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-in] { transform: none; transition-duration: 200ms; } }
.no-js [data-in] { opacity: 1; transform: none; }

/* spec sheet: the label schema every object in the rules half shares */
.spec { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); border-top: 1.5px solid currentColor; }
.spec > div { padding: 0.9rem 1rem 1.1rem 0; border-bottom: 1px solid color-mix(in oklab, currentColor 25%, transparent); }
.spec dt { font-family: var(--sc-font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.78; margin-bottom: 0.35rem; }
.spec dd { font-weight: 600; font-size: 1.02rem; line-height: 1.35; }
.foot__top { overflow-x: clip; }
body.un-world .foot__mark { font-size: clamp(2.6rem, 12.4vw, 13rem); }
body.un-world .foot__mark .un { font-weight: 300; }
