/* =====================================================================
   jlcpcb-mapper · landing page
   Aesthetic: engineering drawing meets terminal printout.
   Cream paper, ink, copper accent. All-mono UI; sans for prose.
   ===================================================================== */

:root {
  /* palette */
  --paper:        #f3eed9;
  --paper-deep:   #ebe4c2;
  --paper-edge:   #e6dfb9;
  --ink:          #1c1d1a;
  --ink-soft:     #4a463a;
  --ink-faint:    #6f6a59;
  --copper:       #b85e2c;
  --copper-warm:  #d97a3f;
  --copper-deep:  #8c441e;
  --blueprint:    #2b5c8c;
  --rule:         #c1b388;
  --rule-soft:    #d4c89c;
  --highlight:    #f4d96b;
  --grid:         rgba(28, 29, 26, 0.045);
  --shadow:       rgba(28, 29, 26, 0.18);

  /* type */
  --font-sans:  "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:  "IBM Plex Mono", ui-monospace, "SFMono-Regular", "Menlo", monospace;
  --font-serif: "IBM Plex Serif", "Iowan Old Style", Georgia, serif;

  /* layout */
  --container: 1180px;
  --content:   720px;
  --gap:       1.25rem;
}

/* ---------- reset & base ---------- */

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

html, body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* engineering grid paper texture */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--copper);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1.5px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover {
  color: var(--copper);
  text-decoration-color: var(--ink);
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: rgba(184, 94, 44, 0.09);
  padding: 0.05em 0.4em;
  border-radius: 0;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }

em { font-style: italic; }

::selection {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- title block (engineering drawing) ---------- */

.title-block {
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 20;
  /* fine line above to suggest a paper edge */
  box-shadow: 0 0 0 1px var(--ink) inset, 0 1px 0 0 var(--ink);
}

.tb-grid {
  display: grid;
  grid-template-columns: 2.4fr 1fr 1.4fr 0.7fr 1fr;
  font-family: var(--font-mono);
  max-width: var(--container);
  margin: 0 auto;
}

.tb-cell {
  padding: 0.55rem 1.1rem 0.6rem;
  border-right: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-height: 3.1rem;
  justify-content: center;
}
.tb-cell:last-child { border-right: 0; }

.tb-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  font-weight: 500;
}

.tb-value {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
}

.tb-name .tb-value {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tb-link a {
  text-decoration: none;
  display: contents;
  color: var(--ink);
}
.tb-link:hover .tb-value {
  color: var(--copper);
}

@media (max-width: 880px) {
  .tb-grid {
    grid-template-columns: 1fr 1fr;
  }
  .tb-cell { border-bottom: 1px solid var(--ink); border-right: 1px solid var(--ink); }
  .tb-cell:nth-child(even) { border-right: 0; }
  .tb-cell:nth-last-child(-n+2) { border-bottom: 0; }
  .tb-name { grid-column: 1 / -1; border-right: 0; }
}

/* ---------- hero ---------- */

.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.2rem, 4vw, 2.5rem) clamp(4rem, 9vw, 7rem);
  position: relative;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--copper);
  margin: 0 0 2rem;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.hero h1 {
  font-family: var(--font-mono);
  font-size: clamp(2.1rem, 5.6vw, 4.6rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0 0 2.2rem;
  color: var(--ink);
  max-width: 17ch;
}

.hl {
  background: linear-gradient(
    180deg,
    transparent 60%,
    rgba(244, 217, 107, 0.62) 60%,
    rgba(244, 217, 107, 0.62) 92%,
    transparent 92%
  );
  font-style: italic;
  padding: 0 0.04em;
  font-weight: 500;
}

.lead {
  max-width: 38em;
  font-size: 1.1rem;
  line-height: 1.62;
  color: var(--ink-soft);
  margin: 0 0 2.6rem;
}

.lead em {
  color: var(--ink);
  font-weight: 500;
}

.hero-cta {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn,
.btn-text {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  font-weight: 500;
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

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

.btn-text {
  color: var(--ink-soft);
  padding: 0.6rem 0.4rem;
  text-decoration-color: var(--rule);
}
.btn-text:hover {
  color: var(--copper);
  text-decoration-color: var(--copper);
}

/* dimension line decoration */
.dimension {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  max-width: 42rem;
}

.dim-tick {
  width: 1px;
  height: 12px;
  background: var(--ink-soft);
}
.dim-line {
  flex: 1;
  height: 1px;
  background: var(--ink-soft);
  position: relative;
}
.dim-text {
  white-space: nowrap;
  letter-spacing: 0.04em;
}

/* ---------- sections ---------- */

.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(3.5rem, 6vw, 5rem) clamp(1.2rem, 4vw, 2.5rem);
  border-top: 1px solid var(--rule);
  position: relative;
}

.section-tight {
  padding-bottom: clamp(2.5rem, 4vw, 3.5rem);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.6rem;
  margin-bottom: 2.2rem;
  flex-wrap: wrap;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--copper);
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.section h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--ink);
}

.section h3.sub {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 0.8rem;
  color: var(--copper);
  text-transform: uppercase;
}

.section-body {
  /* layout container; children control width/grid */
}

.section .prose {
  max-width: 42em;
}

.section .prose p {
  font-size: 1.025rem;
  line-height: 1.65;
  color: var(--ink);
}

.footnote {
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-style: italic;
}

.two-col {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.2rem);
  align-items: start;
}

@media (max-width: 880px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ---------- callout (stats) ---------- */

.callout {
  background: rgba(184, 94, 44, 0.06);
  border: 1px solid var(--copper);
  border-left-width: 3px;
  padding: 1.5rem 1.6rem 1.6rem;
  font-family: var(--font-mono);
  position: relative;
}

.callout::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--copper);
  border-right: 1px solid var(--copper);
}
.callout::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 10px;
  width: 10px;
  height: 10px;
  border-bottom: 1px solid var(--copper);
  border-left: 1px solid var(--copper);
}

.callout-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--copper-deep);
  margin-bottom: 1.2rem;
  font-weight: 600;
}

.callout-stats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.95rem;
}

.callout-stats li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px dashed var(--rule);
}
.callout-stats li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.callout-stats strong {
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--ink);
  font-feature-settings: "tnum", "ss01";
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.callout-stats .pct {
  font-size: 0.95rem;
  color: var(--copper);
  margin-left: 0.05em;
  font-weight: 500;
}

.callout-stats span:not(.pct) {
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.4;
  font-family: var(--font-mono);
}

/* ---------- pipeline ---------- */

.pipeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr;
  align-items: stretch;
  margin: 2.5rem 0 1.5rem;
  font-family: var(--font-mono);
}

.stage {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 1.1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.stage:hover {
  border-color: var(--copper);
  background: rgba(184, 94, 44, 0.04);
}

.stage-id {
  font-size: 0.72rem;
  color: var(--copper);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.stage-body {
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.5;
}

.stage-body code {
  font-size: 0.95em;
  background: rgba(28, 29, 26, 0.06);
}

.stage-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.6rem;
  color: var(--copper);
  font-size: 1.4rem;
  font-weight: 500;
}

.path-badge {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  border: 1px solid currentColor;
  text-transform: uppercase;
  margin-right: 0.15rem;
  vertical-align: 1px;
}

.path-single   { color: var(--ink-soft); }
.path-score    { color: var(--blueprint); }
.path-llm      { color: var(--copper); }

@media (max-width: 880px) {
  .pipeline {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .stage-arrow {
    height: 1.5rem;
    transform: rotate(90deg);
    padding: 0;
    align-self: center;
  }
  .stage { border-bottom: none; }
  .stage:last-of-type { border-bottom: 1px solid var(--rule); }
}

/* ---------- report card ---------- */

.report-card {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: clamp(1.5rem, 3vw, 2.4rem);
  margin-top: 2.5rem;
  position: relative;
  box-shadow: 6px 6px 0 var(--ink);
}

@media (max-width: 880px) {
  .report-card { box-shadow: 4px 4px 0 var(--ink); }
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 0.85rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.report-meta {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.report-badge {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
  border: 1px solid var(--copper);
  padding: 0.1rem 0.55rem;
  font-weight: 600;
}

.report-title {
  font-family: var(--font-mono);
  font-size: 1.18rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  letter-spacing: -0.015em;
}

.ref-list {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 1.4rem;
}

.selected {
  font-family: var(--font-mono);
  font-size: 1rem;
  margin: 1.1rem 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.selected-label {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.selected a {
  text-decoration-color: var(--copper);
  font-weight: 500;
}

.dash { color: var(--ink-faint); }

.part-spec {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin: 1.1rem 0 1.5rem;
}

.part-spec li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.part-spec strong {
  color: var(--ink-faint);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.1rem 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
}

.tier-basic    { background: var(--ink); color: var(--paper); }
.tier-preferred { color: var(--copper); border: 1px solid var(--copper); }
.tier-extended { color: var(--ink-faint); border: 1px solid var(--rule); }

.rationale {
  background: linear-gradient(
    180deg,
    rgba(244, 217, 107, 0.45),
    rgba(244, 217, 107, 0.18)
  );
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--copper);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 1.2rem 0 0.5rem;
}

.rat-key {
  font-weight: 600;
  color: var(--copper-deep);
  margin-right: 0.4rem;
}

.alts {
  margin-top: 1.6rem;
  font-family: var(--font-mono);
}

.alts summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.82rem;
  user-select: none;
  padding: 0.3rem 0;
  list-style: none;
  position: relative;
  padding-left: 1.4rem;
}
.alts summary::-webkit-details-marker { display: none; }

.alts summary::before {
  content: "+";
  position: absolute;
  left: 0;
  color: var(--copper);
  font-weight: 600;
  width: 1.1rem;
  display: inline-block;
  text-align: center;
}
.alts[open] summary::before { content: "−"; }

.alts summary:hover { color: var(--copper); }

.alts-table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.alts-table th, .alts-table td {
  text-align: left;
  padding: 0.5rem 0.85rem 0.5rem 0;
  border-bottom: 1px dotted var(--rule);
}
.alts-table th {
  font-weight: 500;
  color: var(--ink-faint);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.alts-table td code {
  background: transparent;
  padding: 0;
  color: var(--copper);
}

/* ---------- code block ---------- */

.code-block {
  background: var(--ink);
  color: var(--paper);
  padding: 1.6rem 1.85rem 1.7rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.75;
  overflow-x: auto;
  border-radius: 0;
  border: 1px solid var(--ink);
  position: relative;
  margin: 1.8rem 0;
  box-shadow: 5px 5px 0 var(--rule);
}

.code-block::before {
  content: "shell · jlcpcb-mapper";
  position: absolute;
  top: 0;
  right: 0;
  background: var(--copper);
  color: var(--paper);
  font-size: 0.65rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 0.2rem 0.8rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.code-block code {
  background: transparent;
  padding: 0;
  color: inherit;
  white-space: pre;
}

.prompt {
  color: var(--copper-warm);
  user-select: none;
  margin-right: 0.6rem;
  font-weight: 600;
}

.cmt {
  color: rgba(243, 238, 217, 0.42);
  font-style: italic;
}

/* ---------- colophon / footer ---------- */

.colophon {
  border-top: 2px solid var(--ink);
  padding: 2.5rem clamp(1.2rem, 4vw, 2.5rem) 2rem;
  font-family: var(--font-mono);
  background: var(--paper-edge);
  margin-top: 3rem;
  position: relative;
}

.colo-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 2fr 0.8fr 0.6fr;
  gap: 2rem;
  font-size: 0.85rem;
}

.colo-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.colophon a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--copper);
  text-underline-offset: 0.2em;
}

.colo-mark {
  max-width: var(--container);
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--rule);
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

@media (max-width: 880px) {
  .colo-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .colo-grid { grid-template-columns: 1fr; }
}

/* ---------- print ---------- */

@media print {
  body { background: white; background-image: none; }
  .title-block { position: static; }
  .btn, .hero-cta { display: none; }
  .code-block { box-shadow: none; }
  .report-card { box-shadow: none; }
}
