/* Shop — layered on top of site.css. Stays inside DESIGN.md tokens (ember, rules, mono, narrow). */

.page-stage .cue-card { margin-bottom: 40px; }

[data-store-cart][hidden],
[data-store-cart-open][hidden],
[data-store-add][hidden],
[data-store-fallback][hidden] {
  display: none;
}

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

.store-cart-toggle {
  position: fixed;
  right: clamp(18px, 3vw, 40px);
  bottom: 24px;
  z-index: 180;
  border: 1px solid var(--ember-dim);
  border-radius: 0;
  padding: 12px 16px;
  background: var(--bg);
  color: var(--ink);
  font: 500 12px/1.2 "Archivo Narrow", sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

.store-cart-toggle:hover { color: var(--ember); background: var(--bg-raise); }

.store-cart {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 190;
  width: min(520px, 100vw);
  overflow-y: auto;
  border-left: 1px solid var(--rule-bright);
  padding: clamp(24px, 4vw, 48px);
  background: var(--bg);
  color: var(--ink);
}

.store-cart__head,
.store-cart__foot,
.store-cart__line {
  display: grid;
  align-items: center;
  gap: 16px;
}

.store-cart__head {
  grid-template-columns: 1fr auto;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule-bright);
}

.store-cart__head h2 { margin: 8px 0 0; font: 300 clamp(28px, 4vw, 44px)/1 "Fraunces", serif; }
.store-cart__head h2 em { color: var(--ember); font-weight: 300; }
.store-cart__cue,
.store-cart__status {
  font: 400 10px/1.5 "JetBrains Mono", monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.store-cart__cue { color: var(--ember); }
.store-cart__head button,
.store-cart__line button {
  border: 0;
  background: transparent;
  color: var(--ink-dim);
  font: 400 12px/1.5 "Archivo Narrow", sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}
.store-cart__head button:hover,
.store-cart__line button:hover { color: var(--ember); }

.store-cart__items { margin-top: 24px; }
.store-cart__line {
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  font: 300 16px/1.4 "Fraunces", serif;
}
.store-cart__line > span:nth-child(2) { color: var(--ember); }
.store-cart__empty { padding: 32px 0; color: var(--ink-dim); }
.store-cart__foot {
  grid-template-columns: auto 1fr;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--rule-bright);
}
.store-cart__foot > span { color: var(--ember); font: 400 15px/1 "JetBrains Mono", monospace; }
.store-cart__foot .btn { justify-self: stretch; }
.store-cart__status { min-height: 3em; margin-top: 18px; color: var(--ink-dim); }

@media (max-width: 540px) {
  .store-cart { border-left: 0; }
  .store-cart__foot { grid-template-columns: 1fr; }
  .store-cart__line { grid-template-columns: minmax(0, 1fr) auto; }
  .store-cart__line button { grid-column: 1 / -1; justify-self: start; padding: 0; }
}

/* Featured cards: 3 stacked spearheads rather than a 2-up mosaic. */
.cards-grid--stack {
  grid-template-columns: 1fr;
}

.cards-grid--stack .card.is-spearhead {
  grid-template-columns: 1fr 1.15fr;
  min-height: 520px;
}

@media (max-width: 960px) {
  .cards-grid--stack .card.is-spearhead {
    grid-template-columns: 1fr;
  }
  .cards-grid--stack .card.is-spearhead .card-photo {
    min-height: 420px;
  }
}

/* ---------- Catalogue: client-side filters ---------- */

.shop-catalogue.section-shell {
  padding-top: 96px;
  padding-bottom: 24px;
}

.shop-filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.62fr) minmax(280px, 1fr) auto auto;
  gap: 1px;
  margin: 0 clamp(24px, 4vw, 56px);
  border-top: 1px solid var(--rule-bright);
  border-bottom: 1px solid var(--rule-bright);
  background: var(--rule);
}

.shop-control,
.shop-filter-status,
.shop-filter-reset {
  background: var(--bg);
  display: grid;
  gap: 10px;
  padding: 18px 22px;
}

.shop-control__label,
.shop-filter-status,
.shop-filter-reset {
  font-family: "Archivo Narrow", sans-serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.shop-control__label {
  color: var(--ember);
}

.shop-control select,
.shop-control input {
  width: 100%;
  border: 1px solid var(--rule-bright);
  border-radius: 0;
  background-color: rgba(10, 9, 6, 0.62);
  color: var(--ink);
  font: 300 17px/1.45 "Fraunces", serif;
  padding: 12px 14px;
}

.shop-control select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ember) 50%),
    linear-gradient(135deg, var(--ember) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

.shop-control input::placeholder {
  color: var(--muted);
}

.shop-control select:focus,
.shop-control input:focus {
  border-color: var(--ember-dim);
  background-color: rgba(18, 16, 12, 0.86);
}

.shop-filter-status {
  align-content: center;
  min-width: 180px;
  color: var(--ink-dim);
}

.shop-filter-status [data-store-result-count] {
  font-family: "JetBrains Mono", monospace;
  font-size: 18px;
  letter-spacing: 0.12em;
  color: var(--ember);
}

.shop-filter-reset {
  all: unset;
  display: grid;
  place-items: center;
  min-width: 112px;
  padding: 18px 22px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  font-family: "Archivo Narrow", sans-serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: background 0.25s, color 0.25s;
}

.shop-filter-reset:hover {
  background: var(--bg-raise);
  color: var(--ember);
}

.shop-empty {
  margin: 24px clamp(24px, 4vw, 56px) 0;
  border-top: 1px solid var(--rule-bright);
  border-bottom: 1px solid var(--rule-bright);
  padding: 20px 0;
  font-family: "Fraunces", serif;
  font-weight: 300;
  color: var(--ink-dim);
}

.shop-tile[hidden],
.shop-group[hidden],
.shop-empty[hidden] {
  display: none;
}

@media (max-width: 980px) {
  .shop-filter-panel {
    grid-template-columns: 1fr 1fr;
  }

  .shop-control--search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .shop-filter-panel {
    grid-template-columns: 1fr;
  }

  .shop-filter-status,
  .shop-filter-reset {
    min-width: 0;
  }
}

/* ---------- Catalogue: product grid ---------- */

.shop-group.section-shell {
  padding-top: 88px;
  padding-bottom: 48px;
}

.shop-group + .shop-group.section-shell {
  padding-top: 72px;
}

.shop-group .scene-head .runtime {
  text-align: right;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule-bright);
  border-bottom: 1px solid var(--rule-bright);
}

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

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

@media (max-width: 480px) {
  .shop-grid { grid-template-columns: 1fr; }
}

/* Tile */
.shop-tile {
  background: var(--bg);
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  padding: 18px 18px 22px;
  transition: background 0.3s;
  position: relative;
}

.shop-tile:hover {
  background: var(--bg-raise);
}

.shop-tile:hover .shop-tile__title {
  color: var(--ember);
}

.shop-tile:hover .photo-fill {
  filter: brightness(1.1) saturate(1.05) contrast(1.02);
}

.shop-tile:hover .shop-tile__meta span:last-child {
  color: var(--ember);
  transform: translateX(4px);
}

.shop-tile:hover .shop-tile__price {
  background: var(--ember);
  color: var(--bg);
  border-color: var(--ember);
}

.shop-tile__frame {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  margin-bottom: 18px;
  background: #050302;
  border: 1px solid var(--rule-bright);
  transition: filter 0.5s;
}

.shop-tile__frame .photo-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: contrast(1.04) brightness(0.94);
  transition: filter 0.5s;
}

.shop-tile__crop {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(237, 232, 220, 0.62);
  pointer-events: none;
}

.shop-tile__crop span:first-child {
  color: var(--ember);
  background: rgba(10, 9, 6, 0.7);
  padding: 3px 6px;
  backdrop-filter: blur(2px);
}

.shop-tile__crop span:last-child {
  background: rgba(10, 9, 6, 0.7);
  padding: 3px 6px;
  backdrop-filter: blur(2px);
}

.shop-tile__price {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 6px 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink);
  background: rgba(10, 9, 6, 0.82);
  border: 1px solid var(--ember-dim);
  backdrop-filter: blur(3px);
  transition: background 0.35s, color 0.35s, border-color 0.35s;
}

.shop-tile__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.shop-tile__title {
  font-family: "Fraunces", serif;
  font-weight: 300;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
  transition: color 0.25s;
  /* Two-line clamp keeps the grid regular. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-tile__meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--rule-bright);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.shop-tile__meta span:last-child {
  color: var(--ink-dim);
  transition: color 0.25s, transform 0.25s;
}

/* Slight accent: every 5th tile in a group gets an ember hairline top, like a crop mark. */
.shop-grid > .shop-tile:nth-child(4n+1) .shop-tile__frame {
  border-top-color: var(--ember-dim);
}

/* ---------- Product detail: gallery rail ---------- */

.shop-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 0 clamp(24px, 4vw, 56px);
}

.shop-gallery__plate {
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--rule-bright);
  padding: 10px 10px 6px;
}

.shop-gallery__plate img {
  width: 100%;
  height: auto;
  display: block;
  filter: contrast(1.04) brightness(0.95);
}

.shop-gallery__plate figcaption {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--rule-bright);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Product detail: About + specs split ----------
   First section (ABOUT THIS WORK) renders as prose on the left.
   Remaining short sections (INSTRUMENTATION/DURATION/etc.) stack as a
   dense specs panel on the right so a 3-paragraph About doesn't force
   a 600px dead rectangle next to a 3-word Instrumentation card. */

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.work-prose {
  /* reuses .contact-card chrome */
}

.work-specs {
  margin: 0;
  background: rgba(18, 16, 12, 0.7);
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
}

.work-specs__item {
  padding: 20px 24px;
  border-bottom: 1px solid var(--rule);
}

.work-specs__item:last-child {
  border-bottom: 0;
}

.work-specs__label {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 10px;
}

.work-specs__body {
  margin: 0;
}

.work-specs__body .section-body p {
  font-size: 15px;
  margin-bottom: 6px;
}

.work-specs__body .section-body ul {
  margin: 0;
  gap: 4px;
}

.work-specs__body .section-body li {
  font-size: 15px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .work-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Product detail: section body ---------- */

.section-body {
  color: var(--ink-dim);
}

.section-body p {
  margin-bottom: 12px;
}

.section-body p:last-child { margin-bottom: 0; }

.section-body ul {
  list-style: none;
  padding-left: 0;
  margin: 12px 0;
}

.section-body li {
  padding-left: 14px;
  position: relative;
}

.section-body li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--ember);
}

.section-body a {
  color: var(--ember);
  text-decoration: none;
  border-bottom: 1px solid var(--ember-dim);
}

.section-body a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* Purchased files: the same editorial rules, narrow controls and warm palette. */
.store-order-files { padding: 0 clamp(24px, 4vw, 56px) 96px; max-width: 1440px; margin: 0 auto; }
.store-order-list { list-style: none; padding: 0; margin: 32px 0; border-top: 1px solid var(--rule-bright); }
.store-order-product { padding: 32px 0; border-bottom: 1px solid var(--rule-bright); }
.store-order-edition-files { list-style: none; padding: 0; margin: 0; }
.store-order-edition-label { color: var(--ink-dim); font: 400 12px/1.5 "Archivo Narrow", sans-serif; letter-spacing: .12em; text-transform: uppercase; margin: 24px 0 8px; }
.store-order-history { margin-top: 24px; border-top: 1px solid var(--rule); padding-top: 24px; }
.store-order-history summary { cursor: pointer; color: var(--ink); font: 400 14px/1.5 "Archivo Narrow", sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.store-order-history summary:focus-visible { outline: 2px solid var(--ember); outline-offset: 4px; }
.store-order-history .store-order-edition { margin-top: 24px; }
.store-order-file { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; padding: 32px 0; border-bottom: 1px solid var(--rule); }
.store-order-product h2 { font: 300 clamp(24px, 3vw, 36px)/1.2 "Fraunces", serif; margin: 0 0 16px; }
.store-order-filename { overflow-wrap: anywhere; margin: 0 0 8px; color: var(--ink); }
.store-order-meta, .store-order-reference { color: var(--ink-dim); font: 400 11px/1.7 "JetBrains Mono", monospace; overflow-wrap: anywhere; }
.store-order-file:last-child { border-bottom: 0; }
.store-order-file .btn, .store-order-recovery .btn { font: 400 12px/1.4 "Archivo Narrow", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.store-order-file .btn:focus-visible, .store-order-recovery :focus-visible { outline: 2px solid var(--ember); outline-offset: 4px; }
.store-order-help, .store-order-recovery { max-width: 72ch; color: var(--ink-dim); }
.store-order-recovery { margin-top: 48px; border-top: 1px solid var(--rule); padding-top: 24px; }
.store-order-recovery summary { cursor: pointer; color: var(--ink); font: 400 14px/1.5 "Archivo Narrow", sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.store-order-recovery form { display: grid; gap: 24px; margin-top: 24px; }
.store-order-recovery label { display: grid; gap: 8px; font: 400 11px/1.5 "JetBrains Mono", monospace; }
.store-order-recovery input { width: 100%; box-sizing: border-box; background: var(--bg-raise); color: var(--ink); border: 1px solid var(--rule-bright); border-radius: 0; padding: 16px; font: 300 18px/1.5 "Fraunces", serif; }
.store-order-recovery button { justify-self: start; }
@media (max-width: 600px) { .store-order-file { grid-template-columns: 1fr; gap: 16px; } .store-order-file .btn { justify-self: start; } }

/* Policy prose follows DESIGN.md's Prompt scene structure and 72ch measure. */
.store-policy-intro, .store-policy-section .section-body { max-width: 72ch; color: var(--ink-dim); }
.store-policy-intro, .store-policy-section .section-body { font: 300 17px/1.7 "Fraunces", serif; }
.store-policy-nav { display: flex; flex-wrap: wrap; gap: 16px 24px; margin-top: 32px; }
.store-policy-nav a { font: 400 12px/1.5 "Archivo Narrow", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.store-policy-section { scroll-margin-top: 96px; }
.store-policy-section h2 { margin: 32px 0 24px; font: 300 clamp(28px, 3.4vw, 44px)/1 "Fraunces", serif; letter-spacing: -.02em; }
.store-policy-nav a, .store-policy-link a { text-decoration: underline; text-underline-offset: 4px; }
.store-policy-nav a:focus-visible, .store-policy-link a:focus-visible, .store-policy-section a:focus-visible { outline: 1px solid var(--ember); outline-offset: 4px; }
.store-policy-link { color: var(--ink-dim); font: 300 16px/1.7 "Fraunces", serif; }
