:root {
  color-scheme: light dark;
  --page: #f2f3f5;
  --surface: #e5e7eb;
  --surface-raised: #fafafa;
  --ink: #15171b;
  --muted: #555b66;
  --line: #b9bec7;
  --accent: #1747d1;
  --accent-ink: #f8faff;
  --radius: 14px;
  --page-gutter: clamp(1rem, 3.5vw, 3.75rem);
  --max-width: 1440px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #17181b;
    --surface: #25272c;
    --surface-raised: #1e2024;
    --ink: #f0f2f5;
    --muted: #afb4be;
    --line: #464a53;
    --accent: #7395ff;
    --accent-ink: #111b3b;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: "Arial Narrow", "Avenir Next Condensed", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 10;
  transform: translateY(-160%);
  padding: .75rem 1rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--page);
}

.skip-link:focus { transform: translateY(0); }

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

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, var(--max-width));
  height: 72px;
  margin: 0 auto;
  padding: 0 var(--page-gutter);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  gap: .08em;
  align-items: flex-start;
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.07em;
  line-height: 1;
  text-decoration: none;
}

.wordmark span { color: var(--accent); }

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 3vw, 2.75rem);
  font-size: .88rem;
  font-weight: 650;
}

.site-header nav a { text-decoration: none; }
.site-header nav a:hover { color: var(--accent); }

.nav-shortlist {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .58rem .7rem .58rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--ease);
}

.nav-shortlist:hover,
.nav-shortlist[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--page);
}

.nav-shortlist:active, .primary-link:active, button:active { transform: translateY(1px); }

.saved-count {
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(420px, 1.15fr);
  gap: clamp(1.75rem, 5vw, 6.25rem);
  align-items: center;
  width: min(100%, var(--max-width));
  min-height: calc(100dvh - 72px);
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4.5rem) var(--page-gutter);
}

.hero-copy { align-self: center; }

.eyebrow {
  margin: 0 0 1.5rem;
  color: var(--accent);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 8.8ch;
  margin-bottom: 1.5rem;
  font-size: clamp(3.4rem, 6.3vw, 6.8rem);
  font-weight: 750;
  letter-spacing: -.075em;
  line-height: .88;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 34rem;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  min-width: 13rem;
  padding: .9rem 1rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .9rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .3s var(--ease), filter .3s;
}

.primary-link:hover { filter: brightness(1.12); transform: translateY(-2px); }

.hero-image-wrap {
  position: relative;
  margin: 0;
  align-self: stretch;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}

.hero-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalogue {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: clamp(4.5rem, 9vw, 8rem) var(--page-gutter);
}

.catalogue-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(2.25rem, 5vw, 4rem);
}

.catalogue-heading h2 {
  max-width: 10ch;
  margin-bottom: 0;
  font-size: clamp(2.6rem, 5vw, 5.1rem);
  font-weight: 750;
  letter-spacing: -.065em;
  line-height: .94;
}

.result-status {
  flex: none;
  margin: 0 0 .45rem;
  color: var(--muted);
  font-size: .82rem;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, .3fr);
  gap: 1px;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.field {
  min-width: 0;
  padding: .85rem 1rem .95rem;
  background: var(--page);
}

.field label {
  display: block;
  margin-bottom: .35rem;
  color: var(--muted);
  font-size: .69rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.input-wrap { display: flex; align-items: center; gap: 1rem; }

input, select {
  width: 100%;
  min-height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 600;
}

input::placeholder { color: var(--muted); opacity: .9; }
input:focus, select:focus { outline: 0; }

.field:focus-within {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.clear-search {
  flex: none;
  padding: .35rem .55rem;
  border: 0;
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: .75rem;
  font-weight: 700;
}

.workshop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(3rem, 7vw, 7rem) clamp(1.25rem, 4vw, 4rem);
}

.workshop-card {
  min-width: 0;
  opacity: 0;
  transform: translateY(18px);
}

.workshop-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  transition-delay: calc(var(--index) * 55ms);
}

.workshop-card:nth-child(even) { margin-top: clamp(3rem, 9vw, 9rem); }

.card-image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}

.workshop-card:nth-child(3n + 2) .card-image { aspect-ratio: 1 / 1; }
.workshop-card:nth-child(3n) .card-image { aspect-ratio: 5 / 4; }

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s var(--ease), filter .35s;
}

.workshop-card:hover .card-image img { transform: scale(1.025); }

.saved-flag {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: .42rem .6rem;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .7rem;
  font-weight: 800;
}

.card-header {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  margin: 1rem 0 .6rem;
}

.card-header h3 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2.6vw, 2.45rem);
  font-weight: 750;
  letter-spacing: -.045em;
  line-height: 1;
}

.card-header p {
  flex: none;
  margin: 0;
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 750;
}

.card-meta {
  margin-bottom: .9rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
}

.card-description {
  max-width: 48ch;
  margin-bottom: 1.2rem;
  color: var(--muted);
  font-size: .93rem;
}

.open-item {
  padding: 0 0 .25rem;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 750;
  transition: color .2s, transform .2s;
}

.open-item:hover { color: var(--accent); }

.skeleton { min-height: 34rem; }
.skeleton span, .skeleton i, .skeleton b {
  display: block;
  border-radius: var(--radius);
  background: var(--surface);
}
.skeleton span { aspect-ratio: 4 / 3; }
.skeleton i { width: 64%; height: 2.1rem; margin-top: 1rem; }
.skeleton b { width: 36%; height: .9rem; margin-top: 1rem; }

.empty-state, .error-state {
  padding: clamp(3rem, 8vw, 7rem) 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.empty-state[hidden], .error-state[hidden] { display: none; }
.empty-mark { margin-bottom: .5rem; color: var(--accent); font-size: 4rem; line-height: 1; }
.empty-state h3, .error-state h3 { margin-bottom: .5rem; font-size: 1.8rem; letter-spacing: -.03em; }
.empty-state > p:not(.empty-mark), .error-state p { color: var(--muted); }

.secondary-button {
  padding: .8rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-weight: 750;
}

.secondary-button:hover { background: var(--ink); color: var(--page); }

footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 1rem;
  width: min(100%, var(--max-width));
  min-height: 13rem;
  margin: 0 auto;
  padding: 3rem var(--page-gutter);
  border-top: 1px solid var(--line);
}

footer p { margin: 0; color: var(--muted); font-size: .78rem; }
footer p:last-child { justify-self: end; }

dialog {
  width: min(1120px, calc(100vw - 3rem));
  max-width: none;
  max-height: calc(100dvh - 3rem);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 28px 100px rgba(15, 20, 35, .28);
}

dialog::backdrop {
  background: rgba(15, 17, 21, .68);
  backdrop-filter: blur(8px);
}

dialog[open] { animation: dialog-in .4s var(--ease) both; }

.detail-shell {
  position: relative;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  height: min(760px, calc(100dvh - 3rem));
}

.detail-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .55rem .7rem;
  border: 0;
  border-radius: 8px;
  background: rgba(20, 22, 26, .88);
  color: #f2f3f5;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 700;
}

.detail-close span { font-size: 1.25rem; font-weight: 400; line-height: .7; }

.detail-media { min-height: 0; background: var(--surface); }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }

.detail-content {
  overflow-y: auto;
  padding: clamp(4.5rem, 7vw, 7rem) clamp(1.5rem, 4vw, 4.5rem) 2.5rem;
}

.detail-category {
  margin-bottom: 1.2rem;
  color: var(--accent);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.detail-content h2 {
  max-width: 9ch;
  margin-bottom: 1.5rem;
  font-size: clamp(3rem, 5vw, 5.8rem);
  font-weight: 750;
  letter-spacing: -.07em;
  line-height: .9;
}

.detail-body { max-width: 42ch; margin-bottom: 2.25rem; color: var(--muted); font-size: 1.02rem; }

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1rem;
  margin: 0 0 2.5rem;
}

.detail-facts div { min-width: 0; }
.detail-facts dt { margin-bottom: .15rem; color: var(--muted); font-size: .7rem; font-weight: 700; }
.detail-facts dd { margin: 0; font-size: .93rem; font-weight: 750; }

.save-button {
  width: 100%;
  padding: .95rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
  transition: filter .2s, transform .2s, background-color .2s, color .2s;
}

.save-button:hover { filter: brightness(1.1); }
.save-button[aria-pressed="true"] { background: transparent; color: var(--accent); }
.save-note { margin: .75rem 0 0; color: var(--muted); font-size: .72rem; text-align: center; }

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 767px) {
  :root { --page-gutter: 1rem; --radius: 12px; }
  html { scroll-padding-top: 5rem; }
  .site-header { height: 64px; }
  .site-header nav > a { display: none; }
  .nav-shortlist { padding: .45rem .55rem .45rem .75rem; }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    min-height: calc(100dvh - 64px);
    padding-top: 2.25rem;
    padding-bottom: 1rem;
  }

  .hero-copy { align-self: start; }
  .eyebrow { margin-bottom: 1rem; }
  h1 { max-width: 8.6ch; margin-bottom: 1rem; font-size: clamp(3.2rem, 15vw, 4.25rem); }
  .hero-copy > p:not(.eyebrow) { margin-bottom: 1.4rem; font-size: .98rem; }
  .primary-link { min-width: 12.5rem; }
  .hero-image-wrap { min-height: 0; aspect-ratio: 16 / 10; }

  .catalogue { padding-top: 5rem; padding-bottom: 5rem; }
  .catalogue-heading { display: block; margin-bottom: 2rem; }
  .catalogue-heading h2 { max-width: 9ch; margin-bottom: 1rem; font-size: 3rem; }
  .result-status { margin: 0; }
  .filter-bar { grid-template-columns: 1fr; }
  .workshop-grid { grid-template-columns: 1fr; gap: 3.5rem; }
  .workshop-card:nth-child(even) { margin-top: 0; }
  .workshop-card:nth-child(n) .card-image { aspect-ratio: 4 / 3; }
  .card-header h3 { font-size: 2rem; }
  .card-description { font-size: .9rem; }
  .skeleton { min-height: 29rem; }

  footer { grid-template-columns: 1fr auto; min-height: 11rem; }
  footer p:nth-of-type(1) { display: none; }

  dialog {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .detail-shell {
    display: block;
    height: 100dvh;
    overflow-y: auto;
  }

  .detail-media { height: 42dvh; min-height: 290px; }
  .detail-content { overflow: visible; padding: 2.25rem 1rem 3rem; }
  .detail-content h2 { font-size: 3.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .workshop-card { opacity: 1; transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .detail-close { backdrop-filter: none; background: #202126; }
  dialog::backdrop { backdrop-filter: none; }
}
