/* DC Blueprints: page styles. All values come from tokens.css. */

@font-face {
  font-family: "Satoshi";
  src: url("assets/satoshi-variable.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

/* Telugu fallback: Noto Sans Telugu (SIL OFL 1.1), Telugu subset only, so Latin text never uses it. */
@font-face {
  font-family: "Noto Sans Telugu";
  src: url("assets/noto-sans-telugu-var.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0951-0952, U+0964-0965, U+0C00-0C7F, U+1CD5-1CD6, U+1CD8, U+1CDA, U+1CF2, U+200C-200D, U+25CC;
}

/* ---------- Base ---------- */
[hidden] {
  display: none !important;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  text-wrap: balance;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
p {
  margin: 0;
  text-wrap: pretty;
}
code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 6px;
}
::selection {
  background: var(--lime);
  color: var(--ink);
}
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}
a {
  color: inherit;
}

/* ---------- Shell ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  height: 64px;
  padding-inline: clamp(16px, 4vw, 32px);
  background: color-mix(in srgb, var(--background) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.brand small {
  color: var(--muted-foreground);
  font-weight: 500;
}
.topbar .spacer {
  flex: 1;
}
.version {
  font-size: 13px;
  color: var(--muted-foreground);
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--border-strong);
  transition: box-shadow 200ms var(--ease-out);
}
.icon-btn:hover {
  box-shadow: inset 0 0 0 1px var(--foreground);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  max-width: 1400px;
  margin-inline: auto;
}
.sidenav {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: var(--s-6) var(--s-4) var(--s-6) clamp(16px, 4vw, 32px);
}
.sidenav p {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin: var(--s-5) 0 var(--s-2);
}
.sidenav p:first-child {
  margin-top: 0;
}
.sidenav a {
  display: block;
  padding: 6px var(--s-3);
  margin-left: calc(var(--s-3) * -1);
  border-radius: var(--r-sm);
  font-size: 15px;
  text-decoration: none;
  color: var(--muted-foreground);
  transition: color 150ms, background-color 150ms;
}
.sidenav a:hover {
  color: var(--foreground);
  background: var(--card);
}
.sidenav a.active {
  color: var(--foreground);
  background: var(--card);
  box-shadow: inset 2px 0 0 var(--accent-line);
}

main {
  min-width: 0;
  padding: var(--s-6) clamp(16px, 4vw, 48px) var(--s-10);
}

/* ---------- Sections ---------- */
.hero {
  padding: var(--s-8) 0 var(--s-9);
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-text);
}
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent-line);
}
.hero h1 {
  font-size: clamp(44px, 7vw, 84px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: var(--s-4) 0 var(--s-5);
  max-width: 14ch;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent-text);
}
.hero .lead {
  font-size: 20px;
  color: var(--muted-foreground);
  max-width: 58ch;
}
.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-4);
  margin-top: var(--s-7);
}
.principle {
  padding: var(--s-5);
  background: var(--card);
  border-radius: var(--r-lg);
}
.principle b {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent-text);
  margin-bottom: var(--s-3);
}
.principle h3 {
  font-size: 19px;
  margin-bottom: var(--s-2);
}
.principle p {
  font-size: 15px;
  color: var(--muted-foreground);
}

section.rule {
  padding: var(--s-9) 0 0;
}
.sec-head {
  display: grid;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
  max-width: 68ch;
}
.sec-head .num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted-foreground);
}
.sec-head h2 {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.sec-head p {
  color: var(--muted-foreground);
  font-size: 18px;
}
.sub {
  font-size: 20px;
  font-weight: 700;
  margin: var(--s-7) 0 var(--s-4);
}

.panel {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: clamp(var(--s-5), 3vw, var(--s-6));
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
}

/* rule list */
.rules {
  list-style: none;
  padding: 0;
  margin: var(--s-5) 0 0;
  display: grid;
  gap: var(--s-2);
}
.rules li {
  position: relative;
  padding-left: 32px;
  font-size: 16px;
  line-height: 1.5;
}
.rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  border-radius: 6px;
  background: var(--accent-line);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 14px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* do / don't */
.dd {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
.dd figure {
  margin: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--card);
}
.dd .stage {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: var(--s-6) var(--s-5);
  background: var(--background);
  margin: var(--s-2) var(--s-2) 0;
  border-radius: calc(var(--r-xl) - 6px);
}
.dd figcaption {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-3);
  align-items: start;
  padding: var(--s-4) var(--s-5) var(--s-5);
  font-size: 15px;
  color: var(--muted-foreground);
}
.dd figcaption b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.do b {
  color: var(--good);
}
.dont b {
  color: var(--bad);
}
.do .stage {
  box-shadow: inset 0 -3px 0 var(--good);
}
.dont .stage {
  box-shadow: inset 0 -3px 0 var(--bad);
}

/* ---------- Colour ---------- */
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--s-4);
}
.swatch {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--edge);
}
.swatch .chip {
  height: 96px;
  display: flex;
  align-items: flex-end;
  padding: var(--s-3);
  font-size: 13px;
  font-weight: 700;
}
.swatch .meta {
  padding: var(--s-3) var(--s-4) var(--s-4);
  display: grid;
  gap: 2px;
}
.swatch .meta strong {
  font-size: 15px;
}
.swatch .meta span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-foreground);
}
.ratio {
  display: flex;
  height: 40px;
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: var(--s-4);
}
.ratio div {
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}
.contrast-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s-3);
}
.pair {
  padding: var(--s-4);
  border-radius: var(--r-md);
  display: grid;
  gap: var(--s-1);
}
.pair .aa {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
}

/* ---------- Type ---------- */
.type-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: var(--s-5);
  align-items: baseline;
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--border);
}
.type-row:last-child {
  border-bottom: 0;
}
.type-row .spec {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.6;
}
.type-row .spec strong {
  display: block;
  font-family: var(--font);
  font-size: 14px;
  color: var(--foreground);
}
.type-row .sample {
  overflow-wrap: anywhere;
}
.measure-demo {
  display: grid;
  gap: var(--s-4);
}
.measure-demo .bar {
  font-size: 13px;
  font-family: var(--mono);
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.measure-demo .bar::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

/* ---------- Spacing ---------- */
.space-scale {
  display: grid;
  gap: var(--s-2);
}
.space-row {
  display: grid;
  grid-template-columns: 70px 60px minmax(0, 1fr);
  align-items: center;
  gap: var(--s-4);
  font-size: 14px;
}
.space-row code {
  justify-self: start;
}
.space-row .px {
  font-family: var(--mono);
  color: var(--muted-foreground);
  font-size: 13px;
}
.space-row .bar {
  height: 20px;
  background: var(--accent-line);
  border-radius: 4px;
  max-width: 100%;
}
.space-row .use {
  grid-column: 3;
  font-size: 13px;
  color: var(--muted-foreground);
  margin-top: -4px;
}

/* proximity example card */
.mini-card {
  width: 100%;
  max-width: 280px;
  background: var(--card);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  text-align: left;
}
.mini-card .thumb {
  height: 90px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--surface-2), color-mix(in srgb, var(--accent-line) 30%, var(--surface-2)));
}
.mini-card h4 {
  font-size: 18px;
}
.mini-card p {
  font-size: 14px;
  color: var(--muted-foreground);
}
.mini-card .tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-text);
}
.good-space .thumb { margin-bottom: var(--s-4); }
.good-space .tag { margin-bottom: var(--s-1); display: block; }
.good-space h4 { margin-bottom: var(--s-2); }
.good-space p { margin-bottom: var(--s-5); }
.bad-space { padding: 9px 13px 30px; }
.bad-space .thumb { margin-bottom: 5px; }
.bad-space .tag { margin-bottom: 19px; display: block; }
.bad-space h4 { margin-bottom: 21px; }
.bad-space p { margin-bottom: 7px; }

/* padding anatomy */
.anatomy {
  display: grid;
  place-items: center;
  padding: var(--s-6);
}
.anatomy .box {
  position: relative;
  padding: var(--s-5);
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--accent-line) 22%, transparent) 0 6px, transparent 6px 12px);
  border-radius: var(--r-lg);
  outline: 1px dashed var(--accent-line);
}
.anatomy .inner {
  background: var(--popover);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  display: grid;
  gap: var(--s-2);
  min-width: 220px;
  box-shadow: var(--edge);
}
.anatomy .lbl {
  position: absolute;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-text);
  font-weight: 700;
}
.anatomy .lbl.t { top: 4px; left: 50%; transform: translateX(-50%); }
.anatomy .lbl.l { left: 2px; top: 50%; transform: translateY(-50%) rotate(-90deg); }

/* ---------- Layout ---------- */
.bp-list {
  display: grid;
  gap: var(--s-3);
}
.bp {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  gap: var(--s-4);
  align-items: center;
  font-size: 14px;
}
.bp .track {
  height: 28px;
  background: var(--surface-2);
  border-radius: 8px;
  overflow: hidden;
}
.bp .fill {
  height: 100%;
  background: color-mix(in srgb, var(--accent-line) 55%, transparent);
  border-right: 2px solid var(--accent-line);
}
.bp .px {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-foreground);
}
.cols-demo {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--s-4);
  padding: var(--s-4);
  background: var(--background);
  border-radius: var(--r-lg);
}
.cols-demo .col {
  height: 140px;
  background: color-mix(in srgb, var(--accent-line) 16%, transparent);
  border-radius: 6px;
}
.cols-demo .overlay {
  position: absolute;
  inset: var(--s-4);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--s-4);
  align-content: center;
}
.cols-demo .overlay div {
  height: 64px;
  border-radius: var(--r-md);
  background: var(--popover);
  box-shadow: var(--edge);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}
.seg {
  display: inline-flex;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  margin-bottom: var(--s-4);
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  font: 600 14px var(--font);
  height: 36px;
  padding: 0 var(--s-4);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background-color 200ms var(--ease-out), color 200ms;
}
.seg button[aria-pressed="true"] {
  background: var(--popover);
  color: var(--foreground);
  box-shadow: var(--edge);
}

/* ---------- Radius & depth ---------- */
.radius-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--s-4);
}
.radius-row .r {
  aspect-ratio: 1;
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  display: grid;
  align-content: end;
  padding: var(--s-3);
  font-size: 13px;
}
.radius-row .r span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-foreground);
}
.nested {
  display: grid;
  place-items: center;
  padding: var(--s-5);
}
.nested .outer {
  padding: var(--s-2);
  background: var(--surface-2);
  border-radius: 24px;
  width: 100%;
  max-width: 260px;
}
.nested .inner {
  height: 120px;
  background: var(--popover);
  border-radius: 16px;
  box-shadow: var(--edge);
}
.nested.bad .inner {
  border-radius: 24px;
}
.depth-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-5);
  padding: var(--s-5);
  background: var(--background);
  border-radius: var(--r-lg);
}
.depth-row div {
  height: 110px;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: var(--s-3);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 var(--s-5);
  border: 0;
  border-radius: var(--r-pill);
  font: 600 15px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: background-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out), color 200ms, transform 160ms var(--ease-out);
}
.btn:active {
  transform: scale(0.97);
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-quiet {
  background: transparent;
  color: var(--foreground);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.btn-quiet:hover {
  box-shadow: inset 0 0 0 1px var(--foreground);
}
.btn-ghost {
  background: transparent;
  color: var(--foreground);
  padding-inline: var(--s-3);
}
.btn-ghost:hover {
  background: var(--surface-2);
}
.btn-danger {
  background: var(--destructive);
  color: #fff;
}
:root[data-theme="dark"] .btn-danger {
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-danger {
    color: var(--ink);
  }
}
.btn-danger:hover {
  filter: brightness(1.08);
}
.btn-sm {
  height: 40px;
  padding: 0 var(--s-4);
  font-size: 14px;
}
.btn-lg {
  height: 56px;
  padding: 0 var(--s-6);
  font-size: 16px;
}
.btn .arrow {
  transition: transform 200ms var(--ease-out);
}
.btn:hover .arrow {
  transform: translateX(2px);
}
.btn[disabled],
.btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.btn.force-hover.btn-primary { background: var(--primary-hover); }
.btn.force-hover.btn-quiet { box-shadow: inset 0 0 0 1px var(--foreground); }
.btn.force-focus { outline: 2px solid var(--ring); outline-offset: 3px; }
.btn.force-active { transform: scale(0.97); }
.btn.is-loading {
  cursor: progress;
}
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-table {
  display: grid;
  grid-template-columns: 110px repeat(4, minmax(0, 1fr));
  gap: var(--s-4) var(--s-3);
  align-items: center;
}
.btn-table .h {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
}
.btn-table .cell {
  display: flex;
  justify-content: flex-start;
}
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.scroll-x > * {
  min-width: 640px;
}

.btn-sizes {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--s-6);
}
.btn-sizes figure {
  margin: 0;
  display: grid;
  gap: var(--s-3);
  justify-items: start;
}
.btn-sizes figcaption {
  font-size: 13px;
  color: var(--muted-foreground);
}
.btn-sizes figcaption code {
  margin-right: 4px;
}
.btn-anatomy {
  position: relative;
  display: inline-block;
  padding: 28px 0;
}
.btn-anatomy .dim {
  position: absolute;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-text);
  white-space: nowrap;
}
.btn-anatomy .dim.top { top: 4px; left: 0; right: 0; text-align: center; border-bottom: 1px solid var(--accent-line); padding-bottom: 2px; }
.btn-anatomy .dim.right { right: -64px; top: 28px; bottom: 28px; display: flex; align-items: center; border-left: 1px solid var(--accent-line); padding-left: 6px; }
.btn-anatomy .pad {
  position: absolute;
  top: 28px;
  bottom: 28px;
  width: 24px;
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--accent-line) 40%, transparent) 0 3px, transparent 3px 6px);
  pointer-events: none;
  border-radius: 999px 0 0 999px;
}
.btn-anatomy .pad.r { right: 0; border-radius: 0 999px 999px 0; }
.btn-anatomy .pad.l { left: 0; }

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.modal-mock {
  width: 100%;
  max-width: 340px;
  background: var(--popover);
  border-radius: var(--r-xl);
  padding: var(--s-5);
  box-shadow: var(--edge), var(--shadow-lift);
  text-align: left;
}
.modal-mock h4 {
  font-size: 18px;
  margin-bottom: var(--s-2);
}
.modal-mock p {
  font-size: 14px;
  color: var(--muted-foreground);
  margin-bottom: var(--s-5);
}
.modal-mock .actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* ---------- Forms ---------- */
.field {
  display: grid;
  gap: var(--s-2);
  width: 100%;
  max-width: 340px;
  text-align: left;
}
.field label {
  font-size: 14px;
  font-weight: 600;
}
.field .hint {
  font-size: 13px;
  color: var(--muted-foreground);
}
.input {
  height: 48px;
  width: 100%;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: var(--r-md);
  background: var(--popover);
  color: var(--foreground);
  font: 400 16px var(--font);
  box-shadow: inset 0 0 0 1px var(--input);
  transition: box-shadow 150ms var(--ease-out);
}
.input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.7;
}
.input:hover {
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.input:focus,
.input.force-focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--ring);
}
.input.invalid {
  box-shadow: inset 0 0 0 2px var(--destructive);
}
.input[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.field .err {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--destructive);
}
.field .ok {
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
}
.form-states {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s-6) var(--s-5);
}
.form-mock {
  display: grid;
  gap: var(--s-4);
  width: 100%;
  max-width: 320px;
}
.form-mock.bad {
  gap: 6px;
}
.form-mock.bad .input {
  height: 38px;
  font-size: 14px;
}
.form-mock.bad .btn {
  justify-self: end;
}

/* live form */
.live-form {
  display: grid;
  gap: var(--s-5);
  max-width: 420px;
}
.live-form .btn {
  justify-self: start;
}
.live-form .result {
  font-size: 14px;
  font-weight: 600;
  min-height: 22px;
}

/* ---------- States ---------- */
.state-card {
  display: grid;
  gap: var(--s-3);
  justify-items: center;
  text-align: center;
  padding: var(--s-6) var(--s-5);
  background: var(--background);
  border-radius: var(--r-lg);
  min-height: 260px;
  align-content: center;
}
.state-card h4 {
  font-size: 17px;
}
.state-card p {
  font-size: 14px;
  color: var(--muted-foreground);
  max-width: 28ch;
}
.state-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
}
.state-card .icon svg {
  width: 22px;
  height: 22px;
}
.state-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  margin-bottom: var(--s-2);
}
.skeleton {
  display: grid;
  gap: var(--s-3);
  width: 100%;
  max-width: 220px;
}
.skeleton div {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 40%, var(--background)) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton .blk {
  height: 80px;
  border-radius: var(--r-md);
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

.toast-zone {
  position: fixed;
  right: var(--s-5);
  bottom: var(--s-5);
  z-index: 50;
  display: grid;
  gap: var(--s-2);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 260px;
  max-width: min(360px, calc(100vw - 32px));
  padding: var(--s-3) var(--s-4);
  background: var(--popover);
  border-radius: var(--r-md);
  box-shadow: var(--edge), var(--shadow-lift);
  font-size: 14px;
  font-weight: 600;
  pointer-events: auto;
  animation: toast-in var(--duration-enter) var(--ease-out) both;
}
.toast.leave {
  animation: toast-out var(--duration-exit) var(--ease-out) both;
}
.toast .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex: none;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(4px); }
}

/* ---------- Motion ---------- */
.motion-grid {
  display: grid;
  gap: var(--s-4);
}
.motion-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: var(--s-4);
  align-items: center;
}
.motion-row .spec {
  font-size: 14px;
}
.motion-row .spec span {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-foreground);
}
.track {
  position: relative;
  height: 44px;
  background: var(--background);
  border-radius: var(--r-pill);
}
.track .ball {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-line);
}
.track.go .ball {
  left: calc(100% - 38px);
}
.ease-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s-4);
}
.ease-chart figure {
  margin: 0;
  padding: var(--s-4);
  background: var(--background);
  border-radius: var(--r-lg);
}
.ease-chart svg {
  width: 100%;
  height: auto;
  display: block;
}
.ease-chart figcaption {
  margin-top: var(--s-3);
  font-size: 14px;
}
.ease-chart figcaption span {
  display: block;
  font-size: 13px;
  color: var(--muted-foreground);
}

/* ---------- Accessibility ---------- */
.target-demo {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-6);
  align-items: center;
  justify-content: center;
}
.target {
  position: relative;
  display: grid;
  place-items: center;
}
.target .zone {
  display: grid;
  place-items: center;
  border-radius: 12px;
  outline: 1.5px dashed;
}
.target .zone.ok {
  width: 44px;
  height: 44px;
  outline-color: var(--good);
  background: color-mix(in srgb, var(--good) 12%, transparent);
}
.target .zone.small {
  width: 24px;
  height: 24px;
  outline-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 12%, transparent);
}
.target svg {
  width: 18px;
  height: 18px;
}
.target small {
  display: block;
  margin-top: var(--s-2);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-foreground);
  text-align: center;
}

/* ---------- Writing ---------- */
.copy-table {
  display: grid;
  gap: var(--s-2);
}
.copy-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: var(--card);
  border-radius: var(--r-md);
  font-size: 15px;
  align-items: start;
}
.copy-row .where {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  padding-top: 3px;
}
.copy-row .no {
  color: var(--muted-foreground);
  text-decoration: line-through;
  text-decoration-color: var(--bad);
}
.copy-row .yes::before {
  content: "→ ";
  color: var(--good);
  font-weight: 700;
}
.copy-head {
  background: transparent;
  padding-block: 0;
}
.copy-head span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Checklist ---------- */
.checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-4);
}
.check-group {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.check-group h3 {
  font-size: 17px;
  margin-bottom: var(--s-3);
}
.check-group label {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: var(--s-3);
  padding: var(--s-2) 0;
  font-size: 15px;
  line-height: 1.45;
  cursor: pointer;
}
.check-group input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent-line);
  cursor: pointer;
}
.check-group input:checked + span {
  color: var(--muted-foreground);
  text-decoration: line-through;
}
.progress {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
  flex-wrap: wrap;
}
.progress .bar {
  flex: 1;
  min-width: 160px;
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress .bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent-line);
  transition: width var(--duration-move) var(--ease-out);
}
.progress output {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted-foreground);
}

footer {
  margin-top: var(--s-10);
  padding-top: var(--s-6);
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted-foreground);
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidenav {
    position: sticky;
    top: 64px;
    z-index: 15;
    height: auto;
    display: flex;
    gap: var(--s-1);
    overflow-x: auto;
    padding: var(--s-2) 16px;
    background: color-mix(in srgb, var(--background) 92%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
  }
  .sidenav::-webkit-scrollbar {
    display: none;
  }
  .sidenav p {
    display: none;
  }
  .sidenav a {
    flex: none;
    margin: 0;
    font-size: 14px;
    white-space: nowrap;
  }
  .sidenav a.active {
    box-shadow: inset 0 -2px 0 var(--accent-line);
  }
  html {
    scroll-padding-top: 130px;
  }
}
@media (max-width: 760px) {
  .grid-2,
  .grid-3,
  .dd {
    grid-template-columns: minmax(0, 1fr);
  }
  .type-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-2);
  }
  .motion-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-2);
  }
  .copy-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-1);
  }
  .copy-head {
    display: none;
  }
  .space-row {
    grid-template-columns: 56px 48px minmax(0, 1fr);
    gap: var(--s-3);
  }
  .cols-demo {
    gap: 6px;
    padding: 8px;
  }
  .cols-demo .overlay {
    inset: 8px;
    gap: 6px;
  }
  .brand small,
  .version {
    display: none;
  }
  .hero {
    padding: var(--s-7) 0 var(--s-8);
  }
  section.rule {
    padding-top: var(--s-8);
  }
  .toast-zone {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
  .toast {
    max-width: none;
  }
}

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