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

:root {
  --demo-color-ink: #172129;
  --demo-color-ink-soft: #3c4854;
  --demo-color-muted: #64707a;
  --demo-color-paper: #fbfaf6;
  --demo-color-surface: #ffffff;
  --demo-color-surface-strong: #f3f0e8;
  --demo-color-line: #d9d2c3;
  --demo-color-line-strong: #a99f8d;
  --demo-color-green: #0d5f56;
  --demo-color-green-dark: #073f3a;
  --demo-color-amber: #c98500;
  --demo-color-amber-soft: #fff2c7;
  --demo-color-coral: #a94433;
  --demo-color-blue: #294a61;
  --demo-color-focus: #d69200;
  --demo-shadow-soft: 0 1.1rem 2.8rem rgb(23 33 41 / 0.09);
  --demo-shadow-hover: 0 1.35rem 3.2rem rgb(23 33 41 / 0.14);
  --demo-radius: 0.5rem;
  --demo-radius-sm: 0.35rem;
  --demo-page-max: 76rem;
  --demo-space-page: clamp(1rem, 4vw, 2.5rem);
  --demo-space-section: clamp(2.5rem, 7vw, 5.5rem);

  color-scheme: light;
  color: var(--demo-color-ink);
  background: var(--demo-color-paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 20rem;
  margin: 0;
  color: var(--demo-color-ink);
  background:
    repeating-linear-gradient(
      90deg,
      rgb(23 33 41 / 0.035) 0 1px,
      transparent 1px 6.5rem
    ),
    linear-gradient(180deg, #fffdfa 0%, var(--demo-color-paper) 52%, #f5f7f4 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgb(23 33 41 / 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgb(23 33 41 / 0.02) 1px, transparent 1px);
  background-size: 1rem 1rem, 1rem 1rem;
  mask-image: linear-gradient(180deg, rgb(0 0 0 / 0.65), transparent 65%);
}

a {
  color: var(--demo-color-green);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--demo-color-green-dark);
  text-decoration-thickness: 0.14em;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
.a11y-table-wrapper:focus-visible {
  outline: 3px solid var(--demo-color-focus);
  outline-offset: 0.25rem;
}

button,
select,
input {
  font: inherit;
}

code,
pre {
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, ui-monospace,
    monospace;
}

code {
  color: #20313d;
  font-size: 0.92em;
}

pre {
  position: relative;
  max-inline-size: 100%;
  margin: 0;
  padding: clamp(1rem, 3vw, 1.25rem);
  overflow-x: auto;
  color: #152a35;
  background:
    linear-gradient(90deg, rgb(201 133 0 / 0.14), transparent 0.45rem),
    #f2f5f1;
  border: 1px solid var(--demo-color-line);
  border-radius: var(--demo-radius);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.8);
  font-size: 0.875rem;
  line-height: 1.6;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.1rem 0.35rem;
  color: var(--demo-color-ink);
  text-align: center;
  background: #fffdf8;
  border: 1px solid var(--demo-color-line);
  border-radius: 0.3rem;
  box-shadow: inset 0 -1px 0 #cfc6b6;
  font: inherit;
  font-size: 0.85em;
}

table:not(.a11y-sortable-table) {
  width: 100%;
  border-collapse: collapse;
  color: var(--demo-color-ink);
  background: var(--demo-color-surface);
  border: 1px solid var(--demo-color-line);
  border-radius: var(--demo-radius);
  font-size: 0.95rem;
}

table:not(.a11y-sortable-table) th,
table:not(.a11y-sortable-table) td {
  padding: 0.75rem 0.8rem;
  text-align: start;
  vertical-align: top;
  border-block-end: 1px solid var(--demo-color-line);
}

table:not(.a11y-sortable-table) th {
  color: var(--demo-color-ink);
  background: var(--demo-color-surface-strong);
}

table:not(.a11y-sortable-table) tr:last-child td {
  border-block-end: 0;
}

ul,
ol {
  padding-inline-start: 1.25rem;
}

li + li {
  margin-block-start: 0.35rem;
}

fieldset {
  min-inline-size: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

legend {
  margin-block-end: 0.45rem;
  color: var(--demo-color-ink);
  font-weight: 800;
}

.skip-link {
  position: absolute;
  inset-block-start: 1rem;
  inset-inline-start: 1rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  color: var(--demo-color-ink);
  text-decoration: none;
  background: var(--demo-color-surface);
  border: 2px solid var(--demo-color-green);
  border-radius: var(--demo-radius-sm);
  box-shadow: var(--demo-shadow-soft);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.demo-page {
  width: min(100%, var(--demo-page-max));
  margin-inline: auto;
  padding: var(--demo-space-page);
}

.demo-page .a11y-sortable-table {
  --a11y-sortable-table-border-color: #d8d0bf;
  --a11y-sortable-table-header-bg: #f3f0e8;
  --a11y-sortable-table-header-active-bg: #bd7d00;
  --a11y-sortable-table-state-accent-color: #1b5fa7;
  --a11y-sortable-table-row-hover-bg: #f8f6f0;
  --a11y-sortable-table-row-active-bg: #e7edf4;
  --a11y-sortable-table-row-focus-bg: #e4f0ff;
  --a11y-sortable-table-row-selected-bg: #dcefe6;
  --a11y-sortable-table-row-selected-focus-bg: #c4e4d5;
  --a11y-sortable-table-row-selected-accent-color: #0c6257;
  --a11y-sortable-table-cell-focus-bg: #fff0b8;
  --a11y-sortable-table-cell-focus-ring: inset 0 0 0 3px #1b5fa7;
  --a11y-sortable-table-sort-active-cell-bg: #e8f1ff;
  --a11y-sortable-table-focus-ring: 3px solid var(--demo-color-focus);
  --a11y-sortable-table-button-hover-bg: #e6efe9;
  --a11y-sortable-table-sort-icon-color: #063b36;
}

.demo-hero,
.demo-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(16rem, 0.48fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: end;
  padding-block: clamp(2.5rem, 8vw, 6rem) clamp(2rem, 6vw, 4rem);
  border-block-end: 1px solid var(--demo-color-line);
}

.demo-hero::before,
.demo-header::before {
  align-self: start;
  color: rgb(23 33 41 / 0.1);
  content: "01";
  font-size: 6rem;
  font-weight: 900;
  grid-column: 2;
  grid-row: 1 / span 2;
  line-height: 0.8;
  text-align: end;
}

.demo-hero > *,
.demo-header > * {
  grid-column: 1;
}

.demo-header__description,
.demo-hero > p:not(.demo-eyebrow),
.demo-header > p:not(.demo-header__eyebrow) {
  max-width: 46rem;
  margin-block: 0;
  color: var(--demo-color-ink-soft);
  font-size: 1.125rem;
  line-height: 1.65;
}

.demo-header__links,
.demo-link-row,
.demo-actions,
.demo-filter-grid,
.demo-chip-row,
.demo-chip-list,
.demo-checkbox-grid,
.demo-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: end;
}

.demo-filter-grid,
.demo-checkbox-grid,
.demo-filters {
  align-items: stretch;
}

.demo-nav {
  position: sticky;
  inset-block-start: 0;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding-block: 0.75rem;
  margin-block: 0 1rem;
  background: rgb(251 250 246 / 0.94);
  border-block-end: 1px solid var(--demo-color-line);
  backdrop-filter: blur(12px);
}

.demo-nav a {
  display: inline-flex;
  min-block-size: 2.25rem;
  align-items: center;
  padding: 0.4rem 0.65rem;
  color: var(--demo-color-ink);
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--demo-radius-sm);
  font-size: 0.92rem;
  font-weight: 800;
}

.demo-nav a:hover {
  color: var(--demo-color-green-dark);
  background: #f0ece1;
  border-color: var(--demo-color-line);
}

.demo-eyebrow,
.demo-header__eyebrow,
.demo-section__eyebrow,
.demo-footer__eyebrow {
  margin: 0;
  color: var(--demo-color-coral);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-block-start: 0;
}

h1 {
  max-width: 13ch;
  margin-block-end: 0.3rem;
  color: var(--demo-color-ink);
  font-size: 4rem;
  line-height: 0.98;
}

h2 {
  margin-block-end: 0.45rem;
  color: var(--demo-color-ink);
  font-size: 2rem;
  line-height: 1.08;
}

h3 {
  margin-block-end: 0.4rem;
  color: var(--demo-color-blue);
  font-size: 1.08rem;
  line-height: 1.25;
}

p,
li,
label {
  color: var(--demo-color-ink-soft);
}

.demo-section,
.demo-stage,
.demo-grid,
.demo-notes,
.demo-preview,
.demo-table-group {
  display: grid;
  gap: 1rem;
}

.demo-section > *,
.demo-stage > *,
.demo-preview > *,
.demo-grid > *,
.demo-card-grid > *,
.demo-code-grid > *,
.demo-table-group > * {
  min-inline-size: 0;
}

.demo-section {
  position: relative;
  margin-block-start: var(--demo-space-section);
  padding-inline-start: clamp(0rem, 3vw, 4rem);
}

.demo-section::before {
  position: absolute;
  inset-block-start: 0.2rem;
  inset-inline-start: 0;
  width: clamp(0rem, 2vw, 2.5rem);
  height: 1px;
  background: var(--demo-color-amber);
  content: "";
}

.demo-section__header,
.demo-section > div:first-child:not(.demo-stage):not(.demo-grid):not(.demo-card-grid):not(.demo-code-grid):not(.demo-preview) {
  max-inline-size: min(100%, 52rem);
}

.demo-section p,
.demo-card p,
.demo-section ul,
.demo-section ol {
  margin-block: 0 1rem;
}

.demo-facts dl,
.demo-card-grid,
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
}

.demo-facts dl {
  margin: 0;
}

.demo-facts div,
.demo-card {
  position: relative;
  display: grid;
  gap: 0.45rem;
  min-block-size: 100%;
  padding: 1rem;
  background: rgb(255 255 255 / 0.86);
  border: 1px solid var(--demo-color-line);
  border-radius: var(--demo-radius);
  box-shadow: var(--demo-shadow-soft);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.demo-card::before {
  width: 2.2rem;
  height: 0.22rem;
  background: var(--demo-color-amber);
  content: "";
}

.demo-card:hover {
  border-color: var(--demo-color-line-strong);
  box-shadow: var(--demo-shadow-hover);
  transform: translateY(-2px);
}

.demo-card h3,
.demo-card h2,
.demo-facts dt,
.demo-facts dd,
.demo-card p {
  margin-block: 0;
}

.demo-facts dt {
  color: var(--demo-color-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.demo-facts dd {
  margin-inline-start: 0;
  color: var(--demo-color-ink);
  font-weight: 900;
}

.demo-stage,
.demo-preview {
  position: relative;
  padding: clamp(1rem, 3vw, 1.6rem);
  background:
    linear-gradient(90deg, rgb(201 133 0 / 0.18), transparent 0.4rem),
    rgb(255 255 255 / 0.92);
  border: 1px solid var(--demo-color-line);
  border-radius: var(--demo-radius);
  box-shadow: var(--demo-shadow-soft);
}

.demo-stage::before,
.demo-preview::before {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 0.25rem;
  background: linear-gradient(
    90deg,
    var(--demo-color-green),
    var(--demo-color-amber) 45%,
    var(--demo-color-coral)
  );
  border-start-start-radius: var(--demo-radius);
  border-start-end-radius: var(--demo-radius);
  content: "";
}

.demo-panel {
  padding: 1rem;
  background: #f7f4ed;
  border: 1px solid var(--demo-color-line);
  border-radius: var(--demo-radius);
}

.demo-table-wrap,
.demo-table-group {
  display: grid;
  gap: 0.75rem;
}

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

.a11y-table-wrapper {
  box-shadow: 0 0.8rem 1.8rem rgb(23 33 41 / 0.08);
}

.a11y-table-scroll-hint {
  color: var(--demo-color-muted);
}

.demo-button {
  display: inline-flex;
  min-block-size: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 0.95rem;
  color: #fffdfa;
  text-decoration: none;
  background: var(--demo-color-green);
  border: 1px solid var(--demo-color-green);
  border-radius: var(--demo-radius-sm);
  box-shadow: 0 0.55rem 1.2rem rgb(13 95 86 / 0.18);
  font-weight: 900;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.demo-button:hover {
  color: #fffdfa;
  background: var(--demo-color-green-dark);
  border-color: var(--demo-color-green-dark);
  box-shadow: 0 0.75rem 1.5rem rgb(13 95 86 / 0.24);
  transform: translateY(-1px);
}

.demo-button--secondary {
  color: var(--demo-color-green-dark);
  background: #fffdfa;
  border-color: var(--demo-color-line-strong);
  box-shadow: none;
}

.demo-button--secondary:hover {
  color: var(--demo-color-green-dark);
  background: #f0ece1;
  border-color: var(--demo-color-green);
}

.demo-field,
.demo-filter-field {
  display: grid;
  gap: 0.35rem;
  min-inline-size: min(100%, 14rem);
  color: var(--demo-color-ink);
  font-weight: 800;
}

.demo-field select,
.demo-field input,
.demo-filter-field select,
.demo-filter-field input {
  min-block-size: 2.75rem;
  padding: 0.55rem 0.7rem;
  color: var(--demo-color-ink);
  background: var(--demo-color-surface);
  border: 1px solid var(--demo-color-line-strong);
  border-radius: var(--demo-radius-sm);
}

.demo-checkbox {
  display: inline-flex;
  min-block-size: 2.75rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  color: var(--demo-color-ink);
  background: var(--demo-color-surface);
  border: 1px solid var(--demo-color-line);
  border-radius: var(--demo-radius-sm);
  font-weight: 800;
}

.demo-status {
  margin: 0;
  padding: 0.85rem 1rem;
  color: var(--demo-color-ink);
  background: var(--demo-color-amber-soft);
  border: 1px solid #ddb34f;
  border-inline-start: 0.35rem solid var(--demo-color-amber);
  border-radius: var(--demo-radius);
  font-weight: 900;
}

.demo-status--quiet {
  color: var(--demo-color-ink-soft);
  background: #eef2ed;
  border-color: #c8d3ca;
  border-inline-start-color: var(--demo-color-green);
  font-weight: 800;
}

.demo-empty,
.demo-empty-state {
  display: none;
  margin: 0;
  padding: 0.85rem 1rem;
  color: #6f2f22;
  background: #fff0ea;
  border: 1px solid #dda493;
  border-inline-start: 0.35rem solid var(--demo-color-coral);
  border-radius: var(--demo-radius);
  font-weight: 800;
}

.demo-empty.is-visible,
.demo-empty-state.is-visible {
  display: block;
}

.demo-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  color: var(--demo-color-green-dark);
  background: #e4f0e8;
  border: 1px solid #a8c9bd;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 900;
}

.demo-code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: 1rem;
}

.demo-footer {
  --demo-footer-background: #172129;
  --demo-footer-color: #f8fafc;
  --demo-footer-muted-color: #cbd5d6;
  --demo-footer-link-color: #fffdfa;
  --demo-footer-border-color: rgb(255 255 255 / 0.16);
  --demo-footer-focus-color: var(--demo-color-focus);
  --demo-footer-radius: 0.5rem;
  --demo-footer-space: clamp(1rem, 2vw, 1.5rem);

  max-width: var(--demo-page-max);
  margin: clamp(2rem, 5vw, 4rem) auto clamp(1rem, 4vw, 2rem);
  padding: var(--demo-footer-space);
  color: var(--demo-footer-color);
  background:
    linear-gradient(90deg, rgb(201 133 0 / 0.35), transparent 0.35rem),
    var(--demo-footer-background);
  border: 1px solid var(--demo-footer-border-color);
  border-radius: var(--demo-footer-radius);
}

.demo-footer code {
  color: inherit;
}

.demo-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}

.demo-footer__brand {
  display: grid;
  gap: 0.35rem;
}

.demo-footer__eyebrow,
.demo-footer__credit,
.demo-footer__meta {
  margin: 0;
}

.demo-footer__eyebrow,
.demo-footer__meta {
  color: var(--demo-footer-muted-color);
  font-size: 0.875rem;
  line-height: 1.5;
}

.demo-footer__credit {
  color: var(--demo-footer-color);
  font-size: 1rem;
  line-height: 1.5;
}

.demo-footer__plugin {
  font-weight: 900;
}

.demo-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.demo-footer__item + .demo-footer__item {
  margin-block-start: 0;
}

.demo-footer__link {
  color: var(--demo-footer-link-color);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

.demo-footer__link:hover {
  color: var(--demo-footer-link-color);
  text-decoration-thickness: 0.15em;
}

.demo-footer__link:focus-visible {
  outline: 3px solid var(--demo-footer-focus-color);
  outline-offset: 0.25rem;
  border-radius: 0.25rem;
}

.demo-footer__separator {
  margin-inline: 0.35rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 62rem) {
  h1 {
    font-size: 3.2rem;
  }

  .demo-hero,
  .demo-header {
    grid-template-columns: 1fr;
  }

  .demo-hero::before,
  .demo-header::before {
    grid-column: 1;
    grid-row: auto;
    font-size: 4.25rem;
    text-align: start;
  }
}

@media (max-width: 48rem) {
  h1 {
    max-width: 100%;
    font-size: 2.35rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .demo-page,
  .demo-footer {
    padding-inline: 1rem;
  }

  .demo-section {
    padding-inline-start: 0;
  }

  .demo-section::before {
    display: none;
  }

  .demo-button,
  .demo-field,
  .demo-field select,
  .demo-filter-field,
  .demo-filter-field select,
  .demo-checkbox {
    width: 100%;
  }

  .demo-nav {
    position: static;
  }

  .demo-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .demo-footer__links {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }

  .demo-card:hover,
  .demo-button:hover {
    transform: none;
  }
}

@media (forced-colors: active) {
  body,
  body::before,
  .demo-stage,
  .demo-preview,
  .demo-footer,
  pre {
    background: Canvas;
  }

  .demo-card,
  .demo-panel,
  .demo-stage,
  .demo-preview,
  .demo-status,
  .demo-empty,
  .demo-empty-state,
  .demo-checkbox,
  .demo-button,
  .demo-nav a,
  pre {
    border-color: CanvasText;
  }

  .demo-card::before,
  .demo-section::before,
  .demo-stage::before,
  .demo-preview::before {
    background: CanvasText;
  }

  .demo-button {
    color: ButtonText;
    background: ButtonFace;
  }

  .demo-footer,
  .demo-footer * {
    color: CanvasText;
  }
}
