@font-face {
  font-display: swap;
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  src: url("atkinson-hyperlegible.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --page-pad-inline: 7rem;

  --stone-50: #fafaf9;
  --stone-100: #f4f3f0;
  --stone-200: #e8e6e1;
  --stone-300: #d6d3cd;
  --stone-400: #a6a09b;
  --stone-600: #57534d;
  --chroma-black: #27201c;
  --ink-950: #0a0a0a;
  --ink-900: #171717;
  --ink-700: #404040;
  --ink-secondary: var(--ink-700);
  --ink-muted: var(--stone-600);
  --terminal-bar: #2d2d2d;
  --terminal-bg: #1e1e1e;

  --bg-canvas: var(--stone-100);
  --bg-surface: #ffffff;
  --bg-subtle: var(--stone-50);
  --bg-muted: var(--stone-200);
  --border: #dedcd7;
  --border-strong: #c4c0b8;
  --shadow-hard: #e2dfd9;
  --shadow-hard-hover: #cfcbc2;

  --brand: var(--chroma-black);
  --brand-text: var(--ink-900);
  --brand-hover: var(--ink-950);
  --blue: #60a5fa;
  --red: #c8324c;
  --grey: var(--stone-600);
  --black: var(--chroma-black);
  --focus-ring: #1d56d8;

  --info-bg: var(--bg-surface);
  --info-text: var(--ink-700);
  --info-border: var(--chroma-black);
  --info-edge: var(--border-strong);
  --input-border: #78746d;

  --header-track-max: 1200px;

  --glass-fill: rgba(250, 249, 246, 0.28);
  --glass-fill-dense: rgba(255, 255, 255, 0.46);
  --glass-sheen: rgba(255, 255, 255, 0.46);
  --glass-rim: rgba(255, 255, 255, 0.92);
  --glass-low: rgba(39, 32, 28, 0.12);
  --glass-optic: blur(18px) saturate(185%) contrast(1.03) brightness(1.04);
  --glass-optic-dense: blur(22px) saturate(185%) contrast(1.03) brightness(1.04);
  --glass-shadow:
    0 1px 2px rgba(39, 32, 28, 0.06),
    0 8px 20px rgba(39, 32, 28, 0.08),
    0 20px 44px rgba(39, 32, 28, 0.06);
  --spring-pane: linear(
    0, 0.1515, 0.3211, 0.5922, 0.8223, 0.937, 1.0477, 1.096, 1.1029, 1.0901,
    1.0641, 1.0455, 1.021, 1.0036, 0.9937, 0.9905, 0.9895, 0.9912, 0.993,
    0.9959, 0.9983, 0.9994, 1.0005, 1.001, 1.0011, 1.0009, 1.0007, 1.0005, 1
  );
  --spring-pane-ms: 313ms;
  --spring-press: linear(
    0, 0.1659, 0.4268, 0.6816, 0.8795, 1.0066, 1.084, 1.0861, 1.069, 1.0457,
    1.0241, 1.0079, 0.998, 0.9933, 0.9923, 0.9934, 0.9954, 0.9973, 0.9995,
    1.0003, 1.0006, 1.0007, 1.0005, 1.0004, 1
  );
  --spring-press-ms: 208ms;
}

html {
  box-sizing: border-box;
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  accent-color: var(--black);
  scrollbar-color: #78746d var(--bg-muted);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html,
body {
  min-block-size: 100dvh;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
  color: var(--ink-900);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--black);
  color: var(--stone-50);
}

button,
input,
select,
textarea {
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  font-weight: 500;
}

a {
  color: inherit;
  text-decoration: none;
}

:where(a:any-link, button, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.visually-hidden:not(.skip-link),
.skip-link.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link:focus-visible {
  position: fixed;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 10010;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  background: var(--black);
  color: #fff;
  font-weight: 600;
}

b,
strong,
label,
th {
  font-weight: 600;
}

img {
  border: 0;
  max-inline-size: 100%;
  block-size: auto;
}

#body,
#header,
#footer {
  box-sizing: border-box;
  padding-inline: var(--page-pad-inline);
}

@media only all and (max-width: 59.938em) {
  :root {
    --page-pad-inline: 4rem;
  }
}

@media only all and (max-width: 47.938em) {
  :root {
    --page-pad-inline: 1rem;
  }
}

#header {
  position: sticky;
  inset-block-start: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  inline-size: 100%;
  block-size: 5rem;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.48) 0%,
      rgba(255, 255, 255, 0.08) 48%,
      transparent 100%
    ),
    var(--glass-fill);
  backdrop-filter: var(--glass-optic);
  -webkit-backdrop-filter: var(--glass-optic);
  border-block-end: 1px solid var(--glass-low);
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    inset 0 -1px 0 rgba(255, 255, 255, 0.32),
    0 1px 2px rgba(39, 32, 28, 0.04),
    0 8px 24px rgba(39, 32, 28, 0.06);
}

html.liquid-refract #header {
  backdrop-filter: url(#liquid-glass-lens) var(--glass-optic);
}

#header #logo {
  display: flex;
  align-items: center;
  block-size: 100%;
}

#header #logo .logo-wordmark {
  display: block;
  flex: none;
  inline-size: auto;
  block-size: 1.7rem;
  overflow: visible;
  color: var(--brand);
  transition:
    color 0.2s ease,
    filter 0.2s ease,
    transform var(--spring-press-ms, 208ms) var(--spring-press, ease);
}

#header #logo a:hover .logo-wordmark {
  color: var(--brand-hover);
  filter: brightness(1.06);
}

#header #logo a:active .logo-wordmark {
  transform: scale(0.98);
}

@media only all and (max-width: 47.938em) {
  #header #logo .logo-wordmark {
    block-size: 1.25rem;
  }
}

#header #logo .site-title {
  margin: 0;
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.15;
  text-transform: uppercase;
}

#header #logo a {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--brand);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  transition: color 0.2s ease;
}

@media (scripting: enabled) {
  #header #logo a:not(:has(.logo-wordmark)) {
    color: transparent;
  }
}

#header #logo a:hover {
  color: var(--brand-hover);
}

#body {
  flex: 1 0 auto;
  box-sizing: border-box;
  background: var(--bg-canvas);
  padding-block-start: 2.5rem;
  padding-block-end: 5rem;
}

.google-auto-placed {
  max-inline-size: 100%;
}

#footer {
  --focus-ring: var(--blue);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-block-size: 6rem;
  padding-block: 2.5rem 2rem;
  margin-block-start: auto;
  background: var(--terminal-bg);
  border-block-start: 1px solid var(--black);
  color: var(--stone-200);
  text-align: center;
}

#footer a {
  color: var(--stone-200);
  transition: color 0.15s ease;
}

#footer a:hover {
  color: #fff;
}

#footer p {
  margin: 0;
  text-align: center;
}

#footer .totop {
  position: absolute;
  inset-block-end: 100%;
  inset-inline: 0;
  transform: translateY(1rem);
  text-align: center;
}

#footer .totop > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 3rem;
  min-block-size: 2.25rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 55%),
    rgba(38, 35, 34, 0.48);
  backdrop-filter: blur(10px) saturate(180%) brightness(1.08);
  -webkit-backdrop-filter: blur(10px) saturate(180%) brightness(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 4px 12px rgba(0, 0, 0, 0.2);
  color: var(--stone-50);
  font-size: 1.7rem;
  line-height: 1;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform var(--spring-press-ms, 208ms) var(--spring-press, ease);
}

html.liquid-refract #footer .totop > a {
  backdrop-filter: url(#liquid-glass-lens) blur(10px) saturate(180%) brightness(1.08);
}

#footer .totop > a:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 55%),
    rgba(39, 32, 28, 0.72);
  border-color: rgba(255, 255, 255, 0.36);
  color: #fff;
}

#footer .totop > a:active {
  transform: scale(0.95);
}

@media (prefers-reduced-motion: reduce) {
  #footer .totop > a {
    transition: none;
  }

  #footer .totop > a:active {
    transform: none;
  }
}

.svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  fill: currentColor;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-block: 0.85rem 1.7rem;
  color: var(--ink-900);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  font-weight: 700;
  font-style: normal;
  text-rendering: optimizeLegibility;
  text-transform: uppercase;
  text-wrap: balance;
  font-size: 2rem;
}

.middle + article,
.cat-stage-section + article,
#body > article {
  box-sizing: border-box;
  inline-size: min(100%, calc(var(--frame-max-width, 1000px) + var(--frame-chrome, 80px)));
  margin-inline: auto;
  margin-block-start: 2.75rem;
}

.middle + article:has(> section),
.cat-stage-section + article:has(> section) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.middle + article > section,
.cat-stage-section + article > section {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 1.4rem 1.55rem;
  box-shadow: 6px 6px 0 var(--shadow-hard);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.middle + article > section:hover,
.cat-stage-section + article > section:hover {
  border-color: var(--black);
  box-shadow: 8px 8px 0 var(--shadow-hard-hover);
}

.middle + article > section:last-child:nth-child(odd),
.cat-stage-section + article > section:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

#body article.chroma-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr));
  gap: 1.15rem;
}

article.chroma-cards > section {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1.45rem 1.45rem 1.55rem;
  box-shadow: 6px 6px 0 var(--shadow-hard);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

article.chroma-cards > section:last-child:nth-child(odd) {
  grid-column: auto;
}

article.chroma-cards > section:hover {
  transform: translateY(-2px);
  box-shadow: 8px 8px 0 var(--shadow-hard-hover);
}

@media (prefers-reduced-motion: reduce) {
  article.chroma-cards > section {
    transition: none;
  }

  article.chroma-cards > section:hover {
    transform: none;
  }
}

article.chroma-cards .card-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  margin-block-end: 1.25rem;
  color: var(--ink-900);
  transition: color 0.2s ease;
}

article.chroma-cards .card-glyph svg {
  inline-size: 3.125rem;
  block-size: 3.125rem;
  filter: drop-shadow(2px 2px 0 var(--shadow-hard));
}

article.chroma-cards > section h2 {
  display: block;
  margin-block: 0 0.45rem;
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink-900);
}

article.chroma-cards > section p {
  margin-block: 0;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--stone-600);
}

article.chroma-cards > section p a {
  color: var(--ink-900);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

article.chroma-cards > section p a:hover {
  color: var(--brand-hover);
  text-decoration-color: currentColor;
}

article.chroma-cards > section h2 a {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

article.chroma-cards > section h2 a:hover,
article.chroma-cards > section h2 a:focus-visible {
  color: var(--brand-hover);
  text-decoration-color: currentColor;
}

/* Jewel-inspired 6-color hover cycle */
article.chroma-cards > section:nth-child(6n + 1) {
  --jewel-color: #dc2626;
}

article.chroma-cards > section:nth-child(6n + 2) {
  --jewel-color: #d97706;
}

article.chroma-cards > section:nth-child(6n + 3) {
  --jewel-color: #00a651;
}

article.chroma-cards > section:nth-child(6n + 4) {
  --jewel-color: #0070f3;
}

article.chroma-cards > section:nth-child(6n + 5) {
  --jewel-color: #c026d3;
}

article.chroma-cards > section:nth-child(6n) {
  --jewel-color: #0891b2;
}

article.chroma-cards > section:hover {
  border-color: var(--jewel-color);
  box-shadow: 8px 8px 0 color-mix(in oklab, var(--jewel-color) 24%, var(--shadow-hard));
}

article.chroma-cards > section:hover .card-glyph {
  color: var(--jewel-color);
}

.legal-doc {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: 6px 6px 0 var(--shadow-hard);
}

.legal-doc > header h1 {
  margin-block: 0 1rem;
  text-align: left;
  font-size: clamp(2rem, 1.2rem + 2.5vw, 2.8rem);
  letter-spacing: -0.02em;
}

.legal-doc > header p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-700);
}

.legal-toc {
  margin-block: 1.75rem 0.5rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-subtle);
}

.legal-toc ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-toc a {
  font-size: 0.95rem;
  color: var(--ink-700);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.legal-toc a:hover,
.legal-toc a:focus-visible {
  color: var(--brand-hover);
  text-decoration-color: currentColor;
}

.legal-doc > section {
  margin-block-start: 1.75rem;
  padding-block-start: 1.75rem;
  border-block-start: 1px solid var(--border);
}

.legal-doc > section h2 {
  margin-block: 0 0.75rem;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
}

.legal-doc > section p {
  margin-block: 0.9rem;
}

.legal-doc > section p:last-child {
  margin-block-end: 0;
}

.legal-doc > section :is(ul, ol) {
  margin-block: 0.9rem 0;
}

.legal-doc > section li + li {
  margin-block-start: 0.5rem;
}

@media only all and (min-width: 60em) {
  #body article.chroma-cards:has(> section:only-child) {
    grid-template-columns: minmax(0, 1fr);
  }

  #body article.chroma-cards:has(> section:nth-child(2):last-child),
  #body article.chroma-cards:has(> section:nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media only all and (max-width: 59.938em) {
  #body article.chroma-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

article :where(p, li) {
  color: var(--ink-700);
}

h1 {
  font-size: 3.2rem;
  text-align: center;
  letter-spacing: -3px;
}

h2 {
  letter-spacing: -2px;
}

h3 {
  letter-spacing: -1px;
}

h4 {
  font-size: 1.75rem;
}

h5 {
  font-size: 1.35rem;
}

@media only all and (min-width: 48em) and (max-width: 59.938em) {
  h2 {
    font-size: 2.1rem;
  }

  h3 {
    font-size: 1.7rem;
  }

  h4 {
    font-size: 1.35rem;
  }
}

@media only all and (max-width: 47.938em) {
  h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-block-end: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.6rem;
  }

  h4 {
    font-size: 1.25rem;
  }

  .middle + article:has(> section),
  .cat-stage-section + article:has(> section),
  #body article.chroma-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  article.chroma-cards > section {
    padding: 1.15rem 1.25rem;
  }

  .legal-toc ul {
    flex-direction: column;
    gap: 0.35rem;
  }
}

p {
  margin-block: 1.7rem;
  text-wrap: pretty;
}

ul,
ol {
  margin-block: 1.7rem;
}

ul ul,
ul ol,
ol ul,
ol ol {
  margin-block: 0;
}

.info-box {
  box-sizing: border-box;
  padding: 1rem 1.35rem;
  margin-block: 0 1.75rem;
  border: 1px solid var(--info-edge);
  border-radius: 6px;
  background: var(--info-bg);
  color: var(--info-text);
  box-shadow: 6px 6px 0 var(--shadow-hard);
  font-size: 0.98rem;
  line-height: 1.65;
}

.info-box:has(~ .middle),
.info-box:has(~ .cat-stage-section),
.info-box:has(~ article.chroma-cards),
.info-box:has(~ .legal-doc) {
  inline-size: min(100%, calc(var(--frame-max-width, 1000px) + var(--frame-chrome, 80px)));
  margin-inline: auto;
}

.info-box p {
  margin: 0;
  padding: 0;
}

.info-box > .google-auto-placed:has(iframe, ins[data-ad-status="filled"]) {
  margin-block-start: 0.9rem;
}

@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass-fill: rgba(250, 249, 246, 0.96);
    --glass-fill-dense: rgba(255, 255, 255, 0.98);
    --glass-optic: none;
    --glass-optic-dense: none;
  }

  #header,
  #footer .totop > a {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (forced-colors: active) {
  #header #logo .logo-wordmark {
    filter: none;
  }

  #header #logo .logo-wordmark path {
    fill: CanvasText;
  }

  #header {
    background: Canvas;
    backdrop-filter: none;
    border-block-end: 1px solid CanvasText;
    box-shadow: none;
  }

  #footer {
    border-block-start: 1px solid CanvasText;
  }

  .info-box,
  article.chroma-cards > section,
  .legal-doc {
    border-color: CanvasText;
    box-shadow: none;
  }

  article.chroma-cards .card-glyph svg {
    filter: none;
  }

  :where(a:any-link, button, summary, [tabindex]):focus-visible {
    outline: 2px solid Highlight;
  }
}
