:root {
  --color-text: #231b2b;
  --color-text-muted: #62576b;
  --color-text-inverse: #faf7ff;
  --color-background: #f4f3f5;
  --color-surface: #fffdfb;
  --color-surface-muted: #ece9ef;
  --color-surface-inverse: #2d2237;
  --color-border: #8e8595;
  --color-divider: #d9d2df;
  --color-primary: #6c304e;
  --color-primary-hover: #4d2037;
  --color-accent: #68449b;
  --color-accent-light: #b599ed;
  --color-accent-surface: #eee7f8;
  --color-ocean: #305f64;
  --color-ocean-light: #9bc4c5;
  --color-ocean-surface: #e3eff0;
  --color-success: #315e50;
  --color-success-surface: #e4eee8;
  --color-warning: #77571e;
  --color-warning-surface: #fff0cc;
  --color-danger: #a02d48;
  --color-danger-surface: #f9e6eb;
  --color-focus: #f1c75b;

  --font-body: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --text-small: 0.875rem;
  --text-body: 1.0625rem;
  --text-lead: clamp(1.2rem, 2vw, 1.45rem);
  --text-heading: clamp(2.5rem, 5.5vw, 3.8rem);
  --weight-body: 400;
  --weight-strong: 700;
  --line-body: 1.6;
  --line-heading: 1.08;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --radius-small: 4px;
  --radius-medium: 10px;
  --radius-large: 16px;
  --shadow-soft: 0 8px 28px rgb(35 27 43 / 6%);
  --shadow-raised: 0 16px 40px rgb(35 27 43 / 10%);
  --duration-fast: 140ms;
  --ease-standard: cubic-bezier(0.2, 0, 0.2, 1);
  --measure: 65ch;
  --wide: 1180px;
  --reading-width: 760px;
  --target-size: 44px;

  /* Compatibility aliases for existing site and map components. */
  --ink: var(--color-text);
  --paper: var(--color-background);
  --white: var(--color-surface);
  --link: var(--color-primary);
  --muted: var(--color-text-muted);
  --border: var(--color-border);
  --border-soft: var(--color-divider);
  --teal: var(--color-ocean);
  --jade: var(--color-success);
  --jade-light: var(--color-ocean-light);
  --gold: var(--color-warning);
  --gold-light: var(--color-focus);
  --focus: var(--color-focus);
  --error: var(--color-danger);
  --soft-jade: var(--color-ocean-surface);
  --soft-gold: var(--color-warning-surface);
  --soft-green: var(--color-success-surface);
  --soft-plum: var(--color-accent-surface);
  --shadow: var(--shadow-raised);
}

* {
  box-sizing: border-box;
}
html {
  min-width: 280px;
  background: var(--color-surface-inverse);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 100%;
  line-height: var(--line-body);
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--color-background);
  font-size: var(--text-body);
}
::selection {
  color: var(--color-text);
  background: var(--color-accent-light);
}
a {
  color: var(--color-primary);
  font-weight: var(--weight-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
a:hover {
  color: var(--color-primary-hover);
  text-decoration-thickness: 2px;
}
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--color-text);
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
table,
figure {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-weight: var(--weight-strong);
  text-wrap: balance;
}
h1 {
  max-width: 22ch;
  margin-bottom: var(--space-5);
  font-size: var(--text-heading);
  line-height: var(--line-heading);
  letter-spacing: -0.04em;
}
h2 {
  margin: var(--space-8) 0 var(--space-5);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.16;
  letter-spacing: -0.025em;
}
h3 {
  margin: var(--space-6) 0 var(--space-3);
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
p,
li {
  max-width: var(--measure);
}
p,
ul,
ol {
  margin-bottom: var(--space-5);
}
code,
.data-label {
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}
code {
  overflow-wrap: anywhere;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.card,
.panel {
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-medium);
  background: var(--color-surface);
}
.card h3,
.panel h3 {
  margin-top: 0;
}
.card > :last-child,
.panel > :last-child {
  margin-bottom: 0;
}
.panel--muted {
  background: var(--color-surface-muted);
}
.panel--accent {
  border-color: var(--color-accent);
  background: var(--color-accent-surface);
}
.callout,
.notice {
  margin: var(--space-6) 0;
  padding: var(--space-5);
  border-left: 4px solid var(--color-ocean);
  border-radius: 0 var(--radius-medium) var(--radius-medium) 0;
  background: var(--color-ocean-surface);
}
.callout > :last-child,
.notice > :last-child {
  margin-bottom: 0;
}
.notice__title {
  margin-bottom: var(--space-2);
  font-weight: var(--weight-strong);
}
.warning,
.notice--warning {
  border-left-color: var(--color-warning);
  background: var(--color-warning-surface);
}
.notice--success {
  border-left-color: var(--color-success);
  background: var(--color-success-surface);
}
.notice--danger {
  border-left-color: var(--color-danger);
  background: var(--color-danger-surface);
}
.filter-row,
.button-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: var(--space-5) 0 var(--space-6);
  align-items: center;
}
.button,
.filter-row a:not(.button),
.filter-row button:not(.button),
.inline-button {
  display: inline-flex;
  min-height: var(--target-size);
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  padding: 0.65rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: var(--color-surface);
  color: var(--color-primary);
  font: inherit;
  font-size: 0.95rem;
  font-weight: var(--weight-strong);
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}
.button:hover,
.filter-row a:not(.button):hover,
.filter-row button:not(.button):hover,
.inline-button:hover {
  color: var(--color-primary-hover);
  background: var(--color-accent-surface);
  border-color: var(--color-primary);
}
.button--primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}
.button--primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-text-inverse);
}
.button--quiet {
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.button--danger {
  color: var(--color-danger);
  border-color: var(--color-danger);
}
.button--danger:hover {
  color: var(--color-danger);
  background: var(--color-danger-surface);
  border-color: var(--color-danger);
}
.button:disabled,
.inline-button:disabled {
  color: var(--color-text-muted);
  border-color: var(--color-border);
  background: var(--color-surface-muted);
  cursor: not-allowed;
}
.button:active:not(:disabled),
.inline-button:active:not(:disabled) {
  box-shadow: inset 0 2px 3px rgb(35 27 43 / 15%);
}
.inline-button {
  margin-top: var(--space-2);
}
.field {
  max-width: 36rem;
  margin-bottom: var(--space-5);
}
.field__label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: var(--weight-strong);
}
.field__help,
.field__error {
  margin-bottom: var(--space-2);
  font-size: 0.95rem;
}
.field__help {
  color: var(--color-text-muted);
}
.field__error {
  color: var(--color-danger);
  font-weight: var(--weight-strong);
}
.field__input {
  width: 100%;
  min-height: var(--target-size);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  color: var(--color-text);
  background: var(--color-surface);
  font: inherit;
}
.field__input::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}
.field__input[aria-invalid="true"] {
  border: 2px solid var(--color-danger);
}
.field__input:disabled {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  cursor: not-allowed;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

main,header,footer { width:min(100% - 2rem,1180px); margin-inline:auto; }
header { padding-block:3rem 1rem; } main { padding-bottom:4rem; } footer { padding-block:2rem; }
nav { display:flex; flex-wrap:wrap; gap:1.5rem; margin-block:2rem; }
.swatches { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:1rem; }
.swatch { border:1px solid var(--color-divider); border-radius:10px; overflow:hidden; background:var(--color-surface); }
.swatch div { height:80px; background:var(--swatch); } .swatch p { padding:1rem; margin:0; } .swatch code { display:block; }
.examples { display:grid; gap:1.5rem; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); }
pre { overflow-x:auto; padding:1.5rem; background:var(--color-surface-muted); border-radius:10px; }
table { border-collapse:collapse; width:100%; } th,td { text-align:left; padding:1rem; border-bottom:1px solid var(--color-divider); }
.table-scroll { overflow:auto; } .skip-link { position:absolute; top:-100px; padding:1rem; background:var(--color-focus); } .skip-link:focus {top:0;}
.tag { font-size:.875rem; color:var(--color-text-muted); } .lead {font-size:var(--text-lead);}
