:root {
  color-scheme: light dark;
  --paper: #f6f7f6;
  --fog: #e8eceb;
  --line: #cfd7d5;
  --ink: #17211f;
  --muted: #596662;
  --rail: #13201d;
  --teal: #087c6d;
  --teal-bright: #0b9b88;
  --code: #e4eeeb;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
body { margin: 0; }
a { color: var(--teal); text-underline-offset: 0.17em; }
a:hover { color: var(--teal-bright); }
a:focus-visible { outline: 3px solid var(--teal-bright); outline-offset: 3px; border-radius: 2px; }

.site-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 92%, white); }
.site-header__inner { max-width: 88rem; margin: 0 auto; padding: 1rem 1.5rem; display: flex; gap: 1.5rem; align-items: baseline; justify-content: space-between; }
.site-name { color: var(--ink); font-weight: 800; text-decoration: none; letter-spacing: -0.03em; }
.site-name::before { content: ""; display: inline-block; width: .7rem; height: .7rem; margin-right: .5rem; border-radius: 50%; background: var(--teal); }
.site-header nav { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .9rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }

.site-layout { max-width: 88rem; margin: 0 auto; display: grid; grid-template-columns: 15rem minmax(0, 1fr); }
.reference-rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 2rem 1.5rem; background: var(--rail); color: #eff8f5; }
.reference-rail p { margin: 0 0 .75rem; color: #a9bbb5; font-size: .72rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.reference-rail a { display: block; padding: .3rem 0; color: #d1e1dc; font-size: .86rem; text-decoration: none; }
.reference-rail a:hover { color: white; }

main { min-width: 0; width: min(72ch, calc(100vw - 4rem)); padding: 4rem 0 6rem; margin: 0 auto; }
h1, h2, h3 { letter-spacing: -0.035em; line-height: 1.08; scroll-margin-top: 2rem; }
h1 { font-size: clamp(2.3rem, 6vw, 4.6rem); margin: 0 0 1.25rem; max-width: 14ch; }
h2 { font-size: 1.5rem; margin-top: 3rem; }
h3 { margin-top: 2rem; }
p, li { line-height: 1.65; }
code { padding: .08em .28em; border-radius: .2rem; background: var(--code); color: inherit; font-size: .9em; }
pre { overflow-x: auto; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-left: 4px solid var(--teal); background: #13201d; color: #eaf4f0; }
pre code { padding: 0; background: transparent; color: inherit; }
table { width: 100%; margin: 1.5rem 0; border-collapse: collapse; font-size: .91rem; }
th, td { padding: .7rem; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; }
.table-scroll { overflow-x: auto; max-width: 100%; overscroll-behavior-x: contain; }
.table-scroll table { min-width: max-content; }
.table-scroll code { white-space: normal; overflow-wrap: anywhere; }

.eyebrow { margin: 0 0 .5rem; color: var(--teal); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.lede { max-width: 58ch; color: var(--muted); font-size: 1.15rem; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1px; margin: 2.5rem 0; border: 1px solid var(--line); background: var(--line); }
.page-grid a { min-height: 9rem; padding: 1.25rem; background: var(--paper); color: var(--ink); text-decoration: none; }
.page-grid a:hover { background: var(--fog); }
.page-grid strong { display: block; margin-bottom: .55rem; color: var(--teal); }

.example-panel { margin: 2.5rem 0; padding: 1.25rem; border: 1px solid var(--line); background: var(--fog); }
.example-panel h2 { margin-top: 0; }
.live-example { min-height: 5rem; padding: 1.25rem; border: 1px solid var(--line); background: var(--paper); }
.contact-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 2.5rem 0; border: 1px solid var(--line); background: var(--line); }
.contact-sheet figure { margin: 0; padding: .8rem; background: var(--paper); }
.contact-sheet figure:last-child { background: #15211f; color: #eff8f5; }
.contact-sheet figcaption { margin-bottom: .6rem; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.contact-sheet img { display: block; width: 100%; min-height: 7rem; object-fit: cover; border: 1px solid currentColor; }

@media (max-width: 52rem) {
  .site-layout { display: block; }
  .reference-rail { position: static; height: auto; padding: 1rem 1.5rem; columns: 2; }
  .reference-rail p { column-span: all; }
  main { width: min(72ch, calc(100vw - 2.5rem)); padding-top: 2.5rem; }
}

@media (max-width: 34rem) {
  .site-header__inner { display: block; }
  .site-header nav { margin-top: .9rem; }
  .reference-rail { columns: 1; }
  .contact-sheet { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
