:root {
  --bg-0: #0e0d0b;
  --bg-1: #16140f;
  --bg-2: #201d16;
  --bg-3: #2c281f;
  --fg-0: #f4ecd8;
  --fg-1: #d8cfb8;
  --fg-2: #a89e85;
  --fg-3: #756c58;
  --accent: #e8a653;
  --accent-2: #c08243;
  --signal-err: #d97a6c;
  --f-ui: 'Inter Tight', system-ui, sans-serif;
  --f-serif: 'Instrument Serif', serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg-0); color: var(--fg-0); font-family: var(--f-ui); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
img, video { display: block; max-width: 100%; }

/* Shell uses the full viewport width with reasonable side gutters. The old
   980px max was wasting most of a desktop screen. */
.shell {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px clamp(12px, 3vw, 28px) 56px;
}

header.site-hd {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 18px; border-bottom: 1px solid var(--bg-3); margin-bottom: 22px;
}
header.site-hd .brand {
  font-family: var(--f-serif); font-style: italic; font-weight: 700;
  font-size: clamp(26px, 4vw, 34px); letter-spacing: -0.01em; color: var(--accent);
}
header.site-hd .brand a { color: inherit; }
header.site-hd .tagline {
  font-size: 11px; color: var(--fg-2);
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* ---------- Reel grid: 2 cards per row on web, 1 on mobile ---------------- */

.reel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.reel-grid.solo { grid-template-columns: minmax(0, 720px); justify-content: center; }
@media (max-width: 760px) {
  .reel-grid { grid-template-columns: 1fr; gap: 14px; }
}

/* Each card = reel media (left, 9:16) + products list (right). On very narrow
   mobile, products stack BELOW the reel inside the card. */
.reel-card {
  background: var(--bg-1);
  border: 1px solid var(--bg-3);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  min-height: 0;
}
@media (max-width: 480px) {
  .reel-card { grid-template-columns: 1fr; }
}

/* Reel media: 9:16 portrait. Reduced height by capping width — on a 1400px
   viewport, each card is ~675px wide, reel column is ~280px → reel ~498px tall.
   On mobile (1-up), reel column is full card width. */
.reel-media {
  position: relative;
  aspect-ratio: 9 / 16;
  background: var(--bg-2);
  cursor: pointer;
  overflow: hidden;
  /* Cap absolute height so reels don't dominate the viewport */
  max-height: 80vh;
}
.reel-media video, .reel-media img {
  width: 100%; height: 100%; object-fit: cover;
}
.reel-media .no-media {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-3); font-size: 11px;
}
.reel-media .play-badge {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
  transition: opacity 0.15s;
}
.reel-media:hover .play-badge { opacity: 0.85; }

.reel-meta-overlay {
  position: absolute; left: 8px; right: 8px; bottom: 8px;
  display: flex; align-items: center; justify-content: space-between;
  pointer-events: none;
}
.reel-meta-overlay .persona {
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: 0.04em;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 8px;
  border-radius: 4px;
}
.reel-meta-overlay .ig-pill {
  pointer-events: auto;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.06em;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 7px;
  border-radius: 4px;
}
.reel-meta-overlay .ig-pill:hover { color: var(--accent); }

/* ---------- Products column ---------------------------------------------- */

.reel-products {
  padding: 14px 14px 12px;
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
}
.reel-caption {
  font-size: 12.5px;
  color: var(--fg-2);
  line-height: 1.45;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.reel-products-empty {
  font-size: 11px; color: var(--fg-3);
  font-family: var(--f-mono); letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 0;
  border-top: 1px solid var(--bg-3);
}
.product-list {
  display: flex; flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--bg-3);
  flex: 1;
}
.product {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg-3);
}
.product:last-child { border-bottom: none; }
.product img, .product .product-thumb-placeholder {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-2);
}
.product .info { min-width: 0; }
.product .info .name {
  font-size: 13px;
  color: var(--fg-0);
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product .info .desc {
  font-size: 11px;
  color: var(--fg-3);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product .actions {
  display: flex; flex-direction: column; gap: 4px;
  align-items: stretch;
}
.product .actions a {
  display: inline-block;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
}
.btn-check {
  background: transparent;
  color: var(--fg-1);
  border: 1px solid var(--bg-3);
}
.btn-check:hover { color: var(--accent); border-color: var(--accent); }
.btn-buy {
  background: var(--accent);
  color: var(--bg-0);
  font-weight: 700;
  border: 1px solid var(--accent);
}
.btn-buy:hover { background: var(--fg-0); color: var(--bg-0); border-color: var(--fg-0); }

/* On wider cards, lay the two CTAs side-by-side instead of stacked */
@media (min-width: 481px) {
  .product .actions { flex-direction: row; gap: 6px; }
}

/* ---------- Empty / loading / detail extras ------------------------------ */

.empty {
  padding: 80px 20px; text-align: center;
  color: var(--fg-3); font-size: 13px;
}

.back {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 11px;
  font-family: var(--f-mono);
  color: var(--fg-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.back:hover { color: var(--accent); }

.footer {
  margin-top: 56px; padding-top: 20px;
  border-top: 1px solid var(--bg-3);
  font-size: 10px; color: var(--fg-3);
  text-align: center;
  letter-spacing: 0.06em; text-transform: uppercase;
  font-family: var(--f-mono);
}
