/* ==========================================================================
   KHC Precision — shared stylesheet (the only stylesheet)
   Mobile-first. DARK ONLY, by design — the site always renders the graphite
   theme regardless of the visitor's OS preference. Don't add a light theme
   or prefers-color-scheme queries without a deliberate decision.
   No frameworks, no build step: edit this file directly.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------ */

:root {
  /* Graphite plate, machinist-orange accent */
  --bg: #111318;
  --surface: #181b21;
  --surface-2: #1f232b;
  --ink: #dfe2e6;
  --ink-strong: #f4f5f7;
  --muted: #98a1ad;
  --line: #2a2f38;
  --line-strong: #3a4150;
  --accent: #f07b3c;
  --accent-ink: #f68d55;
  --accent-contrast: #16181d;
  --grid-line: rgba(223, 226, 230, 0.05);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  /* Dark-only: keeps native form controls and scrollbars dark too */
  color-scheme: dark;
}

/* ---- Base ---------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  color: var(--ink-strong);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
  overflow-wrap: break-word;
}

h1 { font-size: clamp(1.85rem, 5.5vw, 2.8rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 3.6vw, 1.7rem); font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }

p { margin: 0 0 1rem; }

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

img, svg { max-width: 100%; height: auto; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

strong { color: var(--ink-strong); }

::selection { background: var(--accent); color: var(--accent-contrast); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---- Layout primitives --------------------------------------------------- */

.container {
  width: min(100% - 2.5rem, 66rem);
  margin-inline: auto;
}

/* "Narrow" sections keep the same left edge as every other section (same
   container width) and only cap their content's line length — a narrower,
   centered container made the safety/contact headings look indented on
   desktop next to the full-width sections above them. */
.container--narrow > * { max-width: 46rem; }

.section { padding-block: 3rem; }

@media (min-width: 720px) {
  .section { padding-block: 4.5rem; }
}

/* Mono "engineering label" above a heading, e.g. 01 / SENSORS */
.kicker {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 0.75rem;
}

.kicker::before { content: "// "; opacity: 0.6; }

.lede {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 44rem;
}

/* ---- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 0.7rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 4px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.btn--primary:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: var(--accent-contrast);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-strong);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 0;
  list-style: none;
}

/* ---- Header ---------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  /* Machined accent edge along the very top of every page */
  border-top: 3px solid var(--accent);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink-strong);
}

.brand-mark { width: 1.75rem; height: 1.75rem; flex: none; }

.brand-name {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-name small {
  /* Hidden below 480px: .brand-name is nowrap, and this tracked-out mono
     line is the widest thing in the header — it overflows a 375px screen. */
  display: none;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.1;
}

/* 560px, not 480: with the cart icon in the nav, the tracked-out subline no
   longer fits alongside the full nav on 480px-class screens. */
@media (min-width: 560px) {
  .brand-name small { display: block; }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.site-nav a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
}

.site-nav a:hover { color: var(--accent-ink); }

.site-nav a[aria-current="page"] {
  color: var(--accent-ink);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

.site-nav .nav-cta {
  padding: 0.42rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent-ink);
  font-weight: 600;
}

.site-nav .nav-cta:hover,
.site-nav .nav-cta[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-contrast);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.42rem;
}

/* Compact header on phones: brand + DIY + Store + cart icon must fit 320px.
   The Home text link goes (the brand mark is the home link); everything
   tightens a notch. Verified via .header-row scrollWidth at 320/375. */
@media (max-width: 479px) {
  .header-row { gap: 0.5rem; }
  .brand { gap: 0.45rem; }
  .brand-mark { width: 1.5rem; height: 1.5rem; }
  .brand-name { font-size: 0.95rem; }
  .site-nav { gap: 0.6rem; }
  .site-nav .nav-cta { padding: 0.42rem 0.7rem; }
  .site-nav a:first-child { display: none; }
}

/* ---- Cart ---------------------------------------------------------------- */

.nav-cart {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--ink);
  /* Room for the badge's overhang so it never widens the header row. */
  padding-right: 6px;
}

.nav-cart:hover { color: var(--accent-ink); }

.nav-cart svg { width: 22px; height: 22px; }

.cart-count {
  position: absolute;
  top: -7px;
  right: 0;
  min-width: 1rem;
  height: 1rem;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* display:grid above would defeat the hidden attribute without this. */
.cart-count[hidden] { display: none; }

/* Add-to-cart product block (store grid / optics buy area / DIY parts) */
.cart-add {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.1rem 1.2rem;
  min-width: 15rem;
  max-width: 24rem;
}

.cart-add .btn { margin-top: 0.9rem; }

.cart-add .repo-name { margin: 0 0 0.15rem; }

.cart-add p.optic-price { margin: 0 0 0.85rem; }

/* Cart page */
.cart-rows { list-style: none; padding: 0; margin: 1.5rem 0 0; }

.cart-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}

.cart-row:last-child { border-bottom: 1px solid var(--line); }

.cart-row-info .repo-name { display: block; }

.cart-row-controls { display: flex; align-items: center; gap: 0.9rem; }

input,
select {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0.5rem 0.65rem;
}

.cart-remove {
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.cart-remove:hover { color: var(--accent-ink); }

.cart-summary { margin-top: 1.25rem; color: var(--muted); }

.cart-checkout { margin-top: 1.5rem; display: grid; gap: 0.6rem; max-width: 26rem; }

.cart-checkout label { font-size: 0.9rem; color: var(--muted); }

.cart-error { color: var(--accent-ink); font-size: 0.92rem; margin: 0; }

/* Standalone notice at the top of the cart (e.g. "X was removed"). */
[data-cart-page] > .cart-error { margin-bottom: 1.25rem; }

.cart-note { color: var(--muted); font-size: 0.88rem; margin-top: 1.25rem; max-width: 34rem; }
.cart-verify { display: grid; gap: 0.5rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.cart-verify-text { margin: 0; font-size: 0.95rem; }
.cart-verify input#cart-code { font: 600 1.4rem/1.2 var(--mono, monospace); letter-spacing: 0.3em; max-width: 12rem; }
.cart-remember { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--muted); }
.cart-verify-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0; }
.link-button { background: none; border: 0; padding: 0.35rem 0; color: var(--accent-ink); font: inherit; font-size: 0.9rem; text-decoration: underline; cursor: pointer; min-height: 44px; }
.link-button[hidden] { display: none; }
.cart-verify[hidden], .cart-verify [hidden] { display: none; }

/* ---- Hero (homepage) -------------------------------------------------------- */

.hero {
  /* Blueprint grid: hairline squares fading toward the bottom */
  background-image:
    linear-gradient(to bottom, transparent 55%, var(--bg)),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  border-bottom: 1px solid var(--line);
  padding-block: 3.5rem 3rem;
}

@media (min-width: 720px) {
  .hero { padding-block: 5rem 4.5rem; }
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 840px) {
  .hero-grid { grid-template-columns: 7fr 4fr; }
}

.hero h1 { max-width: 22ch; margin-bottom: 1rem; }

.hero .lede { margin-bottom: 0; }

.hero-art {
  display: none;
  color: var(--muted);
}

@media (min-width: 840px) {
  .hero-art { display: block; }
}

/* Small mono spec readouts under the hero copy */
.hero-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1.75rem;
  padding: 0;
  list-style: none;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-specs li::before { content: "▸ "; color: var(--accent); }

/* ---- Cards ------------------------------------------------------------------ */

.card-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

@media (min-width: 720px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem 1.4rem 1.4rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Chamfered corner — a machinist's edge break, top right */
.card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: linear-gradient(225deg, var(--accent) 50%, transparent 50.5%);
}

.card .kicker { margin-bottom: 0.5rem; }

.card h3 { margin-bottom: 0.5rem; }

.card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 0; }

/* Product thumbnail at the top of a card (Stripe-hosted photo).
   aspect-ratio reserves the space so the grid doesn't shift while the
   image loads; contain (not cover) keeps product shots uncropped. */
.card .card-figure {
  aspect-ratio: 4 / 3;
  margin: 0 0 0.9rem;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
}

.card .card-figure img { width: 100%; height: 100%; object-fit: contain; }

/* First description paragraph on a card, clamped to three lines. */
.card p.card-summary {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Store buy-cards carry full Stripe content: paragraph spacing, a compact
   highlights list, and the Add-to-cart button at the bottom. */
.card p + p { margin-top: 0.6rem; }

.card .optic-features {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.card button[data-add-to-cart] { margin-top: 1.1rem; }

/* "N in stock" tag on cards and buy areas (tracked products only). */
.stock-note {
  margin: 0.35rem 0 0;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* Press-config picker: brand / model / autodrive selects gating the
   Add-to-cart button on products with metadata config=press. */
.config-picker {
  display: grid;
  gap: 0.5rem;
  margin: 0.9rem 0 0;
}

.config-picker select { width: 100%; font-size: 0.9rem; }
.config-picker select[hidden] { display: none; }

/* A conditional price under the main one ("$225.00 — B Team Engineering · 12V board"). */
.variant-note {
  margin: 0.35rem 0 0;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--muted);
}
.cart-add .variant-note { margin: -0.5rem 0 0.85rem; }

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Sold-out marker in place of the Add-to-cart button. */
.card .oos-tag {
  margin: 1.1rem 0 0;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.card .card-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}

.card .card-link::after { content: " →"; }

/* ---- Trust / process strip ---------------------------------------------------- */

.spec-strip {
  display: grid;
  gap: 1rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .spec-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .spec-strip { grid-template-columns: repeat(5, 1fr); }
}

.spec-strip li {
  border-top: 2px solid var(--line-strong);
  padding-top: 0.85rem;
}

.spec-strip .spec-num {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--accent-ink);
  margin-bottom: 0.35rem;
}

.spec-strip h3 { font-size: 0.98rem; margin-bottom: 0.3rem; }

.spec-strip p { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* ---- Notices -------------------------------------------------------------------- */

/* Safety callout: honest, prominent, not alarmist */
.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 1.4rem 1.5rem;
  margin-top: 1.5rem;
}

.notice h3 { margin-bottom: 0.5rem; }

.notice p { margin-bottom: 0; color: var(--muted); }

.notice p + p { margin-top: 0.75rem; }

/* ---- Store ------------------------------------------------------------------------ */

.store-intro p { max-width: 46rem; }

.store-intro .notice { margin: 0 0 1.5rem; max-width: 46rem; }

.product-group {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  /* Anchor targets land below the sticky site header + jump nav */
  scroll-margin-top: 7rem;
}

.product-group .group-after { margin-top: 1.5rem; }

/* DIY page: one block per design */
.design {
  margin-top: 2.5rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  scroll-margin-top: 4.5rem;
}

.design:first-child { margin-top: 1rem; border-top: 0; padding-top: 0; }

.design > p { color: var(--muted); max-width: 44rem; }

.design-note { font-size: 0.9rem; margin-top: 0.75rem; }

/* Build-docs button row at the top of each DIY design. */
.design-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 0.25rem 0 1.75rem;
}

/* Part buttons under a DIY design: tighter, and left-aligned to match the
   design copy (a single centered block looks stranded). */
.design .buy-button-grid { margin-top: 0.75rem; justify-content: flex-start; }

/* Generated jump chips sit inside the flex row as if they were direct children */
.jump-chips { display: contents; }

.design .optic-links { align-items: baseline; }

.design .optic-links .repo-slug { font-weight: 400; }

/* Sticky section index under the site header (store page). Chips scroll
   horizontally inside the bar on narrow screens so the page never widens. */
.jump-nav {
  position: sticky;
  top: calc(3.5rem + 4px); /* site header: 3.5rem row + 3px top + 1px bottom border */
  z-index: 15;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.jump-nav-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-block: 0.6rem;
}

.jump-nav-row::-webkit-scrollbar { display: none; }

.jump-label {
  flex: none;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.25rem;
}

.jump-nav a {
  flex: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.jump-nav a:hover { border-color: var(--accent); color: var(--accent-ink); }

.jump-nav .jump-top { margin-left: auto; border-color: transparent; color: var(--muted); }

.product-group > p {
  color: var(--muted);
  max-width: 44rem;
}

/* Compact buy-button groups (DIY part buttons): each .cart-add block is
   its own small card, laid out in a wrapping row that centers and stacks
   on narrow screens. */
.buy-button-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem auto 0;
}

/* The notice replaces the buttons, so it spans the whole flex row. */
.buy-button-grid > .oos-notice { flex: 1 1 100%; }

/* Row list of linked items (store's compact optics list, rendered by
   assets/products.js) */
.repo-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.6rem;
  max-width: 34rem;
}

.repo-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.repo-list a:hover { border-color: var(--accent); }

.repo-name {
  display: block;
  font-weight: 600;
  color: var(--ink-strong);
}

.repo-slug {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Out-of-stock notice: fills an empty category grid or an optic's buy area */
.oos-notice {
  text-align: center;
  padding: 2.25rem 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
}

.oos-notice h3 { margin-bottom: 0.5rem; }

.oos-notice p {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---- Legal / long-form pages ("prose") ----------------------------------------------- */

.page-header {
  border-bottom: 1px solid var(--line);
  padding-block: 2.5rem 2rem;
  background-image:
    linear-gradient(to bottom, transparent 40%, var(--bg)),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
}

.effective-date {
  display: inline-block;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-strong);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  margin-bottom: 1.25rem;
}

.prose { max-width: 46rem; }

.prose h2 {
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.prose ul { padding-left: 1.25rem; margin: 0 0 1rem; }

.prose li { margin-bottom: 0.6rem; }

.prose li p { margin-bottom: 0; }

/* ---- Transactional pages (thankyou / success / cancel / billing / 404) ------------------ */

.status-page {
  padding-block: 3.5rem;
  max-width: 42rem;
}

.status-page .status-icon {
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 1.25rem;
  color: var(--accent);
}

.contact-lines {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
}

.contact-lines li {
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
}

.contact-lines li:last-child { border-bottom: 1px solid var(--line); }

.contact-lines .contact-label {
  display: inline-block;
  min-width: 6.5rem;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-lines a { overflow-wrap: anywhere; }

/* ---- Footer -------------------------------------------------------------------------------- */

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: 2.5rem 2rem;
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.4fr; }
}

.footer-brand p { color: var(--muted); margin: 0.5rem 0 0; max-width: 30ch; }

.footer-heading {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li { margin-bottom: 0.4rem; }

.footer-links a {
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.footer-links a:hover { color: var(--accent-ink); }

.footer-note {
  margin: 2.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-note p { margin: 0 0 0.35rem; }

/* ---- Product catalog: optics cards/details, prices (rendered by assets/products.js) ---- */

/* Homepage has four catalog cards: 2×2 on tablets, one row on wide screens.
   Placed after .card-grid so the same-specificity override wins. */
@media (min-width: 720px) {
  .card-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .card-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.optic-price {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink-strong);
}

.card p.optic-price { margin: 0.9rem 0 0; }

/* One detail block per product; scroll-margin keeps #slug deep links from
   hiding the heading under the sticky header. */
.optic {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  scroll-margin-top: 4.5rem;
}

.optic p.optic-price { margin: 0 0 1.25rem; font-size: 1.25rem; }

.optic-subhead {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.75rem 0 0.6rem;
}

.optic-figure {
  aspect-ratio: 4 / 3;
  max-width: 30rem;
  margin: 0 0 1.5rem;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.75rem;
  color: var(--muted);
  overflow: hidden;
}

.optic-figure svg { width: 36%; max-width: 150px; opacity: 0.6; }

.optic-figure img { width: 100%; height: 100%; object-fit: contain; }

/* A real product photo: the dashed border is the placeholder look only. */
.optic-figure--photo { border-style: solid; }

.optic-figure figcaption {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.optic-features {
  padding-left: 1.25rem;
  margin: 0;
  color: var(--muted);
}

.optic-features li { margin-bottom: 0.4rem; }

/* Spec sheet as a two-column definition grid; a <table> would be the classic
   375px overflow source. */
.spec-list {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) 2fr;
  gap: 0 1rem;
  max-width: 40rem;
  margin: 0;
}

.spec-list dt,
.spec-list dd {
  margin: 0;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
}

.spec-list dt {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.7rem;
}

.spec-list dd { overflow-wrap: anywhere; }

.buy-area { margin-top: 1.75rem; }

.fulfillment-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.75rem 0 0;
}

/* Status notice, not a safety warning: neutral edge instead of the accent. */
.notice.coming-soon { border-left-color: var(--line-strong); margin-top: 0; }

.notice.coming-soon .kicker { color: var(--muted); margin-bottom: 0.4rem; }

.notice.coming-soon p:first-of-type { color: var(--ink-strong); font-weight: 600; }

.optic-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1.25rem 0 0;
  font-weight: 600;
  font-size: 0.92rem;
}

.optic-links a { text-decoration: none; }

.optics-list .optic-price { flex: none; font-size: 0.95rem; }


/* ---- Free registration form (/register) ---------------------------------------------------- */

.reg-form { margin-top: 1.5rem; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 0.9rem;
  max-width: 34rem;
}

.field {
  display: grid;
  gap: 0.3rem;
  grid-column: span 2;
  min-width: 0;
}

.field span { font-size: 0.9rem; color: var(--muted); }

.field input { width: 100%; min-width: 0; }

@media (min-width: 560px) {
  .field { grid-column: span 1; }
}

.field-note { color: var(--muted); font-size: 0.85rem; margin: 0.85rem 0 0; }

.reg-form .btn-row { margin-top: 1.25rem; }

/* Honeypot: off-screen, not display:none (some bots skip hidden fields). */
.reg-trap {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
