@font-face {
  font-family: "Onest";
  src: url("assets/fonts/onest/Onest-Variable-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-1);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-rail);
  border-bottom: 1px solid var(--qs-border-soft);
  background: var(--glass);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo { width: 78px; height: 16px; display: block; }
[data-theme="light"] .logo { filter: invert(1); }
.brand-link { display: inline-flex; align-items: center; text-decoration: none; }
.site-title { color: var(--text-2); font-size: 13px; white-space: nowrap; }

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a,
.theme-toggle {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: var(--r-tight);
  padding: 0 11px;
  background: transparent;
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
}

.nav a:hover,
.nav a[aria-current="page"],
.theme-toggle:hover { background: var(--fill); color: var(--text-1); }

main { padding: 72px 0 96px; }
.hero { max-width: 820px; margin-bottom: 64px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
}

h1, h2, h3 { margin-top: 0; letter-spacing: -.02em; }
h1 { margin-bottom: 20px; font-size: clamp(36px, 6vw, 64px); line-height: 1.02; font-weight: 560; }
h2 { margin-bottom: 12px; font-size: 24px; line-height: 31px; font-weight: 580; }
h3 { margin-bottom: 8px; font-size: 15px; line-height: 21px; font-weight: 620; }
p { margin: 0 0 14px; }
.lede { color: var(--text-2); font-size: 17px; line-height: 1.6; max-width: 720px; }
.meta { color: var(--text-3); font-size: 12px; }
.small { font-size: 13px; color: var(--text-2); }

.status-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--qs-border-soft);
  border-radius: var(--r-pill);
  padding: 0 10px;
  color: var(--text-2);
  background: var(--surface-1);
  font-size: 11px;
  font-weight: 600;
}
.badge.canonical,
.badge.backed { color: var(--ok-text); border-color: var(--ok-border); background: var(--ok-tint); }
.badge.deviation { color: var(--danger-text); border-color: var(--danger-border); background: var(--danger-tint); }
.badge.proposed { color: var(--accent-text); border-color: var(--accent-border); background: var(--accent-tint); }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.card {
  grid-column: span 6;
  min-height: 180px;
  border: 1px solid var(--qs-border-soft);
  border-radius: var(--r-card);
  padding: 24px;
  background: var(--surface-1);
}
a.card {
  color: inherit;
  text-decoration: none;
  transition: transform var(--t-fast) var(--ease-brand), border-color var(--t-fast);
}
a.card:hover { transform: translateY(-2px); border-color: var(--qs-border-strong); }
.card p:last-child { margin-bottom: 0; }
.card .arrow { margin-top: 28px; color: var(--accent-text); }

.section { margin-top: 72px; scroll-margin-top: 96px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--qs-border-soft);
  margin-bottom: 24px;
}
.section-head > div:first-child { max-width: 720px; }

.spec-list { border: 1px solid var(--qs-border-soft); border-radius: var(--r-card); overflow: hidden; background: var(--surface-1); }
.spec-row {
  display: grid;
  /* The source column is a fraction, not auto. Auto sized itself to the
     max-content width of a long production path and squeezed the
     description into a four-word ribbon. */
  grid-template-columns: minmax(180px, .7fr) minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 18px 20px;
  border-bottom: 1px solid var(--qs-border-soft);
}
.spec-row:last-child { border-bottom: 0; }
.spec-row p { margin: 0; color: var(--text-2); }
.source {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--text-3);
  overflow-wrap: anywhere;
}

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.swatch { border: 1px solid var(--qs-border-soft); border-radius: var(--r-ctrl); overflow: hidden; background: var(--surface-1); }
.swatch-color { height: 72px; border-bottom: 1px solid var(--qs-border-soft); }
.swatch-label { padding: 10px; color: var(--text-2); font-size: 11px; }
.swatch-role { display: block; color: var(--text-1); font-weight: 600; margin-bottom: 3px; }
.swatch-label code { font-size: 10.5px; }

/* Alpha tokens read as invisible on an opaque card, so --fill, --glass,
   and the three tint families get a checkerboard behind them. The pattern
   lives on the wrapper: a background-image on .swatch-color would paint
   over the colour rather than under it. */
.swatch--check {
  background-color: var(--bg);
  background-image: conic-gradient(from 90deg, var(--surface-2) 0 25%, transparent 0 50%, var(--surface-2) 0 75%, transparent 0);
  background-size: 16px 16px;
}
.swatch--check .swatch-label { background: var(--surface-1); }

/* Line tokens are strokes, so they are shown as 1px rules, not as fills. */
.swatch-color.is-rule { display: grid; place-items: center; padding: 0 14px; }
.rule { display: block; width: 100%; height: 1px; }
.rule--soft { background: var(--qs-border-soft); }
.rule--strong { background: var(--qs-border-strong); }

/* The chart ramp is one sequence. Five separate cards would misrepresent
   that, so it is a single contiguous bar. */
.ramp-bar { display: flex; height: 56px; border: 1px solid var(--qs-border-soft); border-radius: var(--r-ctrl); overflow: hidden; }
.ramp-bar > i { flex: 1; }
.ramp-bar .c1 { background: var(--chart-1); }
.ramp-bar .c2 { background: var(--chart-2); }
.ramp-bar .c3 { background: var(--chart-3); }
.ramp-bar .c4 { background: var(--chart-4); }
.ramp-bar .c5 { background: var(--chart-5); }
.ramp-legend { display: flex; margin-top: 8px; color: var(--text-3); font-size: 11px; }
.ramp-legend > span { flex: 1; }

pre {
  overflow: auto;
  margin: 18px 0 0;
  border: 1px solid var(--qs-border-soft);
  border-radius: var(--r-ctrl);
  padding: 18px;
  background: var(--surface-2);
  color: var(--text-2);
  font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.demo {
  border: 1px solid var(--qs-border-soft);
  border-radius: var(--r-card);
  padding: 24px;
  background: var(--surface-2);
}
.segmented { display: inline-flex; gap: 2px; border-radius: var(--r-ctrl); padding: 3px; background: var(--fill); }
.segment { border: 0; border-radius: 9px; padding: 7px 12px; background: transparent; color: var(--text-2); }
.segment.active { background: var(--surface-1); color: var(--text-1); box-shadow: var(--elev-soft); }

.avatar-wrap { position: relative; width: 56px; }
/* The particle is positioned with inset rather than sized with a
   percentage. A percentage height resolved against an auto-sized grid row,
   which made the dot an ellipse pinned to the top-left. */
.avatar {
  position: relative;
  width: 56px; height: 56px;
  border: 1px solid var(--accent-border); border-radius: 50%;
  color: transparent; font-size: 0;
}
.avatar::before {
  content: "";
  position: absolute; inset: 28%;
  border-radius: 50%; background: var(--qs-accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--qs-accent) 55%, transparent);
}
.owner {
  position: absolute; right: -5px; bottom: -5px; width: 22px; height: 22px;
  display: grid; place-items: center; border: 2px solid var(--surface-2);
  border-radius: 50%; background: var(--btn-primary-bg); color: var(--btn-primary-fg);
  font-size: 9px; font-weight: 700;
}

/* ============================================================
   SPECIMEN CHROME
   The frames the specimens sit in. The specimens themselves are styled
   by demo.css. Nothing below styles a component.
   ============================================================ */

/* Sub-headings inside a section group the specimens. The global h3 rule
   zeroes margin-top for card headings, so restore it here only. */
.section > h3 { margin-top: 32px; }
.section > .section-head + h3,
.section > .section-head + .demo-note + h3 { margin-top: 8px; }

.demo--wide { overflow-x: auto; }
/* A well puts the page canvas back behind a specimen, so a shadow has
   something to fall on. On --surface-2 an elevation token is invisible. */
.demo--well { background: var(--bg); }
.demo-note { margin: 12px 0 0; color: var(--text-3); font-size: 12px; max-width: 720px; }
.demo-note:first-child { margin-top: 0; margin-bottom: 14px; }
.demo-cap { margin: 0 0 12px; color: var(--text-3); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.demo + .demo { margin-top: 16px; }
.section > .demo { margin-top: 16px; }
.spec-list + .demo { margin-top: 16px; }

/* A neutral badge for the static-reproduction label. Deliberately not
   green: these specimens are not evidence of production behaviour. */
.badge.static { color: var(--text-3); border-color: var(--qs-border-strong); background: var(--fill); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.strip { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---- type specimens ----
   Driven entirely by the tokens so a value can never drift from
   tokens.css. Anything hardcoded here is documenting a number that is
   NOT a token, and says so. */
.type-title-1 { font-size: var(--text-title-1); line-height: var(--text-title-1--line-height); }
.type-title-2 { font-size: var(--text-title-2); line-height: var(--text-title-2--line-height); }
.type-title-3 { font-size: var(--text-title-3); line-height: var(--text-title-3--line-height); }
.type-body { font-size: var(--text-qs-body); line-height: var(--text-qs-body--line-height); }
.type-small { font-size: var(--text-small); line-height: var(--text-small--line-height); }
.type-caption { font-size: var(--text-qs-caption); line-height: var(--text-qs-caption--line-height); }
.type-micro { font-size: var(--text-qs-micro); line-height: var(--text-qs-micro--line-height); }
/* The three collided renderings. Not tokens: these are what the legacy
   AIC @theme block produces in the production Tailwind build. */
.type-collided-body { font-size: 15px; line-height: 20px; }
.type-collided-caption { font-size: 11px; line-height: 15px; }
.type-collided-micro { font-size: 10px; line-height: 14px; }
.type-sample { margin: 0; font-weight: 400; letter-spacing: normal; color: var(--text-1); }

/* ---- radius ramp ---- */
.ramp { display: flex; flex-wrap: wrap; gap: 14px; }
.ramp-item { width: 84px; color: var(--text-3); font-size: 10.5px; text-align: center; }
.ramp-box { height: 74px; margin-bottom: 8px; border: 1px solid var(--qs-border-strong); background: var(--fill); }
.ramp-box--tight { border-radius: var(--radius-tight); }
.ramp-box--ctrl { border-radius: var(--radius-ctrl); }
.ramp-box--inner { border-radius: var(--radius-inner); }
.ramp-box--card { border-radius: var(--radius-card); }
.ramp-box--frame { border-radius: var(--radius-frame); }
.ramp-box--pill { border-radius: var(--radius-pill); }
.ramp-item b { display: block; color: var(--text-1); font-size: 11.5px; margin-bottom: 2px; }

/* ---- spacing ruler ----
   The bars sit on a 4px grid so the rhythm is the thing you see, not the
   six variables. */
.ruler {
  padding: 10px 0;
  background-image: repeating-linear-gradient(90deg, var(--qs-border-soft) 0 1px, transparent 1px 4px);
}
.ruler-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; color: var(--text-3); font-size: 11px; }
.ruler-bar { height: 14px; border-radius: 2px; background: var(--qs-accent); flex: none; }
.ruler-bar--1 { width: var(--qs-space-1); }
.ruler-bar--2 { width: var(--qs-space-2); }
.ruler-bar--3 { width: var(--qs-space-3); }
.ruler-bar--4 { width: var(--qs-space-4); }
.ruler-bar--5 { width: var(--qs-space-5); }
.ruler-bar--6 { width: var(--qs-space-6); }

/* ---- easing ---- */
.ease-track { position: relative; height: 34px; border-radius: var(--radius-pill); background: var(--track); }
.ease-dot {
  position: absolute;
  top: 9px;
  left: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--qs-accent);
  animation-name: ease-slide;
  animation-timing-function: var(--ease-brand);
  animation-iteration-count: infinite;
  animation-direction: alternate;
}
.ease-dot--fast { animation-duration: var(--t-fast); }
.ease-dot--base { animation-duration: var(--t-base); }
.ease-dot--slow { animation-duration: var(--t-slow); }
.ease-dot--reveal { animation-duration: var(--t-reveal); }
@keyframes ease-slide {
  from { left: 8px; }
  to { left: calc(100% - 24px); }
}
.motion-off { display: none; }

/* ---- geometry diagrams ----
   For behaviour a static specimen would misrepresent: a resize range, a
   breakpoint, a modal that would hijack the page. Presentation attributes
   do not resolve var(), so every colour here comes through a class. */
.diagram { width: 100%; height: auto; }
.diagram text { font-size: 10.5px; fill: var(--text-2); }
.diagram text.dim { fill: var(--text-3); }
.diagram text.strong { fill: var(--text-1); font-weight: 600; }
.diagram .frame { fill: none; stroke: var(--qs-border-strong); stroke-width: 1; }
.diagram .band { fill: var(--accent-tint); stroke: var(--accent-border); stroke-width: 1; }
.diagram .wash { fill: var(--fill); stroke: none; }
.diagram .panel { fill: var(--surface-3); stroke: var(--qs-border-soft); stroke-width: 1; }
.diagram .arrow { stroke: var(--qs-accent); stroke-width: 1.5; fill: none; }
.diagram .tick { stroke: var(--qs-border-strong); stroke-width: 1; fill: none; }

/* ---- layer scale ---- */
.layers { position: relative; height: 236px; }
.layer {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(310px, 82%);
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--qs-border-strong);
  border-radius: var(--r-tight);
  background: var(--surface-1);
  box-shadow: var(--shadow-soft);
  color: var(--text-2);
  font-size: 11.5px;
}
.layer b { color: var(--text-1); font-weight: 600; }
.layer .n { margin-left: auto; color: var(--text-3); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.layer--0 { top: 202px; left: 0; }
.layer--1 { top: 177px; left: 14px; }
.layer--2 { top: 152px; left: 28px; }
.layer--3 { top: 127px; left: 42px; }
.layer--4 { top: 102px; left: 56px; }
.layer--5 { top: 77px; left: 70px; }
.layer--6 { top: 52px; left: 84px; }
.layer--7 { top: 27px; left: 98px; }
.layer--8 { top: 2px; left: 112px; }

.callout {
  border-left: 2px solid var(--qs-accent);
  padding: 12px 16px;
  background: var(--accent-tint);
  color: var(--text-2);
  border-radius: 0 var(--r-tight) var(--r-tight) 0;
}

.footer {
  border-top: 1px solid var(--qs-border-soft);
  padding: 28px 0 44px;
  color: var(--text-3);
  font-size: 12px;
}
.footer-inner { display: flex; justify-content: space-between; gap: 20px; }

@media (max-width: 820px) {
  .header-inner { flex-wrap: wrap; padding: 14px 0; gap: 10px; }
  .nav { width: 100%; margin-left: 0; overflow-x: auto; }
  main { padding-top: 48px; }
  .card { grid-column: span 12; }
  .grid > * { grid-column: span 12 !important; }
  .spec-row { grid-template-columns: 1fr; gap: 8px; }
  .swatches { grid-template-columns: repeat(2, 1fr); }
  .pair { grid-template-columns: 1fr; }
  .layers { height: 260px; }
  .layer { width: 90%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  /* The clamp above would make the easing specimen jump to its end state
     and sit there, which reads as a broken demo rather than a suppressed
     one. Stop it outright and swap in a caption saying so. */
  .ease-dot { animation: none !important; }
  .motion-on { display: none; }
  .motion-off { display: block; }
}
