/* ==========================================================================
   RUG BURN LLC — tech-precision
   Blueprint navy + millwork brass, IBM Plex, CAD title-block sheet.
   Not Sorted charcoal/silver, not Telec cyan, not PROMAR indigo/mint,
   not BK-TON white paper panels.
   ========================================================================== */

:root {
  --bg: #0d141c;
  --bg-alt: #121c28;
  --bg-deep: #081017;
  --ink: #e8eef4;
  --ink-soft: #8b9aab;
  --ink-invert: #f4f7fa;
  --accent: #c4a36a;
  --accent-soft: #1c2836;
  --line: #243140;
  --accent-ink: #0d141c;
  --rule: color-mix(in srgb, var(--accent) 14%, transparent);

  --font-display: "IBM Plex Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --tracking-display: -0.03em;
  --radius: 2px;
  --radius-lg: 2px;
  --container: 1120px;
  --shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}

html { color-scheme: dark; }

section[id],
.faq__list details {
  scroll-margin-top: 5.5rem;
}

body {
  background:
    linear-gradient(90deg, var(--bg-deep) 0 2.75rem, transparent 2.75rem),
    repeating-linear-gradient(
      to bottom,
      transparent 0 47px,
      var(--rule) 47px 48px
    ),
    var(--bg);
  background-attachment: fixed;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- chrome --- */
.site-header {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  color: var(--ink);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.site-header__brand img {
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.nav a {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav a:hover { color: var(--accent); opacity: 1; }

.btn {
  border-radius: var(--radius);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.68rem;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { color: var(--accent-ink); }
.btn--ghost {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
}
.btn--ghost:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.section__head {
  max-width: 40rem;
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
}
.section__head .lede { margin-top: 0.85rem; }

.field input,
.field textarea,
.field select {
  background: var(--bg-deep);
  color: var(--ink);
  border-color: var(--line);
  border-radius: var(--radius);
}
.field select { padding: 0.85em 1em; }

.site-footer {
  background: var(--bg-deep);
  color: var(--ink);
  border-top-color: var(--line);
}
.footer__grid {
  display: grid;
  gap: var(--gap);
}
.footer__grid nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}
.footer__grid nav a {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
}
.footer__grid nav a:hover { color: var(--accent); }
.footer__grid .muted { margin-top: 0.75rem; max-width: 22rem; }

@media (min-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

/* --- hero: CAD sheet --- */
.hero {
  padding-block: clamp(2rem, 4vw, 4rem) var(--section-y);
}
.hero__sheet {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-alt) 80%, transparent);
  padding: clamp(1.1rem, 2.5vw, 2rem);
}
.hero__file {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.hero__grid { display: grid; gap: var(--gap); }
.hero__copy h1 { max-width: 14ch; }
.hero__copy .lede { margin-top: 1rem; max-width: 38rem; }
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.hero__viewport {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--bg-deep);
}
.hero__viewport img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.hero__dim {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}
.title-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 1.25rem;
  border: 1px solid var(--line);
}
.title-block > div {
  padding: 0.7rem 0.85rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.title-block > div:nth-child(2n) { border-right: 0; }
.title-block > div:nth-child(n + 3) { border-bottom: 0; }
.title-block dt {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.title-block dd {
  margin: 0.2rem 0 0;
  font-size: var(--step--1);
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: minmax(18rem, 0.9fr) 1.2fr;
    align-items: start;
  }
  .title-block {
    grid-template-columns: repeat(4, 1fr);
  }
  .title-block > div {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
  .title-block > div:last-child { border-right: 0; }
}

/* --- protocol --- */
.protocol { background: var(--bg-alt); }
.protocol__layout { display: grid; gap: var(--gap); }
.protocol__photo { margin: 0; border: 1px solid var(--line); }
.protocol__photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.instruments {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.instrument {
  background: var(--bg);
  padding: 1.25rem 1.2rem;
}
.instrument__code {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.instrument h3 {
  font-size: var(--step-1);
  margin: 0.35rem 0 0.5rem;
}
.instrument p { color: var(--ink-soft); font-size: var(--step--1); }

@media (min-width: 900px) {
  .protocol__layout {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: stretch;
  }
  .protocol__photo img { height: 100%; aspect-ratio: auto; }
}

/* --- about --- */
.about__grid { display: grid; gap: var(--gap); }
.about__photo { margin: 0; border: 1px solid var(--line); }
.about__photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.about__copy p + p { margin-top: 1em; }
.about__facts {
  list-style: none;
  padding: 0;
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
}
.about__facts li {
  padding: 0.85rem 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: var(--step--1);
}
.about__facts li:nth-child(2n) { border-right: 0; }
.about__facts li:nth-child(n + 3) { border-bottom: 0; }
.about__facts span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

@media (min-width: 768px) {
  .about__grid {
    grid-template-columns: 0.72fr 1.28fr;
    align-items: center;
  }
}

/* --- services --- */
.services { background: var(--bg-alt); }
.spec-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.spec {
  background: var(--bg);
  padding: 1.4rem 1.25rem;
}
.spec__sku {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.spec h3 {
  font-size: var(--step-1);
  margin: 0.4rem 0 0.7rem;
}
.spec p { color: var(--ink-soft); font-size: var(--step--1); }
.spec--photo {
  display: grid;
  gap: 1rem;
}
.spec--photo figure { margin: 0; }
.spec--photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

@media (min-width: 768px) {
  .spec-grid { grid-template-columns: 1fr 1fr; }
  .spec:last-child { grid-column: 1 / -1; }
  .spec--photo {
    grid-column: 1 / -1;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    padding: 0;
  }
  .spec--photo > div { padding: 1.5rem 1.4rem; }
  .spec--photo img { aspect-ratio: 4 / 3; height: 100%; }
}

/* --- matrix --- */
.matrix__scroll { overflow-x: auto; border: 1px solid var(--line); }
.match {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: var(--step--1);
}
.match th,
.match td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.match thead th {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--bg-alt);
  font-weight: 500;
}
.match tbody th {
  font-weight: 600;
  white-space: nowrap;
}
.match tbody tr:last-child th,
.match tbody tr:last-child td { border-bottom: 0; }
.match tbody tr:hover td,
.match tbody tr:hover th { background: var(--accent-soft); }
.matrix__note {
  margin-top: 1rem;
  max-width: 46rem;
  font-size: var(--step--1);
}

/* --- crew --- */
.crew { background: var(--bg-alt); }
.crew__grid { display: grid; gap: var(--gap); }
.crew__photo { margin: 0; border: 1px solid var(--line); }
.crew__photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.warranty {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.warranty li {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.85rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.warranty span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding-top: 0.15rem;
}
.warranty strong {
  display: block;
  font-size: var(--step-0);
  margin-bottom: 0.25rem;
}
.warranty p { color: var(--ink-soft); font-size: var(--step--1); }

@media (min-width: 900px) {
  .crew__grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
  }
}

/* --- faq --- */
.faq__grid { display: grid; gap: var(--gap); }
.faq__list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.faq__list details { background: var(--bg-alt); }
.faq__list summary {
  cursor: pointer;
  padding: 1.05rem 1.2rem;
  font-weight: 600;
  list-style: none;
}
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list summary::after {
  content: "+";
  float: right;
  font-family: var(--font-mono);
  color: var(--accent);
}
.faq__list details[open] summary::after { content: "–"; }
.faq__list details p {
  padding: 0 1.2rem 1.15rem;
  color: var(--ink-soft);
  max-width: 40rem;
}

@media (min-width: 768px) {
  .faq__grid { grid-template-columns: 0.7fr 1.3fr; align-items: start; }
  .faq .section__head { margin-bottom: 0; }
}

/* --- contact: form left --- */
.contact__grid { display: grid; gap: var(--gap); }
.contact__form,
.contact__meta {
  border: 1px solid var(--line);
  padding: clamp(1.2rem, 3vw, 2rem);
  background: var(--bg-alt);
}
.contact__form { display: grid; gap: 1rem; }
.contact__form h2,
.contact__meta h2 { font-size: var(--step-2); }
.contact__note { margin-top: -0.25rem; }
.contact__list {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
}
.contact__list li {
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}
.contact__list span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.contact__list a { text-decoration: none; }
.contact__list a:hover { color: var(--accent); }
.contact__list address { font-style: normal; }

@media (min-width: 900px) {
  .contact__grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }
}

@media (max-width: 374px) {
  .hero__copy h1 { font-size: var(--step-3); }
  .title-block { grid-template-columns: 1fr; }
  .title-block > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .title-block > div:last-child { border-bottom: 0; }
}

@media (max-width: 699px) {
  body {
    background:
      repeating-linear-gradient(
        to bottom,
        transparent 0 47px,
        var(--rule) 47px 48px
      ),
      var(--bg);
  }
}
