/* ------------------------------------------------------------------
   Forma · workshop catalog
   Type: Cabinet Grotesk (display) + Satoshi (body), self-hosted.
   Icons: Phosphor (MIT), inlined.
   ------------------------------------------------------------------ */

@font-face {
  font-family: "Cabinet Grotesk";
  src: url("/artifacts/forma-frontend--v1--s2--glm-5.3--taste--2026-09-17T08-39-52-599Z/assets/fonts/cabinet-grotesk-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cabinet Grotesk";
  src: url("/artifacts/forma-frontend--v1--s2--glm-5.3--taste--2026-09-17T08-39-52-599Z/assets/fonts/cabinet-grotesk-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cabinet Grotesk";
  src: url("/artifacts/forma-frontend--v1--s2--glm-5.3--taste--2026-09-17T08-39-52-599Z/assets/fonts/cabinet-grotesk-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("/artifacts/forma-frontend--v1--s2--glm-5.3--taste--2026-09-17T08-39-52-599Z/assets/fonts/satoshi-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("/artifacts/forma-frontend--v1--s2--glm-5.3--taste--2026-09-17T08-39-52-599Z/assets/fonts/satoshi-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("/artifacts/forma-frontend--v1--s2--glm-5.3--taste--2026-09-17T08-39-52-599Z/assets/fonts/satoshi-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens ------------------------------------------------------ */

:root {
  color-scheme: light dark;

  --font-display: "Cabinet Grotesk", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Satoshi", "Avenir Next", "Helvetica Neue", Arial, sans-serif;

  --paper: #eef0e6;
  --paper-raise: #e5e8d8;
  --ink: #1b241e;
  --ink-2: #566255;
  --accent: #23503a;
  --accent-strong: #23503a;
  --accent-deep: #1b3f2d;
  --on-accent: #f0f3e8;
  --line: rgb(27 36 30 / 0.16);
  --focus: #23503a;
  --backdrop: rgb(14 19 15 / 0.55);
  --shadow: 0 24px 60px rgb(27 36 30 / 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121a14;
    --paper-raise: #18231b;
    --ink: #e9ede1;
    --ink-2: #a2ae9f;
    --accent: #7fbb95;
    --accent-strong: #335c45;
    --accent-deep: #2a4d38;
    --on-accent: #eaf2e6;
    --line: rgb(233 237 225 / 0.16);
    --focus: #8fc9a6;
    --backdrop: rgb(4 8 5 / 0.62);
    --shadow: 0 24px 60px rgb(0 0 0 / 0.5);
  }
}

/* --- Base -------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  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%;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.icon {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  display: inline-block;
  vertical-align: -0.14em;
}

.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent-strong);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus-visible {
  top: 12px;
}

/* --- Buttons ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-solid {
  background: var(--accent-strong);
  color: var(--on-accent);
}
.btn-solid:hover {
  background: var(--accent-deep);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Header ------------------------------------------------------- */

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

.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.wordmark::before {
  content: "";
  width: 11px;
  height: 11px;
  background: var(--accent);
  flex: none;
}
.wordmark:hover {
  color: var(--accent);
}

.header-note {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-2);
}

/* --- Hero --------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: center;
  gap: 32px;
  padding-top: clamp(48px, 8vh, 84px);
  padding-bottom: clamp(56px, 9vh, 96px);
}

.hero-copy {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}

.hero-copy h1 {
  font-size: clamp(2.35rem, 4.4vw, 4rem);
  font-weight: 800;
  max-width: 13ch;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--ink-2);
  max-width: 44ch;
}

.hero-media {
  grid-column: span 6;
  position: relative;
}

.hero-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.hero-media::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  background: var(--accent-strong);
}

/* --- Browse section ------------------------------------------------ */

.browse {
  padding-block: clamp(48px, 7vh, 80px) 40px;
}

.browse h2 {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 700;
}

.count {
  margin-top: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-2);
}

/* Controls band */

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-top: 32px;
  padding: 20px;
  background: var(--paper-raise);
  border: 1px solid var(--line);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.input-shell {
  position: relative;
  display: block;
}

.field-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  translate: 0 -50%;
  width: 1.05rem;
  height: 1.05rem;
  color: var(--ink-2);
  pointer-events: none;
}

input[type="search"],
select {
  width: 100%;
  appearance: none;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
  transition: border-color 0.15s ease;
}

.field-search input {
  padding-left: 40px;
}

.field-category select {
  padding-right: 40px;
}

.select-shell .field-icon {
  left: auto;
  right: 12px;
}

input::placeholder {
  color: var(--ink-2);
}

input:hover,
select:hover {
  border-color: var(--accent);
}

.field-shortlist {
  justify-content: flex-end;
}

.saved-filter {
  padding: 12px 16px;
  gap: 8px;
}

.saved-filter .saved-count {
  min-width: 1.6em;
  padding: 1px 7px;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
}

.saved-filter[aria-pressed="true"] {
  background: var(--accent-strong);
  color: var(--on-accent);
  border-color: var(--accent-strong);
}

.saved-filter[aria-pressed="true"] .saved-count {
  background: var(--on-accent);
  color: var(--accent-strong);
  border-color: transparent;
}

/* --- Index grid ---------------------------------------------------- */

.index-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 32px;
  row-gap: 64px;
  margin-top: 48px;
}

.item {
  display: flex;
  flex-direction: column;
}

.item:nth-of-type(4n+1) { grid-column: span 7; }
.item:nth-of-type(4n+2) { grid-column: span 5; }
.item:nth-of-type(4n+3) { grid-column: span 5; }
.item:nth-of-type(4n+4) { grid-column: span 7; }

.item:nth-of-type(4n+1) .card-media,
.item:nth-of-type(4n+4) .card-media {
  aspect-ratio: 16 / 10;
}

.card-media {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--paper-raise);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-media:hover img,
.card-media:focus-visible img {
  transform: scale(1.03);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
  flex: 1;
}

.card-cat {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.card-title button {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: left;
  transition: color 0.15s ease;
}

.card-title button .icon {
  width: 0.72em;
  height: 0.72em;
  align-self: center;
  transition: translate 0.2s ease;
}

.card-title button:hover {
  color: var(--accent);
}

.card-title button:hover .icon {
  translate: 2px -2px;
}

.card-desc {
  color: var(--ink-2);
  font-size: 0.98rem;
  max-width: 52ch;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-2);
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 16px;
}

.card-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--accent);
}

.card-price span {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-2);
  margin-left: 4px;
}

.card-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.card-save:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.card-save[aria-pressed="true"] {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--on-accent);
}

/* --- Empty state ---------------------------------------------------- */

.empty {
  margin-top: 56px;
  padding: clamp(40px, 7vh, 72px) 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  max-width: 46ch;
}

.empty h3 {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 700;
}

.empty p {
  color: var(--ink-2);
}

.empty .btn {
  margin-top: 10px;
}

/* --- Detail dialog --------------------------------------------------- */

dialog {
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  overflow: visible;
}

dialog::backdrop {
  background: var(--backdrop);
}

.detail-shell {
  display: grid;
  grid-template-columns: 5fr 6fr;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  position: relative;
}

.detail-media {
  margin: 0;
  min-height: 0;
}

.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 320px;
}

.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.detail-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.detail-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(28px, 4vw, 48px);
  min-width: 0;
}

.detail-cat {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

.detail-title {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.detail-body {
  font-size: 1.08rem;
  color: var(--ink);
  max-width: 56ch;
}

.detail-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 24px;
  margin: 6px 0 4px;
}

.spec {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.spec dt {
  order: 1;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
}

.spec dd {
  order: 2;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.spec-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--accent);
}

.save-toggle {
  margin-top: 8px;
  padding: 15px 22px;
  width: 100%;
}

.save-toggle[aria-pressed="false"] {
  background: var(--accent-strong);
  color: var(--on-accent);
  border-color: var(--accent-strong);
}

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

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

/* --- Footer ----------------------------------------------------------- */

.site-footer {
  margin-top: clamp(72px, 10vh, 120px);
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 48px;
  padding-block: 40px 56px;
}

.wordmark-sm {
  font-size: 1.25rem;
}

.footer-notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 52ch;
  font-size: 0.85rem;
  color: var(--ink-2);
}

.footer-notes p:first-child {
  font-weight: 700;
  color: var(--ink);
}

/* --- Motion ------------------------------------------------------------ */
/* Entrance + hover motion. All of it is gated behind no-preference. */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .rise {
    animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--d, 0ms);
  }

  .index-grid .item {
    animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc(var(--i, 0) * 60ms);
  }

  /* After the one entrance pass, items never re-animate on filtering. */
  .index-grid.settled .item {
    animation: none;
  }

  dialog[open] {
    animation: dialog-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  dialog[open]::backdrop {
    animation: backdrop-in 0.3s ease both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 18px;
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    translate: 0 14px;
    scale: 0.985;
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
}

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

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 1023px) {
  .hero-copy h1 {
    font-size: clamp(2.4rem, 6vw, 3.4rem);
  }
}

@media (max-width: 899px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-bottom: 56px;
  }

  .hero-copy,
  .hero-media {
    grid-column: 1 / -1;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .index-grid {
    row-gap: 48px;
  }

  .item,
  .item:nth-of-type(4n+1),
  .item:nth-of-type(4n+2),
  .item:nth-of-type(4n+3),
  .item:nth-of-type(4n+4) {
    grid-column: 1 / -1;
  }

  .item:nth-of-type(4n+1) .card-media,
  .item:nth-of-type(4n+4) .card-media {
    aspect-ratio: auto;
  }

  .detail-shell {
    grid-template-columns: 1fr;
  }

  .detail-media img {
    aspect-ratio: 16 / 10;
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .container {
    padding-inline: 20px;
  }

  .header-inner {
    padding-block: 16px;
  }

  .header-note {
    display: none;
  }

  .hero-media::before {
    inset: 12px -12px -12px 12px;
  }

  .detail-specs {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    flex-direction: column;
    gap: 24px;
  }
}
