:root {
  color-scheme: light dark;
  --paper: light-dark(#f6f8fc, #101a2b);
  --surface: light-dark(white, #162238);
  --ink: light-dark(#14233b, #e8eef9);
  --muted: light-dark(#465973, #b5c3d9);
  --blue: light-dark(#254bc4, #a5bfff);
  --line: light-dark(#ccd6e3, #364861);
  --branch-line: light-dark(#9cafd1, #617898);
  --code-bg: light-dark(#182941, #0c1422);
  --mono: Consolas, "Liberation Mono", monospace;
  font: 100%/1.55 "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, figure, pre { margin: 0; }
body { overflow-wrap: break-word; }
a { color: var(--blue); text-underline-offset: .23em; }
a:hover { text-decoration-thickness: .13em; }
:is(a, button):focus-visible { outline: 3px solid light-dark(#ac5608, #ffbf6c); outline-offset: 4px; }
.wrap { width: min(76rem, 90%); margin-inline: auto; }
.skip { position: absolute; top: -6rem; padding: .5rem 1rem; background: var(--surface); z-index: 1; }
.skip:focus { top: .5rem; }
.masthead { border-bottom: 1px solid var(--line); }
nav, footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.6rem; }
.masthead nav { flex-wrap: wrap; padding-block: .5rem; }
.brand { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); text-decoration: none; font-size: 1.4rem; font-weight: 700; letter-spacing: -.055em; }
.mark { display: block; flex: none; width: 2rem; height: 2rem; margin-right: .2rem; }
.nav-links { display: flex; align-items: center; gap: clamp(.8rem, 3vw, 2.5rem); margin-inline-start: auto; }
.nav-links a { color: var(--ink); font-size: .92rem; font-weight: 550; text-decoration: none; }
.nav-links a:hover { text-decoration: underline; }
.nav-links a[aria-current="page"] { color: var(--blue); text-decoration: underline; }
.theme-toggle {
  align-items: center; justify-content: center; gap: .45rem; min-height: 2.25rem; padding: 0 .65rem;
  border: 1px solid var(--line); border-radius: .45rem; color: var(--ink); background: var(--surface);
  font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer;
}
.theme-toggle:not([hidden]) { display: inline-flex; }
.theme-toggle:hover { color: var(--blue); border-color: currentColor; }
#theme-symbol { width: 1em; font: 1.2rem/1 "Segoe UI Symbol", "Apple Symbols", sans-serif; }
.hero { padding-block: clamp(2.5rem, 5vw, 5.5rem); display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(16rem, .8fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.eyebrow { font: 600 .875rem/1.45 var(--mono); color: var(--blue); margin-bottom: .85rem; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: clamp(2.8rem, 5.2vw, 4.95rem); line-height: 1.04; font-weight: 650; letter-spacing: -.063em; }
h1 em { color: var(--blue); font-style: normal; }
.lead, .section-intro, .walkthrough p { color: var(--muted); }
.lead { max-width: 57ch; margin-block: 1.2rem 1.45rem; font-size: 1.12rem; }
.button { display: inline-flex; align-items: center; padding: .7rem 1.12rem .78rem; border-radius: .35rem; color: light-dark(white, #11213d); background: var(--blue); font-weight: 650; text-decoration: none; }
.button:hover { background: light-dark(#193da8, #c0d1ff); }
.model { background: light-dark(#edf2f9, #1c2b42); border: 1px solid var(--line); border-radius: .65rem; padding: clamp(1.1rem, 2.1vw, 2rem); font-size: .96rem; }
.model-input { display: flex; gap: .72rem; align-items: center; }
.model-input strong, .branches strong { display: block; font-weight: 650; }
.file-mark { background: light-dark(#d8e4fd, #293e60); border: 1px solid light-dark(#aebfe5, #516c94); color: light-dark(#244198, #c5d7ff); border-radius: .26rem; padding: .23rem .36rem; font: bold .93rem/1.55 var(--mono); }
.model-input code, .branches span, .branches code { display: block; color: var(--muted); font-size: .875rem; }
.branches { list-style: none; margin: .75rem 0 0 1rem; padding: 0; }
.branches li { position: relative; padding: .45rem 0 .45rem 1.65rem; }
.branches li::before, .branches li::after { content: ""; position: absolute; left: 0; }
.branches li::before { top: 0; bottom: 0; border-left: 1px solid var(--branch-line); }
.branches li:last-child::before { bottom: auto; height: 1.2rem; }
.branches li::after { width: 1.1rem; top: 1.2rem; border-top: 1px solid var(--branch-line); }
.example { background: var(--surface); border-block: 1px solid var(--line); padding-block: clamp(2.4rem, 4.2vw, 4rem); scroll-margin-top: 1.5rem; }
h2 { font-size: clamp(2rem, 3.5vw, 3rem); font-weight: 650; line-height: 1.12; letter-spacing: -.046em; }
.section-intro { max-width: 78ch; margin-block: .85rem 1.55rem; }
.pair { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr); gap: 1rem; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: .55rem; overflow: hidden; }
.panel figcaption, .preview-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .66rem 1rem; border-bottom: 1px solid var(--line); font: .875rem/1.5 var(--mono); }
.file-label { font-family: "Segoe UI", Roboto, sans-serif; font-weight: 650; }
.source { background: var(--code-bg); border-color: light-dark(#182941, var(--line)); color: #ecf2fc; }
.source figcaption { border-color: #3a4c63; color: #d5dfef; }
.code-label { margin: 1.15rem clamp(.9rem, 1.65vw, 1.5rem) 0; color: #bdcce0; font-size: .9rem; }
.source pre { padding-top: .45rem; }
pre { padding: clamp(.9rem, 1.65vw, 1.5rem); font: clamp(.875rem, 1.02vw, 1rem)/1.75 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
code { font-family: var(--mono); }
.key { color: #a8c7ff; } .literal { color: #ffd48e; } .string { color: #a8e4cd; } .member { color: #b8d5ff; }
.inspector { background: light-dark(#f1f4f7, #111c2c); display: flex; flex-direction: column; }
.inspector figcaption, .preview-title { background: light-dark(#f8fafd, #1c2b42); }
.image-link { display: flex; flex: 1; align-items: center; }
.image-link:focus-visible { outline-offset: -4px; }
.inspector img { display: block; width: 100%; height: auto; }
.metadata-examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.metadata-preview { text-decoration: none; }
.preview-title .file-label { color: var(--ink); }
.preview-title span { text-decoration: underline; white-space: nowrap; }
.metadata-preview picture { display: block; aspect-ratio: 668 / 716; overflow: hidden; }
.metadata-preview img { height: 100%; object-fit: cover; object-position: left top; }
.metadata-examples figcaption { margin-top: .65rem; color: var(--muted); }
.database { margin-top: clamp(2rem, 4vw, 3.6rem); }
.database h3 { font-size: clamp(1.5rem, 2.6vw, 2.15rem); }
.type-map { width: 100%; margin-block: 1.3rem 2.2rem; border-collapse: collapse; text-align: left; }
.type-map caption { margin-bottom: .55rem; text-align: left; font-weight: 600; }
.type-map thead { background: var(--paper); color: var(--muted); font-size: .9rem; }
.type-map th, .type-map td { padding: .55rem .75rem; border-bottom: 1px solid var(--line); }
.type-map code { font-size: .92em; overflow-wrap: anywhere; }
.sql-example p { margin-bottom: .6rem; color: var(--muted); }
.sql-example pre { background: var(--code-bg); color: #ecf2fc; border-radius: .5rem; }
.walkthrough { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 5rem); margin-top: 2rem; }
h3 { font-size: 1.18rem; line-height: 1.3; letter-spacing: -.02em; }
.walkthrough p { margin-top: .5rem; }
.walkthrough p strong { color: var(--ink); font-weight: 600; }
.walkthrough code { font-size: .92em; color: light-dark(#253f78, #bed1ff); }
.text-link { display: inline-block; margin-top: .65rem; font-weight: 650; }
.setup { padding-block: clamp(2.4rem, 4.2vw, 4rem); scroll-margin-top: 1.5rem; }
#local-setup pre { margin-block: .5rem .85rem; padding: .65rem .85rem; border-inline-start: 2px solid var(--branch-line); background: var(--surface); }
#local-setup details { margin-block: .65rem; }
#local-setup summary { color: var(--blue); cursor: pointer; }
.sites-grid { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.25fr); gap: clamp(1.5rem, 4vw, 3.2rem); align-items: start; }
.sites-note p { color: var(--muted); }
.sites-note p + p, .sites-note .sql-example + p { margin-top: .75rem; }
.sites-note code { font-size: .92em; color: light-dark(#253f78, #bed1ff); }
.sites-note .sql-example pre { padding: .75rem 1rem; font-size: .92rem; }
.sites-note .sql-example pre code { color: #ecf2fc; }
.sites-table { margin-block: 0; }
.sites-table th, .sites-table td { vertical-align: top; }
.sites-table th[scope="row"], .sites-table td:nth-child(3) { white-space: nowrap; }
.sites-table th[scope="row"] code { overflow-wrap: normal; }
.comparison { margin-block: 1.3rem 1.4rem; }
.comparison-card { background: var(--surface); border: 1px solid var(--line); }
.comparison-card thead { background: light-dark(#edf2f9, #1c2b42); }
.comparison th, .comparison td { width: 50%; vertical-align: top; }
.comparison td strong { color: var(--ink); font-weight: 650; }
.prose { padding-block: clamp(2.4rem, 4.8vw, 4.5rem); max-width: 68ch; }
.prose h1 { font-size: clamp(2.25rem, 4.2vw, 3.35rem); letter-spacing: -.05em; }
.prose .lead { max-width: 64ch; margin-block: 1rem 2rem; }
.prose section { margin-top: 2rem; }
.prose h2 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); letter-spacing: -.03em; margin-bottom: .65rem; }
.prose p { color: var(--muted); }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: .7rem; }
.prose ul { margin: 0; padding-left: 1.25rem; color: var(--muted); }
.prose li + li { margin-top: .45rem; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code { font-size: .92em; color: light-dark(#253f78, #bed1ff); }
.prose-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 2.4rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.prose-actions .text-link { margin-top: 0; }
.warehouse { padding-block: clamp(2.4rem, 4.2vw, 4rem); }
.warehouse .walkthrough { margin-top: 1.2rem; align-items: start; }
.stock-ledger { width: 100%; border-collapse: collapse; background: var(--surface); }
.stock-ledger caption { text-align: left; font-weight: 650; padding-bottom: .5rem; }
.stock-ledger th, .stock-ledger td { padding: .4rem .7rem; border-bottom: 1px solid var(--line); }
.stock-ledger th { text-align: left; font-weight: 500; }
.stock-ledger th:not(:first-child), .stock-ledger td { text-align: right; font-variant-numeric: tabular-nums; }
.stock-ledger tfoot { color: var(--blue); font-weight: 650; }
.stock-ledger tfoot th { font-weight: inherit; }
footer { border-top: 1px solid var(--line); }
footer .wrap { flex-wrap: wrap; color: var(--muted); font-weight: 600; }
footer .wrap span:last-child { font-size: .9rem; font-weight: 400; }
@media (max-width: 54rem) {
  .hero { grid-template-columns: 1fr; gap: 1.7rem; }
  .model { padding: .9rem 1.2rem; }
  .branches { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin: .65rem 0 0; }
  .branches li { border-left: 2px solid var(--branch-line); padding: 0 0 0 .65rem; }
  .branches li::before, .branches li::after { content: none; }
  .pair, .metadata-examples { grid-template-columns: 1fr; }
  .sites-grid { grid-template-columns: 1fr; }
}
@media (max-width: 38rem) {
  .wrap { width: min(100% - 2rem, 76rem); }
  nav { min-height: 3.9rem; }
  .masthead nav, .nav-links { gap: .5rem; }
  .masthead nav { position: relative; }
  .masthead .brand { min-height: 2.75rem; }
  .nav-links { flex-basis: 100%; flex-wrap: wrap; }
  .nav-links a { display: inline-flex; align-items: center; min-height: 2.75rem; }
  .theme-toggle { position: absolute; inset-block-start: .5rem; inset-inline-end: 0; width: 2.75rem; min-height: 2.75rem; padding: 0; }
  #theme-label { display: none; }
  h1 { font-size: clamp(2.15rem, 8.6vw, 3rem); }
  .branches { display: grid; }
  .walkthrough { grid-template-columns: 1fr; }
  .type-map, .type-map tbody, .type-map tr, .type-map caption { display: block; }
  .type-map thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .type-map tbody th { display: block; background: var(--paper); }
  .type-map td { display: grid; grid-template-columns: minmax(7rem, .88fr) minmax(0, 1.5fr); gap: .5rem; }
  .type-map td::before { content: attr(data-label); color: var(--muted); font-size: .875rem; }
  .comparison td { display: block; width: auto; }
  .comparison td::before { display: block; margin-bottom: .2rem; font-weight: 600; }
  .comparison-card { border: 0; background: transparent; }
  .comparison tr { margin-bottom: .85rem; border: 1px solid var(--line); border-radius: .45rem; overflow: hidden; }
  .comparison tr td:last-child { border-bottom: 0; }
  .sites-table th[scope="row"], .sites-table td:nth-child(3) { white-space: normal; }
}
@media (max-width: 23.25rem) {
  .masthead .wrap { width: calc(100% - 1rem); gap: .4rem; }
  .brand { gap: .3rem; font-size: 1.2rem; }
  .mark { width: 1.75rem; height: 1.75rem; margin-right: 0; }
  .nav-links { gap: .4rem; }
  .nav-links a { font-size: .8125rem; }
}
#warehouse-perspectives { margin-block: 0.75rem; }

.capability-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; margin-block: 1.5rem; }
.capability-grid article { display: flex; flex-direction: column; padding: 1.15rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); }
.capability-grid h3 { margin: 0; }
.capability-grid p { flex: 1; margin-block: .6rem 1rem; }
.capability-grid a { align-self: flex-start; }
