/* Forma — visual identity
   Warm paper, ink, and terracotta. Editorial serif for display,
   system sans for interface text. Plain CSS, system fonts only. */

:root {
  --paper: #f7f2ea;
  --paper-deep: #efe7db;
  --card: #fffdf9;
  --ink: #241f1a;
  --ink-soft: #3d352c;
  --muted: #6f6558;
  --faint: #786d5e;
  --line: #e3d9c9;
  --line-strong: #d2c5b0;
  --accent: #b04a29;
  --accent-deep: #8c3a1f;
  --accent-soft: #f3e0d5;
  --focus: #1f6f8b;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(36, 31, 26, 0.05);
  --shadow-md: 0 10px 30px -14px rgba(36, 31, 26, 0.28);
  --shadow-lg: 0 30px 70px -30px rgba(36, 31, 26, 0.45);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --shell: 1180px;
  --gutter: clamp(1.1rem, 4vw, 3rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

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

.eyebrow {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 100;
  padding: 0.55rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 0.16s ease;
}

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

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}

.brand__mark {
  color: var(--accent);
  flex: none;
}

.brand__name {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  gap: clamp(0.9rem, 3vw, 1.8rem);
  font-size: 0.9rem;
  font-weight: 550;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-block: 0.25rem;
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(2.4rem, 6vw, 5rem) clamp(2rem, 5vw, 3.5rem);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.8rem, 4vw, 3.4rem);
  align-items: center;
}

@media (min-width: 900px) {
  .hero__inner {
    grid-template-columns: 1.02fr 0.98fr;
  }
}

.hero__copy {
  max-width: 34rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 4.15rem);
  margin-block: 0.7rem 0.9rem;
}

.hero__lede {
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  color: var(--muted);
  max-width: 32rem;
}

.hero__actions {
  margin-top: 1.7rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem;
}

.hero__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--faint);
  letter-spacing: 0.02em;
}

.dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
}

.hero__media {
  margin: 0;
  position: relative;
}

.hero__media img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.hero__media figcaption {
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--faint);
  letter-spacing: 0.02em;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.15rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, transform 0.12s ease;
}

.button--primary {
  background: var(--accent);
  color: #fff;
}

.button--primary:hover {
  background: var(--accent-deep);
}

.button--primary:active {
  transform: translateY(1px);
}

.button--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.button--ghost:hover {
  background: var(--paper-deep);
  border-color: var(--ink-soft);
}

/* ---------- Browse ---------- */
#workshops,
#studio,
#top {
  scroll-margin-top: 4.5rem;
}

.browse {
  padding-block: clamp(2rem, 5vw, 3.2rem);
}

.browse__head {
  max-width: 38rem;
  margin-bottom: 1.6rem;
}

.browse__head h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  margin-bottom: 0.5rem;
}

.browse__intro {
  color: var(--muted);
}

.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 760px) {
  .controls {
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr) auto;
    align-items: end;
  }
}

.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field__label {
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.field__icon {
  position: absolute;
  left: 0.85rem;
  color: var(--faint);
  pointer-events: none;
}

.field__chevron {
  position: absolute;
  right: 0.85rem;
  color: var(--muted);
  pointer-events: none;
}

.field input[type="search"],
.field select {
  width: 100%;
  padding: 0.72rem 0.9rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 11px;
  background-color: var(--card);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input[type="search"] {
  padding-left: 2.5rem;
}

.field input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

.field input[type="search"]:hover,
.field select:hover {
  border-color: var(--faint);
}

.field input[type="search"]:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input[type="search"]:focus-visible,
.field select:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
}

.field select {
  appearance: none;
  padding-right: 2.3rem;
  cursor: pointer;
  touch-action: manipulation;
}

/* ---------- Toggle ---------- */
.field--saved {
  justify-content: flex-end;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 11px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease;
}

.toggle:hover {
  border-color: var(--faint);
  background: var(--paper);
}

.toggle__icon {
  color: currentColor;
}

.toggle__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding-inline: 0.3rem;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--muted);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.toggle[aria-pressed="true"]:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.toggle[aria-pressed="true"] .toggle__count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* ---------- Results ---------- */
.results {
  margin-block: 1.4rem 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Grid ---------- */
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.1rem, 2.4vw, 1.7rem);
}

@media (min-width: 620px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Card ---------- */
.card {
  height: 100%;
  scroll-margin-top: 5rem;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.card:focus-within {
  border-color: var(--accent);
}

.card__media {
  position: relative;
  overflow: hidden;
  background: var(--paper-deep);
}

.card__media img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card__media img {
  transform: scale(1.045);
}

.card__tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--card);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card__saved {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.1rem 1.15rem 1.2rem;
  flex: 1;
}

.card__title {
  font-size: 1.35rem;
}

.card__desc {
  color: var(--muted);
  font-size: 0.94rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-top: auto;
  padding-top: 0.4rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.card__meta svg {
  color: var(--accent);
  flex: none;
}

.card__price {
  font-weight: 700;
}

.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.card__instructor {
  font-size: 0.83rem;
  color: var(--faint);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__open {
  flex: none;
}

/* ---------- Empty state ---------- */
.empty-state[hidden] {
  display: none;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.7rem;
  padding: clamp(2.5rem, 7vw, 4.5rem) 1.5rem;
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--muted);
}

.empty-state svg {
  color: var(--faint);
}

.empty-state h3 {
  font-size: 1.5rem;
  color: var(--ink);
}

.empty-state .button {
  margin-top: 0.5rem;
}

/* ---------- Studio ---------- */
.studio {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  padding-block: clamp(2.4rem, 5vw, 3.6rem);
  background: var(--ink);
  color: var(--paper);
}

.studio__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 860px) {
  .studio__inner {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 4rem;
  }
}

.studio h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  margin-block: 0.5rem 0.8rem;
}

.studio p {
  color: #d8cfc2;
  max-width: 34rem;
}

.studio .eyebrow {
  color: #e79a76;
}

.studio__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding-top: 1.4rem;
}

@media (min-width: 860px) {
  .studio__facts {
    border-top: none;
    border-left: 1px solid rgba(255, 255, 255, 0.16);
    padding-top: 0;
    padding-left: 2.4rem;
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }
}

.studio__facts dt {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a99e8e;
  margin-bottom: 0.25rem;
}

.studio__facts dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.12rem;
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 2rem;
  border-top: 1px solid var(--line);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.84rem;
  color: var(--faint);
}

.site-footer__brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink);
}

/* ---------- Detail dialog ---------- */
.detail-dialog {
  width: min(960px, calc(100vw - 2rem));
  max-width: 960px;
  max-height: min(90vh, 900px);
  max-height: min(90dvh, 900px);
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  overscroll-behavior: contain;
}

.detail-dialog::backdrop {
  background: rgba(30, 24, 19, 0.55);
  backdrop-filter: blur(3px);
}

.detail {
  display: grid;
  grid-template-columns: 1fr;
  max-height: min(90vh, 900px);
  max-height: min(90dvh, 900px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (min-width: 780px) {
  .detail {
    grid-template-columns: 0.9fr 1.1fr;
    overflow: hidden;
    max-height: min(90vh, 900px);
    max-height: min(90dvh, 900px);
  }
}

.detail__media {
  position: relative;
  background: var(--paper-deep);
}

@media (min-width: 780px) {
  .detail__media {
    height: 100%;
  }
}

.detail__media img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  max-height: 300px;
  object-fit: cover;
}

@media (min-width: 780px) {
  .detail__media img {
    max-height: none;
    position: absolute;
    inset: 0;
  }
}

.detail__panel {
  position: relative;
  padding: clamp(1.4rem, 3.5vw, 2.4rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

@media (min-width: 780px) {
  .detail__close {
    position: sticky;
    top: 0;
    align-self: flex-end;
    margin-bottom: -2.4rem;
    z-index: 2;
  }
}

.detail__close:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.detail__category {
  align-self: flex-start;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail__title {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  padding-right: 2.4rem;
}

.detail__body {
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.detail__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.2rem;
  margin: 0.3rem 0 0;
  padding: 1.15rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

@media (min-width: 480px) {
  .detail__facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.detail__facts div {
  min-width: 0;
}

.detail__facts dt {
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.detail__facts dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}

.detail__actions {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

.detail__save {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.2rem;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.detail__save:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.detail__save[aria-pressed="true"] {
  background: transparent;
  color: var(--accent-deep);
}

.detail__save[aria-pressed="true"]:hover {
  background: var(--accent-soft);
}

.detail__note {
  font-size: 0.82rem;
  color: var(--faint);
}

/* ---------- 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;
  }
}
