/* Arche Modular
   Palette drawn from the objects themselves: drafting vellum, PCB soldermask
   green as the ink, ENIG gold and bare copper as the two accents. */

:root {
  --vellum:     #EAEBE4;
  --vellum-dim: #DEDFD6;
  --ink:        #16382D;
  --ink-soft:   #4C5F57;
  --gold:       #A97A1E;
  --copper:     #96552E;
  --rule:       #C4C7BC;

  --measure: 68ch;

  --step-0: 1rem;
  --step-1: 1.15rem;
  --step-2: 1.42rem;
  --step-3: 1.85rem;
  --step-4: 2.6rem;
  --step-5: clamp(2.8rem, 7vw, 4.6rem);
}

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

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

body {
  margin: 0;
  background: var(--vellum);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.62;
  font-feature-settings: "kern", "liga";
}

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

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem 2rem;
  padding-block: 1.6rem 1.4rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
  font-weight: 600;
  font-size: var(--step-2);
  letter-spacing: 0.005em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.wordmark span { color: var(--gold); }

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.masthead nav a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.masthead nav a:hover,
.masthead nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

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

.hero { padding-block: 3.6rem 2.4rem; }

.hero h1 {
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-weight: 600;
  font-size: var(--step-5);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0 0 1.4rem;
  max-width: 20ch;
  text-wrap: balance;
}

.hero p {
  max-width: var(--measure);
  font-size: var(--step-1);
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.trace {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 2.8rem;
}

.trace .grid { stroke: var(--rule); stroke-width: 0.5; }
.trace .axis { stroke: var(--rule); stroke-width: 1; }

.trace .wave {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  animation: draw 2.2s cubic-bezier(0.4, 0, 0.2, 1) 0.25s forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .trace .wave { animation: none; stroke-dashoffset: 0; }
}

/* ---------- generic page content ---------- */

main { padding-bottom: 5rem; }

.page-intro { padding-block: 3rem 1rem; }

.page-intro h1 {
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-weight: 600;
  font-size: var(--step-4);
  line-height: 1.1;
  margin: 0 0 1rem;
}

.page-intro p {
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: var(--step-1);
  margin: 0 0 1rem;
}

.band {
  padding-block: 2.6rem;
  border-top: 1px solid var(--rule);
}

.band > h2 {
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-weight: 600;
  font-size: var(--step-3);
  margin: 0 0 0.6rem;
}

.band > p {
  max-width: var(--measure);
  color: var(--ink-soft);
  margin: 0 0 1.6rem;
}

/* ---------- entry lists ---------- */

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

.entries li {
  padding-block: 1.1rem;
  border-top: 1px solid var(--vellum-dim);
}

.entries li:first-child { border-top: none; }

.entries h3 {
  font-size: var(--step-1);
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.entries h3 a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
}

.entries h3 a:hover { color: var(--copper); border-bottom-color: var(--copper); }

.entries p {
  margin: 0;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.status {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  color: var(--copper);
  letter-spacing: 0.01em;
}

/* ---------- module detail blocks ---------- */

.module {
  padding-block: 2.4rem;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 0.4rem 3rem;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: start;
}

.module h2 {
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: var(--step-3);
  font-weight: 600;
  margin: 0 0 0.5rem;
  grid-column: 1;
}

.module .body { grid-column: 1; }
.module .body p { margin: 0 0 0.9rem; max-width: var(--measure); }

.spec {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--ink-soft);
  border-left: 2px solid var(--gold);
  padding-left: 1.1rem;
  margin: 0.4rem 0 0;
}

.spec div { display: flex; justify-content: space-between; gap: 1rem; }
.spec dt, .spec dd { margin: 0; }
.spec dd { color: var(--ink); text-align: right; }

@media (max-width: 46rem) {
  .module { grid-template-columns: 1fr; }
  .module h2, .module .body, .spec { grid-column: 1; }
  .spec { grid-row: auto; margin-top: 1rem; }
}

/* ---------- topic columns ---------- */

.topics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem 3rem;
}

.topics section h3 {
  font-size: var(--step-1);
  font-weight: 600;
  margin: 0 0 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--gold);
}

.topics ul { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); }
.topics li { margin-bottom: 0.35rem; }

/* ---------- prose ---------- */

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.1rem; }
.prose h2 {
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: var(--step-2);
  margin: 2.2rem 0 0.6rem;
}
.prose a { color: var(--copper); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }

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

footer {
  border-top: 1px solid var(--rule);
  padding-block: 2rem 3.5rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

footer a { color: var(--ink-soft); }

footer p { margin: 0 0 0.4rem; max-width: var(--measure); }

/* ---------- focus ---------- */

a:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: 1px;
}
