/* ==========================================================================
   Forma - hands-on creative workshops
   Plain CSS, no build step. Self-hosted fonts, local icons and photos.
   Palette: bone paper + deep pine ink + a single marigold accent (light and dark).
   ========================================================================== */

/* --- Fonts (self-hosted, downloaded during generation) ------------------- */
@font-face {
  font-family: "Syne";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("assets/fonts/syne-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/archivo-latin.woff2") format("woff2");
}

/* --- Design tokens ------------------------------------------------------- */
:root {
  --paper: #f3f0e7;
  --paper-2: #eae6da;
  --surface: #fbf9f3;
  --surface-2: #f0ede3;
  --ink: #15231c;
  --text: #39433b;
  --muted: #5b6459;
  --line: #d6d1c2;
  --line-soft: #e2ddcf;
  --brand: #1e4d3b;
  --brand-soft: #dbe6de;
  --accent: #e5a02c;
  --accent-strong: #d38f1c;
  --accent-ink: #3a2a06;
  --shadow: 20px 24px 60px -34px rgba(21, 35, 27, 0.45);
  --shadow-sm: 0 2px 6px -3px rgba(21, 35, 27, 0.4);

  --radius-card: 16px;
  --radius-input: 12px;
  --radius-pill: 999px;

  --container: 1240px;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --header-h: 64px;

  --font-display: "Syne", "Avenir Next", "Trebuchet MS", sans-serif;
  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1913;
    --paper-2: #0a130e;
    --surface: #16241d;
    --surface-2: #1b2b23;
    --ink: #f1eee2;
    --text: #c8cec5;
    --muted: #939f93;
    --line: #2b3a31;
    --line-soft: #223129;
    --brand: #86bd9f;
    --brand-soft: #1d3128;
    --accent: #f0ae3a;
    --accent-strong: #f6bd5a;
    --accent-ink: #2a1d00;
    --shadow: 20px 24px 60px -34px rgba(0, 0, 0, 0.7);
    --shadow-sm: 0 2px 6px -3px rgba(0, 0, 0, 0.6);
  }
}

/* --- Reset --------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img {
  display: block;
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 700;
}
p {
  margin: 0;
}
a {
  color: inherit;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* --- Shared helpers ------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  scroll-margin-top: calc(var(--header-h) + 12px);
}
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus {
  top: 0.75rem;
}
:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.8rem 1.4rem;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), background-color 0.2s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:active {
  transform: translateY(1px) scale(0.985);
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.btn--outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--outline:hover {
  border-color: var(--ink);
  background: var(--surface-2);
}

/* --- Header -------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header__inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
}
.brand__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.site-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.site-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* --- Hero ---------------------------------------------------------------- */
.hero {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2.5rem, 6vw, 5rem);
  overflow: hidden;
}
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero__copy {
  max-width: 34rem;
}
.hero h1 {
  font-size: clamp(2.4rem, 4.6vw, 4.05rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}
.hero__lede {
  margin-top: 1.35rem;
  font-size: clamp(1.02rem, 1.3vw, 1.16rem);
  color: var(--text);
  max-width: 33ch;
}
.hero__actions {
  margin-top: 1.9rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.hero__media {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 0.62fr;
  gap: 1rem;
  align-items: end;
}
.hero__figure {
  margin: 0;
}
.hero__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}
.hero__figure:first-child img {
  aspect-ratio: 4 / 5;
}
.hero__figure--offset {
  transform: translateY(2.2rem);
}
.hero__figure--offset img {
  aspect-ratio: 3 / 4;
}
.hero__figure figcaption {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: var(--muted);
}

/* --- Section head -------------------------------------------------------- */
.section-head {
  max-width: 42rem;
  margin-bottom: clamp(1.75rem, 3vw, 2.75rem);
}
.section-head h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.75rem);
}
.section-head p {
  margin-top: 0.85rem;
  color: var(--text);
  max-width: 58ch;
}

/* --- Toolbar ------------------------------------------------------------- */
.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  background: var(--paper);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding-block: 0.9rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.toolbar__inner {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) auto auto;
  gap: 0.9rem 1.1rem;
  align-items: end;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.field label,
.field__label {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap__icon {
  position: absolute;
  left: 0.85rem;
  width: 1.05rem;
  height: 1.05rem;
  color: var(--muted);
  pointer-events: none;
}
input[type="search"],
select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  padding: 0.72rem 0.9rem;
  color: var(--ink);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input[type="search"] {
  padding-left: 2.4rem;
}
input[type="search"]::placeholder {
  color: var(--muted);
  opacity: 1;
}
input[type="search"]:hover,
select:hover {
  border-color: var(--muted);
}
input[type="search"]:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 77, 59, 0.28);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}
.select-wrap {
  position: relative;
}
.select-wrap::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2rem;
  cursor: pointer;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.7rem 1rem 0.7rem 0.9rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease),
    color 0.2s var(--ease), transform 0.18s var(--ease);
}
.toggle:active {
  transform: translateY(1px) scale(0.99);
}
.toggle:hover {
  border-color: var(--brand);
}
.toggle[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--paper);
}
.toggle[aria-pressed="true"] .icon {
  fill: var(--accent);
  stroke: var(--accent);
}
.toggle__count {
  display: grid;
  place-items: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding-inline: 0.35rem;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.toggle[aria-pressed="true"] .toggle__count {
  background: rgba(243, 240, 231, 0.22);
  background: color-mix(in srgb, var(--paper) 22%, transparent);
  color: var(--paper);
}
.result-count {
  align-self: center;
  justify-self: end;
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* --- Grid & cards -------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2vw, 1.85rem);
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--line);
}
.card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.card:hover .card__media img {
  transform: scale(1.035);
}
.save-btn {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.18s var(--ease), background-color 0.2s var(--ease),
    color 0.2s var(--ease);
}
.save-btn .icon {
  width: 1.2rem;
  height: 1.2rem;
}
.save-btn:hover {
  background: var(--surface);
}
.save-btn:active {
  transform: scale(0.9);
}
.save-btn[aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--accent);
}
.save-btn[aria-pressed="true"] .icon {
  fill: var(--accent-ink);
  stroke: var(--accent-ink);
}
.card__body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.2rem 1.25rem 1.35rem;
  flex: 1;
}
.card__cat {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.01em;
}
.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.32rem;
  margin: 0;
}
.card__title button {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.card__title button:hover {
  color: var(--brand);
}
.card__desc {
  font-size: 0.93rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta {
  list-style: none;
  margin: auto 0 0;
  padding: 0.85rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.86rem;
  color: var(--text);
}
.card__meta li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.card__meta .icon {
  width: 1rem;
  height: 1rem;
  color: var(--muted);
}
.card__price {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--ink);
}
.card__price span {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--muted);
}
.card__instructor {
  font-size: 0.88rem;
  color: var(--muted);
}

/* Spotlight (first result) */
.card--spotlight {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}
.card--spotlight .card__media {
  aspect-ratio: auto;
  min-height: 340px;
}
.card--spotlight .card__body {
  padding: clamp(1.5rem, 3vw, 2.6rem);
  justify-content: center;
  gap: 0.85rem;
}
.card--spotlight .card__title {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}
.card--spotlight .card__desc {
  -webkit-line-clamp: 3;
  font-size: 1rem;
}

/* --- Empty state --------------------------------------------------------- */
.empty {
  text-align: center;
  max-width: 34rem;
  margin: 3rem auto 0;
  padding: clamp(2rem, 5vw, 3.5rem) 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
}
.empty__icon {
  width: 2rem;
  height: 2rem;
  color: var(--muted);
}
.empty h3 {
  margin-top: 0.9rem;
  font-size: 1.5rem;
}
.empty p {
  margin: 0.7rem 0 1.4rem;
  color: var(--muted);
}

/* --- Studio -------------------------------------------------------------- */
.studio {
  background: var(--paper-2);
  border-block: 1px solid var(--line-soft);
}
.studio__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.studio__media {
  margin: 0;
}
.studio__media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}
.studio__body h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
}
.studio__body p {
  margin-top: 1.1rem;
  max-width: 52ch;
  color: var(--text);
}
.studio__facts {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.studio__facts li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-weight: 500;
  color: var(--ink);
}
.studio__facts .icon {
  color: var(--brand);
  margin-top: 0.15rem;
}

/* --- Footer -------------------------------------------------------------- */
.site-footer {
  padding-block: clamp(2.75rem, 6vw, 4rem);
}
.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto;
  gap: 1.5rem 3rem;
  align-items: start;
}
.site-footer__brand p {
  margin-top: 0.6rem;
  color: var(--muted);
  max-width: 34ch;
}
.site-footer__brand .brand__word {
  font-size: 1.35rem;
}
.site-footer__nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-footer__nav a {
  text-decoration: none;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.site-footer__nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.site-footer__fine {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line-soft);
  padding-top: 1.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 70ch;
}

/* --- Detail dialog ------------------------------------------------------- */
.detail {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  color: var(--text);
}
/* Only take over the display box while open; a closed dialog keeps the UA
   display:none so no invisible layer can block the page. */
.detail[open] {
  display: grid;
  place-items: center;
}
.detail::backdrop {
  background: rgba(8, 16, 12, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.detail__panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: min(980px, 100%);
  max-height: min(90vh, 760px);
  margin: auto;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 40px 90px -40px rgba(8, 16, 12, 0.7);
}
.detail__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.18s var(--ease), background-color 0.2s var(--ease);
}
.detail__close:hover {
  background: var(--surface);
}
.detail__close:active {
  transform: scale(0.92);
}
.detail__media {
  margin: 0;
  min-height: 0;
}
.detail__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail__content {
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.detail__cat {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand);
}
.detail__content h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  margin-top: 0.4rem;
}
.detail__body {
  margin-top: 0.9rem;
  font-size: 1.02rem;
}
.detail__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.25rem;
  margin: 1.5rem 0 0;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-input);
}
.detail__facts div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.detail__facts dt {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
}
.detail__facts dd {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.detail__facts .icon {
  width: 1rem;
  height: 1rem;
  color: var(--brand);
}
.detail__actions {
  margin-top: auto;
  padding-top: 1.6rem;
}
.btn--save {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  width: 100%;
  padding-block: 0.95rem;
}
.btn--save:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.btn--save .icon {
  width: 1.2rem;
  height: 1.2rem;
}
.btn--save[aria-pressed="true"] {
  background: var(--brand);
  color: var(--paper);
  border-color: var(--brand);
}
.btn--save[aria-pressed="true"] .icon {
  fill: var(--accent);
  stroke: var(--accent);
}

/* --- Motion (transform / opacity only) ----------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .detail[open] .detail__panel {
    animation: dialogIn 0.32s var(--ease) both;
  }
  .detail[open]::backdrop {
    animation: fadeIn 0.3s var(--ease) both;
  }
  .grid.anim .card {
    animation: cardIn 0.5s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 45ms);
  }
  .save-btn[aria-pressed="true"] .icon {
    animation: heartPop 0.32s var(--ease);
  }
}
@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}
@keyframes heartPop {
  50% {
    transform: scale(1.25);
  }
}

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

@media (prefers-reduced-transparency: reduce) {
  .site-header,
  .save-btn,
  .detail__close {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .site-header {
    background: var(--paper);
  }
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card--spotlight {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }
  .hero__media {
    max-width: 560px;
  }
  .toolbar__inner {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }
  .field--toggle {
    grid-column: 1 / 2;
  }
  .result-count {
    grid-column: 2 / 3;
  }
  .studio__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem;
  }
  .studio__media {
    max-width: 440px;
  }
}

@media (max-width: 680px) {
  :root {
    --header-h: 58px;
  }
  .site-nav {
    gap: 1.1rem;
  }
  .site-nav a {
    font-size: 0.9rem;
  }
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .card--spotlight {
    grid-template-columns: minmax(0, 1fr);
  }
  .card--spotlight .card__media {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
  .card--spotlight .card__body {
    padding: 1.25rem;
  }
  .toolbar__inner {
    grid-template-columns: minmax(0, 1fr);
  }
  .field--toggle,
  .result-count {
    grid-column: auto;
  }
  .result-count {
    justify-self: start;
  }
  .toggle {
    width: 100%;
    justify-content: center;
  }
  .detail {
    padding: 0;
  }
  .detail__panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: 0;
  }
  .detail__media {
    min-height: 0;
    max-height: 34vh;
  }
  .detail__content {
    padding: 1.5rem 1.25rem 2rem;
  }
  .detail__facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
  }
  .site-footer__nav {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .hero__media {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero__figure--offset {
    display: none;
  }
}
