/* ============================================================
   circuitbent.tv — SCIENTIFICALLY BROKEN (pass 1, 2026-08-05)
   One voice: the site is a technical document; the subject
   matter is beautiful wreckage. Black on paper, monospace,
   hairline rules. Glitch images are specimens with captions.
   The deadpan never winks.
   ============================================================ */

:root {
  --paper: #f7f6f2;
  --ink: #111111;
  --muted: #5f5f5a;
  --line: #111111;
  --line-soft: #c9c7bf;
  --max: 52rem;
  --mono: "SF Mono", ui-monospace, Menlo, "Courier New", monospace;
}

/* dark mode — light is the paperwork, dark is the tube. Paper becomes
   switched-off CRT glass; the specimens become the only light source. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161614;
    --ink: #e6e4de;
    --muted: #8b8983;
    --line: #cfcdc7;
    --line-soft: #3a3936;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
}

.site-header,
main,
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* title block — drawing-sheet corner stamp energy */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.4rem;
  padding-bottom: 0.9rem;
  border-bottom: 2px solid var(--line);
  flex-wrap: wrap;
}

.wordmark {
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-header nav {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.site-header nav a.active,
.site-header nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

main {
  padding-top: 2.2rem;
  padding-bottom: 4rem;
  min-height: 60vh;
}

h1 {
  font-size: 1.35rem;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 2.2rem 0 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
}

a {
  color: var(--ink);
  text-underline-offset: 3px;
}

.muted {
  color: var(--muted);
}

.rule-note {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---- figures: specimens with coordinates ---- */
figure.fig {
  margin: 2rem 0;
  border: 1px solid var(--line);
}

figure.fig img {
  display: block;
  width: 100%;
  height: auto;
}

figure.fig figcaption {
  border-top: 1px solid var(--line);
  padding: 0.55rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1.5;
}

figure.fig figcaption .fig-no {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

figure.fig figcaption .fig-params {
  display: block;
  color: var(--muted);
}

/* figure strip — characteristic-curve sequences, side by side */
.fig-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  margin: 2rem 0;
}

.fig-strip > div {
  border-right: 1px solid var(--line);
}

.fig-strip > div:last-child {
  border-right: none;
}

.fig-strip img {
  display: block;
  width: 100%;
  height: auto;
}

.fig-strip .strip-label {
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

/* ---- catalog table (products index) ---- */
table.catalog {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

table.catalog th,
table.catalog td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  vertical-align: top;
}

table.catalog th {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

table.catalog a {
  font-weight: 700;
}

.status-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}

/* ---- product spec sheet ---- */
.spec-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.buy {
  display: inline-block;
  border: 2px solid var(--ink);
  padding: 0.55rem 1.2rem;
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1.2rem;
}

.buy:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---- unit grid: one-of-one builds; sold units stay as the catalog ---- */
.series-head {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1.6rem 0 0.6rem;
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
}

.unit-card {
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.unit-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* sold = voided like a drawing revision: one hairline strike, nothing loud */
.unit-card.sold .unit-photo {
  position: relative;
}

.unit-card.sold img {
  filter: grayscale(0.35);
  opacity: 0.8;
}

.unit-card.sold .unit-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top right,
    transparent calc(50% - 0.5px),
    var(--ink) calc(50% - 0.5px),
    var(--ink) calc(50% + 0.5px),
    transparent calc(50% + 0.5px)
  );
}

.unit-card.sold .unit-serial {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.unit-meta {
  border-top: 1px solid var(--line);
  padding: 0.5rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.unit-serial {
  font-weight: 700;
}

.unit-finish {
  color: var(--muted);
}

.unit-status {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.unit-buy {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

/* ---- red crumbs: annotations that are artifacts, not decoration ----
   Real values, wire colors, thresholds — decodable by anyone who studies
   the artwork. Crumbs never lie. Usage: wrap an image in .fig-annot and
   drop .crumb spans with inline top/left percentages. */
.fig-annot {
  position: relative;
}

.crumb {
  position: absolute;
  color: #b3261e;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transform: rotate(-4deg);
  text-shadow: 0 0 2px var(--paper);
  pointer-events: none;
  white-space: nowrap;
}

.crumb.tick::before {
  content: "◯ ";
  font-weight: 400;
}

/* ---- ascii diagram blocks ---- */
pre.diagram {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  padding: 1rem 1.2rem;
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 1.5rem 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 2px solid var(--line);
  padding-top: 1rem;
  padding-bottom: 2.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  flex-wrap: wrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-footer a {
  color: var(--muted);
}

/* ---- print: the site claims to be a document; behave like one ---- */
@media print {
  body {
    background: #fff;
    font-size: 11pt;
  }
  .site-header nav,
  .buy,
  video {
    display: none;
  }
  figure.fig,
  .fig-strip,
  pre.diagram {
    break-inside: avoid;
  }
  a {
    text-decoration: none;
    color: #000;
  }
}
