/*
  Forma. Cool paper, deep teal ink, one orange accent taken from the poppy photo.
  Shape rule: controls are pills, images and panels use --r (16px).
  System fonts only; no remote resources.
*/
:root {
  color-scheme: light dark;
  --bg: #eef2f1;
  --surface: #f9fbfa;
  --sunk: #e1e8e7;
  --ink: #0e2830;
  --muted: #475f66;
  --line: #7b9296;
  --hair: #cbd7d8;
  --accent: #f08a24;
  --accent-ink: #a23f08;
  --on-accent: #0e2830;
  --scrim: rgb(8 24 30 / .62);
  --shadow: 0 1px 2px rgb(14 40 48 / .08), 0 14px 40px -18px rgb(14 40 48 / .35);
  --r: 16px;
  --pill: 999px;
  --font: "Avenir Next", "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1c22;
    --surface: #12303a;
    --sunk: #0f262e;
    --ink: #eaf2f1;
    --muted: #a5bbc0;
    --line: #5f7d84;
    --hair: #234753;
    --accent: #f59a3c;
    --accent-ink: #ffb066;
    --on-accent: #0b1c22;
    --scrim: rgb(2 10 13 / .72);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 14px 40px -18px rgb(0 0 0 / .7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

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

.wrap {
  width: min(1280px, 100% - clamp(32px, 8vw, 96px));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--pill);
  z-index: 100;
}
.skip:focus { top: 12px; }

/* Header */
.top { padding-block: 20px; }
.top__row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.brand {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}
.brand--small { font-size: 1.25rem; }
.top__note { color: var(--muted); font-size: .9375rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  border: 1.5px solid var(--ink);
  border-radius: var(--pill);
  background: transparent;
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s, color .2s;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  min-height: 44px;
  padding: 0 20px;
  background: var(--surface);
}
.btn--close:hover { background: var(--ink); color: var(--bg); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  padding-block: clamp(16px, 3vw, 40px) clamp(40px, 6vw, 72px);
}
.hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 4.25rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.hero h1 span { display: block; color: var(--accent-ink); }
.hero__sub {
  max-width: 34rem;
  margin-block: 24px 32px;
  font-size: 1.1875rem;
  color: var(--muted);
}
.hero__media {
  border-radius: var(--r);
  overflow: hidden;
  aspect-ratio: 4 / 4.2;
  max-height: 460px;
  width: 100%;
  background: var(--sunk);
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; }

/* Toolbar */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-block: 1px solid var(--hair);
}
.toolbar__grid {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) 220px auto;
  gap: 16px 20px;
  align-items: end;
  padding-block: 14px;
}
.toolbar__title {
  align-self: end;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 48px;
  padding-right: 12px;
}
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: .875rem; font-weight: 650; color: var(--muted); }
.field input, .field select {
  width: 100%;
  min-height: 48px;
  padding: 0 20px;
  border: 1.5px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--ink);
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 24px) 52%, calc(100% - 18px) 52%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.field input::placeholder { color: var(--muted); opacity: 1; }
.field input:focus-visible, .field select:focus-visible { outline-offset: 2px; border-color: var(--ink); }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px 0 22px;
  border: 1.5px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s var(--ease), background-color .2s, border-color .2s;
}
.toggle:active { transform: scale(.98); }
.toggle__count {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding-inline: 8px;
  border-radius: var(--pill);
  background: var(--sunk);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.toggle[aria-pressed="true"] .toggle__count { background: var(--on-accent); color: var(--accent); }

.status {
  min-height: 1.5em;
  margin-block: 24px 8px;
  color: var(--muted);
  font-size: .9375rem;
  font-variant-numeric: tabular-nums;
}
.status strong { color: var(--ink); font-weight: 650; }

/* Workshop grid */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px clamp(24px, 3vw, 44px);
  align-items: start;
  padding-block: 16px 96px;
}
.item { position: relative; display: grid; gap: 18px; }
.item:nth-child(3n + 2) { margin-top: 56px; }
.item__img {
  overflow: hidden;
  border-radius: var(--r);
  aspect-ratio: 5 / 4;
  background: var(--sunk);
}
.item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s var(--ease);
}
.item:hover .item__img img { transform: scale(1.04); }
.item__meta { display: flex; justify-content: space-between; gap: 12px; font-size: .9375rem; font-weight: 650; color: var(--accent-ink); }
.item__ended { color: var(--muted); font-weight: 550; }
.item__title { margin-top: 2px; font-size: 1.625rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.item__desc {
  margin-top: 10px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item__when { margin-top: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.item__who { color: var(--muted); font-size: .9375rem; }
.item__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
}
.item__price { font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.item__actions { display: flex; align-items: center; gap: 8px; }

.item__open {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  cursor: pointer;
}
/* The open control stretches across the whole item so the photo and text are clickable. */
.item__open::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
.item__open:focus-visible { outline: none; }
.item__open:focus-visible::after { outline: 3px solid var(--ink); outline-offset: 6px; }

.item__save {
  position: relative;
  z-index: 2;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  font-weight: 650;
  cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s;
}
.item__save:active { transform: scale(.97); }
.item__save[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Skeletons */
.skeleton {
  min-height: 420px;
  border-radius: var(--r);
  background: linear-gradient(100deg, var(--sunk) 30%, var(--hair) 50%, var(--sunk) 70%) 0 0 / 200% 100%;
}
.skeleton:nth-child(3n + 2) { margin-top: 56px; }

/* Empty and error */
.empty {
  max-width: 34rem;
  padding-block: 40px 120px;
}
.empty h3 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.15; }
.empty p { margin-block: 12px 24px; color: var(--muted); }

/* Footer */
.foot { border-top: 1px solid var(--hair); padding-block: 32px; color: var(--muted); font-size: .9375rem; }
.foot__row { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.foot .brand { color: var(--ink); }

/* Detail dialog */
.detail {
  width: min(1040px, 100vw - 48px);
  max-width: none;
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: calc(var(--r) + 4px);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.detail::backdrop { background: var(--scrim); }
.detail__scroll { max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; }
.detail__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 520px; }
.detail__media { position: relative; background: var(--sunk); }
.detail__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail__content { padding: clamp(28px, 4vw, 52px); padding-top: 72px; display: grid; align-content: start; gap: 0; }
.detail__cat { color: var(--accent-ink); font-weight: 700; }
.detail__title { margin-top: 6px; font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.04; text-wrap: balance; }
.detail__body { margin-top: 18px; max-width: 36rem; font-size: 1.125rem; }
.facts {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--hair);
}
.facts dt { font-size: .875rem; font-weight: 650; color: var(--muted); }
.facts dd { font-weight: 650; font-variant-numeric: tabular-nums; }
.detail__note { margin-top: 20px; color: var(--muted); }
.detail__actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.btn--save[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--save[aria-pressed="true"]:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.detail__saved { font-weight: 650; color: var(--accent-ink); }

/* Tablet */
@media (max-width: 1099px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item:nth-child(3n + 2) { margin-top: 0; }
  .item:nth-child(2n) { margin-top: 48px; }
  .skeleton:nth-child(3n + 2) { margin-top: 0; }
  .toolbar__grid { grid-template-columns: minmax(0, 1fr) 200px auto; }
  .toolbar__title { display: none; }
}

@media (max-width: 899px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero__media { aspect-ratio: 16 / 10; max-height: none; order: -1; }
  .hero__copy { display: grid; justify-items: start; }
  .toolbar { position: static; }
}

/* Phone */
@media (max-width: 719px) {
  .top__note { display: none; }
  .hero__sub { font-size: 1.0625rem; margin-block: 16px 24px; }
  .toolbar__grid { grid-template-columns: 1fr 1fr; }
  .field--search { grid-column: 1 / -1; }
  .toggle { justify-content: space-between; }
  .grid { grid-template-columns: 1fr; gap: 44px; padding-bottom: 64px; }
  .item:nth-child(n) { margin-top: 0; }
  .skeleton:nth-child(n) { margin-top: 0; min-height: 360px; }
  .foot__row { flex-direction: column; gap: 8px; }

  .detail {
    width: 100vw;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }
  .detail__scroll { max-height: 100dvh; height: 100dvh; }
  .detail__grid { grid-template-columns: 1fr; min-height: 0; }
  .detail__media { aspect-ratio: 3 / 2; }
  .detail__content { padding: 24px 20px 40px; }
  .btn--primary.btn--save { width: 100%; }
}

/* Motion: entrance and feedback only, and only when allowed. */
@media (prefers-reduced-motion: no-preference) {
  .item { animation: rise .6s var(--ease) both; }
  .item:nth-child(2) { animation-delay: .06s; }
  .item:nth-child(3) { animation-delay: .12s; }
  .item:nth-child(n + 4) { animation-delay: .18s; }
  .hero__copy > * { animation: rise .7s var(--ease) both; }
  .hero__copy > :nth-child(2) { animation-delay: .08s; }
  .hero__copy > :nth-child(3) { animation-delay: .16s; }
  .skeleton { animation: shimmer 1.4s linear infinite; }
  .detail[open] { animation: pop .32s var(--ease); }
  .detail[open]::backdrop { animation: fade .25s ease-out; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
