/* The one token system for this page. DESIGN.md is the source of truth for
   every value here; nothing outside this block declares a colour or a font. */
:root {
  --arc-red: #d8001b;
  --arc-black: #17202e;
  --arc-cream: #f5f6f7;
  --arc-gray-900: #20242b;
  --arc-gray-700: #4b596b;
  --arc-gray-500: #69717d;
  --arc-gray-300: #aeb5bf;
  --arc-gray-100: #dfe3e8;
  --arc-white: #fff;
  --arc-info: #1d4ed8;
  --arc-caution: #8a6100;
  --arc-ink-hover: #2a3442;
  --arc-surface-2: #f1f3f5;
  --arc-surface-3: #f7f8f9;
  --arc-band: #eef1f4;
  --arc-border-strong: #cfd5dc;
  --arc-border-soft: #d7dce2;
  --arc-border-hover: #aeb7c3;
  --arc-border-hover-quiet: #c7ced7;
  --font-headline: "IBM Plex Sans", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-data: "IBM Plex Mono", monospace;
  --shadow-sm: 0 1px 3px rgba(22, 32, 46, 0.08);
  --shadow-md: 0 8px 24px rgba(22, 32, 46, 0.12);
  --shadow-search: 0 12px 34px rgba(22, 32, 46, 0.09);
  --ring-info: 0 0 0 3px rgba(29, 78, 216, 0.13);
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--arc-cream);
  color: var(--arc-gray-900);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--arc-info);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 30;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  transform: translateY(-160%);
  border-radius: 5px;
  background: var(--arc-black);
  color: var(--arc-white);
  font-weight: 700;
}

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

.container {
  max-width: 1280px;
}

header {
  padding: 22px 0 26px;
  border-bottom: 1px solid var(--arc-gray-100);
}

.header-utility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 42px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  min-width: 38px;
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  background: var(--arc-red);
  color: var(--arc-white);
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.kicker {
  color: var(--arc-gray-700);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.resource-links {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--arc-gray-100);
  border-radius: 7px;
  background: var(--arc-white);
  box-shadow: var(--shadow-sm);
}

.resource-links a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 5px;
  color: var(--arc-gray-700);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.resource-links a:hover {
  background: var(--arc-surface-2);
  color: var(--arc-black);
}

.resource-links a.active {
  background: var(--arc-red);
  color: var(--arc-white);
}

.resource-links a.quick-menu-entry {
  background: var(--arc-black);
  color: var(--arc-white);
}

.resource-links a.quick-menu-entry:hover {
  background: var(--arc-ink-hover);
  color: var(--arc-white);
}

h1 {
  max-width: 780px;
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.98;
  text-wrap: balance;
}

.subtitle {
  max-width: 720px;
  margin-top: 16px;
  color: var(--arc-gray-500);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
  text-wrap: pretty;
}

.command-search {
  min-height: 58px;
  max-width: 820px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 0 14px 0 18px;
  border: 1px solid var(--arc-border-strong);
  border-radius: 9px;
  background: var(--arc-white);
  box-shadow: var(--shadow-search);
}

.command-search:focus-within {
  border-color: var(--arc-info);
  box-shadow: var(--ring-info), var(--shadow-search);
}

.command-search svg {
  width: 24px;
  fill: none;
  stroke: var(--arc-gray-500);
  stroke-width: 2;
  stroke-linecap: round;
}

#search {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--arc-black);
  font-size: 17px;
  font-weight: 600;
}

#search:focus {
  width: 100%;
  box-shadow: none;
}

.command-search kbd {
  min-width: 28px;
  padding: 4px 7px;
  border: 1px solid var(--arc-gray-100);
  border-radius: 5px;
  background: var(--arc-surface-3);
  color: var(--arc-gray-500);
  font-family: var(--font-data);
  font-size: 11px;
  text-align: center;
}

.statbar {
  gap: 34px;
  padding: 22px 0 0;
}

.stat .num {
  font-size: 24px;
  font-weight: 600;
}

.stat .lbl {
  font-size: 11px;
  font-weight: 600;
}

.memory-band {
  padding: 26px 0;
  border-bottom: 1px solid var(--arc-gray-100);
  background: var(--arc-band);
}

.memory-empty {
  grid-column: 1 / -1;
  color: var(--arc-gray-700);
  font-size: 13px;
}

.memory-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.memory-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.memory-heading h2 {
  font-size: 15px;
  font-weight: 700;
}

.memory-heading span {
  color: var(--arc-gray-500);
  font-size: 11px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.mini-card {
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid var(--arc-border-soft);
  border-radius: 6px;
  background: var(--arc-white);
  color: var(--arc-black);
  text-decoration: none;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.mini-card:hover {
  transform: translateY(-1px);
  border-color: var(--arc-border-hover);
  box-shadow: var(--shadow-sm);
}

.mini-card strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-card span {
  overflow: hidden;
  margin-top: 2px;
  color: var(--arc-gray-500);
  font-family: var(--font-data);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filters {
  padding: 9px 0;
}

.filters .row {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters .row::-webkit-scrollbar {
  display: none;
}

.pill {
  min-height: 31px;
  padding: 0 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font-size: 12px;
  white-space: nowrap;
}

.pill.active {
  border-color: var(--arc-red);
  background: var(--arc-red);
}

.result-status {
  margin-left: auto;
  color: var(--arc-gray-500);
  font-size: 11px;
  white-space: nowrap;
}

body.is-searching .memory-band,
body.is-searching header h1,
body.is-searching header .subtitle,
body.is-searching header .statbar {
  display: none;
}

body.is-searching header {
  padding-bottom: 18px;
}

body.is-searching .header-utility {
  margin-bottom: 16px;
}

body.is-searching .command-search {
  margin-top: 0;
}

main {
  padding-top: 8px;
}

.section-head {
  margin-top: 28px;
}

.section-head .rule {
  display: none;
}

.section-head h2 {
  font-family: var(--font-body);
  font-size: 19px;
  letter-spacing: -0.015em;
}

.grid {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 10px;
}

.card {
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--arc-border-hover-quiet);
  box-shadow: var(--shadow-md);
}

.card:active,
.mini-card:active {
  transform: translateY(1px);
}

.card .body {
  padding: 16px 18px 18px;
}

.card h3 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
}

/* Only the cards that carry a Peek control reserve room for it. */
.card:has(.peek) h3 {
  padding-right: 48px;
}

.card p {
  line-height: 1.45;
  text-wrap: pretty;
}

footer {
  border-top: 1px solid var(--arc-gray-100);
}

footer a {
  color: var(--arc-info);
}

footer code {
  font-family: var(--font-data);
  font-size: 11px;
}

@media (max-width: 800px) {
  .header-utility,
  .memory-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-utility {
    margin-bottom: 30px;
  }

  .memory-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .container {
    padding-inline: 16px;
  }

  .resource-links {
    width: 100%;
  }

  .resource-links a {
    flex: 1;
    justify-content: center;
  }

  h1 {
    font-size: 42px;
  }

  .statbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .stat .num {
    font-size: 22px;
  }

  .stat .lbl {
    font-size: 9px;
  }

  .command-search {
    min-height: 54px;
  }

  .command-search kbd,
  .result-status {
    display: none;
  }

  .command-search {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
