/* Switchyard site. Colours are tokens on :root, redefined for dark body sections.
   The hero, header and footer sit on ink in both modes (.on-dark). No frameworks, no external requests. */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand (design-kit/brand.md) */
  --ink: #16212B;
  --paper: #F6F8FA;
  --route-light: #A6420A;   /* burnt orange: the route on light backgrounds */
  --amber: #FFAE57;         /* signal amber: the route on dark backgrounds */
  --amber-hover: #FFC078;
  --slate: #596C7F;         /* parallel rails on light backgrounds */
  --steel: #CBD5E0;         /* parallel rails on dark backgrounds */

  /* Light body */
  --bg: var(--paper);
  --surface: #FFFFFF;
  --text: var(--ink);
  --heading: var(--ink);
  --muted: #4A5A6A;          /* 6.7:1 on paper */
  --rule: #D3DBE3;
  --link: var(--route-light);
  --focus: var(--route-light);
  --rail: var(--slate);
  --route: var(--route-light);
  --chip: #E4EAF0;
  --track: #E1E7EE;
  --meter-solid: var(--ink);
  --meter-hatch: var(--slate);
  --code-bg: #1E2A36;
  --code-text: #E6EDF3;
  --code-muted: #A9B7C5;

  /* Dark chrome (header, hero, rails divider, footer) */
  --hero-bg: var(--ink);
  --hero-text: var(--paper);
  --hero-muted: #BCC8D4;
  --hero-rule: #2E3D4D;

  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1120px;
  --gutter: 16px;
  --measure: 68ch;
  --radius: 12px;
  --radius-sm: 8px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1820;
    --surface: #172330;
    --text: #F6F8FA;
    --heading: #F6F8FA;
    --muted: #A9B7C5;         /* 8.8:1 on the dark body */
    --rule: #2A3947;
    --link: var(--amber);
    --focus: var(--amber);
    --rail: var(--steel);
    --route: var(--amber);
    --chip: #22303D;
    --track: #22303D;
    --meter-solid: #F6F8FA;
    --meter-hatch: var(--steel);
    --code-bg: #0B131B;
    --code-text: #E6EDF3;
    --code-muted: #A9B7C5;
  }
}

/* ---------- Base ---------- */

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

[hidden] {
  display: none !important;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

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

img {
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  max-width: var(--measure);
  text-wrap: pretty;
}

p + p {
  margin-top: 1em;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
}

code {
  background: var(--chip);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  background: var(--amber);
  color: var(--ink);
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--gutter);
}

.wrap {
  max-width: calc(var(--wrap) + 64px);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 600px) {
  :root {
    --gutter: 24px;
  }
}

@media (min-width: 1024px) {
  :root {
    --gutter: 32px;
  }
}

/* Dark chrome: header, hero, footer when it sits on ink. */
.on-dark {
  --text: var(--hero-text);
  --heading: var(--hero-text);
  --muted: var(--hero-muted);
  --link: var(--amber);
  --focus: var(--amber);
  --rail: var(--steel);
  --route: var(--amber);
  --rule: var(--hero-rule);
  --code-bg: #0B131B;
  background: var(--hero-bg);
  color: var(--hero-text);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: 600 1rem/1.2 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--amber);
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--amber-hover);
}

.btn-ghost {
  border-color: var(--steel);
  color: var(--hero-text);
}

.btn-ghost:hover {
  border-color: var(--amber);
  color: var(--amber);
}

/* ---------- Icons ---------- */

.icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* The rail crossover mark (brand.md): two rails in slate or steel, a route in burnt orange or amber. */
.sy-mark {
  width: 24px;
  height: 24px;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.sy-rail {
  stroke: var(--rail);
}

.sy-route {
  stroke: var(--route);
}

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

.site-header {
  padding-block: 16px;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.wordmark {
  display: inline-flex;
  line-height: 0;
  border-radius: 4px;
}

.wordmark img {
  height: 32px;
  width: auto;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
}

.site-nav a {
  color: var(--hero-text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

/* ---------- Hero ---------- */

.hero {
  padding-top: clamp(24px, 4vw, 48px);
  padding-bottom: 28px;
}

.hero-grid {
  display: grid;
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  max-width: none;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.25rem, 1.3rem + 3.4vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--hero-text);
}

.lede {
  margin-top: 20px;
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--hero-muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-shot {
  margin: 0;
}

.hero-shot img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--hero-rule);
  background: #1E2A36;
}

.hero-shot figcaption {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--hero-muted);
}

/* The rail divider: a 24 px strip at the foot of the hero, 1:1 with the mark's geometry.
   The SVG uses preserveAspectRatio="xMidYMid slice", so it is never scaled and the crossover stays centred. */
.rails {
  margin-top: clamp(40px, 6vw, 64px);
  height: 24px;
  max-width: var(--wrap);
  margin-inline: auto;
  overflow: hidden;
}

.rails svg {
  width: 100%;
  height: 24px;
}

.rails path {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rails .rail {
  stroke: var(--rail);
}

.rails .route {
  stroke: var(--route);
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(56px, 8vw, 104px);
  scroll-margin-top: 16px;
}

.section--tight {
  padding-top: 0;
}

.section-head {
  margin-bottom: clamp(32px, 4vw, 48px);
}

.section h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.875rem, 1.4rem + 1.4vw, 2.5rem);
  line-height: 1.15;
  color: var(--heading);
}

.section-head p {
  margin-top: 12px;
  color: var(--muted);
}

.section h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.3;
  color: var(--heading);
}

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

/* ---------- Features ---------- */

.feature-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  list-style: none;
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px;
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature .icon {
  color: var(--rail);
}

.feature p {
  color: var(--muted);
  font-size: 1rem;
}

/* ---------- Views (screenshots) ---------- */

.views {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
}

.views-pair {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 720px) {
  .views-pair {
    grid-template-columns: repeat(2, 330px);
  }
}

@media (min-width: 1080px) {
  .views-pair {
    grid-template-columns: repeat(2, 330px) minmax(0, 1fr);
    align-items: start;
  }
}

.views-notes {
  padding: 8px 0 0 16px;
}

.views-notes h3 {
  margin: 0 0 16px;
  font-family: var(--font-serif, "Source Serif 4", serif);
  font-size: 1.375rem;
  line-height: 1.25;
}

.views-notes dl {
  margin: 0;
}

.views-notes dt {
  margin-top: 18px;
  font-weight: 600;
}

.views-notes dd {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 1079px) {
  .views-notes {
    grid-column: 1 / -1;
    padding: 0;
  }
}

.views figure {
  margin: 0;
}

.views img {
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.views figcaption {
  margin-top: 10px;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---------- Estimates callout ---------- */

.callout {
  display: grid;
  gap: 32px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .callout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 56px;
  }
}

.callout h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.1rem);
  line-height: 1.2;
  color: var(--heading);
}

.callout .callout-copy p {
  margin-top: 16px;
  color: var(--muted);
}

.meters {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr);
}

.meter-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr);
}

.meter-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-weight: 600;
}

.meter-value {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
}

.meter {
  position: relative;
  height: 16px;
  border-radius: 4px;
  background: var(--track);
  overflow: hidden;
}

.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
}

/* Verified: solid. */
.meter-fill--verified {
  width: 50%;
  background: var(--meter-solid);
}

/* Estimate: hatched, with a hard edge. The hatch means "not verified". */
.meter-fill--estimate {
  width: 60%;
  background: repeating-linear-gradient(-45deg, var(--meter-hatch) 0 2px, transparent 2px 7px);
  border-right: 2px solid var(--meter-hatch);
}

.meter-note {
  font-size: 0.9375rem;
  color: var(--muted);
  max-width: none;
}

/* ---------- How it works ---------- */

.steps {
  display: grid;
  gap: 16px;
  list-style: none;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-num {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1;
  color: var(--rail);
  font-variant-numeric: lining-nums;
}

.step p {
  color: var(--muted);
  font-size: 1rem;
}

.layout {
  margin-top: clamp(40px, 6vw, 64px);
  display: grid;
  gap: 24px;
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 56px;
  }
}

.layout figure {
  margin: 0;
}

.layout figcaption {
  margin-top: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.layout h3 {
  margin-bottom: 8px;
}

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

pre {
  margin: 0;
  padding: 20px 24px;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  line-height: 1.7;
  overflow-x: auto;
  max-width: 100%;
  tab-size: 2;
}

/* Commands wrap at spaces on narrow screens instead of scrolling. */
pre.pre-wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
  overflow-wrap: normal;
}

/* ---------- Install ---------- */

.requirements {
  display: grid;
  gap: 12px;
  margin-bottom: 40px;
  list-style: none;
  color: var(--muted);
  grid-template-columns: minmax(0, 1fr);
}

.requirements li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.requirements .icon {
  margin-top: 3px;
  color: var(--rail);
  width: 20px;
  height: 20px;
}

.requirements strong {
  color: var(--text);
  font-weight: 600;
}

.install-steps {
  display: grid;
  gap: 32px;
  list-style: none;
  counter-reset: install;
  grid-template-columns: minmax(0, 1fr);
}

.install-steps li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 0 16px;
}

.install-steps li::before {
  counter-increment: install;
  content: counter(install);
  grid-row: span 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--rail);
  color: var(--heading);
  font-weight: 600;
  font-size: 0.9375rem;
  font-variant-numeric: lining-nums;
}

.install-steps li > * {
  grid-column: 2;
}

.install-steps h3 {
  margin-top: 4px;
}

.install-steps p {
  margin-top: 8px;
  color: var(--muted);
}

.install-steps p + pre,
.install-steps h3 + p + pre,
.install-steps ul + pre {
  margin-top: 16px;
}

.install-steps ul {
  margin-top: 8px;
  padding-left: 20px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.agents {
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}

.agents h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.agent-list {
  display: grid;
  gap: 0;
  margin-top: 24px;
  list-style: none;
  grid-template-columns: minmax(0, 1fr);
}

.agent-list li {
  padding-block: 24px;
  border-top: 1px solid var(--rule);
}

.agent-list li:last-child {
  border-bottom: 1px solid var(--rule);
}

.agent-list h4 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--heading);
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-list h4 .icon {
  color: var(--rail);
  width: 20px;
  height: 20px;
}

.agent-list p {
  margin-top: 8px;
  color: var(--muted);
}

.agent-list pre {
  margin-top: 16px;
  font-size: 0.875rem;
}

.note {
  margin-top: 40px;
  padding: 16px 20px;
  border-left: 3px solid var(--rail);
  background: var(--chip);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  font-size: 0.9375rem;
  max-width: var(--measure);
}

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

.site-footer {
  padding-block: 40px 48px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9375rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

.footer-inner p {
  max-width: none;
}

.footer-logo {
  height: 22px;
  width: auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  list-style: none;
}

.footer-links a {
  color: var(--link);
}

/* ---------- Motion ---------- */

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