/*
  gamutlens.com — shared design system
  Zero external requests: system fonts, CSS gradients, inline SVG only.

  Token system
  ------------
  Neutrals:  --ink (near-black violet-charcoal), --paper (near-white violet)
  Signal chips (the "spectrum"): magenta / amber / lime / cyan / violet
  The active signal chip drives --accent everywhere via the swatch rail —
  that's the site's signature interaction (see assets/app.js).
*/

:root {
  --ink: #121017;
  --ink-raised: #1b1826;
  --ink-line: #322c44;
  --paper: #f6f3ff;
  --paper-dim: #cdc6e6;

  --sig-magenta: #ff3e7f;
  --sig-amber: #ffb627;
  --sig-lime: #a6e22e;
  --sig-cyan: #2fe6d9;
  --sig-violet: #8b5cf6;

  --accent: var(--sig-magenta);
  --accent-rgb: 255, 62, 127;
  --accent-2: var(--sig-violet);

  --bg: var(--ink);
  --bg-raised: var(--ink-raised);
  --line: var(--ink-line);
  --fg: var(--paper);
  --fg-dim: var(--paper-dim);

  --radius: 14px;
  --radius-sm: 8px;

  --font-display: -apple-system, "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Menlo", "Consolas", monospace;

  --shadow-lift: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: var(--paper);
  --bg-raised: #ffffff;
  --line: #ded7f2;
  --fg: var(--ink);
  --fg-dim: #5b5470;
  --shadow-lift: 0 20px 50px -22px rgba(60, 40, 90, 0.35);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: var(--paper);
    --bg-raised: #ffffff;
    --line: #ded7f2;
    --fg: var(--ink);
    --fg-dim: #5b5470;
    --shadow-lift: 0 20px 50px -22px rgba(60, 40, 90, 0.35);
    color-scheme: light;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.55;
  transition: background 0.25s ease, color 0.25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

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

code,
kbd,
.mono {
  font-family: var(--font-mono);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
  color: var(--fg-dim);
  max-width: 62ch;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- header / nav ---------- */

/* Deliberately not sticky, and neither is the toolbar below it: nothing in the
   chrome may overlay an AdSense anchor unit or an Auto-ads in-content slot.
   Wordmark and one icon button, no links and no swatch rail, which is what
   brings this bar down from 121px on a phone to 47px. */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  /* Budgeted: 8 + 36 (the toggle) + 8 + the 1px rule is a 53px bar, which with
     the 45px toolbar keeps the closed chrome at 98px on every page. */
  padding-top: 8px;
  padding-bottom: 8px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--bg);
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(
    90deg,
    var(--sig-magenta),
    var(--sig-amber),
    var(--sig-lime),
    var(--sig-cyan),
    var(--sig-violet),
    var(--sig-magenta)
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hue-sweep 10s linear infinite;
}

@keyframes hue-sweep {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 220% 50%;
  }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--fg);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   toolbar v1 — the portfolio navigation pattern.
   Spec: github.com/ngineer420/ngineer420.github.io/issues/13

   Copied verbatim from the photoshrink pilot. Everything site-specific is the
   eight custom properties declared on `.toolbar` below; remap those to this
   site's tokens and nothing else needs touching. The silhouette is shared, the
   palette and the type are not.

   Structure: one <nav class="toolbar">, a direct child of <body> immediately
   after </header>. A <details> trigger pinned left that never scrolls, and a
   single non-wrapping row of tool chips that does. Never sticky.
   ========================================================================== */

.toolbar {
  /* ---- the only site-owned values in this block ---- */
  --tb-bg: var(--bg);
  --tb-bg-elev: var(--bg-raised);
  --tb-border: var(--line);
  --tb-border-soft: var(--line);
  --tb-text: var(--fg);
  --tb-text-dim: var(--fg-dim);
  --tb-accent: var(--accent);
  --tb-focus: var(--accent);

  /* A stacking context, so the sheet lands above the tool's own positioned
     bits without a z-index arms race inside it. */
  position: relative; z-index: 40;
  display: flex; align-items: stretch;
  /* 44px of content plus the 1px rule. box-sizing is border-box, so a flat
     44px here leaves the rail a 43px content box, the 44px chips overflow it
     by a pixel and the 2px active underline gets clipped to 1px. */
  height: 45px;
  background: var(--tb-bg);
  border-bottom: 1px solid var(--tb-border-soft);
}
/* The bar is full-bleed so its rule spans the window, but its contents belong
   in the same column as the header and <main>. Full-bleed is kept below 720px,
   where the gutter would come straight out of the rail's scrollable width and
   the fades already handle the edges. */
@media (min-width: 720px) {
  .toolbar { padding-inline: max(24px, calc((100% - 1080px) / 2 + 24px)); }
}

/* ---- the trigger: labelled, counted, and never collapses to an icon ---- */
.tb-menu { position: relative; flex: 0 0 auto; }
.tb-trigger {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px;
  white-space: nowrap; cursor: pointer; list-style: none;
  font-size: 14.5px; font-weight: 700; color: var(--tb-text);
  border-right: 1px solid var(--tb-border-soft);
}
.tb-trigger::-webkit-details-marker { display: none; } /* Safari */
.tb-trigger::marker { content: ""; }
.tb-trigger:hover { color: var(--tb-accent); }
.tb-glyph { color: var(--tb-accent); font-size: 15px; line-height: 1; }

/* ---- the rail: one row, always. Wrapping is what produced every ragged
   multi-row header in the audit; nowrap makes those faults impossible. ---- */
.tb-rail {
  /* The centre-on-current JS reads `current.offsetLeft` and treats it as an
     offset inside this scroller. Without a position here the nearest
     positioned ancestor is `.toolbar`, so that figure also carries the
     trigger's width and the rail over-scrolls by it — the current chip lands
     with its first letters under the left fade, which is the clipped label
     this pattern exists to prevent. */
  position: relative;
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-wrap: nowrap; gap: 0;
  margin: 0; padding: 0; list-style: none;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;  /* a swipe past the end is not a back-nav */
  scroll-padding-inline: 24px;     /* Tab must not park a chip under the fade */
  scrollbar-width: none;
  /* The right fade is ON by default and JS turns it off once it can prove the
     rail is scrolled to its end. Defaulting it off would mean a JS-disabled
     visitor gets a label hard-clipped mid-word, which is the one thing this
     pattern exists to stop. It costs nothing when the rail does not scroll,
     because the rail is a flex item that stretches: the last chip only reaches
     the right edge when there is something behind it. */
  --f0: 0px; --f1: 24px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--f0),
    #000 calc(100% - var(--f1)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--f0),
    #000 calc(100% - var(--f1)), transparent 100%);
}
.tb-rail::-webkit-scrollbar { display: none; } /* the fade is the affordance */
.tb-rail.can-l { --f0: 24px; }
.tb-rail.js-on:not(.can-r) { --f1: 0px; }
.tb-rail > li { flex: 0 0 auto; }
.tb-rail a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px;
  white-space: nowrap; text-decoration: none;
  font-size: 14.5px; font-weight: 600; color: var(--tb-text-dim);
  box-shadow: inset 0 -2px 0 transparent;
}
/* Hover changes colour only, so the scroller never reflows under the cursor. */
.tb-rail a:hover { color: var(--tb-text); text-decoration: none; }
.tb-rail a[aria-current] {
  color: var(--tb-text); font-weight: 800;
  box-shadow: inset 0 -2px 0 var(--tb-accent);
}

/* outline-offset is negative so the ring is not clipped by the scroller. */
.tb-trigger:focus-visible,
.tb-rail a:focus-visible,
.tb-sheet a:focus-visible {
  outline: 2px solid var(--tb-focus); outline-offset: -2px;
}

/* ---- the sheet: a disclosure, not a modal. Focus is never trapped. ---- */
.tb-sheet {
  position: absolute; top: 100%; left: 0; z-index: 2;
  width: min(680px, 92vw); max-height: min(70vh, 520px);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--tb-bg-elev);
  border: 1px solid var(--tb-border);
  /* Radius and shadow are site-owned: a hard-edged idiom reads wrong with a
     soft drop shadow and a 12px corner. Structure stays identical portfolio-
     wide; only these two tokens move. */
  border-radius: var(--tb-sheet-radius, 0 0 12px 12px);
  box-shadow: var(--tb-sheet-shadow, 0 18px 40px -20px rgba(0, 0, 0, .5));
  padding: 14px 4px;
  columns: 2; column-gap: 24px;
}
/* At <= 8 destinations the sheet renders one flat list and the columns move
   onto it; group headings are noise at that size. */
.tb-sheet.is-flat { columns: 1; }
.tb-sheet.is-flat ul { columns: 2; column-gap: 24px; }
.tb-sheet ul { margin: 0 0 12px; padding: 0; list-style: none; break-inside: avoid; }
.tb-sheet li { break-inside: avoid; }
.tb-sheet a {
  display: flex; align-items: center; min-height: 36px; padding: 0 14px;
  font-size: 14.5px; text-decoration: none; color: var(--tb-text-dim);
  border-left: 3px solid transparent; /* reserved, so the current item never shifts */
}
.tb-sheet a:hover { color: var(--tb-text); text-decoration: none; }
.tb-sheet a[aria-current] {
  color: var(--tb-text); font-weight: 800; border-left-color: var(--tb-accent);
}
/* <p>, not <h2>: chrome headings would pollute the outline of an SEO page. */
.tb-grouplabel {
  margin: 0 0 4px; padding: 0 14px;
  font-size: 12px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--tb-text-dim);
  /* A group label and its list are two boxes, so `break-inside: avoid` on the
     list does nothing to keep them together: the column balancer will happily
     end a column on the heading and start the next one with the list it
     introduces. */
  break-after: avoid;
}
/* The one route from the chrome to a tier-2 family. */
.tb-hub {
  column-span: all; break-inside: avoid;
  margin: 2px 0 0; padding: 10px 14px 0;
  border-top: 1px solid var(--tb-border-soft);
}
.tb-hub a {
  padding: 0; border-left: 0; min-height: 36px;
  color: var(--tb-accent); font-weight: 700;
}

/* ---- mobile: full-bleed sheet, scrim, short trigger label ---- */
.tb-scrim { display: none; }
@media (max-width: 719px) {
  .tb-menu { position: static; }
  /* No multicol at all on a phone, not even `columns: 1`. A multicol box with
     a max-height fragments into *extra* columns laid out sideways, so on a
     grouped sheet the last group and the hub link were rendered off the right
     edge with a blank band where they should have been — `overflow-y` cannot
     scroll to content that overflowed inline. A plain block scrolls. */
  .tb-sheet, .tb-sheet.is-flat ul {
    columns: auto;
  }
  .tb-sheet {
    left: 0; right: 0; width: auto;
    border-width: 1px 0; border-radius: 0;
  }
  .tb-sheet a { min-height: 44px; padding: 0 16px; }
  /* Anchored to the bar rather than the viewport, so it cannot cover the
     trigger — with JS off, tapping the trigger again is the way out and there
     must be nothing on top of it. Pure CSS, so it works with JS off too. */
  .tb-menu[open] ~ .tb-scrim {
    display: block; position: absolute; top: 100%; left: 0; right: 0;
    height: 100vh; z-index: 1; background: rgba(0, 0, 0, .42);
  }
}
@media (max-width: 399px) {
  .tb-label-long { display: none; } /* "All 13 sheets" -> "All 13"; the
                                       accessible name keeps the full string */
}

/* ---- tier-2 sibling chips, inside the tool's own surface ----
   A color family is a parameter of the shades generator, not a peer of the
   other seven tools, so the switcher lives here rather than in the toolbar.
   Real links, never intercepted: these pages differ by more than a preset. */
.chip-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.chip-row-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
}
.chip-row ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chip-row a.chip-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--fg-dim);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.chip-row a.chip-link:hover { color: var(--fg); border-color: var(--accent); }
.chip-row a.chip-link[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
@media (max-width: 640px) { .chip-row a.chip-link { min-height: 38px; } }

/* ---------- swatch rail (signature element) ---------- */

.swatch-rail {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.swatch-rail button {
  appearance: none;
  border: 2px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  padding: 0;
  transition: transform 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.swatch-rail button:hover {
  transform: translateY(-3px) scale(1.08);
}

.swatch-rail button[aria-pressed="true"] {
  border-color: var(--fg);
}

.swatch-rail button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 1px dashed var(--fg-dim);
}

.swatch-rail .rail-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  margin-right: 4px;
}

/* ---------- hero ---------- */

.hero {
  padding: 26px 0 18px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 480px;
  background: conic-gradient(
    from 0deg,
    var(--sig-magenta),
    var(--sig-amber),
    var(--sig-lime),
    var(--sig-cyan),
    var(--sig-violet),
    var(--sig-magenta)
  );
  filter: blur(120px) saturate(140%);
  opacity: 0.35;
  z-index: -1;
  animation: drift 26s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .hero::before,
  .wordmark {
    animation: none;
  }
}

@keyframes drift {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  max-width: 16ch;
}

.hero .lede {
  font-size: 1.15rem;
  max-width: 52ch;
}

.hero .rail-row {
  margin: 14px 0 6px;
  padding: 14px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}

/* ---------- tool cards / overview grid ---------- */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 28px 0 56px;
}

.tool-card {
  display: block;
  text-decoration: none;
  color: var(--fg);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  box-shadow: var(--shadow-lift);
}

.tool-card .chip {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.tool-card .chip svg {
  width: 18px;
  height: 18px;
}

.tool-card h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.tool-card p {
  font-size: 14px;
  margin: 0;
}

/* ---------- panels (tool workspaces) ---------- */

.panel {
  padding: 8px 0 64px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.panel-head h2,
.panel-head h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0;
}

.back-to-tools {
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--fg-dim);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
}

.back-to-tools:hover {
  color: var(--fg);
  border-color: var(--accent);
}

.workspace {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-lift);
}

.controls-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  font-weight: 700;
}

.field input[type="text"],
.field input[type="number"] {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  width: 100%;
}

.field input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0;
  background: none;
  cursor: pointer;
}

.field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.field input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: var(--radius-sm);
}
.field input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: var(--radius-sm);
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.field select {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  width: 100%;
}

.range-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-dim);
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.copy-row .value {
  font-family: var(--font-mono);
  font-size: 14px;
  flex: 1;
  /* A flex child will not shrink below its own content by default, so a long
     value (a whole hex list, a share URL on a narrow phone) pushes the Copy
     button out through the side of the row. It scrolls internally instead. */
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  user-select: all;
}

.copy-row .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  min-width: 44px;
}

button.copy-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

button.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

button.copy-btn.is-copied {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

button.action-btn {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

button.ghost-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.swatch-preview {
  height: 96px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hstack {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- gradient tool ---------- */

.stop-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.stop-row input[type="color"] {
  width: 44px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

.stop-row .pos-value {
  font-family: var(--font-mono);
  font-size: 12px;
  width: 44px;
  text-align: right;
  color: var(--fg-dim);
}

.gradient-preview {
  height: 160px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}

/* ---------- palette tool ---------- */

.palette-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.palette-chip {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}

.palette-chip .swatch {
  height: 76px;
}

.palette-chip .meta {
  padding: 8px 10px;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
}

.palette-chip .meta button {
  margin-top: 4px;
}

.scheme-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.scheme-tabs button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg-dim);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.scheme-tabs button[aria-pressed="true"] {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- contrast tool ---------- */

.contrast-demo {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 18px;
}

.contrast-demo .big {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
}

.contrast-demo .small {
  font-size: 14px;
}

.ratio-display {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}

.ratio-display .num {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 800;
}

.verdicts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.verdict {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13px;
}

.verdict .tag {
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: 999px;
}

.verdict.pass .tag {
  background: color-mix(in srgb, var(--sig-lime) 25%, transparent);
  color: var(--sig-lime);
}

.verdict.fail .tag {
  background: color-mix(in srgb, var(--sig-magenta) 25%, transparent);
  color: var(--sig-magenta);
}

/* ---------- image extractor ---------- */

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 18px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone.is-drag {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.dropzone input[type="file"] {
  display: none;
}

.dropzone p {
  color: var(--fg);
  margin: 0 0 6px;
}

.dropzone .privacy-note {
  font-size: 12px;
  margin-top: 8px;
  color: var(--fg-dim) !important;
}

.extract-preview {
  display: none;
  gap: 20px;
  margin-bottom: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.extract-preview.is-visible {
  display: flex;
}

.extract-preview img {
  max-width: 240px;
  max-height: 240px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

/* ---------- shareable link row ---------- */

/* Reuses .copy-row's shell so the link reads as one more copyable value
   alongside HEX/RGB/HSL, rather than a separate widget bolted on. */
.share-row {
  margin-top: 16px;
  margin-bottom: 0;
}

.share-row .label {
  min-width: 34px;
}

input.share-url {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: var(--fg-dim);
  min-width: 0;
  text-overflow: ellipsis;
}

input.share-url:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- articles ---------- */

.article-hub,
.article-page {
  padding: 8px 0 64px;
}

.article-page .wrap {
  max-width: 720px;
}

.article-page h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 6px;
}

.article-page h2 {
  font-size: 1.25rem;
  margin-top: 34px;
}

.article-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-dim);
  margin-bottom: 28px;
}

.article-page code {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.92em;
}

.article-page ul {
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--fg-dim);
}

.article-page li {
  margin-bottom: 8px;
}

.article-list {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.article-list a {
  display: block;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.article-list a:hover {
  border-color: var(--accent);
  transform: translateX(3px);
}

.article-list h2 {
  font-size: 1.05rem;
  margin: 0 0 4px;
}

.article-list p {
  color: var(--fg-dim);
  font-size: 14px;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .article-list a {
    transition: none;
  }
  .article-list a:hover {
    transform: none;
  }
}

.article-swatches {
  display: flex;
  gap: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  margin: 18px 0 22px;
}

.article-swatches span {
  flex: 1;
  height: 54px;
  display: block;
}

/* ---------- content sections (per-tool SEO copy) ---------- */

.content-section {
  padding: 44px 0;
  border-top: 1px solid var(--line);
}

.content-section h2 {
  font-size: 1.5rem;
}

.content-section h3 {
  font-size: 1rem;
  margin: 24px 0 0;
}

.content-section p {
  color: var(--fg-dim);
}

.faq dt {
  font-weight: 700;
  margin-top: 16px;
}

.faq dd {
  margin: 6px 0 0;
  color: var(--fg-dim);
}

.related-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.related-links a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--fg);
}

.related-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.how-to ol {
  padding-left: 20px;
}

.how-to li {
  margin-bottom: 8px;
  color: var(--fg-dim);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 18px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}

.footer-links a {
  color: var(--fg-dim);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--fg);
}

.footer-tag {
  font-size: 12px;
  color: var(--fg-dim);
}

.erabbit-mark {
  display: block;
  width: 10px;
  margin: 14px 0 0 auto;
  line-height: 0;
}

.erabbit-mark img {
  display: block;
  width: 10px;
  height: 10px;
}

/* ---------- simple content pages (privacy/terms/404) ---------- */

.doc-page {
  padding: 56px 0 60px;
  max-width: 720px;
}

.doc-page h1 {
  font-size: 2rem;
}

.doc-page h2 {
  font-size: 1.2rem;
  margin-top: 1.6em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- shades generator, name finder, family pages ---------- */

.strip-title {
  font-size: 0.95rem;
  margin: 22px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.strip-title span {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--fg-dim);
}

.shade-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.shade-chip {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-raised);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.shade-chip:hover,
.shade-chip:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* The swatches on a landing page are a reference table, not a control: no
   pointer, no lift, nothing implying a click that does nothing. */
.shade-chip.is-static {
  cursor: default;
}
.shade-chip.is-static:hover {
  border-color: var(--line);
  transform: none;
}

.shade-swatch {
  display: block;
  height: 56px;
}

.shade-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-dim);
}

.shade-meta b {
  color: var(--fg);
  font-size: 12px;
}

.strip-note {
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg-dim);
  font-size: 13px;
}

.copy-block {
  margin-top: 16px;
}

.copy-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.copy-block textarea {
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
}

/* ---------- the named-colour tables ---------- */
/* Wide by nature. It scrolls inside its own box so a phone never ends up
   scrolling the whole page sideways to read a hex value. */

.data-table {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.data-table table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  position: sticky;
  top: 0;
  background: var(--bg-raised);
  text-align: right;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.data-table td {
  text-align: right;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-dim);
}

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
  color: var(--fg);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table .mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.swatch-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 1px solid var(--line);
}

.wcag-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--sig-lime) 45%, transparent);
  color: var(--sig-lime);
  font-size: 11px;
  white-space: nowrap;
}

.wcag-tag.is-fail {
  border-color: color-mix(in srgb, var(--sig-magenta) 45%, transparent);
  color: var(--sig-magenta);
}

.table-note,
.page-tagline {
  color: var(--fg-dim);
}

.page-tagline {
  font-size: 15px;
  color: var(--fg);
}

.cta-link {
  display: inline-block;
  margin-top: 6px;
  font-weight: 600;
}

/* ---------- the name finder's result ---------- */

.name-hit {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: 16px;
  margin-top: 16px;
}

.name-swatch {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.name-swatch.small {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

.name-body {
  min-width: 0;
}

.name-body h3 {
  margin: 0;
  font-size: 1.25rem;
  font-family: var(--font-mono);
}

.name-verdict {
  margin: 4px 0 0;
  color: var(--fg-dim);
  font-size: 13px;
}

.name-facts {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-dim);
  word-break: break-word;
}

.name-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.name-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--fg-dim);
}

.name-list b {
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13px;
}

.name-list span:not(.name-swatch) {
  font-family: var(--font-mono);
  font-size: 12px;
}

.name-list li span:last-child {
  margin-left: auto;
}

/* ---------- homepage family links ---------- */

.family-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.family-links-label {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-right: 4px;
}

.family-links a {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--fg-dim);
  font-size: 12.5px;
  text-decoration: none;
}

.family-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
