:root {
  color-scheme: light;
  --page: #ffffff;
  /* Same value as BACKDROP in scripts/stage.js. */
  --stage: #edecea;
  --ink: #1f1b2e;
  --ink-soft: #6a6777;
  --line: #e3e1dc;
  --filament: #ffc72c;
  --danger: #c8442b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2,
h3,
p,
ol {
  margin: 0;
}

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

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 40px 64px;
}

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.site-header__brand {
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 40px;
}

[data-page="home"] .site-header {
  margin-bottom: 14px;
}

[data-page="home"] .site-header__brand {
  font-size: clamp(2.5rem, 6.6vw, 4.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-wrap: balance;
}

.cart-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: border-color 160ms ease;
}

.cart-button:hover {
  border-color: var(--ink);
}

.cart-button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  margin-right: -6px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--page);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.cart-button span[data-count="0"] {
  display: none;
}

.intro {
  margin-bottom: 24px;
  color: var(--ink-soft);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.4;
  text-wrap: balance;
}

.how {
  margin-bottom: 36px;
  padding: 18px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.how h2 {
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 650;
}

.how ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 28px;
  padding: 0;
  list-style: none;
  counter-reset: step;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.how li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  counter-increment: step;
}

.how li::before {
  content: counter(step);
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: -1px;
  border-radius: 50%;
  background: var(--filament);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 650;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 28px;
}

.product-card__art,
.product__art {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--stage);
}

.product-card__art {
  margin-bottom: 12px;
  border-radius: 12px;
}

.product-card__art img,
.product__art video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}

.product-card__body h2 {
  font-size: 1rem;
  font-weight: 550;
  line-height: 1.3;
  text-decoration: underline transparent 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 160ms ease;
}

.product-card:hover h2 {
  text-decoration-color: currentColor;
}

.price-tag {
  flex: none;
  color: var(--ink-soft);
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  transition: color 160ms ease;
}

.back-link:hover {
  color: var(--ink);
}

.product {
  display: flex;
  align-items: flex-start;
  gap: 56px;
}

.product__art {
  flex: 0 1 624px;
  max-width: max(320px, calc(100svh - 196px));
  border-radius: 16px;
}

.detail {
  flex: 1 0 280px;
  max-width: 360px;
  padding-top: 8px;
}

.detail h1 {
  font-size: 2.25rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.detail__price {
  margin-top: 10px;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.detail__blurb {
  margin-top: 20px;
  color: var(--ink-soft);
}

.quantity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.quantity-stepper {
  display: inline-flex;
  align-items: center;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.quantity-stepper button {
  width: 40px;
  height: 100%;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 1.0625rem;
  transition: color 160ms ease;
}

.quantity-stepper button:hover:not(:disabled) {
  color: var(--ink);
}

.quantity-stepper button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.quantity-stepper span {
  min-width: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.button {
  height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--page);
  cursor: pointer;
  font-weight: 550;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.button:hover:not(:disabled) {
  background: var(--filament);
  color: var(--ink);
}

.button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.button-quiet {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.9375rem;
  transition: color 160ms ease;
}

.button-quiet:hover {
  color: var(--ink);
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, calc(100vw - 32px));
  background: var(--page);
  padding: 28px 28px 28px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 30;
}

.cart-panel.is-open {
  transform: translateX(0);
}

.cart-scrim {
  position: fixed;
  inset: 0;
  background: rgba(31, 27, 46, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
  z-index: 20;
}

.cart-panel.is-open + .cart-scrim {
  opacity: 1;
  pointer-events: auto;
}

.cart-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
}

.cart-panel__header h2 {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.cart-items {
  display: grid;
  align-content: start;
  gap: 20px;
  overflow: auto;
}

.cart-item {
  display: grid;
  gap: 8px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.cart-item:last-child {
  border-bottom: 0;
}

.cart-item h3 {
  font-size: 1rem;
  font-weight: 550;
}

.cart-item__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-item__footer strong {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.remove-button {
  border: 0;
  background: none;
  color: var(--ink-soft);
  padding: 0;
  cursor: pointer;
  font-size: 0.875rem;
  justify-self: start;
  transition: color 160ms ease;
}

.remove-button:hover {
  color: var(--danger);
}

.cart-order {
  display: grid;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.cart-order[hidden] {
  display: none;
}

.cart-order__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 1.125rem;
}

.cart-order__total strong {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.field input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--ink-soft);
  border-radius: 10px;
  background: var(--page);
  color: var(--ink);
  font-size: 1rem;
}

.cart-order .button {
  width: 100%;
}

.cart-order__note {
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.empty-state {
  color: var(--ink-soft);
}

@media (max-width: 880px) {
  .page {
    padding: 20px 20px 28px;
  }

  .how {
    margin-bottom: 28px;
  }

  .how ol {
    grid-template-columns: 1fr;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 16px;
  }

  .product-card__body {
    flex-direction: column;
  }

  .product {
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
  }

  .product__art {
    flex: none;
  }

  .detail {
    flex: none;
    max-width: none;
    padding-top: 0;
  }
}
