:root {
  --bg: #ffffff;
  --fg: #171717;
  --muted: #666666;
  --line: #e6e6e6;
  --panel: #fafafa;
  --red: #c4262e;
  --amber: #a15c00;
  --green: #1a7f37;
  --blue: #0b57d0;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0e;
    --fg: #ededed;
    --muted: #a0a0a0;
    --line: #2a2a2a;
    --panel: #161616;
    --red: #ff6b6b;
    --amber: #f0b45a;
    --green: #5cc97a;
    --blue: #7aa7ff;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e0e;
  --fg: #ededed;
  --muted: #a0a0a0;
  --line: #2a2a2a;
  --panel: #161616;
  --red: #ff6b6b;
  --amber: #f0b45a;
  --green: #5cc97a;
  --blue: #7aa7ff;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1.5rem; }

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

a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); }
code { font-size: 0.88em; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -3rem; background: var(--fg); color: var(--bg); padding: 0.4rem 0.8rem; border-radius: 6px; z-index: 5; }
.skip:focus { top: 0.75rem; }

.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 24px; }

/* Nav */
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; text-decoration: none; }
.logo svg { width: 22px; height: 22px; }
.nav nav { display: flex; align-items: center; gap: 24px; font-size: 15px; }
.nav nav a { text-decoration: none; color: var(--muted); }
.nav nav a:hover { color: var(--fg); }
.nav .nav-gh { color: var(--fg); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 88px;
}
h1 {
  margin: 0 0 20px;
  font-size: clamp(36px, 4.6vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 600;
}
.sub { font-size: 21px; line-height: 1.35; font-weight: 500; letter-spacing: -0.01em; margin-bottom: 14px; }
.lede { font-size: 18px; line-height: 1.55; color: var(--muted); max-width: 32em; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 28px 0 20px; }
.btn {
  display: inline-block; background: var(--fg); color: var(--bg);
  padding: 10px 20px; border-radius: 999px;
  font-weight: 500; font-size: 16px; text-decoration: none;
}
.btn:hover { opacity: 0.85; }
.link { font-weight: 500; font-size: 16px; text-decoration: none; }
.link:hover { text-decoration: underline; }
.facts { font-size: 14.5px; color: var(--fg); margin-bottom: 4px; }
.fine { font-size: 13.5px; color: var(--muted); max-width: 30em; }

/* Terminal */
.term-fig { margin: 0; min-width: 0; }
.term { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.term-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.term-bar b { flex: 1; text-align: center; font-weight: 400; font-size: 12.5px; color: var(--muted); margin-right: 40px; }
.term-body {
  margin: 0; padding: 18px 20px 20px;
  font-size: 12.5px; line-height: 1.75;
  overflow-x: auto;
}
.term-body .o::before { content: "  "; }
.p { color: var(--muted); }
.tool { color: var(--blue); }
.s { color: var(--green); }
.d { color: var(--muted); }
.r { color: var(--red); }
.a { color: var(--amber); }
.g { color: var(--green); font-weight: 600; }
.verified {
  display: inline-block; color: var(--green); font-weight: 700; font-size: 1.08em;
  background: color-mix(in srgb, var(--green) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--green) 35%, transparent);
  border-radius: 6px; padding: 1px 8px; margin-left: -9px;
}
.term-fig figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 12px; }

.js .term-body.play .ln { visibility: hidden; }
.js .term-body.play .ln.on,
.js .term-body.play .ln.typing { visibility: visible; }

/* Body: left index + sections */
.body {
  display: grid;
  grid-template-columns: 200px minmax(0, 680px);
  gap: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.toc { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; gap: 6px; padding-top: 72px; font-size: 14.5px; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover, .toc a[aria-current="true"] { color: var(--fg); }

.sections section { padding: 72px 0 8px; }
.kicker { font-weight: 600; font-size: 15px; margin: 0 0 6px; }
h2 { margin: 0 0 16px; font-size: clamp(26px, 3vw, 32px); line-height: 1.2; letter-spacing: -0.025em; font-weight: 600; }

.block {
  margin: 24px 0 8px; padding: 16px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  font-size: 12.5px; line-height: 1.7; overflow-x: auto;
}
.note { font-size: 13px; color: var(--muted); }

table { width: 100%; border-collapse: collapse; margin: 24px 0 16px; font-size: 15.5px; }
th, td { text-align: left; vertical-align: top; padding: 12px 0; border-top: 1px solid var(--line); }
thead th { font-size: 13px; font-weight: 500; color: var(--muted); border-top: 0; padding-bottom: 8px; }
tbody th { font-weight: 600; width: 34%; padding-right: 24px; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 1px solid var(--line); }

.st { font-size: 13px; padding: 2px 8px; border-radius: 6px; border: 1px solid currentColor; font-weight: 500; }
.st-new { color: var(--red); }
.st-amber { color: var(--amber); }
.st-ok { color: var(--green); }

.chart { margin: 32px 0 0; }
.chart figcaption { font-size: 14px; margin-bottom: 12px; }
.chart figcaption span { color: var(--muted); margin-left: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .bars rect { fill: var(--red); }
.chart .base { stroke: var(--muted); stroke-width: 1; }
.chart .deploy { stroke: var(--fg); stroke-dasharray: 3 3; }
.chart text { font-family: var(--mono); font-size: 11px; fill: var(--muted); }

.sections .end { padding-bottom: 96px; }
.end .cta { margin-bottom: 0; }

.foot { border-top: 1px solid var(--line); padding-top: 24px; padding-bottom: 48px; font-size: 13.5px; color: var(--muted); }
.foot p { margin: 0 0 4px; }

/* Narrow screens */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 40px; padding-bottom: 56px; }
  .body { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .sections section { padding-top: 56px; }
}
@media (max-width: 560px) {
  .wrap { padding-inline: 16px; }
  .nav nav { gap: 16px; }
  .nav nav a:first-child { display: none; }
  .lede { font-size: 17px; }
  .sub { font-size: 19px; }
  .term-body, .block { font-size: 11.5px; }
  .term-body { white-space: pre-wrap; overflow-wrap: break-word; }
  .term-bar b { margin-right: 0; }
  tbody th { width: 40%; padding-right: 16px; }
}

/* Migration picker */
/* Legal pages */
.legal { max-width: 728px; padding-top: 48px; padding-bottom: 96px; }
.legal h1 { font-size: clamp(32px, 4vw, 44px); margin-bottom: 8px; }
.legal .updated { color: var(--muted); font-size: 14px; margin-bottom: 32px; }
.legal-notice { margin: 0 0 32px; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 10px; background: var(--panel); font-size: 15px; }
.legal-notice p { margin: 0 0 6px; }
.legal-notice p:last-child { margin-bottom: 0; }
.legal h2 { font-size: 22px; margin: 40px 0 10px; letter-spacing: -0.015em; }
.legal ul { padding-left: 1.2em; margin: 0 0 1em; }
.legal li { margin-bottom: 6px; }
.legal a { text-underline-offset: 2px; }

/* Footer links */
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 12px; }
.foot-links a { color: var(--fg); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }

/* Consent banner */
.consent {
  position: fixed; left: 24px; bottom: 24px; z-index: 10;
  width: min(400px, calc(100vw - 32px));
  background: var(--panel); color: var(--fg);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.12);
  padding: 16px 18px; font-size: 14.5px; line-height: 1.5;
}
.consent[hidden] { display: none; }
.consent p { margin: 0 0 12px; }
.consent-actions { display: flex; gap: 8px; }
.consent-btn {
  flex: 1; font: inherit; font-weight: 500; cursor: pointer;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--muted); background: transparent; color: var(--fg);
}
.consent-btn:hover { border-color: var(--fg); }
@media (max-width: 560px) {
  .consent { left: 16px; bottom: 16px; }
}
