/*
  Bestia Paint: colour matcher and room planner (Screenery template)
  The page is built from the maker's own chip cards: a riveted fan deck on a cobalt first screen, then flat
  Fauvist blocks (viridian, oleander, chrome yellow, chip white, violet, vermilion) holding white punched cards.
  Yeseva One speaks; Raleway does the work. All eight page colours are chips from the range.

  Contents
   1. Tokens
   2. Base and browser surfaces
   3. Grounds, painterly edges, wrap, section heads
   4. Components: buttons, cards, fields, segmented choices, steppers, toast
   5. Header
   6. Hero and the fan deck
   7. Matcher
   8. Room
   9. Tins
  10. Range
  11. The back of the card
  12. Order
  13. Questions and footer
  14. Motion
  15. Narrow screens
*/

/* ---------- 1. Tokens ---------- */
:root {
  /* The eight page colours, all from the range */
  --cobalt: #1f45c2;      /* BE19 Cobalt Boat */
  --chrome: #f5c518;      /* BE05 Chrome Noon */
  --vermilion: #ec5030;   /* BE01 Harbour Vermilion */
  --viridian: #0f7a5c;    /* BE13 Viridian Pool */
  --oleander: #f06fa6;    /* BE28 Oleander */
  --violet: #5b2a86;      /* BE25 Violet Shadow */
  --milk: #fbf9f3;        /* BE36 Ceiling Milk */
  --ink: #1d1a24;         /* BE40 Ink Black */

  --card: #fffdf8;
  --line: #d9d2c3;
  --ink-soft: #4a4453;    /* secondary text on light card, 8.6:1 */
  --err: #b3261e;
  --ok: #0f7a5c;

  --f-display: "Yeseva One", Georgia, serif;
  --f-body: "Raleway", "Helvetica Neue", Arial, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
  --r1: 3px; --r2: 6px; --r3: 10px;
  --shadow: 0 10px 24px -10px rgb(29 26 36 / .45), 0 2px 4px rgb(29 26 36 / .18);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --wrap: 1240px;
  --head-h: 64px;
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--milk); color: var(--ink);
  font: 500 1rem/1.6 var(--f-body); overflow-x: hidden;
  scrollbar-color: var(--cobalt) var(--milk);
}
::selection { background: var(--chrome); color: var(--ink); }
input, textarea { caret-color: var(--vermilion); }
:where(input, button, select) { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 400; line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -.005em; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1.5px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--chrome); border-radius: 2px; }
.g-cobalt :focus-visible, .g-violet :focus-visible, .g-viridian :focus-visible, .g-ink :focus-visible { outline-color: var(--milk); box-shadow: 0 0 0 6px var(--ink); }
.g-viridian .card :focus-visible, .g-violet .spec :focus-visible { outline-color: var(--ink); box-shadow: 0 0 0 6px var(--chrome); }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--chrome); color: var(--ink); padding: 10px 16px; font-weight: 700; border-radius: var(--r2); }
.skip:focus { top: 12px; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.num, output, td, dd, .near__de { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- 3. Grounds, painterly edges, wrap, section heads ---------- */
.g-cobalt   { --bg: var(--cobalt);    --fg: var(--milk); --sub: #e4e8fb; }
.g-viridian { --bg: var(--viridian);  --fg: var(--milk); --sub: #e3f2ec; }
.g-oleander { --bg: var(--oleander);  --fg: var(--ink);  --sub: #2c1426; }
.g-chrome   { --bg: var(--chrome);    --fg: var(--ink);  --sub: #3a2d05; }
.g-paper    { --bg: var(--milk);      --fg: var(--ink);  --sub: var(--ink-soft); }
.g-violet   { --bg: var(--violet);    --fg: var(--milk); --sub: #ece2f6; }
.g-vermilion{ --bg: var(--vermilion); --fg: var(--ink);  --sub: #2a0e08; }
.g-ink      { --bg: var(--ink);       --fg: var(--milk); --sub: #cfc9d8; }
:is(.g-cobalt, .g-viridian, .g-oleander, .g-chrome, .g-paper, .g-violet, .g-vermilion, .g-ink) { background: var(--bg); color: var(--fg); }

/* A ragged, brushed top edge: the section's own colour bleeds up into the one above */
.edge { position: relative; }
.edge::before {
  content: ""; position: absolute; left: 0; right: 0; top: -22px; height: 24px; background: var(--bg);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 24' preserveAspectRatio='none'%3E%3Cpath d='M0 24V14l9-3 12 4 10-6 14 3 9-5 15 6 11-4 13 2 8-6 16 5 12-2 10 4 14-7 9 3 13-1 11 5 15-6 10 2 12-4 9 6 16-3 11 2 10-5 14 4 12-3 9 5 13-6 15 3 10-2 12 5 8-4 14 2 11-5 13 4 9-2 V24z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 24' preserveAspectRatio='none'%3E%3Cpath d='M0 24V14l9-3 12 4 10-6 14 3 9-5 15 6 11-4 13 2 8-6 16 5 12-2 10 4 14-7 9 3 13-1 11 5 15-6 10 2 12-4 9 6 16-3 11 2 10-5 14 4 12-3 9 5 13-6 15 3 10-2 12 5 8-4 14 2 11-5 13 4 9-2 V24z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}
.wrap { width: min(100% - 48px, var(--wrap)); margin-inline: auto; }
section { padding-block: var(--s8) calc(var(--s8) + 8px); }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s6) var(--s8); align-items: end; margin-bottom: var(--s7); }
.sec-head h2, .room h2, .tins h2, .back__text h2, .order h2, .faq h2 { font-size: clamp(2.3rem, 4.6vw, 4.2rem); }
.sec-head p { color: var(--sub); max-width: 62ch; font-size: 1.06rem; }

/* ---------- 4. Components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border: 2px solid var(--ink); border-radius: 999px; font-weight: 700; font-size: .98rem; text-decoration: none; cursor: pointer;
  background: var(--card); color: var(--ink); transition: transform .3s var(--ease), background-color .2s, box-shadow .3s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn--yellow { background: var(--chrome); border-color: var(--chrome); }
.btn--ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn--paper { background: var(--milk); border-color: var(--milk); }
.btn--ink { background: var(--ink); color: var(--milk); }
.btn--line { background: transparent; color: inherit; border-color: currentColor; }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: .9rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.is-loading { cursor: progress; }
.btn.is-loading::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 1.75px solid var(--ink); background: var(--card); color: var(--ink); cursor: pointer; padding: 0; flex: none;
}
.icon-btn:hover { background: var(--chrome); }
.icon-btn .i { width: 16px; height: 16px; }
.icon-btn[disabled] { opacity: .4; cursor: not-allowed; background: var(--card); }
.mini {
  min-height: 32px; padding: 0 10px; border: 1.5px solid var(--ink); background: var(--card); color: var(--ink);
  border-radius: 999px; font-size: .78rem; font-weight: 700; cursor: pointer;
}
.mini:hover { background: var(--chrome); }
.mini[aria-pressed="true"] { background: var(--ink); color: var(--milk); }

/* The chip card: a white card with a punched hole, the house object everything sits on */
.card {
  position: relative; background: var(--card); color: var(--ink); border-radius: var(--r2);
  padding: var(--s7) var(--s6) var(--s6); box-shadow: var(--shadow);
}
.card__hole { position: absolute; top: 14px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 1px 2px rgb(0 0 0 / .35); }
.card__title { font-size: 1.55rem; margin-bottom: var(--s4); }
.card__title--sub { font-size: 1.15rem; margin-top: var(--s6); }

.field { display: grid; gap: 6px; min-width: 0; }
.field__label { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.field input[type="text"], .field input[type="email"], .wall input {
  width: 100%; min-height: 46px; padding: 0 12px; border: 1.75px solid var(--ink); border-radius: var(--r1); background: #fff;
}
.field input::placeholder { color: #6b6474; }
.field input[aria-invalid="true"], .wall input[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 3px rgb(179 38 30 / .16); }
.field__msg { font-size: .85rem; color: var(--ink-soft); min-height: 1.3em; }
.field__msg.is-err, .field__msg--err { color: var(--err); font-weight: 600; }
input[type="color"] { width: 100%; height: 46px; padding: 3px; border: 1.75px solid var(--ink); border-radius: var(--r1); background: #fff; cursor: pointer; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--ink); }

.seg { border: 0; padding: 0; margin: var(--s5) 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.seg legend { margin-bottom: 8px; padding: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 40px; min-width: 44px; justify-content: center; padding: 0 14px; border: 1.75px solid var(--ink); border-radius: 999px; font-weight: 600; font-size: .92rem; }
.seg input:checked + span { background: var(--ink); color: var(--milk); }
.seg input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--chrome); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: var(--s5); font-weight: 600; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; }

.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper .field__label { margin-right: 4px; }
.stepper output { min-width: 1.6em; text-align: center; font-weight: 800; font-size: 1.1rem; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translateX(-50%);
  background: var(--ink); color: var(--milk); padding: 12px 18px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow);
  max-width: calc(100% - 32px); display: flex; gap: 10px; align-items: center;
}
.toast::before { content: ""; width: 14px; height: 14px; border-radius: 3px; background: var(--toast, var(--chrome)); flex: none; }

/* ---------- 5. Header ---------- */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--head-h); display: flex; align-items: center; gap: var(--s6);
  padding: 0 24px; background: var(--milk); border-bottom: 2px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-display); font-size: 1.7rem; }
.brand__mark { width: 22px; height: 32px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 10px 12px; font-weight: 700; text-decoration: none; border-radius: 999px; font-size: .95rem; }
.nav a:hover { background: var(--chrome); }
.basket-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 12px; border: 2px solid var(--ink); border-radius: 999px; font-weight: 700; text-decoration: none; }
.basket-link:hover { background: var(--oleander); }
.count { min-width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0 6px; background: var(--vermilion); color: var(--ink); border-radius: 999px; font-size: .82rem; }
.count.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); } }

/* ---------- 6. Hero and the fan deck ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--s6); align-items: center;
  padding: var(--s8) max(24px, calc((100% - var(--wrap)) / 2)) var(--s8); min-height: calc(100svh - var(--head-h)); overflow: hidden;
}
.hero h1 { font-size: clamp(2.6rem, 4.9vw, 4.8rem); color: var(--chrome); max-width: 12ch; }
.hero__lede { margin-top: var(--s5); font-size: 1.12rem; max-width: 46ch; color: var(--sub); }
.hero__acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--s6); }
.hero__facts { display: flex; flex-wrap: wrap; gap: var(--s5) var(--s6); margin: var(--s7) 0 0; padding-top: var(--s5); border-top: 2px solid rgb(251 249 243 / .4); }
.hero__facts div { display: grid; }
.hero__facts dt { font-size: .82rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--sub); }
.hero__facts dd { margin: 0; font-family: var(--f-display); font-size: 1.9rem; color: var(--milk); }

.fan { --h: 430px; --w: 116px; display: grid; justify-items: center; }
.fan__deck { position: relative; width: calc(var(--h) * 1.32 + var(--w)); max-width: 100%; height: calc(var(--h) + 20px); }
.fan__strip {
  --r: calc(-42deg + var(--i) * 12deg);
  position: absolute; left: calc(50% - var(--w) / 2); bottom: 0; width: var(--w); height: var(--h);
  display: flex; flex-direction: column; background: var(--card); border-radius: 6px 6px 10px 10px; padding: 0 6px 36px;
  transform-origin: 50% calc(100% - 18px); rotate: var(--r);
  box-shadow: 0 6px 16px -6px rgb(0 0 0 / .45), 0 1px 2px rgb(0 0 0 / .25);
  transition: translate .45s var(--ease);
}
.fan__strip:nth-child(1) { --i: 0; } .fan__strip:nth-child(2) { --i: 1; } .fan__strip:nth-child(3) { --i: 2; } .fan__strip:nth-child(4) { --i: 3; }
.fan__strip:nth-child(5) { --i: 4; } .fan__strip:nth-child(6) { --i: 5; } .fan__strip:nth-child(7) { --i: 6; } .fan__strip:nth-child(8) { --i: 7; }
.fan__strip:hover, .fan__strip:focus-within { z-index: 9; translate: calc(sin(var(--r)) * 18px) calc(cos(var(--r)) * -18px); }
.fan__head { font-family: var(--f-display); font-size: .95rem; text-align: center; padding: 6px 0 4px; color: var(--ink); }
.fan__chip {
  flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 0; text-align: left;
  border: 0; margin: 0 0 3px; padding: 6px 8px; background: var(--c); color: var(--ink); cursor: pointer; min-height: 0; line-height: 1.15;
}
.fan__chip[data-on="paper"] { color: var(--milk); }
.fan__chip span { font-weight: 800; font-size: .74rem; opacity: 0; transition: opacity .25s; }
/* Like a real deck, only the codes on the left edge show until a strip is lifted; the top strip shows its names */
.fan__strip:hover .fan__chip span, .fan__strip:focus-within .fan__chip span, .fan__strip:last-of-type .fan__chip span { opacity: 1; }
.fan__chip small { font-size: .69rem; font-weight: 600; }
/* Under the top strip the codes sit at the outer end of each chip, where the strips have fanned apart, so the next strip never cuts them */
.fan__strip:not(:last-of-type) .fan__chip { justify-content: flex-start; }
/* below the first chip the strips overlap too tightly for a whole code; the rest show when a strip is lifted */
.fan__strip:not(:last-of-type):not(:hover):not(:focus-within) .fan__chip:not(:first-of-type) small { opacity: 0; }
.fan__chip small { transition: opacity .25s; }
.fan__chip:hover { filter: saturate(1.15); outline: 2px solid var(--ink); outline-offset: -2px; }
.fan__chip.is-on { outline: 3px solid var(--ink); outline-offset: -3px; }
.fan__chip:focus-visible { outline-offset: -3px; box-shadow: none; }
.fan__rivet { position: absolute; left: 50%; bottom: 8px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; z-index: 10; background: radial-gradient(circle at 35% 35%, #fff 0 18%, #b9b2a3 40%, #6f6858 100%); box-shadow: 0 2px 4px rgb(0 0 0 / .4); }
.fan__hint { margin-top: var(--s7); font-weight: 600; color: var(--sub); font-size: .92rem; }

/* ---------- 7. Matcher ---------- */
.match__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s6); align-items: start; }
.target { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--s5); align-items: stretch; }
.target__swatch { background: var(--t); border-radius: var(--r1); min-height: 140px; border: 1.75px solid var(--ink); transition: background-color .4s var(--ease); }
.target__fields { display: grid; gap: var(--s4); }
#hex-msg { margin-top: 10px; }
.bench { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.obj {
  display: grid; justify-items: center; gap: 4px; padding: 10px 6px 10px; border: 1.75px solid var(--line); background: #f6f1e6;
  border-radius: var(--r2); cursor: pointer; font-weight: 700; font-size: .86rem; color: var(--ink); transition: border-color .2s, transform .3s var(--ease);
}
.obj svg { width: 72px; height: 58px; }
.obj:hover { border-color: var(--ink); transform: translateY(-2px); }
.obj[aria-pressed="true"] { border: 2.5px solid var(--ink); background: #fff; box-shadow: var(--shadow); }

.verdict { font-family: var(--f-display); font-size: 1.35rem; line-height: 1.25; margin-bottom: var(--s5); min-height: 2.5em; }
.near { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.near__row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 6px 6px 6px 6px; border: 1.75px solid var(--line); border-radius: var(--r2); background: #fff;
}
.near__row:first-child { border-color: var(--ink); }
.near__sw { height: 52px; background: var(--c); border-radius: 3px; position: relative; overflow: hidden; }
/* left half shows the target, right half the chip, so you see them side by side */
.near__sw::before { content: ""; position: absolute; inset: 0 50% 0 0; background: var(--t, transparent); }
.near__name { display: grid; line-height: 1.25; min-width: 0; }
.near__name b { font-size: 1rem; }
.near__name small { font-size: .8rem; color: var(--ink-soft); font-weight: 600; }
.near__de { font-weight: 800; font-size: .95rem; text-align: right; white-space: nowrap; }
.near__acts { display: flex; gap: 6px; }
.scale { display: flex; justify-content: space-between; margin-top: var(--s4); padding-top: 8px; font-size: .75rem; font-weight: 700; color: var(--ink-soft); border-top: 6px solid; border-image: linear-gradient(90deg, var(--viridian) 0 10%, #8fd3b6 10% 25%, var(--chrome) 25% 50%, var(--vermilion) 50% 100%) 1; }

.pairs { margin-top: var(--s6); padding: var(--s6); border: 2px solid rgb(251 249 243 / .55); border-radius: var(--r2); }
.pairs__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s4); align-items: center; margin-bottom: var(--s5); }
.pairs__head h3 { font-size: 1.6rem; }
.pairs__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-radius: var(--r2); overflow: hidden; }
.pair { display: grid; align-content: end; min-height: 190px; padding: var(--s4); background: var(--c); color: var(--ink); }
.pair[data-on="paper"] { color: var(--milk); }
.pair__sw { display: none; }
.pair__role { font-size: .8rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.pair b { font-family: var(--f-display); font-weight: 400; font-size: 1.3rem; line-height: 1.15; }
.pair small { font-weight: 700; font-size: .8rem; }
.pairs__note { margin-top: var(--s4); color: var(--sub); max-width: 80ch; font-size: .95rem; }

/* ---------- 8. Room ---------- */
.room__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); grid-template-areas: "side fig" "controls fig"; gap: var(--s5) var(--s7); align-items: start; }
.room__side { grid-area: side; } .room__fig { grid-area: fig; align-self: center; } .room__controls { grid-area: controls; }
.room__side > p { margin-top: var(--s4); max-width: 46ch; color: var(--sub); font-size: 1.05rem; }
.surfaces { border: 0; padding: 0; margin: var(--s6) 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.surfaces legend { font-size: .8rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 8px; padding: 0; }
.surf { position: relative; display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--card); border: 2px solid transparent; border-radius: var(--r2); cursor: pointer; line-height: 1.2; }
.surf input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.surf:has(input:checked) { border-color: var(--ink); box-shadow: var(--shadow); }
.surf:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; }
.surf__sw { width: 30px; height: 30px; border-radius: 3px; border: 1.5px solid var(--ink); background: var(--c, #eee); flex: none; }
.surf b { display: block; font-size: .95rem; }
.surf small { font-size: .8rem; color: var(--ink-soft); font-weight: 600; }
.palette { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin-top: var(--s5); }
.palette button { aspect-ratio: 1; min-height: 32px; border: 2px solid var(--card); border-radius: 3px; background: var(--c); cursor: pointer; padding: 0; }
.palette button:hover { border-color: var(--ink); }
.palette button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--card); }
.room__status { margin-top: var(--s4); font-weight: 700; min-height: 1.6em; }
.room__acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--s4); }
.room__fig { margin: 0; }
.roomsvg { width: 100%; height: auto; border: 3px solid var(--ink); border-radius: var(--r2); background: var(--milk); box-shadow: var(--shadow); filter: url(#rough); }
.roomsvg { --wall: #f2dc3a; --feature: #2a8fc9; --trim: #5e3d25; --ceiling: #f7e08a; } /* the lemon pairing, before the script runs */
.s-wall { fill: var(--wall); } .s-feature { fill: var(--feature); } .s-trim { fill: var(--trim); } .s-ceiling { fill: var(--ceiling); }
.s-wall, .s-feature, .s-trim, .s-ceiling { transition: fill .6s var(--ease); }
.room__cap { margin-top: var(--s4); font-weight: 700; font-size: .95rem; }

/* ---------- 9. Tins ---------- */
.tins__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--s6); align-items: start; }
.tins__intro { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s6) var(--s8); align-items: end; margin-bottom: var(--s4); }
.tins__intro p { color: var(--sub); max-width: 62ch; font-size: 1.05rem; }
.walls { display: grid; gap: 8px; margin-bottom: var(--s4); }
.wall { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto minmax(0, 1fr) auto 36px; gap: 10px; align-items: center; }
.wall__n { font-weight: 700; font-size: .9rem; }
.wall__u { font-weight: 700; color: var(--ink-soft); }
.wall input { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.calc__row { display: flex; flex-wrap: wrap; gap: var(--s5) var(--s6); margin-top: var(--s5); }
.card--sum { position: sticky; top: calc(var(--head-h) + 24px); }
.sum__big { display: grid; gap: 4px; padding: var(--s5); background: var(--ink); color: var(--milk); border-radius: var(--r2); }
.sum__big b { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.1; }
.sum__big span { font-weight: 600; color: #ddd7e4; }
.sum__table { width: 100%; border-collapse: collapse; margin-top: var(--s5); }
.sum__table th, .sum__table td { padding: 10px 0; border-bottom: 1.5px solid var(--line); text-align: left; font-weight: 600; }
.sum__table td { text-align: right; font-weight: 800; }
.sum__table tr:last-child th, .sum__table tr:last-child td { border-bottom: 2px solid var(--ink); }
.sum__note { margin-top: var(--s4); font-size: .92rem; color: var(--ink-soft); }

/* ---------- 10. Range ---------- */
.sec-head--range { margin-bottom: var(--s5); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filt { min-height: 42px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 999px; background: transparent; font-weight: 700; cursor: pointer; }
.filt:hover { background: var(--chrome); }
.filt[aria-pressed="true"] { background: var(--ink); color: var(--milk); }
.range__count { margin: var(--s4) 0 var(--s5); font-weight: 600; color: var(--ink-soft); }
.family + .family { margin-top: var(--s5); }
.family h3 { font-size: 1.6rem; margin-bottom: var(--s4); padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.chips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: var(--s3); }
.chip { display: grid; grid-template-rows: 92px auto auto; align-content: start; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r2); padding: 8px; box-shadow: 0 4px 10px -6px rgb(29 26 36 / .35); }
.chip__swatch { background: var(--c); border-radius: 3px; box-shadow: inset 0 0 0 1px rgb(29 26 36 / .14); }
.chip__tab { display: grid; padding: 10px 2px 8px; line-height: 1.25; }
.chip__tab b { font-family: var(--f-display); font-weight: 400; font-size: 1.12rem; }
.chip__tab span { font-size: .8rem; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.chip__acts { display: flex; gap: 6px; }

/* ---------- 11. The back of the card ---------- */
.back__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: var(--s7); align-items: start; }
.back__text p { margin-top: var(--s4); max-width: 54ch; color: var(--sub); font-size: 1.05rem; }
.back__text p:first-of-type { font-family: var(--f-display); font-size: 1.4rem; color: var(--chrome); line-height: 1.3; }
.spec { position: relative; background: var(--card); color: var(--ink); border-radius: var(--r2); padding: var(--s7) var(--s6) var(--s6); box-shadow: var(--shadow); }
.spec__table { width: 100%; border-collapse: collapse; margin-bottom: var(--s6); }
.spec__table caption { text-align: left; font-family: var(--f-display); font-size: 1.3rem; margin-bottom: 8px; }
.spec__table th, .spec__table td { text-align: left; padding: 10px 10px 10px 0; border-bottom: 1.5px solid var(--line); vertical-align: top; }
.spec__table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); border-bottom: 2px solid var(--ink); }
.spec__table tbody th { font-weight: 800; }
.spec__rules { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.spec__rules li::marker { color: var(--vermilion); }

/* ---------- 12. Order ---------- */
.order__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s6); align-items: start; }
.order__intro { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s6) var(--s8); align-items: end; margin-bottom: var(--s4); }
.order__intro p { color: var(--sub); font-size: 1.05rem; max-width: 60ch; font-weight: 600; }
.basket__empty { display: grid; justify-items: start; gap: var(--s4); color: var(--ink-soft); }
.basket__empty svg { width: 140px; color: var(--ink-soft); }
.basket { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.basket li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 36px; gap: 12px; align-items: center; padding: 6px; border: 1.5px solid var(--line); border-radius: var(--r2); }
.basket .pot { width: 44px; height: 52px; position: relative; }
.basket .pot::before { content: ""; position: absolute; inset: 10px 4px 0; background: var(--c); border-radius: 0 0 5px 5px; border: 1.5px solid var(--ink); }
.basket .pot::after { content: ""; position: absolute; inset: 2px 0 auto; height: 10px; background: var(--ink); border-radius: 2px; }
.basket b { display: block; font-weight: 800; }
.basket small { color: var(--ink-soft); font-weight: 600; font-size: .8rem; }
.basket .price { font-weight: 800; }
.totals { margin: var(--s5) 0 0; display: grid; gap: 6px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.totals dd { margin: 0; font-weight: 800; }
.totals__all { padding-top: 10px; border-top: 2px solid var(--ink); font-size: 1.15rem; }
.basket__hint { margin-top: var(--s3); font-size: .9rem; font-weight: 700; color: var(--viridian); }
.form__body { display: grid; gap: var(--s3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.form__err { display: flex; gap: 10px; padding: 12px 14px; border: 2px solid var(--err); border-radius: var(--r2); background: #fdebe8; color: #7d140f; font-weight: 700; }
.form__small { font-size: .82rem; color: var(--ink-soft); }
.form__done { display: grid; justify-items: start; gap: var(--s3); }
.form__done:focus, .form__done:focus-visible { outline: none; box-shadow: none; }
.stamp { width: 96px; color: var(--viridian); rotate: -8deg; }
.form__done h4 { font-size: 1.7rem; }
.done__pots { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.done__pots li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1.5px solid var(--line); border-radius: 999px; font-size: .85rem; font-weight: 700; }
.done__pots li span { width: 20px; height: 20px; border-radius: 50%; background: var(--c); border: 1px solid var(--ink); }

/* ---------- 13. Questions and footer ---------- */
.faq__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: var(--s7); }
.faq details { border-bottom: 2px solid var(--ink); }
.faq details:first-child { border-top: 2px solid var(--ink); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 40px 18px 0; position: relative; font-family: var(--f-display); font-size: 1.3rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 18px; height: 18px; margin-top: -9px; background: var(--vermilion); border-radius: 50%; transition: transform .3s var(--ease), border-radius .3s; }
.faq details[open] summary::after { border-radius: 2px; transform: rotate(45deg); background: var(--cobalt); }
.faq details p { padding-bottom: 18px; max-width: 64ch; color: var(--ink-soft); }
.foot { padding-block: var(--s8) var(--s6); }
.foot__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--s6); }
.foot__name { font-family: var(--f-display); font-size: 2.4rem; color: var(--chrome); }
.foot__brand p + p { margin-top: 8px; color: var(--sub); }
.foot__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: start; font-weight: 700; }
.foot__links a { display: inline-block; padding: 4px 0; }
.foot__strip { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(8, 1fr); height: 40px; border-radius: 3px; overflow: hidden; }
.foot__strip span { background: var(--c); }
.foot__small { grid-column: 1 / -1; font-size: .85rem; color: var(--sub); }

/* ---------- 14. Motion: the fan opens once, from a closed (still visible) deck ---------- */
@media (prefers-reduced-motion: no-preference) {
  .fan__strip { animation: fan-open 1.4s var(--ease) both; animation-delay: calc(.15s + var(--i) * 70ms); }
  @keyframes fan-open { from { rotate: calc(var(--r) * .08); } to { rotate: var(--r); } }
  .near__row, .pair { animation: chip-in .5s var(--ease) both; }
  .near__row:nth-child(2) { animation-delay: 40ms; } .near__row:nth-child(3) { animation-delay: 80ms; }
  .near__row:nth-child(4) { animation-delay: 120ms; } .near__row:nth-child(5) { animation-delay: 160ms; }
  @keyframes chip-in { from { translate: 0 6px; opacity: .4; } to { translate: 0 0; opacity: 1; } }
}

/* ---------- 15. Narrow screens ---------- */
@media (max-width: 1100px) {
  .nav { display: none; }
  .basket-link { margin-left: auto; }
  .fan { --h: 330px; --w: 96px; }
  .back__grid, .faq__grid { grid-template-columns: minmax(0, 1fr); }
  .pairs__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero h1 { max-width: 14ch; }
  .fan { --h: 380px; --w: 108px; }
  .room__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "fig" "controls"; }
  .match__grid { grid-template-columns: minmax(0, 1fr); }
  .palette { max-width: 560px; }
}
@media (max-width: 900px) {
  .tins__grid, .order__grid { grid-template-columns: minmax(0, 1fr); }
  .card--sum { position: static; }
  .sec-head, .tins__intro, .order__intro { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
}
@media (max-width: 640px) {
  :root { --head-h: 58px; }
  section { padding-block: var(--s8); }
  .wrap { width: min(100% - 32px, var(--wrap)); }
  .top { padding: 0 16px; gap: 12px; }
  .basket-link span { display: none; }
  .hero { padding: var(--s7) 16px var(--s7); }
  .fan { --h: 218px; --w: 72px; }
  .fan__strip { padding: 0 4px 30px; }
  .fan__chip { padding: 4px 5px; }
  .fan__chip span { font-size: .69rem; }
  .fan__chip small { display: none; }
  .fan__head { visibility: hidden; font-size: .7rem; }
  .fan { order: -1; }
  .fan__hint { margin-top: var(--s5); }
  .hero { gap: var(--s5); padding-top: var(--s5); }
  .card, .spec { padding: var(--s7) var(--s4) var(--s5); }
  .target { grid-template-columns: 1fr; }
  .target__swatch { min-height: 90px; }
  .bench { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .obj svg { width: 56px; height: 46px; }
  .near__row { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "sw name de" "sw name acts"; row-gap: 4px; }
  .near__sw { grid-area: sw; } .near__name { grid-area: name; } .near__de { grid-area: de; } .near__acts { grid-area: acts; justify-self: end; }
  .pairs { padding: var(--s4); }
  .pair { min-height: 130px; }
  .surfaces { grid-template-columns: 1fr; }
  .palette { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
  .wall { grid-template-columns: 52px minmax(0, 1fr) auto minmax(0, 1fr) 36px; gap: 6px; }
  .wall__u { display: none; }
  .field-row { grid-template-columns: 1fr; }
  /* phones: the range becomes a list of chip rows */
  .chips { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .chip { grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-rows: auto; gap: 12px; align-items: center; padding: 6px; }
  .chip__swatch { height: 56px; }
  .chip__tab { padding: 0; }
  .chip__acts .mini { min-height: 36px; }
  .spec__table th, .spec__table td { padding-right: 6px; font-size: .9rem; }
  .foot__grid { grid-template-columns: 1fr; }
}
