/* Self-hosted fonts — font-display: swap on every face */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/newsreader-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2');
}

:root {
  --bg: #0B0D11;
  --bg-panel: #14171B;
  --text: #E8E9E7;
  --text-soft: #8D9296;
  --label: #7FA69E;
  --accent: #45B8A6;
  --accent-ink: #0B1416;
  --rose: #B5605C;
  --teal-heading: #3E9985;
  --card-bg: #F5F4EF;
  --card-text: #17181A;
  --card-text-soft: #6B6E6C;
  --rule: #2A2F33;
  --dot: #3A4045;
  --sans: 'IBM Plex Sans', -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', 'SF Mono', monospace;
  --display: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --measure: 38rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

code, pre { font-family: var(--mono); }
code { color: var(--text); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: 5px;
  font-size: 14px;
  text-decoration: none;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1.5rem; }

section { padding: 5rem 0; }

.divider {
  border-top: 2px dotted var(--dot);
  margin: 0;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--label);
  margin-bottom: 1.2rem;
}

h1, h2 {
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 1.1rem;
  color: var(--text);
}
h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 5.2vw, 2.85rem);
  text-align: center;
  max-width: 22ch;
  margin-left: auto;
  margin-right: auto;
}
h2 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(1.4rem, 3.2vw, 1.9rem);
  max-width: 18ch;
}

p {
  max-width: var(--measure);
  margin: 0 0 1.1rem;
  color: var(--text-soft);
}
p:last-child { margin-bottom: 0; }

/* —— Top nav —— */
nav.top {
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--rule);
}
nav.top .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.navlinks {
  display: flex;
  gap: 1.4rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.navlinks a { color: var(--text-soft); }
.navlinks a:hover,
.navlinks a[aria-current="page"] { color: var(--text); }
.wordmark {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* —— Hero —— */
.hero {
  padding: 6rem 0 8rem;
  text-align: center;
  background:
    radial-gradient(ellipse 900px 480px at 50% -8%, rgba(69, 184, 166, 0.16), transparent 62%),
    var(--bg);
  border-bottom: 1px solid var(--rule);
}
.hero .eyebrow {
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 0.5em;
}
.hero .eyebrow span {
  margin: 0;
  color: var(--label);
}
.hero__sub {
  max-width: 34ch;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.03rem;
}
.hero__sub strong {
  color: var(--text);
  font-weight: 600;
}
.hero__cta { margin-top: 2.2rem; }

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.75rem 1.35rem;
  border-radius: 5px;
  border: 1px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn--primary:hover { opacity: 0.88; color: var(--accent-ink); }
.btn--secondary {
  border-color: var(--rule);
  color: var(--text);
}
.btn--secondary:hover { border-color: var(--text-soft); color: var(--text); }

.cta-row {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.hero .cta-row { justify-content: center; }

/* —— Reveal —— */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* —— Comparison card —— */
.card {
  background: var(--card-bg);
  color: var(--card-text);
  border-radius: 10px;
  padding: 2rem 2rem 1.6rem;
  margin-top: 1.8rem;
}
.card h3.card__title {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 1.6rem;
  color: var(--card-text);
}
.card__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.card__col { text-align: center; }
.card__col h4 {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0 0 1rem;
}
.card--without h4 { color: var(--rose); }
.card--with h4 { color: var(--teal-heading); }
.card__flow {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--card-text);
}
.card__flow div { padding: 0.15rem 0; }
.card__arrow {
  color: #B7B5AC;
  font-size: 0.9rem;
  padding: 0.3rem 0;
}
.card__caption {
  font-size: 0.8rem;
  color: var(--card-text-soft);
  margin-top: 1rem;
  max-width: none;
}
@media (max-width: 560px) {
  .card__cols { grid-template-columns: 1fr; gap: 1.6rem; }
}

.readmore {
  display: inline-block;
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.2rem;
  color: var(--text);
}
.readmore:hover {
  border-color: var(--text-soft);
  color: var(--accent);
}

/* —— Approach mini boundaries —— */
.mini-boundaries {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
  margin-top: 1.8rem;
}
.mini-boundaries h4 {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.7rem;
}
.mini-boundaries--resolves h4 { color: var(--teal-heading); }
.mini-boundaries--not h4 { color: var(--rose); }
.mini-boundaries ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mini-boundaries li {
  font-size: 0.92rem;
  color: var(--text-soft);
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--rule);
}
.mini-boundaries li:last-child { border-bottom: none; }
@media (max-width: 560px) {
  .mini-boundaries { grid-template-columns: 1fr; }
}

/* —— Stages —— */
.stageflow {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 1.8rem;
}
.stageflow__box {
  flex: 1;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.3rem 1rem;
  text-align: center;
  background: var(--bg-panel);
}
.stageflow__who {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  display: block;
  margin-bottom: 0.5rem;
}
.stageflow__name {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.stageflow__box--active { border-color: var(--accent); }
.stageflow__box--active .stageflow__name { color: var(--accent); }
.stageflow__arrow {
  align-self: center;
  color: var(--text-soft);
  font-size: 1.2rem;
}
.stageflow__caption {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-soft);
  max-width: none;
}
@media (max-width: 640px) {
  .stageflow { flex-direction: column; }
  .stageflow__arrow {
    transform: rotate(90deg);
    align-self: center;
  }
}

/* —— Side scroll-spy nav (rail + hollow/filled dots) —— */
.side-nav {
  position: fixed;
  right: 1.6rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.side-nav__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  padding-right: 0.15rem;
}
.side-nav__rail {
  position: absolute;
  top: 0.45rem;
  bottom: 0.45rem;
  right: 0.42rem;
  width: 1px;
  background: rgba(232, 233, 231, 0.18);
  pointer-events: none;
}
.side-nav a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.4rem 0;
  color: rgba(232, 233, 231, 0.38);
  position: relative;
  z-index: 1;
}
.side-nav__label {
  transition: color 0.15s ease;
}
.side-nav__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(232, 233, 231, 0.35);
  background: transparent;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.side-nav a:hover {
  color: rgba(232, 233, 231, 0.72);
}
.side-nav a[aria-current="true"],
.side-nav a.active {
  color: var(--text);
}
.side-nav a[aria-current="true"] .side-nav__dot,
.side-nav a.active .side-nav__dot {
  background: var(--text);
  border-color: var(--text);
}
@media (max-width: 900px) {
  .side-nav { display: none; }
}

/* —— Terminal —— */
.terminal {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 1.8rem;
}
.terminal__bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--rule);
}
.terminal__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.terminal__dot--r { background: #E0645B; }
.terminal__dot--y { background: #E0B34F; }
.terminal__dot--g { background: #55B473; }
.terminal__body {
  padding: 1.1rem 1.2rem 1.3rem;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.85;
}
.terminal__cmd::before {
  content: "$ ";
  color: #5C6368;
}
.terminal__ok { color: var(--accent); }
.terminal__refuse { color: var(--rose); }
.terminal__muted { color: var(--text-soft); }

/* —— Code block —— */
.code-block {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.3rem 1.4rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.9;
  margin-top: 1.6rem;
  color: var(--text);
  position: relative;
}
.code-block .comment { color: var(--text-soft); }

.code-block--copyable {
  padding-top: 2.4rem;
}
.code-block__pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}
.code-block__copy {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--text-soft);
  border-radius: 5px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}
.code-block__copy:hover {
  border-color: var(--text-soft);
  color: var(--text);
}
.code-block__copy.is-copied {
  border-color: var(--accent);
  color: var(--accent);
}

/* —— How steps —— */
.steps {
  margin: 1.8rem 0 0;
  padding: 0;
}
.step {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}
.step:first-child { border-top: 1px solid var(--rule); }
.step dt {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--label);
  margin: 0;
}
.step dd {
  margin: 0;
  color: var(--text-soft);
  max-width: var(--measure);
}
@media (max-width: 560px) {
  .step {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* —— Status —— */
.status {
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-soft);
  border-left: 2px solid var(--accent);
  padding: 0.9rem 0 0.9rem 1.1rem;
  margin-top: 1.2rem;
  max-width: var(--measure);
}

/* —— Footer —— */
footer {
  padding: 2.6rem 0 3.2rem;
  border-top: 1px solid var(--rule);
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.footer__credit,
.footer__links,
.footer__meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.footer__meta {
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
  max-width: none;
}
.footer__links {
  display: flex;
  gap: 1.4rem;
}
.footer__links a { color: var(--text-soft); }
.footer__links a:hover { color: var(--text); }

/* —— Walkthrough —— */
.page-walkthrough .walkthrough-hero {
  padding: 5rem 0 3rem;
  border-bottom: 1px solid var(--rule);
  background:
    radial-gradient(ellipse 700px 360px at 50% -10%, rgba(69, 184, 166, 0.12), transparent 60%),
    var(--bg);
}
.page-walkthrough .walkthrough-hero h1 {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
  max-width: 16ch;
}
.page-walkthrough .walkthrough-hero .hero__sub {
  margin-left: 0;
  margin-right: 0;
  text-align: left;
  max-width: 36ch;
}
.page-walkthrough .walkthrough-step {
  padding: 2.8rem 0;
  border-bottom: 1px solid var(--rule);
}
.page-walkthrough .walkthrough-step h2 {
  max-width: none;
  font-size: 1.25rem;
}
.page-walkthrough .walkthrough-step .code-block {
  margin-top: 1rem;
}
.page-walkthrough .quickstart__walkthrough {
  margin-top: 1.4rem;
}
.page-walkthrough .quickstart__walkthrough a {
  font-family: var(--mono);
  font-size: 0.85rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.15rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
