@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-latin-500.woff2") format("woff2");
}

:root {
  --color-bg: #161826;
  --color-surface: #232532;
  --color-text: #e9e9ed;
  --color-accent: #9184d9;
  --color-divider: color-mix(in srgb, #e9e9ed 16%, transparent);

  --color-neutral-100: #f3f5fe;
  --color-neutral-200: #e4e7f5;
  --color-neutral-300: #cfd3e5;
  --color-neutral-400: #b2b6ca;
  --color-neutral-500: #9397ab;
  --color-neutral-600: #84889b;
  --color-neutral-700: #595d6c;
  --color-neutral-800: #3f424d;
  --color-neutral-900: #292b31;

  --color-accent-100: #f5f4ff;
  --color-accent-200: #e7e5fe;
  --color-accent-300: #d2cefd;
  --color-accent-400: #b5abfc;
  --color-accent-500: #968ae0;
  --color-accent-600: #796cbf;
  --color-accent-700: #5d5294;
  --color-accent-800: #423a6a;
  --color-accent-900: #2b2741;

  --color-section: #262a60;
  --color-ok: #9184d9;
  --color-bad: #f87171;

  --font-heading: "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  /* .btn min-height 44 + .header-bar padding-block 14x2 + 1px border */
  --header-h: 73px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  --shadow-sm: 0 0 0 1px #3f424d;
  --shadow-md: 0 0 0 1px #595d6c, 0 6px 18px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 0 0 1px #9397ab, 0 16px 40px rgba(0, 0, 0, 0.65);
}

[data-rd-theme="light"] {
  --color-bg: #e9ebf6;
  --color-surface: #f7f8fe;
  --color-text: #292b31;
  --color-accent: #5d5294;
  --color-divider: color-mix(in srgb, #292b31 18%, transparent);

  --color-neutral-100: #292b31;
  --color-neutral-200: #3f424d;
  --color-neutral-300: #3f424d;
  --color-neutral-400: #4a4d59;
  --color-neutral-500: #595d6c;
  --color-neutral-600: #666a7d;
  --color-neutral-700: #9397ab;
  --color-neutral-800: #b2b6ca;
  --color-neutral-900: #cfd3e5;

  --color-accent-100: #2b2741;
  --color-accent-200: #423a6a;
  --color-accent-300: #5d5294;
  --color-accent-400: #5d5294;
  --color-accent-500: #796cbf;
  --color-accent-600: #968ae0;
  --color-accent-700: #b5abfc;
  --color-accent-800: #d2cefd;
  --color-accent-900: #e7e5fe;

  --color-section: #d2cefd;
  --color-ok: #5d5294;
  --color-bad: #b91c1c;

  --shadow-sm: 0 0 0 1px #cfd3e5;
  --shadow-md: 0 0 0 1px #b2b6ca, 0 6px 18px rgba(41, 43, 49, 0.1);
  --shadow-lg: 0 0 0 1px #9397ab, 0 16px 40px rgba(41, 43, 49, 0.16);
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

::selection {
  background: color-mix(in srgb, var(--color-accent) 30%, transparent);
}

.hr {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(
    to right,
    transparent,
    var(--color-divider) 48px,
    var(--color-divider) calc(100% - 48px),
    transparent
  );
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.2;
  color: var(--color-text);
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 10px;
  min-height: 44px;
  border-radius: var(--radius-md);
}

.btn:hover {
  text-decoration: none;
}

/* aria-disabled instead of disabled: the button keeps focus, so it has to look inert itself.
   pointer-events kills the hover of every variant at once; the keyboard path is untouched
   and the handler's own guard is what makes an Enter a no-op. */
.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.btn-primary {
  color: var(--color-bg);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--color-accent) 85%, var(--color-text));
}

.btn-secondary {
  border-color: var(--color-divider);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  flex: none;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 32px);
  box-shadow: var(--shadow-sm);
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

.kicker {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-neutral-500);
}

.kicker-accent {
  color: var(--color-accent-300);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-neutral-300);
}

.mono strong {
  font-weight: 400;
  color: var(--color-text);
}

/* carries .mono too, so it sets only what a button needs reset and what it overrides */
.hash-copy {
  flex: none;
  min-height: 24px;
  padding: 4px 6px;
  margin: -4px -6px;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 0.71875rem;
  color: var(--color-neutral-500);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}

.hash-copy:hover {
  color: var(--color-text);
  background: var(--color-neutral-900);
}

.label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-neutral-500);
}

.src {
  display: block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-neutral-600);
}

.src-strong { color: var(--color-neutral-400); }

.legend {
  margin: 0 0 14px;
  line-height: 1.6;
  font-size: 0.75rem;
}

.legend strong {
  font-weight: 400;
  color: var(--color-text);
}

.src a {
  color: var(--color-neutral-500);
}

.grid {
  display: grid;
  gap: clamp(20px, 3vw, 32px);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 12px var(--color-accent);
  animation: rd-pulse 2.4s ease-in-out infinite;
}

@keyframes rd-pulse {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dot {
    animation: none;
  }
}

.rung {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--color-neutral-900);
}

.rung-live {
  background: var(--color-accent-900);
  box-shadow: inset 0 0 0 1px var(--color-accent-700);
}

.rung-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-neutral-600);
  width: 14px;
}

.rung-live .rung-index {
  color: var(--color-accent-300);
}

.rung-body {
  flex: 1;
  min-width: 0;
}

.rung-name {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  color: var(--color-neutral-500);
}

.rung-live .rung-name {
  color: var(--color-text);
}

.rung-meta {
  font-size: 0.75rem;
  color: var(--color-neutral-500);
  margin-top: 3px;
}

.rung-state {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-300);
  border: 1px solid var(--color-accent-700);
  border-radius: 999px;
  padding: 4px 10px;
}

.span {
  font-size: 1.0625rem;
  border-left: 2px solid var(--color-accent);
  padding-left: 14px;
}

.check {
  display: flex;
  gap: 10px;
  font-size: 0.84375rem;
  line-height: 1.4;
}

.check-mark {
  font-family: var(--font-mono);
  color: var(--color-ok);
  flex: none;
}

.check-fail .check-mark,
.check-fail {
  color: var(--color-bad);
}

.check-unresolved .check-mark {
  color: var(--color-neutral-500);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  min-height: 44px;
  padding: 8px 14px;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  color: var(--color-neutral-400);
  background: transparent;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.tab:hover {
  color: var(--color-text);
}

.tab[aria-pressed="true"] {
  color: var(--color-accent);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

.nav-link {
  position: relative;
  background: transparent;
  border: 0;
  padding: 12px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  color: var(--color-neutral-400);
  border-radius: var(--radius-md);
  text-decoration: none;
}

.nav-link:hover {
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
  color: var(--color-text);
  text-decoration: none;
}

.nav-link[aria-current="page"] {
  color: var(--color-text);
}

.nav-link[aria-current="page"]::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--color-accent);
  margin-top: 5px;
  border-radius: 2px;
}

.scroller {
  overflow-x: auto;
}

.checks-toggle {
  cursor: pointer;
  color: var(--color-neutral-500);
  font-size: 0.8125rem;
}

/* A link that stands on its own is a target and needs the 24px WCAG 2.2 AA floor. Links
   inside a sentence are exempt, and must stay that way: padding there overlaps the lines
   around them. Same floor as .hash-copy, so both are one grep. */
.tap-target {
  min-height: 24px;
  padding-block: 2px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-divider);
}

.header-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(12px, 3vw, 28px);
  padding-block: 14px;
}

@media (max-width: 640px) {
  /* The header is one flex row of four items — wordmark 94 + nav 310 + toggle 44 +
     GitHub 91 + gaps 50 = 589 — and below ~640px it stops fitting. Shrinking the
     items one at a time costs the product name and the GitHub label for a 100px-wide
     band and still gives up lower down. The nav takes a row of its own instead: what
     is left above is 94 + 44 + 91 + gaps = ~250, comfortable down to 320px, and every
     label survives at every width. Two tidy rows of 44px targets is ~136px, a sixth of
     a phone screen, which buys nothing pinned there: these are four in-page views, not
     a toolbar. Let it scroll away. */
  header nav {
    flex: 1 0 100%;
    justify-content: space-between;
    order: 1;
  }

  .nav-link {
    padding-inline: 9px;
  }

  .site-header {
    position: static;
    backdrop-filter: none;
  }

  .header-bar {
    gap: 10px;
    padding-block: 10px;
  }

  :root {
    --header-h: 0px;
  }
}

.call-head {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-neutral-500);
  margin: 18px 0 8px;
}

.call-head:first-child {
  margin-top: 0;
}

.turn {
  display: grid;
  grid-template-columns: minmax(88px, auto) 1fr;
  gap: 4px 16px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.turn:hover {
  background: var(--color-neutral-900);
}

.turn-who {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-neutral-500);
  padding-top: 2px;
}

.turn-said {
  font-size: 0.9375rem;
  color: var(--color-neutral-300);
}

.turn-bot .turn-said {
  color: var(--color-neutral-500);
}

.turn-now {
  background: var(--color-accent-900);
  box-shadow: inset 0 0 0 1px var(--color-accent-700);
}

.turn-now .turn-said,
.turn-now .turn-who {
  color: var(--color-text);
}

.turn-field {
  grid-column: 2;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--color-accent-300);
}

.turn-silent {
  cursor: default;
  font-style: italic;
}

.turn-silent .turn-said {
  color: var(--color-neutral-500);
}

@media (max-width: 640px) {
  .turn {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .turn-field {
    grid-column: 1;
  }
}
