/* Forma — paint-chip workshop board.
   Cobalt ground, one swatch colour per craft, navy ink. */

:root {
  --ground: #2331b5;
  --ink: #0a0f3a;
  --ink-soft: #1d2468;
  --chalk: #f8f5ff;
  --chalk-soft: #d9ddff;
  --sun: #ffd23f;

  --clay: #ff7d52;
  --wash: #b4c4ff;
  --petal: #ff9fc9;
  --crust: #ffd23f;

  --display: Rockwell, "Rockwell Nova", "Roboto Slab", "Sitka Heading", Georgia, serif;
  --body: "Gill Sans", "Gill Sans MT", "Gill Sans Nova", Calibri, "Trebuchet MS", sans-serif;

  --pad: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --focus: var(--sun);
}

[data-cat="Ceramics"] { --c: var(--clay); }
[data-cat="Painting"] { --c: var(--wash); }
[data-cat="Floristry"] { --c: var(--petal); }
[data-cat="Baking"] { --c: var(--crust); }

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

html {
  background: var(--ground);
  scroll-behavior: smooth;
  scrollbar-color: var(--sun) var(--ink);
  -webkit-text-size-adjust: 100%;
}
html.lock { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--chalk);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.5;
  caret-color: var(--sun);
}

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

h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

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

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

.skip {
  position: absolute; left: 12px; top: -64px; z-index: 100;
  background: var(--sun); color: var(--ink); padding: 12px 16px; font-weight: 700;
}
.skip:focus { top: 12px; }

.ico {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter;
}
[aria-pressed="true"] > .ico { fill: currentColor; }

.badge {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 26px; padding: 0 7px;
  background: var(--chalk); color: var(--ink);
  font-size: 0.875rem; font-weight: 700; font-variant-numeric: tabular-nums;
}

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

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--pad);
}
.wordmark {
  font-family: var(--display); font-weight: 700; font-size: 2rem; line-height: 1;
  letter-spacing: -0.02em; color: var(--chalk); text-decoration: none;
}
.top-saved {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 16px;
  background: transparent; border: 2px solid var(--chalk); color: var(--chalk);
  font-weight: 600;
  transition: background-color 0.2s, color 0.2s;
}
.top-saved:hover { background: var(--chalk); color: var(--ink); }
.top-saved:hover .badge { background: var(--ink); color: var(--chalk); }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: end;
  padding: 28px var(--pad) 72px;
}
.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(3rem, 6.4vw, 5.5rem);
  line-height: 0.98; letter-spacing: -0.025em;
  text-wrap: balance; color: var(--chalk);
}
.hero-lede {
  margin-top: 28px; max-width: 44ch;
  font-size: 1.25rem; line-height: 1.45; color: var(--chalk-soft);
}
.cta {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 32px; min-height: 56px; padding: 0 24px;
  background: var(--sun); color: var(--ink);
  font-weight: 700; font-size: 1.125rem; text-decoration: none;
  transition: transform 0.25s var(--ease);
}
.cta:hover { transform: translateY(3px); }
.cta .ico { transition: transform 0.25s var(--ease); }
.cta:hover .ico { transform: translateY(3px); }

.chips {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; align-items: end;
}
.chip {
  --h: 200px;
  position: relative; display: flex; flex-direction: column;
  padding: 0; border: 0; text-align: left;
  background: var(--c); color: var(--ink);
  transition: transform 0.35s var(--ease), opacity 0.25s;
}
.chip:nth-child(1) { --h: 150px; }
.chip:nth-child(2) { --h: 250px; }
.chip:nth-child(3) { --h: 200px; }
.chip:nth-child(4) { --h: 300px; }
.chip img { width: 100%; height: var(--h); object-fit: cover; }
.chip::before, .row::after {
  content: ""; position: absolute; z-index: 1;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ground);
}
.chip::before { top: 12px; right: 12px; }
.chip-lab { display: grid; gap: 2px; padding: 14px 14px 18px; }
.chip-name { font-family: var(--display); font-weight: 700; font-size: 1.3rem; line-height: 1.1; }
.chip-n { font-size: 0.9375rem; color: var(--ink-soft); }
.chip:hover { transform: translateY(-8px); }
.chip[aria-pressed="true"] {
  transform: translateY(-14px);
  outline: 3px solid var(--chalk); outline-offset: 4px;
}
.chip[aria-pressed="true"]:focus-visible { outline-color: var(--sun); outline-offset: 6px; }
.chips:has([aria-pressed="true"]) .chip[aria-pressed="false"] { opacity: 0.7; }
.hint { margin-top: 28px; font-size: 0.9375rem; color: var(--chalk-soft); }

/* ---------- finder: toolbar ---------- */

.finder { scroll-margin-top: 0; }

.bar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: minmax(0, 1fr) 240px auto;
  gap: 16px; align-items: end;
  padding: 16px var(--pad) 18px;
  background: var(--ink);
  --focus: var(--sun);
}
.field { display: grid; gap: 6px; }
.field label { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.04em; color: var(--chalk-soft); }
.field input, .field select {
  width: 100%; height: 52px; padding: 0 14px; border-radius: 0;
  border: 2px solid var(--chalk); background: var(--chalk); color: var(--ink);
  appearance: none; -webkit-appearance: none;
}
.field input::placeholder { color: #4a5090; opacity: 1; }
.field input::-webkit-search-cancel-button { filter: none; cursor: pointer; }
.field select {
  padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a0f3a' stroke-width='2.4'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 22px;
}
.saved-toggle {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  height: 52px; padding: 0 18px;
  background: transparent; border: 2px solid var(--chalk); color: var(--chalk);
  font-weight: 700; white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.saved-toggle:hover { background: rgba(248, 245, 255, 0.14); }
.saved-toggle[aria-pressed="true"] { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.saved-toggle[aria-pressed="true"] .badge { background: var(--ink); color: var(--sun); }

.status {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
  padding: 28px var(--pad) 20px;
}
.status p { font-size: 1.0625rem; color: var(--chalk-soft); font-variant-numeric: tabular-nums; }
.status strong { color: var(--chalk); }
.reset {
  background: none; border: 0; padding: 6px 0; font-weight: 700;
  color: var(--sun); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px;
}
.reset[hidden] { display: none; }

/* ---------- workshop rows ---------- */

#results { padding: 0 var(--pad) 96px; }
.list { display: grid; gap: 14px; }

.row {
  --focus: var(--ink);
  position: relative;
  display: grid;
  grid-template-columns: 136px 250px minmax(0, 1fr) 230px;
  min-height: 210px;
  background: var(--c); color: var(--ink);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.row::after { top: 14px; left: 60px; }
.row:hover { transform: translateY(-3px); box-shadow: 0 18px 28px -16px rgba(4, 6, 36, 0.7); }
.list.enter .row { animation: swatch-in 0.55s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes swatch-in {
  from { clip-path: inset(0 100% 0 0); transform: translateX(-12px); }
  to { clip-path: inset(0 0 0 0); transform: none; }
}

.stub {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 44px 18px 18px;
  border-right: 2px dashed var(--ink);
}
.wk { font-size: 0.875rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.day {
  margin-top: 2px;
  font-family: var(--display); font-weight: 700; font-size: 4.25rem; line-height: 0.95;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.mo { font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.cat { margin-top: auto; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

.pic { position: relative; overflow: hidden; background: var(--ink); }
.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.info { padding: 26px 28px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.info h3 { font-family: var(--display); font-weight: 700; font-size: 2.1rem; line-height: 1.05; letter-spacing: -0.015em; text-wrap: balance; }
.desc { max-width: 56ch; color: var(--ink); }
.meta { margin-top: auto; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.buy {
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  padding: 26px 24px 24px 0;
}
.price { font-family: var(--display); font-weight: 700; font-size: 2.75rem; line-height: 1; font-variant-numeric: tabular-nums; }
.seats { margin-top: 4px; font-weight: 600; color: var(--ink-soft); }
.acts { display: flex; gap: 8px; width: 100%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 18px; border: 2px solid var(--ink); border-radius: 0;
  font-weight: 700; background: var(--ink); color: var(--chalk);
  transition: background-color 0.2s, color 0.2s;
}
.open { flex: 1; }
.open::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.open:focus-visible { outline: none; }
.open:focus-visible::after { outline: 3px solid var(--ink); outline-offset: -8px; }
.row:hover .open { background: var(--chalk); color: var(--ink); }

.row-save {
  position: relative; z-index: 2; flex: none;
  width: 52px; height: 52px; padding: 0; display: grid; place-items: center;
  background: transparent; border: 2px solid var(--ink); color: var(--ink);
  transition: background-color 0.2s, color 0.2s;
}
.row-save:hover { background: rgba(10, 15, 58, 0.14); }
.row-save[aria-pressed="true"] { background: var(--ink); color: var(--c); }

/* ---------- empty / error ---------- */

.empty {
  display: grid; justify-items: start; gap: 14px;
  padding: clamp(28px, 5vw, 56px); background: var(--chalk); color: var(--ink);
  --focus: var(--ink);
}
.empty h3 { font-family: var(--display); font-weight: 700; font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.05; }
.empty p { max-width: 52ch; color: var(--ink-soft); }
.empty .btn { margin-top: 6px; }

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

.foot-band { display: grid; grid-template-columns: 1fr 1fr; background: var(--ink); }
.foot-band img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; }
.foot-copy {
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  padding: clamp(28px, 5vw, 72px);
}
.foot-copy p { max-width: 46ch; color: var(--chalk-soft); }
.foot-mark { font-family: var(--display); font-weight: 700; font-size: 2.5rem; line-height: 1; color: var(--chalk) !important; }
.foot-copy .fine { font-size: 0.9375rem; }

/* ---------- detail sheet ---------- */

.detail-dialog {
  width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink);
  --focus: var(--ink);
}
.detail-dialog[open] { display: flex; justify-content: flex-end; }
.detail-dialog::backdrop { background: rgba(6, 9, 40, 0.72); }

.sheet {
  position: relative;
  width: min(700px, 100%); height: 100%;
  display: flex; flex-direction: column; overflow-y: auto;
  background: var(--c);
  scrollbar-color: var(--ink) var(--c);
}
.detail-dialog[open] .sheet { animation: sheet-in 0.45s var(--ease) both; }
@keyframes sheet-in { from { transform: translateX(48px); opacity: 0; } to { transform: none; opacity: 1; } }

.sheet-top {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--c); border-bottom: 2px solid var(--ink);
}
.close { height: 48px; padding: 0 16px 0 12px; background: transparent; color: var(--ink); }
.close:hover { background: var(--ink); color: var(--c); }
.sheet-cat { font-size: 0.875rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }

.sheet-pic { position: relative; flex: none; height: clamp(180px, 30vh, 300px); background: var(--ink); }
.sheet-pic img { width: 100%; height: 100%; object-fit: cover; }
.sheet-pic::after {
  content: ""; position: absolute; top: 16px; left: 20px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--c);
}

.sheet-body { padding: 32px 28px 28px; display: grid; gap: 18px; align-content: start; flex: 1; }
.sheet-body h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.25rem, 6vw, 3.5rem); line-height: 1; letter-spacing: -0.025em; text-wrap: balance;
}
.lede { font-size: 1.25rem; line-height: 1.45; max-width: 52ch; }

.spec {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px; border-top: 2px solid var(--ink);
}
.spec div { padding: 14px 0 14px; border-bottom: 1px solid rgba(10, 15, 58, 0.45); }
.spec div:nth-child(odd) { padding-right: 16px; }
.spec dt { font-size: 0.875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.spec dd { font-family: var(--display); font-weight: 700; font-size: 1.35rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.spec .wide { grid-column: 1 / -1; padding-right: 0; }

.note { font-size: 0.9375rem; color: var(--ink-soft); }

.sheet-foot {
  position: sticky; bottom: 0; z-index: 3;
  padding: 16px 28px 20px; background: var(--c); border-top: 2px solid var(--ink);
}
.save-btn { width: 100%; height: 58px; font-size: 1.125rem; }
.save-btn:hover { background: var(--chalk); color: var(--ink); }
.save-btn[aria-pressed="true"] { background: var(--chalk); color: var(--ink); }
.save-btn[aria-pressed="true"]:hover { background: var(--ink); color: var(--chalk); }
.save-btn[aria-pressed="true"] .ico { fill: currentColor; }

/* ---------- tablet ---------- */

@media (max-width: 1020px) {
  .hero { grid-template-columns: 1fr; align-items: start; padding-bottom: 56px; }
  .hero-chips { max-width: 640px; }
  .row {
    grid-template-columns: 120px 200px minmax(0, 1fr);
    grid-template-areas: "stub pic info" "stub pic buy";
  }
  .stub { grid-area: stub; }
  .pic { grid-area: pic; }
  .info { grid-area: info; padding-bottom: 8px; }
  .buy { grid-area: buy; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 24px 24px 28px; }
  .acts { width: auto; }
  .open { flex: none; }
  .row::after { left: 52px; }
}

/* ---------- mobile ---------- */

@media (max-width: 680px) {
  body { font-size: 1rem; }
  .top { padding-block: 14px; }
  .wordmark { font-size: 1.75rem; }
  .top-saved { padding: 0 12px; }

  .hero { padding-top: 12px; padding-bottom: 40px; gap: 28px; }
  .hero-lede { margin-top: 18px; font-size: 1.125rem; }
  .cta { margin-top: 24px; }
  .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .chip, .chip:nth-child(n) { --h: 84px; }
  .chip:hover { transform: none; }
  .chip[aria-pressed="true"] { transform: none; outline-offset: 3px; }
  .chip-lab { padding: 10px 12px 12px; }
  .chip-name { font-size: 1.15rem; }
  .hint { margin-top: 18px; }

  .bar {
    position: static;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px; padding: 14px var(--pad) 16px;
  }
  .field-search { grid-column: 1 / -1; }
  .saved-toggle { padding: 0 14px; }

  .status { padding-top: 22px; padding-bottom: 16px; }
  #results { padding-bottom: 64px; }

  .row {
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-areas: "stub pic" "info info" "buy buy";
    min-height: 0;
  }
  .row::after { left: 40px; }
  .stub { padding: 40px 12px 14px; min-height: 168px; }
  .day { font-size: 3.25rem; }
  .pic { min-height: 168px; }
  .info { padding: 18px 18px 6px; }
  .info h3 { font-size: 1.75rem; }
  .meta { margin-top: 4px; }
  .buy { padding: 12px 18px 18px; align-items: flex-end; }
  .price { font-size: 2.25rem; }

  .foot-band { grid-template-columns: 1fr; }
  .foot-band img { min-height: 220px; height: 220px; }

  .sheet { width: 100%; }
  .sheet-top { padding: 8px 12px; }
  .sheet-body { padding: 24px 20px 20px; }
  .lede { font-size: 1.125rem; }
  .sheet-foot { padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); }
  .spec dd { font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
  .row:hover, .chip:hover, .cta:hover { transform: none; }
}
