:root {
  --bg: #f4f8f6;
  --surface: #ffffff;
  --ink: #10261e;
  --muted: #4a5f57;
  --line: #d5e1db;
  --brand: #1f9f74;
  --brand-deep: #0b6b4e;
  --on-brand: #ffffff;
  --tint: rgba(31, 159, 116, 0.13);
  --term: #0d1b16;
  --term-ink: #d6e8e0;
  --term-dim: #7f9a8e;
  --radius: 10px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1713;
    --surface: #12211b;
    --ink: #e7f2ec;
    --muted: #9db3a9;
    --line: #243830;
    --brand: #2bbf8e;
    --brand-deep: #4fd6a5;
    --on-brand: #06241a;
    --tint: rgba(43, 191, 142, 0.17);
    --term: #08110e;
    color-scheme: dark;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-deep);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

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

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  z-index: 20;
}

.skip:focus {
  top: 1rem;
}

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

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font: 700 1.3rem/1 var(--display);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 1.5rem;
  height: 1.5rem;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
  margin-inline-end: auto;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: 500 0.95rem/1.2 var(--sans);
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.button:hover {
  border-color: var(--brand);
  text-decoration: none;
}

.button.primary {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: var(--on-brand);
}

.button.primary:hover {
  background: var(--brand);
  border-color: var(--brand);
}

.button.small {
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
}

/* Hero */

.hero {
  padding-block: clamp(3rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 13fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 3.9vw, 3.2rem);
  text-wrap: balance;
}

.lede {
  max-width: 34rem;
  margin: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 1.15rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.route {
  width: 100%;
  height: auto;
  overflow: visible;
}

.route .ghost {
  stroke: var(--tint);
}

.route .line {
  stroke: var(--brand);
}

.route .stop {
  fill: var(--surface);
  stroke: var(--brand);
  stroke-width: 7;
}

.route text {
  fill: var(--ink);
  font: 500 25px/1.2 var(--sans);
}

.route .leader {
  stroke: var(--line);
  stroke-width: 2;
}

@media (prefers-reduced-motion: no-preference) {
  .route .line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: travel 2.2s cubic-bezier(0.5, 0, 0.2, 1) 0.2s forwards;
  }

  .route .line.bowl {
    animation-delay: 1.1s;
  }

  .route .line.leg {
    animation-delay: 1.6s;
  }

  .route .stop,
  .route .label {
    opacity: 0;
    animation: arrive 0.4s ease-out forwards;
  }

  .route .stop:nth-of-type(1),
  .route .label:nth-of-type(1) { animation-delay: 0.3s; }
  .route .stop:nth-of-type(2),
  .route .label:nth-of-type(2) { animation-delay: 0.9s; }
  .route .stop:nth-of-type(3),
  .route .label:nth-of-type(3) { animation-delay: 1.5s; }
  .route .stop:nth-of-type(4),
  .route .label:nth-of-type(4) { animation-delay: 1.9s; }
  .route .stop:nth-of-type(5),
  .route .label:nth-of-type(5) { animation-delay: 2.3s; }
  .route .stop:nth-of-type(6),
  .route .label:nth-of-type(6) { animation-delay: 2.6s; }
}

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

@keyframes arrive {
  to {
    opacity: 1;
  }
}

/* Proof */

.proof {
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.proof .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 2.5rem;
  padding-block: 1.6rem;
  color: var(--muted);
}

.proof strong {
  color: var(--ink);
  font: 600 1.15rem/1.3 var(--display);
}

.proof ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Sections */

section {
  padding-block: clamp(3.5rem, 7vw, 6rem);
}

.section-head {
  max-width: 40rem;
  margin-bottom: 2.75rem;
}

h2 {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
}

.section-head p {
  margin: 1rem 0 0;
  color: var(--muted);
}

/* Writing */

.writing-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.writing-list li {
  border-bottom: 1px solid var(--line);
}

.writing-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 2rem;
  padding: 1.6rem 0.25rem;
  color: var(--ink);
  text-decoration: none;
}

.writing-list h3 {
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.writing-list p {
  grid-column: 1;
  max-width: 44rem;
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.writing-list .go {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--brand-deep);
  font-size: 0.95rem;
  white-space: nowrap;
}

.writing-list a:hover h3 {
  color: var(--brand-deep);
}

.writing-more {
  margin-top: 1.75rem;
}

/* Themes */

.themes {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.theme-grid > div {
  padding: 1.6rem 2rem 1.6rem 0;
  border-bottom: 1px solid var(--line);
}

.theme-grid > div:nth-child(even) {
  padding: 1.6rem 0 1.6rem 2rem;
  border-left: 1px solid var(--line);
}

.theme-grid dt {
  font: 700 1.2rem/1.3 var(--display);
  letter-spacing: -0.01em;
}

.theme-grid dd {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

/* Open source */

.oss .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

.oss h3 {
  margin: 2rem 0 0.8rem;
  font-size: 1.6rem;
}

.oss p {
  color: var(--muted);
  max-width: 32rem;
}

.facts {
  margin: 1.5rem 0 2rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.facts li {
  position: relative;
  padding-left: 1.5rem;
}

.facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 0.7rem;
  height: 2px;
  background: var(--brand);
}

.terminal {
  margin: 0;
  background: var(--term);
  color: var(--term-ink);
  border-radius: 14px;
  border: 1px solid #1d3329;
  box-shadow: 0 24px 48px -28px rgba(7, 30, 21, 0.55);
  overflow: hidden;
}

.terminal figcaption {
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid #1d3329;
  color: var(--term-dim);
  font: 400 0.8rem/1 var(--mono);
}

.terminal pre {
  margin: 0;
  padding: 1.3rem 1.3rem 1.5rem;
  overflow-x: auto;
  font: 400 0.9rem/1.85 var(--mono);
}

.terminal .prompt {
  color: var(--brand);
  user-select: none;
}

.terminal .note {
  color: var(--term-dim);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 3rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
}

.site-footer img {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.9rem;
}

.site-footer p {
  max-width: 34rem;
  margin: 0;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

/* Small screens */

@media (max-width: 600px) {
  .hero {
    overflow-x: clip;
  }

  .route {
    transform: translateX(-9%) scale(1.15);
  }

  .route text {
    display: none;
  }

  .terminal pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 860px) {
  .hero .wrap,
  .oss .wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-nav {
    display: none;
  }

  .site-header .wrap {
    justify-content: space-between;
  }

  .theme-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .theme-grid > div,
  .theme-grid > div:nth-child(even) {
    padding: 1.4rem 0;
    border-left: 0;
  }

  .writing-list a {
    grid-template-columns: minmax(0, 1fr);
  }

  .writing-list .go {
    grid-column: 1;
    grid-row: auto;
    margin-top: 0.5rem;
  }

  .site-footer .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
}
