:root {
  --cream:      #f2f0e6;
  --char:       #292926;
  --orange:     #f26430;
  --grey:       #9e9890;
  --body-cream: #6e6863;
  --body-dark:  #b9b5ab;
  --line:       rgba(41, 41, 38, 0.14);
  --line-soft:  rgba(41, 41, 38, 0.08);
  --line-dark:  rgba(242, 240, 230, 0.14);
  --tile:       #e7e4d8;
  --poppins: "Poppins", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
  --header-h: 76px;
  --filters-h: 61px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  background: var(--cream);
  color: var(--char);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
.dot { color: var(--orange); }

/* ---------- Header (dark, echoes the deck cover) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  height: var(--header-h);
  padding: 0 clamp(20px, 4vw, 48px);
  background: var(--char);
  color: var(--cream);
  border-bottom: 1px solid var(--line-dark);
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand-mark {
  font-family: var(--poppins);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--cream);
}
/* ---------- Section tabs (Props / Gear) ---------- */
.section-tabs {
  display: flex; gap: 4px;
  background: rgba(242, 240, 230, 0.07);
  border: 1px solid var(--line-dark);
  border-radius: 4px; padding: 3px;
}
.section-tab {
  border: none; background: transparent; color: var(--grey);
  font-family: var(--poppins); font-weight: 600; font-size: 13.5px;
  letter-spacing: -0.01em; padding: 7px 20px; border-radius: 2px;
  transition: background .15s, color .15s;
}
.section-tab:hover { color: var(--cream); }
.section-tab.active { background: var(--orange); color: #fff; }

.brand-sub {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--grey);
  letter-spacing: 0.01em;
}

.search { position: relative; flex: 1; max-width: 440px; margin-left: auto; }
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; fill: none;
  stroke: var(--grey); stroke-width: 2; stroke-linecap: round;
  pointer-events: none;
}
#search {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  background: rgba(242, 240, 230, 0.07);
  font-family: var(--mono);
  font-size: 13.5px; color: var(--cream);
  outline: none;
  transition: border-color .15s, background .15s;
}
#search:focus { border-color: var(--orange); background: rgba(242, 240, 230, 0.1); }
#search::placeholder { color: var(--grey); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent; border-radius: 3px;
  padding: 9px 16px;
  font-family: var(--poppins); font-size: 13.5px; font-weight: 600;
  letter-spacing: -0.01em;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: #e0531f; }
.btn-ghost { background: transparent; color: var(--char); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--char); }
.btn-ghost.danger { color: var(--orange); border-color: rgba(242,100,48,.4); }
.btn-ghost.danger:hover { background: rgba(242,100,48,.08); border-color: var(--orange); }
.btn-ghost-light { background: transparent; color: var(--cream); border-color: var(--line-dark); }
.btn-ghost-light:hover { border-color: var(--cream); }

.shortlist-btn .heart { width: 16px; height: 16px; fill: #fff; }
.count-pill {
  background: rgba(0,0,0,.22);
  border-radius: 2px; padding: 1px 7px;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  min-width: 20px; text-align: center;
}

/* ---------- Filters ---------- */
.filters {
  position: sticky; top: var(--header-h); z-index: 30;
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 14px clamp(20px, 4vw, 48px);
  background: var(--cream);
  border-bottom: 1px solid var(--line-soft);
}
.chip {
  border: 1px solid var(--line);
  background: transparent; color: var(--body-cream);
  border-radius: 2px; padding: 6px 13px;
  font-family: var(--mono); font-size: 12.5px;
  transition: all .15s;
}
.chip:hover { border-color: var(--char); color: var(--char); }
.chip.active { background: var(--char); border-color: var(--char); color: var(--cream); }
.chip .chip-n { opacity: .5; margin-left: 7px; }

/* ---------- Layout ---------- */
main { padding: clamp(20px, 3vw, 32px) clamp(20px, 4vw, 48px) 120px; }
.status-line {
  font-family: var(--mono); color: var(--grey);
  font-size: 13px; margin: 0 0 20px; min-height: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: clamp(14px, 1.6vw, 24px);
}

/* ---------- Card (flat editorial media tile) ---------- */
.card { position: relative; cursor: pointer; }

.card-imgwrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color .18s, transform .18s;
}
.card:hover .card-imgwrap { transform: translateY(-3px); border-color: var(--grey); }
.card.selected .card-imgwrap { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }

.card-imgwrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transition: opacity .3s ease;
}
.card-imgwrap img.loaded { opacity: 1; }
.card-imgwrap.broken::after {
  content: "preview unavailable";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; color: var(--grey);
}

.heart-btn {
  position: absolute; top: 9px; right: 9px; z-index: 2;
  width: 34px; height: 34px; border-radius: 3px;
  border: none; background: rgba(242, 240, 230, 0.9); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .12s;
}
.heart-btn:hover { transform: scale(1.07); }
.heart-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--char); stroke-width: 1.8; }
.card.selected .heart-btn { background: var(--orange); }
.card.selected .heart-btn svg { fill: #fff; stroke: #fff; }

.card-meta { padding: 10px 2px 4px; }
.card-name {
  font-family: var(--mono); font-size: 12.5px; color: var(--char);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-sub { font-family: var(--sans); font-size: 11.5px; color: var(--grey); margin-top: 3px; }

/* ---------- Gear cards (product shots on white, contain) ---------- */
.card--gear .card-imgwrap { background: #fff; }
.card-imgwrap img.contain { object-fit: contain; padding: 16px; }
.card-name--gear {
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.3; min-height: 2.4em;
}
.qty-badge {
  position: absolute; top: 9px; left: 9px; z-index: 2;
  background: var(--char); color: var(--cream);
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  padding: 2px 8px; border-radius: 3px;
}

.empty { text-align: center; color: var(--body-cream); padding: 80px 0; }
.empty p { font-family: var(--poppins); font-weight: 600; font-size: 24px; margin-bottom: 16px; letter-spacing: -0.02em; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(20, 19, 16, .94);
  display: flex; align-items: center; justify-content: center;
}
.lb-figure { margin: 0; max-width: 88vw; max-height: 86vh; display: flex; flex-direction: column; align-items: center; }
#lb-img {
  max-width: 88vw; max-height: 74vh; object-fit: contain;
  border-radius: 4px; background: #2f2c28;
}
#lb-img.contain { background: #fff; padding: 2.2vw; }
.lb-caption {
  display: flex; align-items: center; gap: 24px; justify-content: space-between;
  width: 100%; margin-top: 18px; color: var(--cream);
}
.lb-cat {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--orange); margin-right: 12px;
}
.lb-name { font-family: var(--poppins); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.lb-close {
  position: absolute; top: 18px; right: 24px;
  background: none; border: none; color: var(--cream); font-size: 32px; line-height: 1;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(242,240,230,.1); border: none; color: var(--cream);
  width: 50px; height: 50px; border-radius: 3px; font-size: 28px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lb-nav:hover { background: rgba(242,240,230,.2); }
.lb-prev { left: 20px; } .lb-next { right: 20px; }

/* ---------- Share modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20,19,16,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-card {
  position: relative; background: var(--cream); border-radius: 6px;
  width: min(560px, 100%); max-height: 86vh; overflow-y: auto;
  padding: 34px; border: 1px solid var(--line);
}
.modal-close { position: absolute; top: 16px; right: 20px; background: none; border: none; font-size: 28px; color: var(--body-cream); }
.modal-card h2 { font-family: var(--poppins); font-weight: 700; font-size: 30px; letter-spacing: -0.02em; margin-bottom: 6px; }
.share-meta { font-family: var(--mono); color: var(--grey); font-size: 13px; margin-bottom: 22px; }
.share-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
.share-section-h {
  font-family: var(--poppins); font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  margin: 4px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.share-section { display: flex; flex-direction: column; gap: 12px; }
.share-group h3 {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--orange); margin-bottom: 8px;
}
.share-group ul { list-style: none; }
.share-group li {
  font-family: var(--mono); font-size: 12.5px; padding: 4px 0; color: var(--char);
  border-bottom: 1px solid var(--line-soft);
}
.share-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.share-hint { font-family: var(--sans); font-size: 12.5px; color: var(--body-cream); margin-top: 18px; line-height: 1.55; }

/* ---------- Send form ---------- */
.send-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--body-cream);
}
.field > span em { font-style: normal; color: var(--grey); text-transform: none; letter-spacing: 0; }
.field input, .field textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 3px;
  background: #fff; color: var(--char);
  font-family: var(--sans); font-size: 14px;
  outline: none; transition: border-color .15s;
}
.field textarea { resize: vertical; min-height: 60px; }
.field input:focus, .field textarea:focus { border-color: var(--orange); }
.field input::placeholder, .field textarea::placeholder { color: var(--grey); }
.send-btn { width: 100%; justify-content: center; padding: 12px; font-size: 14.5px; }
.send-error {
  font-family: var(--mono); font-size: 12.5px; color: #c2401a;
  background: rgba(242,100,48,.08); border: 1px solid rgba(242,100,48,.3);
  border-radius: 3px; padding: 8px 11px; margin: 0;
}

.send-success { text-align: center; padding: 14px 0 22px; }
.send-success-title { font-family: var(--poppins); font-weight: 700; font-size: 30px; letter-spacing: -0.02em; }
.send-success-msg { font-family: var(--sans); font-size: 14px; color: var(--body-cream); margin-top: 8px; line-height: 1.55; max-width: 42ch; margin-inline: auto; }

.share-alt {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  padding-top: 16px; border-top: 1px solid var(--line-soft);
}
.share-alt-label { font-family: var(--mono); font-size: 12px; color: var(--grey); margin-right: 2px; }
.share-alt .btn { padding: 7px 13px; font-size: 12.5px; }

/* ---------- Received banner ---------- */
.received-banner {
  display: flex; align-items: center; gap: 16px;
  background: var(--orange); color: #fff;
  padding: 11px clamp(20px, 4vw, 48px);
  font-family: var(--mono); font-size: 13px;
}
.received-close { background: none; border: none; color: #fff; font-size: 22px; margin-left: auto; line-height: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--char); color: var(--cream);
  padding: 11px 22px; border-radius: 3px;
  font-family: var(--mono); font-size: 13px; z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  animation: toast-in .2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  :root { --header-h: 64px; }
  .site-header { gap: 14px; padding: 0 18px; }
  .brand-sub { display: none; }
  .search { max-width: none; }
  #search { padding-right: 12px; }
  .shortlist-btn span:not(.count-pill) { display: none; }
  .filters { top: var(--header-h); padding: 12px 18px; }
  main { padding: 18px 18px 120px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .lb-caption { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* Back-to-site link (added for website integration) */
.brand-back { color: inherit; text-decoration: none; font-weight: 700; font-size: 20px; margin-right: 12px; opacity: 0.75; transition: opacity 0.2s; }
.brand-back:hover { opacity: 1; }
a.brand-mark { color: inherit; text-decoration: none; }

/* Opening intro on the library page */
.intro { padding: clamp(30px, 5vw, 66px) clamp(20px, 4vw, 48px) clamp(18px, 2.6vw, 30px); }
.intro-title { font-family: var(--poppins); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-size: clamp(24px, 3.3vw, 46px); color: var(--char); max-width: 22ch; }
.intro-sub { font-family: var(--sans); font-size: clamp(15px, 1.4vw, 20px); line-height: 1.5; color: var(--body-cream); margin-top: 14px; max-width: 58ch; }
.intro .dot { color: var(--orange); }
@media (max-width: 600px) { .intro { padding: 22px 18px 14px; } }
