/* Shared styles for /ledger/open-source/ and /ledger/get-started/.
   Visual language matches /ledger/: near-black ground, hairlines, Promise blue
   for labels and links, the product's pink for the one primary action. */

:root {
  --bg: #0d0d0d;
  --panel: #141414;
  --panel-2: #1a1a1a;
  --line: #2e2e38;
  --line-soft: #23232a;
  --text: #f9fafb;
  --muted: #c6c6c6;
  --dim: #8d8d8d;
  --blue: #0096e0;
  --blue-tint: #80cbf0;
  --pink: #e2008c;
  --pink-tint: #f180c6;
  --pink-deep: #390023;
  --amber: #ffe11f;
  --font-sans: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --gutter: 48px;
  --max: 1240px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a:hover {
  color: var(--text);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
}

p {
  margin: 0;
}

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

:not(pre) > code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.875em;
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

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

.os-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 65px;
  border-bottom: 1px solid var(--line);
  width: 100%;
}

.os-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
}

.os-wordmark {
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
}

.os-product {
  padding-left: 18px;
  border-left: 1px solid var(--line);
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  line-height: 24px;
  text-decoration: none;
}

.os-wordmark:hover,
.os-product:hover {
  color: var(--text);
}

.os-nav ul {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.os-nav a {
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}

.os-nav a:hover {
  color: var(--text);
}

.os-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.os-nav .ext::after {
  content: " ↗";
  color: var(--dim);
}

/* Type helpers ------------------------------------------------------- */

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue-tint);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.lead {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.section {
  padding-block: 112px 0;
}

.section-head {
  max-width: 720px;
  margin-bottom: 48px;
}

.section-head h2,
.h2 {
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-head p:not(.eyebrow) {
  margin-top: 16px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.rule-top {
  border-top: 1px solid var(--line);
  padding-top: 40px;
}

.section-head.rule-top {
  max-width: none;
}

.section-head.rule-top > * {
  max-width: 720px;
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  border-color: #4a4a58;
  background: var(--panel-2);
  color: var(--text);
}

.btn-primary {
  border-color: var(--pink);
  background: var(--pink);
  color: #fff;
}

.btn-primary:hover {
  border-color: #c8007c;
  background: #c8007c;
}

.btn .arrow {
  font-weight: 400;
}

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

.hero {
  padding-top: 88px;
  text-align: center;
}

.hero h1 {
  max-width: 980px;
  margin-inline: auto;
  font-size: 56px;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.hero .lead {
  max-width: 620px;
  margin: 22px auto 0;
}

.hero .actions {
  justify-content: center;
  margin-top: 36px;
}

.hero .hero-shot {
  margin: 72px 0 0;
}

/* Screenshot frames -------------------------------------------------- */

.shot {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
}

/* Screenshots are shown at (or near) the size they were captured, so the
   product's own text stays readable. They never grow past that size. */
.shot-frame {
  display: block;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.8);
  cursor: zoom-in;
  transition: border-color 0.15s ease;
}

a.shot-frame:hover {
  border-color: #4a4a58;
}

a.shot-frame:focus-visible {
  outline-offset: 4px;
  border-radius: var(--radius);
}

.shot-frame picture,
.shot-frame img {
  display: block;
  max-width: 100%;
  height: auto;
}

.shot figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  max-width: 760px;
  margin-top: 12px;
  color: var(--dim);
  font-size: 14px;
  line-height: 1.5;
}

.shot figcaption .cap {
  flex: 1 1 320px;
}

.scene-link {
  flex: none;
  color: var(--blue-tint);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.scene-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.hero .shot {
  align-items: center;
}

.hero .shot figcaption {
  justify-content: center;
  max-width: 900px;
  text-align: center;
}

.hero .shot figcaption .cap {
  flex-basis: 100%;
}

.shot-narrow {
  align-items: center;
}

/* Four questions ---------------------------------------------------- */

.questions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: q;
}

.questions li {
  padding-top: 18px;
  border-top: 1px solid var(--line);
  counter-increment: q;
}

.questions li::before {
  content: "0" counter(q);
  display: block;
  margin-bottom: 10px;
  color: var(--pink-tint);
  font-family: var(--font-mono);
  font-size: 14px;
}

.questions li:first-child {
  border-top-color: var(--pink);
}

.questions p {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

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

.features {
  display: grid;
  gap: 128px;
}

/* Side by side: text in one column, the screenshot in the other. */
.feature-side {
  display: grid;
  grid-template-columns: minmax(0, 9fr) minmax(0, 15fr);
  gap: 56px;
  align-items: start;
}

.feature-side.img-left {
  grid-template-columns: minmax(0, 15fr) minmax(0, 9fr);
}

.feature-side.img-left .shot {
  order: -1;
}

.feature-side .shot {
  align-items: flex-start;
}

.feature-side.img-left .shot {
  align-items: flex-end;
}

.feature-side .shot-narrow {
  align-items: center !important;
}

.feature-side .feature-text {
  position: sticky;
  top: 32px;
}

/* A long list under a side-by-side feature runs across the full width in columns. */
.feature .facts-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 40px;
  margin-top: 40px;
  border-top: 0;
}

.feature .facts-grid li {
  border-top: 1px solid var(--line-soft);
  border-bottom: 0;
}

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

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

/* Wide: text and facts above, the screenshot across the full width. */
.feature-wide {
  display: grid;
  grid-template-columns: minmax(0, 9fr) minmax(0, 15fr);
  gap: 0 56px;
  align-items: start;
}

.feature-wide .facts {
  margin-top: 34px;
}

.feature-wide .shot {
  grid-column: 1 / -1;
  margin-top: 40px;
}

.feature-num {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--blue-tint);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.feature-num span {
  color: var(--pink-tint);
  font-family: var(--font-mono);
  letter-spacing: 0;
}

.feature h3 {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.feature-text > p {
  margin-top: 16px;
  color: var(--muted);
}

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

.facts li {
  position: relative;
  padding: 10px 0 10px 20px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.facts li b {
  color: var(--text, #f9fafb);
  font-weight: 600;
}

.facts li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 18px;
  width: 6px;
  height: 6px;
  background: var(--blue);
}

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

.tag {
  display: inline-block;
  padding: 0 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  line-height: 20px;
  vertical-align: 1px;
  white-space: nowrap;
}

.tag-proposed {
  color: var(--amber);
}

.feature-note {
  margin-top: 16px;
  padding-left: 14px;
  border-left: 2px solid var(--pink);
  color: var(--text);
  font-size: 15px;
}

/* Extend ------------------------------------------------------------- */

.doctrine {
  margin: 0 0 40px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--pink);
  border-radius: var(--radius);
  background: var(--panel);
}

.doctrine p {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.doctrine cite {
  display: block;
  margin-top: 12px;
  color: var(--dim);
  font-size: 14px;
  font-style: normal;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

a.card:hover {
  border-color: #4a4a58;
  background: var(--panel-2);
  color: var(--text);
}

.card .label {
  color: var(--blue-tint);
  font-family: var(--font-mono);
  font-size: 13px;
}

.card h3 {
  margin-top: 10px;
  font-size: 19px;
}

.card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.card .more {
  margin-top: auto;
  padding-top: 18px;
  color: var(--blue-tint);
  font-size: 14px;
}

/* Architecture diagram --------------------------------------------- */

.arch {
  margin: 0;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.node {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.node b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.node small {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
}

.node-core {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(0, 150, 224, 0.25);
}

.node-core b {
  color: var(--text);
}

.node-out {
  border-color: var(--pink);
}

.node-stack {
  display: grid;
  gap: 8px;
}

.node-stack .node {
  padding: 10px 14px;
}

.arrow-r {
  position: relative;
  height: 1px;
  margin-inline: 6px;
  background: #4a4a58;
}

.arrow-r::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  border: 4.5px solid transparent;
  border-left: 6px solid #8a8a98;
  border-right: 0;
}

.arch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 14px;
}

.arch-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  vertical-align: -1px;
}

.arch-legend .l-core::before {
  border-color: var(--blue);
}

.arch-legend .l-out::before {
  border-color: var(--pink);
}

.stack-line {
  margin-top: 28px;
  color: var(--muted);
  font-size: 18px;
}

.stack-line strong {
  color: var(--text);
}

.paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
  margin: 32px 0 0;
}

.paths div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}

.paths dt {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.paths dd {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Limits, licence --------------------------------------------------- */

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 64px;
}

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

.limits li {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.limits li b {
  color: var(--text);
  font-weight: 600;
}

.licence {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.licence h2 {
  font-size: 28px;
  letter-spacing: -0.015em;
}

.licence p:not(.eyebrow) {
  margin-top: 12px;
  max-width: 640px;
  color: var(--muted);
}

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

.os-footer {
  margin-top: 120px;
}

.os-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 14px;
}

.os-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.os-footer a {
  color: var(--muted);
  text-decoration: none;
}

.os-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Guide page ---------------------------------------------------------- */

.guide-hero {
  padding-top: 88px;
  max-width: 760px;
}

.guide-hero h1 {
  font-size: 56px;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.guide-hero .lead {
  margin-top: 20px;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 13px;
}

.guide-meta b {
  color: var(--text);
  font-weight: 400;
}

.guide {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 48px;
  margin-top: 80px;
  padding-top: 48px;
  border-top: 1px solid var(--line);
}

.rail {
  position: sticky;
  top: 32px;
  align-self: start;
}

.rail p {
  margin-bottom: 14px;
  color: var(--dim);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rail ol {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail ol::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--line);
}

.rail a {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 6px 0;
  color: var(--dim);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}

.rail a span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
}

.rail a:hover {
  color: var(--text);
}

.rail a.is-done span {
  border-color: #4a4a58;
  color: var(--muted);
}

.rail a[aria-current="step"] {
  color: var(--text);
  font-weight: 600;
}

.rail a[aria-current="step"] span {
  border-color: var(--pink);
  background: var(--pink);
  color: #fff;
}

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

.step {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px 24px;
  padding-bottom: 72px;
}

.step + .step {
  padding-top: 0;
}

.step-num {
  position: relative;
  color: var(--pink-tint);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 34px;
}

.step-num::after {
  display: none;
  content: "";
  position: absolute;
  left: 9px;
  top: 48px;
  bottom: -64px;
  width: 1px;
  background: var(--line-soft);
}

.step:last-child .step-num::after {
  display: none;
}

.step-body {
  min-width: 0;
}

.step h2 {
  font-size: 28px;
  line-height: 34px;
  letter-spacing: -0.015em;
}

.step-body > p,
.step-body > ul,
.step-body > .note {
  max-width: 680px;
}

.step-body > p {
  margin-top: 12px;
  color: var(--muted);
}

.step-body > p + p {
  margin-top: 12px;
}

.step-body ul.plain {
  margin: 14px 0 0;
  padding-left: 0;
  list-style: none;
}

.step-body ul.plain li {
  position: relative;
  padding: 4px 0 4px 20px;
  color: var(--muted);
}

.step-body ul.plain li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 14px;
  width: 6px;
  height: 6px;
  background: var(--blue);
}

.needs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.needs li {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.needs b {
  display: block;
  font-size: 17px;
}

.needs span {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* Code blocks */

.code {
  position: relative;
  margin: 20px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0a0a0c;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

.code pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  tab-size: 2;
}

.code pre .c {
  color: var(--dim);
}

.code pre .p {
  color: var(--pink-tint);
  user-select: none;
}

.copy {
  display: none;
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.js .copy {
  display: inline-block;
}

.copy:hover {
  border-color: #4a4a58;
  color: var(--text);
}

.copy[data-state="done"] {
  border-color: var(--blue);
  color: var(--blue-tint);
}

.expect {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--panel);
}

.expect .expect-label {
  margin-bottom: 6px;
  color: var(--blue-tint);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.expect pre {
  margin: 0;
  overflow-x: auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.expect p {
  color: var(--muted);
  font-size: 15px;
}

.note {
  margin-top: 16px;
  color: var(--dim);
  font-size: 14px;
}

.note strong {
  color: var(--muted);
}

.people {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.people > li {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.people h4 {
  font-size: 16px;
}

.people .what {
  margin-top: 2px;
  color: var(--dim);
  font-size: 13px;
}

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

.people ul li {
  padding: 2px 0;
  color: var(--muted);
  font-size: 14px;
}

.people ul li span {
  color: var(--dim);
}

.step .shot {
  margin-top: 24px;
  max-width: 560px;
}

.scenes {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
  font-size: 14px;
}

.scenes th,
.scenes td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.scenes th {
  color: var(--dim);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scenes td {
  color: var(--muted);
}

.scenes td:first-child {
  white-space: nowrap;
}

.scenes td:first-child code {
  font-size: 13px;
}

.scenes td:nth-child(2) {
  color: var(--text);
  white-space: nowrap;
}

.table-scroll {
  overflow-x: auto;
}

.scenes caption {
  caption-side: bottom;
  margin-top: 12px;
  text-align: left;
}

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

.checks li {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 15px;
}

.checks code {
  justify-self: start;
  align-self: start;
}

.next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

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

.trouble li {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.trouble b {
  display: block;
  color: var(--text);
  font-weight: 600;
}

.trouble p {
  margin-top: 6px;
  color: var(--muted);
}

.closing {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: start;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.closing h2 {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.closing p:not(.eyebrow) {
  margin-top: 12px;
  color: var(--muted);
}

.closing .code {
  margin-top: 0;
}

/* Reveal on scroll (only when script runs and motion is allowed) ------ */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .js .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

/* Responsive ---------------------------------------------------------- */

@media (max-width: 1100px) {
  .arch-row,
    .arch {
    padding: 28px;
  }

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

  .questions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 32px;
  }
}

@media (max-width: 960px) {
  :root {
    --gutter: 32px;
  }

  .os-header-inner {
    flex-wrap: wrap;
    gap: 0 24px;
    padding-top: 14px;
  }

  .os-nav {
    width: 100%;
    overflow-x: auto;
  }

  .os-nav ul {
    gap: 22px;
    padding: 12px 0 14px;
  }

  .feature-side,
  .feature-side.img-left,
  .feature-wide,
  .two-col,
  .closing {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .feature-side.img-left .shot {
    order: 0;
    align-items: flex-start;
  }

  .feature-wide .facts {
    margin-top: 24px;
  }

  .feature-wide .shot {
    margin-top: 32px;
  }

  .feature-side .feature-text {
    position: static;
  }

  .features {
    gap: 88px;
  }

  .guide {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-top: 56px;
  }

  .rail {
    display: none;
  }

  /* Architecture becomes a vertical flow */
  .arch-row .arrow-r {
    justify-self: center;
    width: 1px;
    height: 28px;
    margin: 0;
  }

  .arch-row .arrow-r::after {
    top: auto;
    bottom: -1px;
    right: auto;
    left: -4px;
    border: 4.5px solid transparent;
    border-top: 6px solid #8a8a98;
    border-bottom: 0;
  }

  .arch-svg {
    display: none;
  }

  .arch-html {
    display: block;
  }

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

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

@media (max-width: 640px) {
  :root {
    --gutter: 20px;
  }

  body {
    font-size: 16px;
  }

  .os-brand {
    gap: 14px;
  }

  .os-wordmark {
    font-size: 16px;
  }

  .os-product {
    padding-left: 14px;
    font-size: 16px;
  }

  .hero {
    padding-top: 56px;
  }

  .hero h1,
  .guide-hero h1 {
    font-size: 38px;
    letter-spacing: -0.025em;
  }

  .guide-hero {
    padding-top: 56px;
  }

  .lead {
    font-size: 18px;
  }

  .hero .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero .hero-shot {
    margin-top: 44px;
  }

  .section {
    padding-top: 80px;
  }

  .section-head {
    margin-bottom: 32px;
  }

  .section-head h2,
  .h2 {
    font-size: 28px;
  }

  .questions,
  .cards,
  .needs,
  .people,
  .next {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature h3,
  .step h2,
  .closing h2,
  .licence h2 {
    font-size: 24px;
    line-height: 1.25;
  }

  .doctrine {
    padding: 22px 20px;
  }

  .doctrine p {
    font-size: 19px;
  }

  .arch,
  .licence,
  .closing {
    padding: 22px 20px;
  }

  .limits li,
  .checks li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .step {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding-bottom: 56px;
  }

  .step-num {
    line-height: 1.4;
  }

  .step-num::after {
    display: none;
  }

  .code pre {
    font-size: 13px;
  }

  .scenes td:nth-child(2) {
    white-space: normal;
  }

  .os-footer {
    margin-top: 88px;
  }
}

code.path {
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .scenes thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .scenes,
  .scenes tbody {
    display: block;
  }

  .scenes tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 12px;
    align-items: baseline;
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .scenes td {
    padding: 0;
    border: 0;
  }

  .scenes td:nth-child(3) {
    grid-column: 1 / -1;
  }

  .scenes caption {
    display: block;
  }
}

.shot-narrow {
  justify-self: center;
  width: 100%;
  max-width: 460px;
}

/* Architecture: SVG on wide screens, stacked boxes on narrow ones ---- */

.arch-svg {
  display: block;
  width: 100%;
  height: auto;
}

.arch-svg .nodes rect {
  fill: var(--bg);
  stroke: var(--line);
  stroke-width: 1;
}

.arch-svg .core rect {
  fill: #07131b;
  stroke: var(--blue);
}

.arch-svg .out rect {
  stroke: var(--pink);
}

.arch-svg .l {
  fill: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
}

.arch-svg .s {
  fill: var(--dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

.arch-html {
  display: none;
}

.arch-html .arch-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.arch-html .arrow-r {
  align-self: center;
}

/* Scene strip under the hero ------------------------------------------ */

.strip {
  margin-top: 56px;
}

.strip-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.strip-head h2 {
  margin: 0;
}

.strip-head p {
  color: var(--muted);
  font-size: 15px;
}

.strip-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.strip-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
}

.strip-list .o {
  color: var(--dim);
  font-size: 13px;
  white-space: nowrap;
}

.strip-list .go {
  color: var(--pink-tint);
  font-size: 11px;
}

.strip-list a:hover .t {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Extend extras ----------------------------------------------------------- */

.aside-link {
  margin-top: 20px;
  color: var(--dim);
  font-size: 15px;
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 13px;
}

/* Larger view of a screenshot ------------------------------------------- */

.lightbox {
  width: min(1480px, 96vw);
  max-width: 96vw;
  max-height: 94vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.82);
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
}

.lightbox-bar p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.lightbox-close {
  flex: none;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: 600 14px var(--font-sans);
  cursor: pointer;
}

.lightbox-close:hover {
  border-color: #4a4a58;
}

.lightbox-body {
  max-height: calc(94vh - 64px);
  overflow: auto;
  overscroll-behavior: contain;
}

.lightbox-body img {
  display: block;
  max-width: none;
  margin-inline: auto;
}

@media (min-width: 641px) {
  .lightbox-body img {
    max-width: 100%;
  }
}

/* Phones: screenshots run edge to edge so their text stays legible ---- */

@media (max-width: 640px) {
  .strip-list {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .strip-list .o {
    grid-column: 1;
    grid-row: 2;
    margin-top: -12px;
  }

  .strip-list .go {
    grid-column: 2;
    grid-row: 1;
  }

  .features .shot:not(.shot-narrow) .shot-frame,
  .hero .shot .shot-frame {
    width: calc(100% + 2 * var(--gutter));
    max-width: none;
    margin-inline: calc(-1 * var(--gutter));
    border-inline: 0;
    border-radius: 0;
  }

  /* Phone crops are shown at their captured size; a wider one scrolls
     sideways inside its frame rather than shrinking its text. */
  .features .shot:not(.shot-narrow) .shot-frame,
  .hero .shot .shot-frame {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .features .shot:not(.shot-narrow) .shot-frame img,
  .hero .shot .shot-frame img {
    width: auto;
    min-width: 100%;
    max-width: none;
  }
}

/* Guide: scene titles, where next --------------------------------------- */

.scenes td:first-child b {
  display: block;
  color: var(--text);
  font-weight: 600;
}

.scenes td:first-child code {
  display: inline-block;
  margin-top: 4px;
}

.scenes td:first-child {
  white-space: normal;
  min-width: 220px;
}

.next {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.next-col {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.next-col h4 {
  font-size: 17px;
}

.next-col p {
  margin-top: 4px;
  color: var(--dim);
  font-size: 14px;
}

.link-list {
  margin: 12px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line-soft);
  list-style: none;
  color: var(--dim);
  font-size: 14px;
}

.link-list li {
  padding: 3px 0;
}

@media (max-width: 1100px) {
  .next {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .scenes td:first-child {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .scenes td:nth-child(2) {
    grid-column: 1 / -1;
    color: var(--dim);
    font-size: 13px;
  }
}

/* Three ways to use it, and the closing call to action. */
.section-lead {
  max-width: 760px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

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

.card.card-accent {
  border-color: var(--pink);
}

.card.card-accent .more {
  color: var(--pink-tint);
}

.work-note {
  margin-top: 22px;
  color: var(--dim);
  font-size: 15px;
}

.work-note a {
  color: var(--blue-tint);
}

.closing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px 56px;
  align-items: center;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.closing h2 {
  margin-top: 10px;
}

.closing p:not(.eyebrow) {
  max-width: 620px;
  margin-top: 12px;
  color: var(--muted);
}

@media (max-width: 1000px) {
  .cards.cards-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .closing {
    grid-template-columns: minmax(0, 1fr);
    padding: 28px 22px;
  }
}

/* From an empty database to where you stand: a numbered path ------------ */

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

.path > li {
  display: grid;
  grid-template-columns: 56px minmax(0, 4fr) minmax(0, 8fr);
  gap: 8px 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: path;
}

.path > li::before {
  content: "0" counter(path);
  color: var(--pink-tint);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.75;
}

.path h3 {
  font-size: 18px;
  line-height: 1.4;
}

.path-body {
  display: contents;
}

.path-body > p {
  grid-column: 3;
  color: var(--muted);
}

/* A command runs under both the step's title and its sentence. */
.path-body > .code {
  grid-column: 2 / -1;
  margin-top: 6px;
}

@media (max-width: 960px) {
  .path > li {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .path > li > h3,
  .path-body > p,
  .path-body > .code {
    grid-column: 2;
  }
}

@media (max-width: 640px) {
  .path > li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .path > li > h3,
  .path-body > p,
  .path-body > .code {
    grid-column: auto;
  }

  .path-body > .code {
    margin-top: 10px;
  }
}

/* Guide: two tracks under one rail --------------------------------------- */

.tracks {
  min-width: 0;
}

.track-head {
  max-width: 760px;
  margin-bottom: 48px;
}

.track-head h2 {
  margin-top: 6px;
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.track-head p:not(.eyebrow) {
  margin-top: 14px;
  color: var(--muted);
}

.track-head + .steps {
  margin-top: 0;
}

.track-next {
  padding-top: 48px;
  border-top: 1px solid var(--line);
}

.rail p + ol + p,
.rail ol + p {
  margin-top: 28px;
}

.step-title {
  font-size: 28px;
  line-height: 34px;
  letter-spacing: -0.015em;
}

@media (max-width: 640px) {
  .track-head h2 {
    font-size: 28px;
  }

  .step-title {
    font-size: 24px;
    line-height: 1.25;
  }
}

.guide-tracks {
  margin-top: 16px;
  color: var(--muted);
}

.step-body > .link-list {
  max-width: 680px;
  margin-top: 16px;
}

/* A second screenshot under a side-by-side feature runs across the full width. */
.feature-side .shot.shot-span,
.feature-side.img-left .shot.shot-span {
  grid-column: 1 / -1;
  order: 0;
  align-items: flex-start;
  margin-top: 8px;
}

/* With a second, full-width screenshot below, the text column must not slide over it. */
.feature-side:has(.shot-span) .feature-text {
  position: static;
}

/* The command under the path's introduction. */
.section-head > .code,
.section-head.rule-top > .code {
  max-width: none;
  margin-top: 24px;
}

.section-head p b {
  color: var(--text);
  font-weight: 600;
}

/* Limits, then the open work, in one column. */
.limits-col {
  min-width: 0;
}

.limits-head {
  margin: 40px 0 16px;
  color: var(--blue-tint);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The rail lists both tracks; on a short screen it stays inside the viewport. */
@media (min-width: 961px) and (max-height: 1040px) {
  .rail a {
    padding: 3px 0;
  }

  .rail p {
    margin-bottom: 8px;
  }

  .rail p + ol + p,
  .rail ol + p {
    margin-top: 18px;
  }
}
