/* ==========================================================================
   The Unofficial Fiesta Color Guide
   Hand-rolled design system. No framework, no webfont, no icon CDN --
   the page is about colour, so every byte that isn't colour gets cut.

   Contents
   1.  Tokens & theming
   2.  Reset & base
   3.  Layout primitives
   4.  Header / nav / theme toggle
   5.  Hero & stats
   6.  Colour ribbon (the timeline strip)
   7.  Toolbar: search, filters, sort
   8.  Colour grid & cards
   9.  Colour detail page
   10. History timeline
   11. Prose, buttons, callouts, FAQ
   12. Footer
   13. Ad slots
   14. Utilities
   ========================================================================== */

/* 1. Tokens & theming ----------------------------------------------------- */

:root {
  color-scheme: light;

  /* Warm neutral canvas: a nod to Old Ivory, kept desaturated so it never
     competes with a swatch sitting on top of it. */
  --bg: #ffffff;
  --surface: #faf8f5;
  --surface-2: #f4f0ea;
  --surface-3: #e9e2d8;
  --border: #e0d8cc;
  --border-strong: #c7bcaa;

  --text: #1a1512;
  --text-muted: #5d5347;
  --text-faint: #786d5f;

  /* --brand is Buy Me a Coffee's orange, used as a fill only: at 2.5:1 on
     white it can never carry text. --accent is the darkened version that can
     (6.4:1), so links and small text use that and fills use --brand. */
  --brand: #ff813f;
  --brand-hover: #f2701f;
  --brand-ink: #2b1000;

  --accent: #9e4310;
  --accent-hover: #83370c;
  --accent-contrast: #ffffff;
  --accent-wash: #fdf2ea;

  /* The black third of the palette: footer ground in light mode. */
  --ink: #17130f;
  --ink-text: #f7f3ee;
  --ink-muted: #c3bab0;
  --ink-border: #332b23;

  --focus: #0b57d0;
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus);

  /* Every swatch gets a hairline so a near-white one still has an edge on a
     light page -- and a near-black one still has an edge on a dark page. */
  --swatch-edge: rgb(0 0 0 / 0.12);

  --ok: #1d6b3f;
  --ok-wash: #e9f4ed;
  --retired-wash: #efece7;

  --shadow-sm: 0 1px 2px rgb(23 21 15 / 0.06), 0 1px 3px rgb(23 21 15 / 0.08);
  --shadow-md: 0 2px 4px rgb(23 21 15 / 0.05), 0 8px 20px rgb(23 21 15 / 0.09);
  --shadow-lg: 0 4px 8px rgb(23 21 15 / 0.06), 0 16px 40px rgb(23 21 15 / 0.13);

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --step--1: clamp(0.82rem, 0.79rem + 0.13vw, 0.89rem);
  --step-0: clamp(1rem, 0.96rem + 0.19vw, 1.09rem);
  --step-1: clamp(1.2rem, 1.13rem + 0.34vw, 1.4rem);
  --step-2: clamp(1.44rem, 1.32rem + 0.58vw, 1.8rem);
  --step-3: clamp(1.73rem, 1.53rem + 0.95vw, 2.3rem);
  --step-4: clamp(2.07rem, 1.76rem + 1.5vw, 2.95rem);
  --step-5: clamp(2.49rem, 2.01rem + 2.3vw, 3.8rem);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --measure: 68ch;
  --gutter: clamp(1rem, 0.6rem + 2vw, 2.5rem);
  --wrap: 1240px;
  --header-h: 4rem;
}

/* System preference, unless the visitor has explicitly chosen light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121110;
    --surface: #1b1917;
    --surface-2: #241f1a;
    --surface-3: #2f2921;
    --border: #362f27;
    --border-strong: #4b4239;

    --text: #f7f3ee;
    --text-muted: #aaa093;
    --text-faint: #968b7e;

    --brand: #ff813f;
    --brand-hover: #ff9761;
    --brand-ink: #2b1000;

    --accent: #ff9761;
    --accent-hover: #ffb184;
    --accent-contrast: #2b1000;
    --accent-wash: #2c1a10;

    --ink: #1b1917;
    --ink-text: #f7f3ee;
    --ink-muted: #aaa093;
    --ink-border: #362f27;

    --focus: #8ab4f8;
    --swatch-edge: rgb(255 255 255 / 0.18);

    --ok: #6cc48d;
    --ok-wash: #16281e;
    --retired-wash: #232019;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 2px 4px rgb(0 0 0 / 0.35), 0 8px 20px rgb(0 0 0 / 0.45);
    --shadow-lg: 0 4px 8px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.55);
  }
}

/* Explicit choice wins in both directions. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121110;
  --surface: #1b1917;
  --surface-2: #241f1a;
  --surface-3: #2f2921;
  --border: #362f27;
  --border-strong: #4b4239;

  --text: #f7f3ee;
  --text-muted: #aaa093;
  --text-faint: #968b7e;

  --brand: #ff813f;
  --brand-hover: #ff9761;
  --brand-ink: #2b1000;

  --accent: #ff9761;
  --accent-hover: #ffb184;
  --accent-contrast: #2b1000;
  --accent-wash: #2c1a10;

  --ink: #1b1917;
  --ink-text: #f7f3ee;
  --ink-muted: #aaa093;
  --ink-border: #362f27;

  --focus: #8ab4f8;
  --swatch-edge: rgb(255 255 255 / 0.18);

  --ok: #6cc48d;
  --ok-wash: #16281e;
  --retired-wash: #232019;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 2px 4px rgb(0 0 0 / 0.35), 0 8px 20px rgb(0 0 0 / 0.45);
  --shadow-lg: 0 4px 8px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.55);
}

/* 2. Reset & base --------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Sticky header height plus breathing room, so #anchors don't land under it. */
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

img,
video {
  height: auto;
}

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

h1,
h2,
h3,
h4 {
  line-height: 1.15;
  text-wrap: balance;
  font-weight: 650;
  letter-spacing: -0.018em;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
h4 { font-size: var(--step-0); }

p { text-wrap: pretty; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Honour the OS motion setting -- including the smooth scroll the ribbon uses. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  z-index: 200;
  padding: 0.7rem 1.1rem;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--brand-ink);
}

/* 3. Layout primitives ---------------------------------------------------- */

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

.wrap--narrow {
  width: min(100% - var(--gutter) * 2, 80ch);
  margin-inline: auto;
}

.section { padding-block: clamp(2.5rem, 1.6rem + 4vw, 5rem); }
.section--tight { padding-block: clamp(1.75rem, 1.2rem + 2.4vw, 3rem); }
.section--surface { background: var(--surface); border-block: 1px solid var(--border); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.5rem;
}

.section-head p {
  color: var(--text-muted);
  max-width: var(--measure);
  margin-top: 0.45rem;
}

.eyebrow {
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

.stack > * + * { margin-top: 1rem; }

/* 4. Header / nav / theme toggle ------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
}

@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: var(--bg); }
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
  padding-block: 0.55rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: var(--step-0);
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
  line-height: 1.15;
}

.brand:hover { color: var(--text); }

/* The mark is a slice of the real palette, so the logo is the data. */
.brand__mark {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  box-shadow: inset 0 0 0 1px var(--swatch-edge);
}

.brand__mark span { display: block; }

.brand__sub {
  display: block;
  font-size: 0.72em;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.005em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.site-nav a {
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 550;
  font-size: var(--step--1);
}

.site-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.site-nav a[aria-current="page"],
.site-nav a[data-section="true"] {
  color: var(--text);
  background: var(--surface-2);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-muted);
}

.theme-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}

.theme-toggle svg { width: 1.05rem; height: 1.05rem; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* 5. Hero & stats --------------------------------------------------------- */

.hero { padding-block: clamp(2rem, 1.2rem + 3.5vw, 4rem) clamp(1.25rem, 1rem + 1.5vw, 2rem); }

.hero__grid {
  display: grid;
  gap: clamp(1.5rem, 1rem + 3vw, 3.5rem);
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
}

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
}

.hero h1 { margin-bottom: 0.9rem; }

.hero__lede {
  font-size: var(--step-1);
  color: var(--text-muted);
  max-width: 50ch;
  line-height: 1.5;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.hero__figure {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--surface-2);
}

.hero__figure img { width: 100%; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 1px;
  margin-top: 2.2rem;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  padding: 0.95rem 1.1rem;
}

.stat dt {
  font-size: var(--step--1);
  color: var(--text-muted);
  order: 2;
  line-height: 1.35;
}

.stat dd {
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin: 0;
  order: 1;
}

/* 6. Colour ribbon -------------------------------------------------------- */

.ribbon {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

/* Escape hatch past 61 sequential links, visible only on keyboard focus. */
.skip-inline {
  position: absolute;
  left: -9999px;
  z-index: 3;
}

.skip-inline:focus {
  position: static;
  display: block;
  padding: 0.6rem 0.9rem;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  font-size: var(--step--1);
  text-decoration: none;
}

.ribbon__scroll {
  display: flex;
  width: 100%;
  height: clamp(64px, 9vw, 96px);
  overflow-x: auto;
  scrollbar-width: thin;
}

.ribbon__swatch {
  position: relative;
  flex: 1 1 0;
  min-width: 9px;
  display: block;
  text-decoration: none;
  transform-origin: center bottom;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ribbon__swatch + .ribbon__swatch {
  box-shadow: inset 1px 0 0 rgb(128 128 128 / 0.28);
}

.ribbon__swatch:hover,
.ribbon__swatch:focus-visible {
  transform: scaleY(1.14);
  z-index: 2;
  box-shadow: var(--shadow-md);
  border-radius: 3px 3px 0 0;
}

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

/* Below ~768px the 61-band strip gives each colour about 4px of width -- far
   under the 24px WCAG 2.2 SC 2.5.8 asks for, and unusable with a thumb. On
   touch-sized screens the ribbon becomes a wall of tappable squares instead,
   which also means the whole palette is visible without a sideways scroll. */
@media (max-width: 768px) {
  .ribbon__scroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(2.5rem, 1fr));
    gap: 3px;
    padding: 3px;
    height: auto;
    overflow: visible;
  }

  .ribbon__swatch {
    aspect-ratio: 1;
    min-width: 0;
    border-radius: 5px;
    box-shadow: inset 0 0 0 1px var(--swatch-edge);
  }

  .ribbon__swatch + .ribbon__swatch {
    box-shadow: inset 0 0 0 1px var(--swatch-edge);
  }

  .ribbon__swatch:hover,
  .ribbon__swatch:focus-visible {
    transform: scale(1.12);
    border-radius: 5px;
  }
}

.ribbon__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--border);
  font-size: var(--step--1);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* 7. Toolbar -------------------------------------------------------------- */

.toolbar {
  position: sticky;
  /* +1px clears the header's bottom border, or content shows through the seam. */
  top: calc(var(--header-h) + 1px);
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 93%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  border-block: 1px solid var(--border);
  padding-block: 0.85rem;
  margin-bottom: 1.75rem;
}

@supports not (backdrop-filter: blur(1px)) {
  .toolbar { background: var(--bg); }
}

.toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.search {
  position: relative;
  flex: 1 1 16rem;
  min-width: 0;
}

.search > svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  translate: 0 -50%;
  width: 1.05rem;
  height: 1.05rem;
  color: var(--text-faint);
  pointer-events: none;
}

.search input {
  width: 100%;
  padding: 0.62rem 2.4rem 0.62rem 2.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
}

.search input::placeholder { color: var(--text-faint); }
.search input:hover { border-color: var(--border-strong); }

.search__clear {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  translate: 0 -50%;
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.search__clear:hover { background: var(--surface-3); color: var(--text); }
.search__clear svg { width: 0.85rem; height: 0.85rem; }

.field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.field > label {
  font-size: var(--step--1);
  color: var(--text-muted);
  white-space: nowrap;
}

.select {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select select {
  appearance: none;
  padding: 0.62rem 2.1rem 0.62rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  cursor: pointer;
  font-size: var(--step--1);
  font-weight: 550;
}

.select select:hover { border-color: var(--border-strong); }

.select::after {
  content: "";
  position: absolute;
  right: 0.85rem;
  width: 0.42rem;
  height: 0.42rem;
  border-right: 1.8px solid var(--text-muted);
  border-bottom: 1.8px solid var(--text-muted);
  rotate: 45deg;
  translate: 0 -0.12rem;
  pointer-events: none;
}

/* Shade filter as a chip row -- faster to scan than a menu, and each chip
   carries its own colour, so the control teaches the taxonomy. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.7rem;
  list-style: none;
  margin: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.36rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--step--1);
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip__dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 1px var(--swatch-edge), inset 0 0 0 1px rgb(128 128 128 / 0.35);
}

.chip[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.chip__count {
  font-variant-numeric: tabular-nums;
  opacity: 0.65;
  font-weight: 500;
}

.toolbar__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.7rem;
  font-size: var(--step--1);
  color: var(--text-muted);
}

.toolbar__status strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.link-button {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: inherit;
  font-weight: 550;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.link-button:hover { color: var(--accent-hover); }

/* 8. Colour grid & cards -------------------------------------------------- */

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
  gap: clamp(0.9rem, 0.6rem + 1vw, 1.4rem);
  list-style: none;
  padding: 0;
  margin: 0;
}

.color-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.color-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.color-card:has(a:focus-visible) {
  box-shadow: var(--focus-ring);
  border-color: transparent;
}

.color-card__swatch {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.8rem;
  /* Deliberately flat. A gloss gradient looks like ceramic but changes the
     pixels, and this site tells people the swatch IS the hex -- someone
     sampling it with an eyedropper has to get that value back. The photograph
     is what shows the glaze. */
  box-shadow: inset 0 0 0 1px var(--swatch-edge);
}

/* The color number, the way it appears on the back of a piece. */
.color-card__sku {
  font-size: 1.9rem;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.color-card__sku--none {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.8;
  align-self: flex-end;
}

.color-card__photo {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgb(255 255 255 / 0.85);
  box-shadow: var(--shadow-sm);
  background: var(--surface-2);
}

.color-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.color-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  padding: 0.85rem 0.9rem 1rem;
  flex: 1;
}

.color-card__name {
  font-size: var(--step-1);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.color-card__name a {
  color: var(--text);
  text-decoration: none;
}

/* Whole card is the hit target; the name stays the accessible link. */
.color-card__name a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.color-card__name a:hover { color: var(--accent); }

.color-card__meta {
  font-size: var(--step--1);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.dot-sep::before {
  content: "\00b7";
  margin-right: 0.4rem;
  color: var(--text-faint);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.16rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill--current {
  background: var(--ok-wash);
  color: var(--ok);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 30%, transparent);
}

.pill--retired {
  background: var(--retired-wash);
  color: var(--text-muted);
  box-shadow: inset 0 0 0 1px var(--border);
}

.pill__dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.empty-state {
  padding: 3.5rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.empty-state h3 { margin-bottom: 0.5rem; color: var(--text); }
.empty-state .btn { margin-top: 1.2rem; }

/* 9. Colour detail page --------------------------------------------------- */

.breadcrumb {
  font-size: var(--step--1);
  color: var(--text-muted);
  padding-block: 1.1rem 0;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.breadcrumb li:not(:first-child)::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--text-faint);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

.color-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 1rem + 2.5vw, 3rem);
  align-items: center;
  padding-block: clamp(1.5rem, 1rem + 2vw, 2.75rem);
}

@media (max-width: 800px) {
  .color-hero { grid-template-columns: 1fr; }
}

.color-hero__swatch {
  position: relative;
  aspect-ratio: 5 / 4;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  /* Flat, for the same reason as the card swatch. */
  box-shadow: inset 0 0 0 1px var(--swatch-edge), var(--shadow-md);
}

/* The color number is what a collector reads off the back of a plate, so it
   is the largest thing on the swatch. The hex moved to the caption below. */
.color-hero__sku {
  font-size: clamp(3rem, 2rem + 5vw, 5rem);
  font-weight: 750;
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.color-hero__sku-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 0.35rem;
}

.color-hero__swatch-note {
  font-size: var(--step--1);
  opacity: 0.82;
  margin-top: 0.15rem;
}

.color-hero__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.color-hero h1 { font-size: var(--step-4); }

.color-hero__years {
  font-size: var(--step-1);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 1rem;
}

.color-hero__desc { color: var(--text-muted); max-width: var(--measure); }

.color-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

.photo-figure {
  margin-top: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.photo-figure picture {
  flex: none;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}

.photo-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-figure figcaption {
  font-size: var(--step--1);
  color: var(--text-muted);
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.spec {
  background: var(--surface);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.spec__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.spec__value {
  font-family: var(--font-mono);
  font-size: 0.94rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.spec__note { font-size: 0.76rem; color: var(--text-muted); }

.contrast-pair {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.contrast-sample {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px rgb(128 128 128 / 0.35);
}

.badge {
  display: inline-block;
  padding: 0.08rem 0.4rem;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgb(128 128 128 / 0.22);
  color: inherit;
}

.related-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-card {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  height: 100%;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.related-card__swatch {
  height: 3.4rem;
  box-shadow: inset 0 0 0 1px var(--swatch-edge);
}

.related-card__body { padding: 0.55rem 0.65rem 0.7rem; }

.related-card__name {
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.25;
}

.related-card__meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 0.12rem;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-top: 2.5rem;
}

.pager a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.pager a:hover { border-color: var(--border-strong); color: var(--text); }
.pager__next { margin-left: auto; flex-direction: row-reverse; text-align: right; }

.pager__swatch {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 1px var(--swatch-edge);
}

.pager__label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 700;
}

.pager__name { font-weight: 600; font-size: 0.94rem; }

/* 9b. Palette combinations ------------------------------------------------
   The centrepiece of a color page: "you own this, here is what to put next
   to it". Drawn as a strip so the combination reads as one object, with every
   band carrying its name, number and availability as text. */

.palette + .palette { margin-top: clamp(1.5rem, 1rem + 2vw, 2.5rem); }

.palette__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
}

.palette__name {
  font-size: var(--step-1);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.palette__tag {
  display: inline-block;
  padding: 0.16rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}

.palette__why {
  color: var(--text-muted);
  font-size: var(--step--1);
  max-width: var(--measure);
  margin: 0.35rem 0 0.85rem;
}

.palette__strip {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--swatch-edge), var(--shadow-sm);
}

.palette__band {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
}

.palette__band > * {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-height: clamp(7rem, 5rem + 6vw, 10rem);
  padding: 0.7rem 0.75rem;
  color: inherit;
  text-decoration: none;
}

.palette__band a:hover { color: inherit; }
.palette__band a:hover .palette__band-name { text-decoration: underline; }

.palette__band a:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: -4px;
  box-shadow: none;
  border-radius: 0;
}

.palette__band-name {
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.palette__band-meta {
  font-size: 0.72rem;
  opacity: 0.85;
  margin-top: 0.15rem;
  overflow-wrap: anywhere;
}

/* The color the reader already owns is called out in text, not just by
   position -- the whole section is addressed to them. */
.palette__yours {
  align-self: flex-start;
  margin-bottom: auto;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1.5px currentColor;
}

/* Below 640px five vertical slivers become unreadable and untappable, so the
   strip stacks into full-width rows instead. */
@media (max-width: 640px) {
  .palette__strip { flex-direction: column; }

  .palette__band > * {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 0.5rem;
    min-height: 3.5rem;
    padding: 0.7rem 0.9rem;
  }

  .palette__yours { margin-bottom: 0; order: 3; }
  .palette__band-meta { margin-top: 0; margin-left: auto; }
}

/* 10. History timeline ---------------------------------------------------- */

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.42rem;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 2px;
  background: linear-gradient(var(--border), var(--border-strong), var(--border));
}

.timeline li {
  position: relative;
  padding: 0 0 1.9rem 2.2rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-strong);
}

.timeline li:target::before {
  background: var(--accent);
  border-color: var(--accent);
}

.timeline__date {
  font-size: var(--step-0);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}

.timeline__date a {
  color: inherit;
  text-decoration: none;
  /* Padding gets a standalone heading link to a 24px target (SC 2.5.8). */
  display: inline-block;
  padding-block: 0.15rem;
}
.timeline__date a:hover { color: var(--accent); }
.timeline p { color: var(--text-muted); max-width: var(--measure); }

.jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.9rem 0 1.6rem;
  list-style: none;
  margin: 0;
}

.jump-nav a {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.jump-nav a:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

/* 11. Prose, buttons, callouts, FAQ --------------------------------------- */

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1rem; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }
.prose p,
.prose li { color: var(--text-muted); }
.prose strong { color: var(--text); }
.prose ul,
.prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: 0.4rem; }

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 1rem 1.15rem;
  font-size: var(--step--1);
  color: var(--text-muted);
}

.callout > * + * { margin-top: 0.6rem; }
.callout strong { color: var(--text); }

.faq {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.faq details + details { border-top: 1px solid var(--border); }

.faq summary {
  padding: 1rem 1.15rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  flex: none;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  rotate: 45deg;
  translate: 0 -0.15rem;
  transition: rotate 0.18s ease;
}

.faq details[open] summary::after { rotate: -135deg; translate: 0 0.1rem; }
.faq summary:hover { background: var(--surface-2); }

.faq details > div {
  padding: 0 1.15rem 1.15rem;
  color: var(--text-muted);
  max-width: var(--measure);
}

.faq details > div > * + * { margin-top: 0.7rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: var(--step--1);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn--primary { background: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { background: var(--brand-hover); color: var(--brand-ink); }

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
}

.btn svg { width: 1rem; height: 1rem; flex: none; }

.link-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 0.5rem 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* 12. Footer -------------------------------------------------------------- */

.plate-stack {
  width: min(100% - var(--gutter) * 2, 1400px);
  margin-inline: auto;
}

/* The footer is the black in "white, orange, black" -- it grounds the page
   and echoes the black masthead the original site used. */
.site-footer {
  border-top: 1px solid var(--ink-border);
  background: var(--ink);
  color: var(--ink-text);
  padding-block: clamp(2.5rem, 1.8rem + 2.5vw, 4rem) 2rem;
  margin-top: clamp(2.5rem, 1.8rem + 2.5vw, 4rem);
  font-size: var(--step--1);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 2rem;
}

.site-footer h2 {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: 0.7rem;
  font-weight: 700;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.site-footer ul a {
  display: inline-block;
  padding-block: 0.15rem;
}

.site-footer a { color: var(--ink-muted); text-decoration: none; }
.site-footer a:hover { color: var(--brand); text-decoration: underline; }
.site-footer p { color: var(--ink-muted); }
.site-footer :focus-visible { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--brand); }

.site-footer__legal {
  border-top: 1px solid var(--ink-border);
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
}

.site-footer__legal p { max-width: 64ch; color: var(--ink-muted); }

.site-footer__legal picture { flex: none; }
.made-in-usa { width: 118px; height: 62px; object-fit: contain; }

/* 13. Ad slots ------------------------------------------------------------
   Reserved boxes so an ad unit can never push content around after load --
   layout shift is both a ranking signal and an accessibility problem. */

.ad-slot {
  margin-block: clamp(1.75rem, 1.2rem + 2vw, 3rem);
  text-align: center;
}

.ad-slot > ins { display: block; }

.ad-slot__label {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.4rem;
}

.ad-slot--leaderboard { min-height: 100px; }
.ad-slot--rectangle { min-height: 280px; }

/* 14. Utilities ----------------------------------------------------------- */

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

[hidden] { display: none !important; }

.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

@media print {
  .site-header,
  .toolbar,
  .ad-slot,
  .theme-toggle,
  .skip-link,
  .pager { display: none !important; }
  body { background: #fff; color: #000; }
  .color-card { break-inside: avoid; }
}
