/* product.css — shared layout for /products/<slug> detail pages ("builds").
   Depends on styles.css (the shared "Engineer's Almanac" design system).
   No hardcoded colours — everything reads from the theme tokens in styles.css
   so light + dark + reduced-motion all work for free.

   Used by every page under /products/<slug>/index.html. To add a new build
   page, copy an existing slug folder and edit the content — see README.md. */

/* ---- Page shell ----------------------------------------------------------- */
.product { padding-block: clamp(2.4rem, 6vw, 4rem) clamp(3rem, 8vw, 5.5rem); }
.product-wrap { max-width: 880px; }

/* ---- Top bar: back link + status badge ------------------------------------ */
.product-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: clamp(1.8rem, 5vw, 3rem); flex-wrap: wrap;
}
/* arrow link with the tip on the left (mirrors .arrow from styles.css) */
.back-link {
  font-family: var(--font-mono); font-size: .82rem; letter-spacing: .02em;
  color: var(--ink-2); display: inline-flex; align-items: center; gap: .5em;
  transition: color .2s var(--ease);
}
.back-link .tip { color: var(--accent); transition: transform .25s var(--ease); }
.back-link:hover { color: var(--accent); }
.back-link:hover .tip { transform: translateX(-.3em); }

/* ---- Header --------------------------------------------------------------- */
.product-head { margin-bottom: clamp(2rem, 5vw, 3.2rem); }
.product-head .eyebrow { margin-bottom: var(--sp-3); }
.product-title {
  font-family: var(--font-display); font-weight: 430;
  font-size: clamp(2.1rem, 5vw, 3.5rem); line-height: 1.04; letter-spacing: -.025em;
  font-optical-sizing: auto; max-width: 20ch; margin-bottom: 1.3rem;
}
.product-head .lede { max-width: 44ch; margin-bottom: 2rem; }

/* ---- Meta strip (mono): status + stack ------------------------------------ */
.product-meta {
  font-family: var(--font-mono); font-size: .74rem;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: grid; gap: 0;
}
.product-meta .meta-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 0; border-bottom: 1px solid var(--line-2);
}
.product-meta .meta-row:last-child { border-bottom: 0; }
.product-meta .meta-key {
  color: var(--ink-3); letter-spacing: .14em; text-transform: uppercase;
  font-size: .64rem; flex-shrink: 0; width: 5.5rem;
}
.product-meta .meta-val { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }

/* ---- Body sections -------------------------------------------------------- */
.product-section {
  display: grid; grid-template-columns: minmax(0, 9rem) 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  padding-block: clamp(2rem, 5vw, 3.2rem);
  border-top: 1px solid var(--line);
}
.section-label {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3);
  padding-top: .35rem;
}
.section-label .num { color: var(--accent); margin-right: .5em; }
.product-section .prose { max-width: 60ch; }
.product-section .tags { margin-top: .2rem; }

/* ---- Closing CTA ---------------------------------------------------------- */
.product-cta {
  margin-top: clamp(2.4rem, 6vw, 3.6rem); padding-top: clamp(2rem, 5vw, 3rem);
  border-top: 1px solid var(--line);
}
.product-cta h2 { margin-bottom: 1.2rem; max-width: 18ch; }
.product-cta .hero-cta { display: flex; flex-wrap: wrap; gap: .85rem; }

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 760px) {
  .product-section { grid-template-columns: 1fr; gap: .75rem; }
  .section-label { padding-top: 0; }
}

/* ===========================================================================
   Case-studies INDEX (/case-studies) — list of all builds.
   Reuses .card / .badge / .tags / .eyebrow / .lede from styles.css.
   =========================================================================== */
.cs-index { padding-block: clamp(2.4rem, 6vw, 4rem) clamp(3rem, 8vw, 5rem); }

.cs-head { margin-bottom: clamp(2rem, 5vw, 3rem); max-width: 30ch; }
.cs-head .display { margin-top: .2rem; }
.cs-head .lede { margin-top: 1.4rem; max-width: 40ch; }

/* Card grid — two up on wide screens, one up below 760px */
.cs-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

/* Each build card is a flex column so footers (tags + read link) line up */
.cs-card { display: flex; flex-direction: column; gap: 1rem; color: inherit; }
a.cs-card:hover { color: inherit; }

.cs-card-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: .8rem; flex-wrap: wrap;
}
.cs-num {
  font-family: var(--font-mono); font-size: .7rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}
.cs-title {
  font-family: var(--font-display); font-weight: 460;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem); line-height: 1.1;
  letter-spacing: -.02em; color: var(--ink);
}
.cs-hook {
  font-family: var(--font-reading); font-size: 1.08rem; line-height: 1.5;
  color: var(--ink-2); max-width: 46ch;
}
.cs-foot { margin-top: auto; display: flex; flex-direction: column; gap: 1rem; padding-top: .3rem; }

.cs-read {
  font-family: var(--font-mono); font-size: .88rem; font-weight: 500;
  letter-spacing: .01em; color: var(--ink);
  display: inline-flex; align-items: center; gap: .5em;
}
.cs-read .tip { color: var(--accent); transition: transform .25s var(--ease); }
a.cs-card:hover .cs-read { color: var(--accent); }
a.cs-card:hover .cs-read .tip { transform: translateX(.3em); }

/* Closing CTA reuses .product-cta from above */

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