/* ==========================================================================
   Forma — a screen-print-flavoured programme for weekend workshops.
   Palette is ink-on-petrol; saturated process colours encode category.
   ========================================================================== */

@font-face {
  font-family: "Syne";
  src: url("assets/syne-variable.woff2") format("woff2");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk-variable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Ink and paper */
  --bg: #0e1a24;
  --bg-2: #14232f;
  --bg-3: #1b2e3c;
  --line: #263b49;
  --line-strong: #3a576a;
  --text: #f0ebdd;
  --text-dim: #9dabb5;

  /* Process colours */
  --teal: #3fc9be;
  --gold: #f0b23e;
  --rose: #ff6fa0;
  --blue: #7d96ff;
  --focus: #3fc9be;

  --cat: var(--teal);

  --wrap: 1200px;
  --pad: clamp(20px, 5vw, 56px);
  --radius: 2px;

  --font-display: "Syne", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Space Grotesk", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

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

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--teal);
  color: #052a27;
  padding: 10px 16px;
  text-decoration: none;
  font-weight: 600;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 16px;
}

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

.masthead {
  border-bottom: 1px solid var(--line);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 20px;
}

.wordmark {
  display: inline-flex;
  flex-direction: column;
  gap: 7px;
  text-decoration: none;
}
.wordmark__text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 25px;
  letter-spacing: 0.01em;
  line-height: 1;
}
.wordmark__rule {
  height: 2px;
  background: var(--teal);
}

.masthead__side {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
}

.masthead__season {
  display: flex;
  flex-direction: column;
  text-align: right;
  line-height: 1.35;
}
.masthead__season-name {
  font-size: 13.5px;
  color: var(--text);
}
.masthead__season-dates {
  font-size: 12.5px;
  color: var(--text-dim);
}

.saved-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px 8px 12px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-dim);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.saved-toggle:hover {
  color: var(--text);
  border-color: var(--text-dim);
}
.saved-toggle[aria-pressed="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: #052a27;
}
.saved-toggle__star svg {
  width: 15px;
  height: 15px;
  display: block;
}
.saved-toggle__star path {
  fill: currentColor;
}
.saved-toggle__count {
  min-width: 20px;
  padding: 0 5px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.saved-toggle[aria-pressed="true"] .saved-toggle__count {
  background: rgba(5, 42, 39, 0.18);
}

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

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(32px, 5vw, 76px);
  padding-block: clamp(48px, 7vw, 96px) clamp(40px, 6vw, 84px);
}

.hero__kicker {
  font-size: 14px;
  color: var(--teal);
  margin-bottom: 20px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 6vw, 4.7rem);
  line-height: 1.01;
  letter-spacing: -0.02em;
  max-width: 13ch;
}

.hero__lede {
  margin-top: 26px;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  color: var(--text-dim);
  max-width: 44ch;
  line-height: 1.62;
}

.hero__jump {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  font-size: 15px;
  text-decoration: none;
}
.hero__jump-line {
  display: block;
  width: 46px;
  height: 1px;
  background: var(--teal);
  transition: width 0.22s ease;
}
.hero__jump:hover .hero__jump-line,
.hero__jump:focus-visible .hero__jump-line {
  width: 74px;
}

.hero__plate {
  position: relative;
  isolation: isolate;
}
.hero__plate::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 16px -16px -16px 16px;
  border: 1px solid var(--teal);
}
.plate-frame {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line-strong);
  background: var(--bg-3);
}
.plate-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.04);
}
.hero__plate figcaption {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------------------------------------------------------------- controls */

.programme {
  padding-bottom: clamp(48px, 6vw, 88px);
  scroll-margin-top: 96px;
}

.controls {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px 22px;
  padding-block: 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.field > label,
.field__legend {
  font-size: 12.5px;
  color: var(--text-dim);
}

.field__input {
  position: relative;
  display: flex;
  align-items: center;
}

.field input,
.field select {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 11px 14px;
  appearance: none;
  cursor: text;
}
.field select {
  cursor: pointer;
  padding-right: 38px;
}
.field input::placeholder {
  color: var(--text-dim);
  opacity: 0.72;
}
.field input:focus-visible,
.field select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
}
.field--search .field__input input {
  padding-left: 42px;
}
.field__icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 1.6;
  pointer-events: none;
}
.field__chevron {
  position: absolute;
  right: 13px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 1.7;
  pointer-events: none;
}

.field--pills {
  align-items: flex-start;
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.pill:hover {
  color: var(--text);
  border-color: var(--text-dim);
}
.pill[aria-pressed="true"] {
  color: var(--text);
  background: var(--bg-3);
  border-color: var(--line-strong);
}
.pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}
.pill__dot[data-cat="Baking"] {
  background: var(--gold);
}
.pill__dot[data-cat="Ceramics"] {
  background: var(--teal);
}
.pill__dot[data-cat="Floristry"] {
  background: var(--rose);
}
.pill__dot[data-cat="Painting"] {
  background: var(--blue);
}

/* -------------------------------------------------------------- programme */

.programme__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 30px 14px;
}
.programme__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: -0.01em;
}
.programme__count {
  font-size: 13.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.item {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 208px;
  gap: 26px;
  align-items: start;
  padding: 28px 24px 28px 28px;
  border-left: 4px solid var(--cat);
  border-bottom: 1px solid var(--line);
  transition: background 0.18s ease;
}
.item:hover {
  background: var(--bg-2);
}

.item__date {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1;
  padding-top: 2px;
}
.item__dow {
  font-size: 12.5px;
  color: var(--text-dim);
}
.item__day {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  color: var(--cat);
  letter-spacing: -0.02em;
}
.item__mon {
  font-size: 12.5px;
  color: var(--text-dim);
}

.item__cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cat);
}
.item__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  line-height: 1.12;
  margin-top: 12px;
  letter-spacing: -0.01em;
}
.item__desc {
  margin-top: 10px;
  font-size: 15.5px;
  color: var(--text-dim);
  max-width: 58ch;
}

.item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 30px;
  margin-top: 18px;
}
.item__meta > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.item__meta dt {
  font-size: 11.5px;
  color: var(--text-dim);
  opacity: 0.85;
}
.item__meta dd {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.item__action {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}
.item__saved-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--cat);
}
.item__saved-tag svg {
  width: 13px;
  height: 13px;
}
.item__saved-tag path {
  fill: currentColor;
}

.item__plate {
  border: 1px solid var(--line);
  background: var(--bg-3);
  overflow: hidden;
}
.item__plate img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.05);
  transition: filter 0.25s ease;
}
.item:hover .item__plate img {
  filter: saturate(1) contrast(1.05);
}

/* ------------------------------------------------------------------ buttons */

.btn {
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  border-radius: var(--radius);
}
.btn--open {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-strong);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.item:hover .btn--open {
  border-color: var(--cat);
  color: var(--cat);
}
.btn--ghost {
  padding: 10px 18px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-strong);
}
.btn--ghost:hover {
  border-color: var(--teal);
  color: var(--teal);
}

/* -------------------------------------------------------------- empty state */

.empty {
  margin-top: 40px;
  padding: 48px 32px;
  border: 1px dashed var(--line-strong);
  text-align: left;
  max-width: 52ch;
}
.empty__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
}
.empty__text {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 15.5px;
}
.empty .btn {
  margin-top: 22px;
}

/* -------------------------------------------------------------- studio note */

.studio-note {
  padding-block: clamp(40px, 5vw, 72px);
  border-top: 1px solid var(--line);
}
.studio-note__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
}
.studio-note__facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin-top: 28px;
}
.studio-note__facts > div {
  padding-top: 16px;
  border-top: 2px solid var(--line-strong);
}
.studio-note__facts dt {
  font-size: 12.5px;
  color: var(--teal);
  margin-bottom: 8px;
}
.studio-note__facts dd {
  font-size: 15px;
  color: var(--text-dim);
}

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

.footer {
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
.footer__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px 40px;
  align-items: center;
  padding-block: 34px;
  font-size: 13px;
  color: var(--text-dim);
}
.footer__brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
}
.footer__note a {
  color: var(--text-dim);
}
.footer__meta {
  white-space: nowrap;
}

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

.detail {
  width: min(1040px, calc(100vw - 40px));
  max-width: none;
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--text);
  border-radius: var(--radius);
  overflow: hidden;
}
.detail::backdrop {
  background: rgba(4, 9, 14, 0.72);
}
.detail[open] {
  animation: detail-in 0.22s ease both;
}
@keyframes detail-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.detail__shell {
  position: relative;
  max-height: calc(100vh - 42px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
.detail__close:hover {
  border-color: var(--cat);
  color: var(--cat);
}
.detail__close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.detail__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 520px;
}

.detail__plate {
  background: var(--bg-3);
  border-right: 1px solid var(--line);
}
.detail__plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.95) contrast(1.04);
}

.detail__content {
  padding: clamp(28px, 4vw, 52px);
  display: flex;
  flex-direction: column;
}

.detail__cat {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cat);
}
.detail__cat::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--cat);
}

.detail__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin-top: 16px;
}

.detail__body {
  margin-top: 20px;
  font-size: 17px;
  color: var(--text-dim);
  max-width: 52ch;
}

.detail__meta {
  margin-top: 28px;
  border-top: 1px solid var(--line);
}
.detail__meta > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.detail__meta dt {
  font-size: 13px;
  color: var(--text-dim);
}
.detail__meta dd {
  font-size: 15px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.detail__actions {
  margin-top: auto;
  padding-top: 30px;
}

.save-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
  padding: 14px 20px;
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.save-btn:hover {
  border-color: var(--cat);
  color: var(--cat);
}
.save-btn[aria-pressed="true"] {
  background: var(--cat);
  border-color: var(--cat);
  color: #071a24;
}
.save-btn__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.save-btn__icon path {
  fill: currentColor;
}
.detail__hint {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-dim);
  text-align: center;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .hero__title {
    max-width: 16ch;
  }
  .hero__plate {
    max-width: 620px;
  }
  .controls {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: end;
  }
  .field--pills {
    grid-column: 1 / -1;
  }
  .item {
    grid-template-columns: 76px minmax(0, 1fr) 168px;
    gap: 20px;
  }
  .studio-note__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail__grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .detail__plate {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .detail__plate img {
    aspect-ratio: 16 / 9;
    height: auto;
  }
  .detail__actions {
    margin-top: 32px;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 16px;
  }
  .masthead__inner {
    align-items: flex-start;
  }
  .masthead__season {
    text-align: left;
  }
  .masthead__side {
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
  }
  .controls {
    grid-template-columns: 1fr;
    padding-block: 14px;
    position: static;
  }
  .field--pills {
    grid-column: auto;
  }
  .programme__head {
    padding-top: 24px;
  }
  .item {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 22px 18px 26px 22px;
  }
  .item__plate {
    order: -1;
  }
  .item__plate img {
    aspect-ratio: 16 / 10;
  }
  .item__date {
    flex-direction: row;
    align-items: baseline;
    gap: 9px;
  }
  .item__day {
    font-size: 30px;
  }
  .item__meta {
    gap: 10px 24px;
  }
  .studio-note__facts {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .footer__inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .detail {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
  .detail__close-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .detail__close {
    padding: 9px;
  }
  .detail__content {
    padding: 24px 22px 28px;
  }
}

/* -------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
