/* Page-level components: project cards, shop, cart, and demo chrome.
   Depends on the tokens in site.css. */

.card-body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  flex: 1;
}

.card-body h3 { font-size: 1.02rem; }
.card-body h3 a { color: var(--fg); text-decoration: none; }
.card-body h3 a:hover { color: var(--accent-lit); }

/* ---------- project cards ---------- */

.project-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--proj-accent) 22%, transparent), transparent 65%),
    var(--bg-soft);
  border-bottom: 1px solid var(--border);
  color: var(--proj-accent, var(--accent-lit));
  text-decoration: none;
}

/* Faint grid, so the preview reads as a screen rather than an empty box. */
.project-preview::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .22;
}

.project-preview-glyph { position: relative; }

.project-preview .chip {
  position: absolute;
  top: .75rem; right: .75rem;
  background: rgba(11,13,18,.8);
}

/* ---------- product cards ---------- */

.product-card .thumb {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  display: block;
}

.price {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fg);
}

/* ---------- homepage split note ---------- */

.split-note {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%),
    var(--surface);
  padding: 2rem;
}

.split-note h2 { font-size: 1.2rem; margin-bottom: .6rem; }
.split-note p { max-width: 62ch; margin-bottom: 1.2rem; }

/* ---------- store filters ---------- */

.filters {
  display: flex;
  gap: .9rem;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.75rem;
}

.filters label { display: flex; flex-direction: column; gap: .3rem; }
.filters select, .filters input { min-width: 11rem; }

.result-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--fg-muted);
}

@media (max-width: 640px) {
  .filters label, .filters select, .filters input { width: 100%; min-width: 0; }
  .result-count { margin-left: 0; }
}

/* ---------- product detail ---------- */

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 820px) { .product-detail { grid-template-columns: 1fr; gap: 1.5rem; } }

.product-detail .hero-img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.product-detail h1 { font-size: 1.7rem; margin-bottom: .75rem; }

.spec-list { color: var(--fg-muted); font-size: .93rem; padding-left: 1.1rem; }
.spec-list li { margin-bottom: .4rem; }

.qty-row { display: flex; align-items: center; gap: .6rem; margin: 1.25rem 0; }
.qty-row input { width: 5rem; }

/* ---------- cart ---------- */

.cart-line {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 1.1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  margin-bottom: .8rem;
}

.cart-line img {
  width: 88px; height: 66px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.cart-line .line-title a { color: var(--fg); text-decoration: none; font-weight: 600; }
.cart-line .line-title a:hover { color: var(--accent-lit); }
.cart-line .line-right { text-align: right; }

@media (max-width: 620px) {
  .cart-line { grid-template-columns: 64px minmax(0, 1fr); }
  .cart-line img { width: 64px; height: 50px; }
  .cart-line .line-right { grid-column: 2; text-align: left; }
}

.link-danger {
  background: none; border: none; padding: 0;
  color: var(--bad); cursor: pointer;
  font-family: var(--mono); font-size: .78rem;
  margin-top: .3rem;
}
.link-danger:hover { text-decoration: underline; }

.totals {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  max-width: 26rem;
  margin-left: auto;
}

.totals-row {
  display: flex; justify-content: space-between;
  margin-bottom: .55rem;
  font-family: var(--mono); font-size: .9rem;
}

.totals-row.grand {
  border-top: 1px solid var(--border);
  padding-top: .8rem; margin-top: .8rem;
  font-size: 1.1rem; font-weight: 700;
}

@media (max-width: 620px) { .totals { max-width: none; } }

/* ---------- demo pages ---------- */

.demo-header { padding: 2.5rem 0 1.5rem; border-bottom: 1px solid var(--border); }
.demo-header h1 { font-size: 1.9rem; margin-bottom: .6rem; }

.demo-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}

.demo-controls {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  align-items: flex-end;
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.demo-controls label { display: flex; flex-direction: column; gap: .35rem; }

.demo-note { color: var(--fg-muted); font-size: .9rem; max-width: 68ch; }

.readout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .8rem;
  margin-top: 1.25rem;
}

.readout div {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .7rem .85rem;
}

.readout dt, .readout .k {
  font-family: var(--mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--fg-dim);
}

.readout dd, .readout .v {
  margin: .25rem 0 0;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
}

/* ---------- build log ---------- */

.log-card { margin-bottom: 1.25rem; }
.log-card.current { border-color: var(--accent-dim); }

.log-head {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
}

.log-head h2 { font-size: 1.1rem; }

.day-log {
  list-style: none;
  margin: .5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.day-log li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 1rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .93rem;
}

.day-name {
  font-family: var(--mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--fg-dim);
  padding-top: .15rem;
}

@media (max-width: 560px) {
  .day-log li { grid-template-columns: 1fr; gap: .2rem; }
}
