/* ScopeWire — site styles */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/Archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --ink: #13302A;
  --ink-2: #4B5F58;
  --paper: #F2F4F0;
  --panel: #E2E8E2;
  --line: #C3CEC6;
  --patch: #F0C419;
  --cat6: #1D5FBF;
  --font: "Archivo", "Arial Narrow", Arial, sans-serif;
  --wrap: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
}

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

a {
  color: var(--cat6);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--ink); }

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

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px; top: 1rem; z-index: 10;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; border-radius: 6px;
}
.skip:focus { left: 1rem; }

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

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

.site-header { background: var(--ink); color: var(--paper); }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--paper);
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: 800;
  font-stretch: 78%;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--paper); }
.brand svg { flex: none; }
.site-nav ul {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
}
.site-nav a:hover { color: var(--patch); }
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--patch);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.5em;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-radius: 6px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: 700 1rem/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--patch {
  background: var(--patch);
  border-color: var(--patch);
  color: var(--ink);
}
.btn--patch:hover {
  background: #F4D04A;
  border-color: #F4D04A;
  color: var(--ink);
}

/* ---------- Cable tag (topic label) ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.6rem 0.25rem 0.45rem;
  border-radius: 4px;
  background: var(--patch);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
}
.tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px rgba(19, 48, 42, 0.45);
}

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

.hero {
  background: var(--ink);
  color: var(--paper);
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 6vw, 5rem);
}
.hero h1 {
  font-size: clamp(3rem, 8.2vw, 6.6rem);
  font-weight: 850;
  font-stretch: 68%;
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
  max-width: 13ch;
}
.hero__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem 3rem;
  align-items: end;
}
.hero__lede {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  color: #C9D6CF;
  max-width: 46ch;
  margin: 0;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero .btn { border-color: var(--paper); color: var(--paper); }
.hero .btn:hover { background: var(--paper); color: var(--ink); }
.hero .btn--patch { border-color: var(--patch); color: var(--ink); }
.hero .btn--patch:hover { background: #F4D04A; border-color: #F4D04A; color: var(--ink); }
@media (max-width: 820px) {
  .hero__row { grid-template-columns: 1fr; }
}

/* ---------- Wire run: the guide list ---------- */

.run-section { padding-block: clamp(3rem, 6vw, 4.5rem); }
.run-section > .wrap > h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 850;
  font-stretch: 72%;
  line-height: 1;
  margin: 0 0 0.5rem;
}
.run-section > .wrap > p {
  color: var(--ink-2);
  margin: 0 0 2rem;
  max-width: 60ch;
}

.run {
  position: relative;
  padding-top: 3rem;
}
.run__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}
/* the main cable */
.run::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 1.25rem;
  height: 5px;
  border-radius: 3px;
  background: var(--ink);
}
/* the signal pulse */
.run__pulse {
  position: absolute;
  top: calc(1.25rem - 4.5px);
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--patch);
  box-shadow: 0 0 0 4px rgba(240, 196, 25, 0.3), 0 0 18px rgba(240, 196, 25, 0.9);
  opacity: 0;
}
.run__list > li { position: relative; }
/* drop from the cable to each card */
.run__list > li::before {
  content: "";
  position: absolute;
  left: 2rem;
  top: -1.75rem;
  width: 5px;
  height: 1.75rem;
  background: var(--ink);
}
/* terminal on the cable */
.run__list > li::after {
  content: "";
  position: absolute;
  left: calc(2rem - 5px);
  top: -2.1rem;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--paper);
  border: 4px solid var(--ink);
}
@media (prefers-reduced-motion: no-preference) {
  .run__pulse { animation: pulse-run 2.4s 0.4s ease-in-out forwards; }
  .run__list > li::after { animation: terminal-lit 0.4s ease forwards; }
  .run__list > li:nth-child(1)::after { animation-delay: 0.9s; }
  .run__list > li:nth-child(2)::after { animation-delay: 1.6s; }
  .run__list > li:nth-child(3)::after { animation-delay: 2.3s; }
}
@media (prefers-reduced-motion: reduce) {
  .run__list > li::after { background: var(--patch); }
}
@keyframes pulse-run {
  0% { left: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: calc(100% - 14px); opacity: 0; }
}
@keyframes terminal-lit {
  to { background: var(--patch); }
}

.card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.card__img { display: block; background: var(--panel); }
.card__img img { width: 100%; height: auto; }
.card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 1.2rem 1.25rem 1.4rem;
  flex: 1;
}
.card h3 {
  font-size: 1.45rem;
  font-weight: 800;
  font-stretch: 80%;
  line-height: 1.1;
  margin: 0;
}
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--patch);
  text-decoration-thickness: 3px;
}
.card p { margin: 0; color: var(--ink-2); }
.card .readtime { margin-top: auto; font-size: 0.9rem; }

@media (max-width: 900px) {
  .run { padding: 0 0 0 3rem; }
  .run__list { grid-template-columns: 1fr; }
  .run::before {
    left: 1rem;
    right: auto;
    top: 0;
    bottom: 0;
    width: 5px;
    height: auto;
  }
  .run__pulse { display: none; }
  .run__list > li::before {
    left: -2rem;
    top: 2rem;
    width: 2rem;
    height: 5px;
  }
  .run__list > li::after {
    left: calc(-2rem - 5px);
    top: calc(2rem - 5px);
  }
}

/* ---------- About strip ---------- */

.strip {
  border-top: 1px solid var(--line);
  padding-block: clamp(3rem, 6vw, 4.5rem);
}
.strip__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 1.5rem 4rem;
}
.strip h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 850;
  font-stretch: 72%;
  line-height: 1;
  margin: 0;
}
.strip p {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 1rem;
  max-width: 60ch;
}
@media (max-width: 760px) {
  .strip__grid { grid-template-columns: 1fr; }
}

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

.site-footer {
  background: var(--ink);
  color: #C9D6CF;
  padding-block: 2.5rem;
  font-size: 0.95rem;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1.5rem 2rem;
}
.site-footer p { margin: 0.8rem 0 0; max-width: 52ch; }
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.25rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.site-footer ul a { color: var(--paper); }
.site-footer ul a:hover { color: var(--patch); }
@media (max-width: 640px) {
  .site-footer__grid { grid-template-columns: 1fr; }
  .site-footer ul { justify-content: flex-start; }
}

/* ---------- Article ---------- */

.post-top {
  background: var(--ink);
  color: var(--paper);
  padding-block: 2rem 0;
}
.crumbs { font-size: 0.92rem; margin: 0 0 1.5rem; }
.crumbs a { color: #C9D6CF; }
.crumbs a:hover { color: var(--patch); }
.post-top h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
  font-weight: 850;
  font-stretch: 70%;
  line-height: 0.98;
  letter-spacing: -0.005em;
  margin: 1rem 0 1rem;
  max-width: 20ch;
}
.post-top .dek {
  font-size: clamp(1.1rem, 1.7vw, 1.3rem);
  line-height: 1.55;
  color: #C9D6CF;
  max-width: 58ch;
  margin: 0;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  font-size: 0.92rem;
  color: #C9D6CF;
}
.post-figure {
  margin: 2.5rem 0 0;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background: var(--panel);
  transform: translateY(1px);
}
.post-figure img { width: 100%; height: auto; }

.post-body { padding-block: 3rem 4rem; }

.scope {
  max-width: 46rem;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 2.5rem;
}
.scope h2 {
  margin: 0;
  padding: 0.75rem 1.1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 1rem;
  font-weight: 700;
}
.scope dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
}
.scope dt, .scope dd {
  margin: 0;
  padding: 0.7rem 1.1rem;
  border-top: 1px solid var(--line);
}
.scope dt { font-weight: 700; }
.scope dd { color: var(--ink-2); }
.scope dl > :nth-child(1), .scope dl > :nth-child(2) { border-top: 0; }
@media (max-width: 560px) {
  .scope dl { grid-template-columns: 1fr; }
  .scope dd { border-top: 0; padding-top: 0; }
}

.prose {
  font-size: 1.14rem;
  line-height: 1.7;
  max-width: 68ch;
}
.prose > * { margin: 0; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 850;
  font-stretch: 74%;
  line-height: 1.05;
  margin-top: 2.2em;
  scroll-margin-top: 1rem;
}
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.45em; }
.prose ol li::marker { font-weight: 800; color: var(--cat6); }
.prose ul li::marker { color: var(--cat6); }
.prose strong { font-weight: 700; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
  line-height: 1.45;
  min-width: 34rem;
}
.prose th, .prose td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.prose thead th { background: var(--panel); font-weight: 700; }
.prose tbody th { font-weight: 700; }
.prose tbody tr:last-child > * { border-bottom: 0; }

.faq-list details {
  border-top: 2px solid var(--ink);
  padding: 1rem 0;
}
.faq-list details:last-child { border-bottom: 2px solid var(--ink); }
.faq-list summary {
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  margin-top: 0.35rem;
  border-right: 3px solid var(--cat6);
  border-bottom: 3px solid var(--cat6);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.faq-list details[open] summary::after { transform: rotate(-135deg); margin-top: 0.6rem; }
.faq-list details p { margin: 0.7rem 0 0; color: var(--ink-2); }

.further {
  max-width: 77.5ch;
  margin-top: 3rem;
  padding: 1.4rem 1.5rem;
  border-radius: 10px;
  background: var(--panel);
}
.further h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
}
.further ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.6rem; }
.further li { display: grid; gap: 0.1rem; }
.further a { font-weight: 600; }
.further span { font-size: 0.9rem; color: var(--ink-2); }

.next {
  max-width: 77.5ch;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.next p { margin: 0; color: var(--ink-2); }
.next strong { display: block; color: var(--ink); font-size: 1.15rem; }

/* Plain pages */
.page { padding-block: clamp(3rem, 7vw, 5rem); }
.page h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 850;
  font-stretch: 70%;
  line-height: 0.98;
  margin: 0 0 1.5rem;
}
.page .prose { margin-bottom: 2rem; }

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