/* bestaitoolsforcre.com. Values follow the better-* skills: OKLCH ramps with role tokens,
   three-layer shadow rings, concentric radii, a named type scale, 0.96 press scale,
   100ms staggered entrances and motion gated behind prefers-reduced-motion. */

/* ---------- Tier 1: primitives (never used in components) ---------- */
:root {
  --neutral-1: oklch(0.988 0.002 277);
  --neutral-2: oklch(0.975 0.004 277);
  --neutral-3: oklch(0.957 0.006 277);
  --neutral-4: oklch(0.937 0.007 277);
  --neutral-6: oklch(0.9 0.009 277);
  --neutral-7: oklch(0.85 0.011 277);
  --neutral-8: oklch(0.72 0.014 277);
  --neutral-11: oklch(0.5 0.017 277);
  --neutral-12: oklch(0.21 0.02 277);
  --white: oklch(1 0 0);

  --indigo-2: oklch(0.97 0.012 277);
  --indigo-3: oklch(0.945 0.025 277);
  --indigo-4: oklch(0.915 0.04 277);
  --indigo-6: oklch(0.83 0.075 277);
  --indigo-7: oklch(0.74 0.115 277);
  --indigo-9: oklch(0.5 0.23 277);
  --indigo-10: oklch(0.45 0.215 277);
  --indigo-11: oklch(0.48 0.21 277);
  --indigo-12: oklch(0.3 0.13 277);

  --neutral-dark-1: oklch(0.165 0.006 277);
  --neutral-dark-2: oklch(0.195 0.008 277);
  --neutral-dark-3: oklch(0.225 0.009 277);
  --neutral-dark-4: oklch(0.255 0.01 277);
  --neutral-dark-6: oklch(0.3 0.011 277);
  --neutral-dark-7: oklch(0.36 0.013 277);
  --neutral-dark-8: oklch(0.46 0.015 277);
  --neutral-dark-11: oklch(0.77 0.014 277);
  --neutral-dark-12: oklch(0.965 0.005 277);

  --indigo-dark-2: oklch(0.225 0.035 277);
  --indigo-dark-3: oklch(0.27 0.06 277);
  --indigo-dark-6: oklch(0.42 0.12 277);
  --indigo-dark-9: oklch(0.55 0.19 277);
  --indigo-dark-10: oklch(0.5 0.2 277);
  --indigo-dark-11: oklch(0.8 0.095 277);
}

/* ---------- Tier 2: semantic roles (the only tier components read) ---------- */
:root {
  color-scheme: light dark;
  --color-bg-page: var(--neutral-1);
  --color-bg-surface: var(--white);
  --color-bg-sunken: var(--neutral-2);
  --color-bg-hover: var(--neutral-3);
  --color-bg-raised: var(--white);
  --color-text-primary: var(--neutral-12);
  --color-text-secondary: var(--neutral-11);
  --color-text-inverse: var(--white);
  --color-text-on-accent: var(--white);
  --color-border-subtle: var(--neutral-6);
  --color-border: var(--neutral-7);
  --color-border-strong: var(--neutral-8);
  --color-border-focus: var(--indigo-9);
  --color-separator: var(--neutral-6);
  --color-accent-subtle: var(--indigo-2);
  --color-accent-muted: var(--indigo-3);
  --color-accent-border: var(--indigo-6);
  --color-accent-solid: var(--indigo-9);
  --color-accent-solid-hover: var(--indigo-10);
  --color-accent-text: var(--indigo-11);
  --color-accent-text-strong: var(--indigo-12);
  --color-pattern: var(--indigo-4);

  --shadow-border:
    0px 0px 0px 1px oklch(0 0 0 / 0.06),
    0px 1px 2px -1px oklch(0 0 0 / 0.06),
    0px 2px 4px 0px oklch(0 0 0 / 0.04);
  --shadow-border-hover:
    0px 0px 0px 1px oklch(0 0 0 / 0.08),
    0px 1px 2px -1px oklch(0 0 0 / 0.08),
    0px 2px 4px 0px oklch(0 0 0 / 0.06);
  --shadow-raised:
    0px 0px 0px 1px oklch(0 0 0 / 0.06),
    0px 4px 8px -2px oklch(0 0 0 / 0.08),
    0px 16px 32px -8px oklch(0 0 0 / 0.12);
  --shadow-scroll: oklch(0 0 0 / 0.14);

  /* Type scale by role: size / line-height / weight travel together. */
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --text-label: 0.75rem;     /* uppercase labels, 1.4, 500 */
  --text-caption: 0.8125rem; /* citations, meta, 1.4, 400 */
  --text-small: 0.875rem;    /* UI, tables, nav, 1.5, 400-500 */
  --text-body: 1rem;         /* body, 1.6, 400 */
  --text-lead: 1.125rem;     /* hero lede, 1.55, 400 */
  --text-heading: 1.125rem;  /* h3, 1.3, 600 */
  --text-title: 1.5rem;      /* h2, 1.2, 600 */
  --text-display: clamp(2rem, 1.55rem + 1.6vw, 2.75rem);   /* h1, 1.1, 600 */
  --text-hero: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);      /* home h1, 1.1, 600 */

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px; --space-20: 80px;

  --radius-sm: 6px;   /* chips, tags */
  --radius-md: 8px;   /* buttons, menu items */
  --radius-lg: 12px;  /* cards, tables */
  --radius-xl: 16px;  /* panels: 8px items + 8px padding */

  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --header-h: 64px;
  --wrap: 75rem;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg-page: var(--neutral-dark-1);
    --color-bg-surface: var(--neutral-dark-2);
    --color-bg-sunken: var(--neutral-dark-1);
    --color-bg-hover: var(--neutral-dark-4);
    --color-bg-raised: var(--neutral-dark-3);
    --color-text-primary: var(--neutral-dark-12);
    --color-text-secondary: var(--neutral-dark-11);
    --color-text-inverse: var(--neutral-dark-1);
    --color-border-subtle: var(--neutral-dark-6);
    --color-border: var(--neutral-dark-7);
    --color-border-strong: var(--neutral-dark-8);
    --color-border-focus: var(--indigo-dark-11);
    --color-separator: var(--neutral-dark-6);
    --color-accent-subtle: var(--indigo-dark-2);
    --color-accent-muted: var(--indigo-dark-3);
    --color-accent-border: var(--indigo-dark-6);
    --color-accent-solid: var(--indigo-dark-9);
    --color-accent-solid-hover: var(--indigo-dark-10);
    --color-accent-text: var(--indigo-dark-11);
    --color-accent-text-strong: var(--neutral-dark-12);
    --color-pattern: var(--neutral-dark-6);
    --shadow-border: 0 0 0 1px oklch(1 0 0 / 0.08);
    --shadow-border-hover: 0 0 0 1px oklch(1 0 0 / 0.13);
    --shadow-raised: 0 0 0 1px oklch(1 0 0 / 0.1), 0 16px 32px -8px oklch(0 0 0 / 0.5);
    --shadow-scroll: oklch(0 0 0 / 0.5);
  }
}
@media (prefers-contrast: more) {
  :root { --color-text-secondary: oklch(0.4 0.017 277); --color-accent-text: oklch(0.4 0.19 277); --color-border-subtle: var(--neutral-8); --color-separator: var(--neutral-8); }
}
@media (prefers-color-scheme: dark) and (prefers-contrast: more) {
  :root { --color-text-secondary: oklch(0.86 0.01 277); --color-accent-text: oklch(0.88 0.05 277); --color-border-subtle: var(--neutral-dark-8); --color-separator: var(--neutral-dark-8); }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-block-start: calc(var(--header-h) + 16px);
}
body {
  margin: 0;
  background: var(--color-bg-page);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: var(--text-display); line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: var(--text-title); line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; }
h3 { font-size: var(--text-heading); line-height: 1.3; font-weight: 600; letter-spacing: -0.005em; }
p, li, dd { text-wrap: pretty; }
p { margin: 0; }
b, strong { font-weight: 600; }
a {
  color: var(--color-accent-text);
  text-decoration-line: underline;
  text-decoration-color: var(--color-accent-border);
  text-decoration-thickness: from-font;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 150ms ease-out, color 150ms ease-out;
}
@media (hover: hover) { a:hover { text-decoration-color: currentColor; } }
:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--color-accent-muted); color: var(--color-text-primary); }
ul, ol { margin: 0; padding: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2px; stroke-linecap: round; stroke-linejoin: round; }
.icon-16 { width: 16px; height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link {
  position: absolute; inset-block-start: 8px; inset-inline-start: -999px; z-index: 100;
  padding: 10px 16px; border-radius: var(--radius-md);
  background: var(--color-accent-solid); color: var(--color-text-on-accent); font-weight: 500; text-decoration: none;
}
.skip-link:focus { inset-inline-start: 16px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right)); }
@media (min-width: 120rem) { :root { --wrap: 82rem; } }
@media (max-width: 40rem) { :root { --gutter: 16px; } }

/* ---------- Header ---------- */
.top {
  padding-block-start: env(safe-area-inset-top);
  position: sticky; inset-block-start: 0; z-index: 50;
  background: var(--color-bg-surface);
  border-block-end: 1px solid var(--color-separator);
}
.top-in { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--color-text-primary); text-decoration: none; font-weight: 600; letter-spacing: -0.01em; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-md); background: var(--color-accent-solid); color: var(--color-text-on-accent); flex: none; }
.logo { width: 20px; height: 20px; fill: currentColor; }
.brand-name { white-space: nowrap; }
.nav { display: flex; align-items: center; gap: var(--space-1); min-width: 0; }
.nav-links { display: flex; gap: var(--space-1); list-style: none; }
.nav a, .jobs > summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border-radius: var(--radius-md); color: var(--color-text-secondary); font-size: var(--text-small); font-weight: 500;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}
.jobs > summary { list-style: none; padding-inline-end: 10px; -webkit-tap-highlight-color: transparent; }
.jobs > summary::-webkit-details-marker { display: none; }
.nav a[aria-current="page"] { color: var(--color-text-primary); background: var(--color-bg-hover); }
@media (hover: hover) {
  .nav a:hover, .jobs > summary:hover { color: var(--color-text-primary); background: var(--color-bg-hover); }
}
.jobs[open] > summary { color: var(--color-text-primary); background: var(--color-bg-hover); }
.jobs > summary .icon-16 { transition: rotate 150ms ease-out; }
.jobs[open] > summary .icon-16 { rotate: 180deg; }
.jobs { position: static; }
.jobs-panel {
  position: absolute; inset-block-start: calc(100% + 8px); z-index: 60;
  inset-inline-end: max(var(--gutter), (100% - var(--wrap)) / 2 + var(--gutter));
  width: min(36rem, calc(100% - 2 * var(--gutter)));
  padding: var(--space-2); border-radius: var(--radius-xl);
  background: var(--color-bg-raised); border: 1px solid transparent; box-shadow: var(--shadow-raised);
  overscroll-behavior: contain; max-height: calc(100dvh - var(--header-h) - 24px); overflow-y: auto;
}
.panel-label { padding: 8px 12px 4px; font-family: var(--font-mono); font-size: var(--text-label); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-text-secondary); }
.jobs-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.nav .job-link {
  display: flex; gap: 10px; min-height: 40px; padding: 8px 12px; width: 100%;
  color: var(--color-text-primary); font-weight: 500; border-radius: var(--radius-md);
}
.job-link .icon { color: var(--color-accent-text); }
.nav .job-link[aria-current="page"] { background: var(--color-accent-subtle); }

/* ---------- Page head ---------- */
.page-head {
  position: relative; isolation: isolate;
  border-block-end: 1px solid var(--color-separator);
  background: var(--color-bg-surface);
  padding-block: var(--space-12) var(--space-10);
}
.page-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, var(--color-pattern) 1px, transparent 0);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(to bottom, oklch(0 0 0 / 0.9), transparent 85%);
  mask-image: linear-gradient(to bottom, oklch(0 0 0 / 0.9), transparent 85%);
}
.page-head.home { padding-block: var(--space-16) var(--space-12); }
.head-grid { display: grid; gap: var(--space-8); align-items: start; }
@media (min-width: 64rem) {
  .has-aside .head-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--space-12); }
  .home .head-grid { align-items: center; }
}
.head-main { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); min-width: 0; }
.home h1 { font-size: var(--text-hero); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: var(--text-small); color: var(--color-text-secondary); }
.crumbs a { color: var(--color-text-secondary); text-decoration-color: var(--color-border); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 8px; border-radius: 999px;
  background: var(--color-accent-subtle); color: var(--color-accent-text);
  font-family: var(--font-mono); font-size: var(--text-label); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; line-height: 1.4;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lede { font-size: var(--text-lead); line-height: 1.55; color: var(--color-text-secondary); max-width: 62ch; }
.meta { font-size: var(--text-caption); line-height: 1.4; color: var(--color-text-secondary); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-block: var(--space-2); }

/* Buttons: one filled primary per view, neutral secondary. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding-inline: 18px; border-radius: var(--radius-md); border: 1px solid transparent;
  font-size: var(--text-small); font-weight: 600; text-decoration: none; white-space: nowrap;
  transition-property: scale, background-color, box-shadow; transition-duration: 150ms; transition-timing-function: ease-out;
  -webkit-tap-highlight-color: transparent;
}
.btn:has(.icon) { padding-inline-end: 16px; }
.btn:not(:disabled):active { scale: 0.96; }
.btn-primary { background: var(--color-accent-solid); color: var(--color-text-on-accent); }
.btn-secondary { background: var(--color-bg-surface); color: var(--color-text-primary); box-shadow: var(--shadow-border); }
@media (hover: hover) {
  .btn-primary:hover { background: var(--color-accent-solid-hover); }
  .btn-secondary:hover { box-shadow: var(--shadow-border-hover); background: var(--color-bg-sunken); }
}

/* Answer card: the hero aside. */
.answer {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4);
  padding: var(--space-6); border-radius: var(--radius-xl);
  background: var(--color-accent-subtle); border: 1px solid var(--color-accent-border);
}
.answer > .icon { color: var(--color-accent-text); margin-block-start: 3px; }
.answer p { font-size: var(--text-body); line-height: 1.6; }
.answer b:first-child { color: var(--color-accent-text-strong); }
.answer-list { list-style: none; counter-reset: rank; display: grid; gap: 2px; margin-block-start: var(--space-3); }
.answer-list li { counter-increment: rank; display: flex; gap: 12px; align-items: baseline; font-size: var(--text-small); line-height: 1.45; }
.answer-list li::before { content: counter(rank); min-width: 1.5em; font-family: var(--font-mono); font-size: var(--text-caption); color: var(--color-accent-text); text-align: end; }
.answer-list a { color: var(--color-text-primary); text-decoration-color: var(--color-accent-border); padding-block: 3px; }

/* ---------- Layout ---------- */
.layout { padding-block: var(--space-12) var(--space-16); display: grid; gap: var(--space-12); }
@media (min-width: 64rem) {
  .layout.has-toc { grid-template-columns: 14.5rem minmax(0, 1fr); gap: var(--space-12); align-items: start; }
}
.content { min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.content > h2, .content > section > h2 { margin-block-start: var(--space-12); }
.content > h2:first-child, .content > section:first-child > h2 { margin-block-start: 0; }
.content > section { display: flex; flex-direction: column; gap: var(--space-4); }
.content > p, .content > section > p { max-width: 68ch; }
.section-sub { color: var(--color-text-secondary); margin-block-start: calc(-1 * var(--space-2)); }

/* "On this page" */
.toc { display: none; }
@media (min-width: 64rem) {
  .toc { display: block; position: sticky; inset-block-start: calc(var(--header-h) + var(--space-8)); max-height: calc(100dvh - var(--header-h) - var(--space-12)); overflow-y: auto; overscroll-behavior: contain; padding-inline-end: var(--space-2); }
}
.toc-title { font-family: var(--font-mono); font-size: var(--text-label); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-text-secondary); margin-block-end: var(--space-3); }
.toc ol { list-style: none; display: grid; gap: 2px; }
.toc a {
  display: flex; gap: 10px; align-items: baseline; padding: 5px 10px; border-radius: var(--radius-sm);
  color: var(--color-text-secondary); font-size: var(--text-small); line-height: 1.4; text-decoration: none;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}
.toc > ol > li > a { color: var(--color-text-primary); font-weight: 500; }
.toc-kids { margin-block: 2px var(--space-2); padding-inline-start: 10px; border-inline-start: 1px solid var(--color-separator); margin-inline-start: 10px; }
.toc-rank { min-width: 1.4em; font-family: var(--font-mono); font-size: var(--text-caption); color: var(--color-text-secondary); text-align: end; }
.toc a[aria-current="true"] { background: var(--color-accent-subtle); color: var(--color-accent-text); }
.toc a[aria-current="true"] .toc-rank { color: var(--color-accent-text); }
@media (hover: hover) { .toc a:hover { background: var(--color-bg-hover); color: var(--color-text-primary); } }

/* ---------- Ranked entries ---------- */
.entries { display: flex; flex-direction: column; gap: var(--space-4); list-style: none; }
.entry {
  position: relative; overflow: hidden; container-type: inline-size;
  background: var(--color-bg-surface); border-radius: var(--radius-lg);
  border: 1px solid transparent; box-shadow: var(--shadow-border);
  transition: box-shadow 150ms ease-out;
}
@media (hover: hover) { .entry:hover { box-shadow: var(--shadow-border-hover); } }
.entry.ours { box-shadow: 0 0 0 1px var(--color-accent-border), 0 1px 2px -1px oklch(0 0 0 / 0.06), 0 2px 4px 0 oklch(0 0 0 / 0.04); }
.entry.ours::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 0; height: 3px; background: var(--color-accent-solid); pointer-events: none; }
.entry-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-5) var(--space-6) 0; flex-wrap: wrap; }
.rank {
  display: grid; place-items: center; min-width: 32px; height: 32px; padding-inline: 6px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: var(--text-small); font-weight: 600; color: var(--color-text-secondary);
  background: var(--color-bg-sunken); box-shadow: inset 0 0 0 1px var(--color-border-subtle);
}
.ours .rank { background: var(--color-accent-solid); color: var(--color-text-on-accent); box-shadow: none; }
.mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: var(--color-bg-sunken); box-shadow: inset 0 0 0 1px var(--color-border-subtle);
  font-weight: 600; font-size: 1.0625rem; color: var(--color-text-primary);
}
.ours .mark { background: var(--color-accent-subtle); color: var(--color-accent-text); box-shadow: inset 0 0 0 1px var(--color-accent-border); }
.mark .logo { width: 22px; height: 22px; }
.entry-id { flex: 1 1 12rem; min-width: 0; display: grid; gap: 2px; }
.entry-id h3 a { color: var(--color-text-primary); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.entry-id h3 a .icon-16 { color: var(--color-text-secondary); transition: color 150ms ease-out; }
@media (hover: hover) { .entry-id h3 a:hover { color: var(--color-accent-text); } .entry-id h3 a:hover .icon-16 { color: currentColor; } }
.host { font-size: var(--text-caption); line-height: 1.4; color: var(--color-text-secondary); }
.tag {
  display: inline-flex; align-items: center; min-height: 24px; padding-inline: 8px; border-radius: var(--radius-sm);
  background: var(--color-accent-subtle); color: var(--color-accent-text); box-shadow: inset 0 0 0 1px var(--color-accent-border);
  font-family: var(--font-mono); font-size: var(--text-label); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
}
.entry-body { padding: var(--space-4) var(--space-6) var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.what { max-width: 72ch; }
.entry-meta { margin: 0; display: grid; gap: var(--space-2); }
.entry-meta div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--space-4); }
.entry-meta dt, .fact-topic, .price-label {
  font-family: var(--font-mono); font-size: var(--text-label); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--color-text-secondary); line-height: 1.4; padding-block-start: 0.3em;
}
.entry-meta dd { margin: 0; font-size: var(--text-small); line-height: 1.55; }
.entry-note { display: flex; gap: 8px; align-items: flex-start; font-size: var(--text-small); line-height: 1.5; color: var(--color-text-secondary); padding: 10px 12px; border-radius: var(--radius-md); background: var(--color-bg-sunken); }
.entry-note .icon-16 { margin-block-start: 2px; color: var(--color-text-secondary); }
.entry-note b { color: var(--color-text-primary); font-weight: 500; }
.facts { list-style: none; display: grid; gap: var(--space-3); padding-block-start: var(--space-4); border-block-start: 1px solid var(--color-separator); }
.facts li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--space-4); }
.fact-topic { overflow-wrap: anywhere; }
.fact-claim { font-size: var(--text-small); line-height: 1.55; }
.cite { display: block; margin-block-start: 2px; font-size: var(--text-caption); line-height: 1.4; color: var(--color-text-secondary); }
.cite a { color: var(--color-text-secondary); text-decoration-color: var(--color-border); }
@media (hover: hover) { .cite a:hover { color: var(--color-accent-text); text-decoration-color: currentColor; } }
.price {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--space-4);
  padding: var(--space-4) var(--space-6); background: var(--color-bg-sunken); border-block-start: 1px solid var(--color-separator);
}
.price p { font-size: var(--text-small); line-height: 1.55; font-weight: 500; }
.price .cite { font-weight: 400; }
@container (max-width: 34rem) {
  .entry-head { padding: var(--space-4) var(--space-4) 0; }
  .entry-body { padding: var(--space-4); }
  .price { padding: var(--space-4); }
  .entry-meta div, .facts li, .price { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
.panel .facts { border: 0; padding: 0; }

/* Standalone fact panel (home and 2027) */
.panel {
  padding: var(--space-6); border-radius: var(--radius-lg); background: var(--color-bg-surface);
  border: 1px solid transparent; box-shadow: var(--shadow-border); container-type: inline-size;
}
@container (max-width: 34rem) { .panel .facts li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
@media (max-width: 40rem) { .panel { padding: var(--space-4); } }

/* ---------- Tables ---------- */
.scroll {
  overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid transparent; box-shadow: var(--shadow-border);
  background:
    linear-gradient(to right, var(--color-bg-surface) 30%, transparent) left center / 40px 100% no-repeat local,
    linear-gradient(to left, var(--color-bg-surface) 30%, transparent) right center / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--shadow-scroll), transparent) left center / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--shadow-scroll), transparent) right center / 14px 100% no-repeat scroll,
    var(--color-bg-surface);
}
.scroll:focus-visible { outline-offset: 2px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--text-small); line-height: 1.5; }
.wide table { min-width: 52rem; }
.table-2 table { min-width: 30rem; }
th, td { padding: 12px 16px; text-align: start; vertical-align: top; border-block-end: 1px solid var(--color-separator); }
tbody tr:last-child > * { border-block-end: 0; }
thead th {
  font-family: var(--font-mono); font-size: var(--text-label); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--color-text-secondary); white-space: nowrap; padding-block: 10px; background: var(--color-bg-sunken);
}
tbody th, td.name { font-weight: 600; color: var(--color-text-primary); }
tbody tr { transition: background-color 100ms ease-out; }
@media (hover: hover) { tbody tr:hover { background: var(--color-bg-hover); } }
tr.ours { background: var(--color-accent-subtle); }
.table-2 tbody th { width: 34%; }
td .muted { color: var(--color-text-secondary); }

/* ---------- Home: job grid ---------- */
.job-grid { list-style: none; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.job-card {
  position: relative; display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-5); border-radius: var(--radius-lg); background: var(--color-bg-surface);
  border: 1px solid transparent; box-shadow: var(--shadow-border);
  transition: box-shadow 150ms ease-out;
}
@media (hover: hover) {
  .job-card:hover { box-shadow: var(--shadow-border-hover); }
  .job-card:hover .go { color: var(--color-accent-text); translate: 2px 0; }
}
.job-top { display: flex; align-items: center; gap: var(--space-3); }
.job-top .icon { color: var(--color-accent-text); }
.job-card h3 { font-size: var(--text-body); line-height: 1.3; flex: 1; }
.job-card h3::first-letter, .job-card h3 a::first-letter { text-transform: uppercase; }
.job-card h3 a { color: var(--color-text-primary); text-decoration: none; }
.job-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.job-card:has(a:focus-visible) { outline: 2px solid var(--color-border-focus); outline-offset: 2px; }
.job-card h3 a:focus-visible { outline: none; }
.go { color: var(--color-text-secondary); transition-property: color, translate; transition-duration: 150ms; transition-timing-function: ease-out; }
.job-card dl { margin: 0; display: grid; gap: var(--space-2); }
.job-card dl div { display: grid; gap: 2px; }
.job-card dt { font-family: var(--font-mono); font-size: var(--text-label); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-text-secondary); line-height: 1.4; }
.job-card dd { margin: 0; font-size: var(--text-small); line-height: 1.5; color: var(--color-text-secondary); }
.job-card dd.pick { color: var(--color-text-primary); font-weight: 600; font-size: var(--text-body); }

/* Split section: prose beside a panel or diagram */
.content > .split { display: grid; gap: var(--space-8); align-items: center; margin-block-start: var(--space-12); }
.content > .split:first-child { margin-block-start: 0; }
@media (min-width: 60rem) { .content > .split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-12); } }
.diagram-wrap { padding: var(--space-6); border-radius: var(--radius-lg); background: var(--color-bg-surface); border: 1px solid transparent; box-shadow: var(--shadow-border); }
.split > div { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.diagram { width: 100%; height: auto; color: var(--color-text-secondary); }
.diagram .d-box { fill: var(--color-bg-surface); stroke: var(--color-border); stroke-width: 1px; }
.diagram .d-layer { fill: var(--color-accent-subtle); stroke: var(--color-accent-border); stroke-width: 1px; }
.diagram .d-solid { fill: var(--color-accent-solid); }
.diagram .d-line { stroke: var(--color-border-strong); stroke-width: 1.5px; fill: none; stroke-dasharray: 3 4; }
.diagram .d-faint { fill: var(--color-border-subtle); }
.diagram text { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; fill: var(--color-text-secondary); }

/* Price list (2027) */
.price-list { list-style: none; border-radius: var(--radius-lg); background: var(--color-bg-surface); border: 1px solid transparent; box-shadow: var(--shadow-border); container-type: inline-size; }
.price-list li { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: var(--space-4); padding: 14px var(--space-5); border-block-end: 1px solid var(--color-separator); font-size: var(--text-small); line-height: 1.55; }
.price-list li:last-child { border-block-end: 0; }
.price-list b { font-weight: 600; }
@container (max-width: 34rem) { .price-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* ---------- Trial checklist ---------- */
.checks { list-style: none; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.checks li {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4);
  padding: var(--space-5); border-radius: var(--radius-lg); background: var(--color-bg-surface);
  border: 1px solid transparent; box-shadow: var(--shadow-border);
}
.check-num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--color-accent-subtle); color: var(--color-accent-text); font-family: var(--font-mono); font-size: var(--text-caption); font-weight: 600; box-shadow: inset 0 0 0 1px var(--color-accent-border); }
.checks h3 { font-size: var(--text-body); line-height: 1.3; margin-block: 5px 4px; }
.checks p { font-size: var(--text-small); line-height: 1.55; color: var(--color-text-secondary); }

/* ---------- FAQ ---------- */
.faq-list { border-radius: var(--radius-lg); background: var(--color-bg-surface); border: 1px solid transparent; box-shadow: var(--shadow-border); }
.faq details + details { border-block-start: 1px solid var(--color-separator); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  min-height: 56px; padding: 14px var(--space-5); cursor: pointer; list-style: none; font-weight: 500; line-height: 1.4;
  border-radius: var(--radius-lg); -webkit-tap-highlight-color: transparent; transition: background-color 150ms ease-out;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon-16 { color: var(--color-text-secondary); transition: rotate 150ms ease-out; }
.faq details[open] summary .icon-16 { rotate: 180deg; }
@media (hover: hover) { .faq summary:hover { background: var(--color-bg-hover); } }
.faq-a { padding: 0 var(--space-5) var(--space-5); }
.faq-a p { color: var(--color-text-secondary); max-width: 68ch; }

/* ---------- About cards ---------- */
.about-grid { list-style: none; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.about-grid li { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); border-radius: var(--radius-lg); background: var(--color-bg-surface); border: 1px solid transparent; box-shadow: var(--shadow-border); }
.about-grid h2 { font-size: var(--text-heading); line-height: 1.3; letter-spacing: 0; margin: 0 !important; }
.about-grid p { color: var(--color-text-secondary); }
.about-grid .icon { color: var(--color-accent-text); }

/* ---------- Related ---------- */
.related { padding-block: 0 var(--space-16); display: flex; flex-direction: column; gap: var(--space-4); }
.related h2 { font-size: var(--text-heading); line-height: 1.3; letter-spacing: 0; }
.related-grid { list-style: none; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.related-card {
  display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 12px 16px;
  border-radius: var(--radius-lg); background: var(--color-bg-surface); border: 1px solid transparent; box-shadow: var(--shadow-border);
  color: var(--color-text-primary); font-size: var(--text-small); font-weight: 500; text-decoration: none; line-height: 1.35;
  transition: box-shadow 150ms ease-out;
}
.related-card span { flex: 1; }
.related-card .icon:first-child { color: var(--color-accent-text); }
.related-card .icon:last-child { color: var(--color-text-secondary); transition-property: color, translate; transition-duration: 150ms; transition-timing-function: ease-out; }
@media (hover: hover) { .related-card:hover { box-shadow: var(--shadow-border-hover); } .related-card:hover .icon:last-child { color: var(--color-accent-text); translate: 2px 0; } }

/* ---------- Footer ---------- */
.foot { background: var(--color-bg-surface); border-block-start: 1px solid var(--color-separator); padding-block: var(--space-12) var(--space-8); font-size: var(--text-small); color: var(--color-text-secondary); }
.foot-grid { display: grid; gap: var(--space-8); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 52rem) { .foot-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.8fr); gap: var(--space-12); } }
.foot-brand { display: flex; flex-direction: column; gap: var(--space-3); max-width: 40ch; }
.foot-title { font-family: var(--font-mono); font-size: var(--text-label); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; margin-block-end: var(--space-3); }
.foot-col ul { list-style: none; display: grid; gap: 2px; }
.foot-col a { display: inline-block; padding-block: 4px; color: var(--color-text-secondary); text-decoration: none; }
@media (hover: hover) { .foot-col a:hover { color: var(--color-text-primary); text-decoration: underline; text-decoration-color: var(--color-border); } }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-6); margin-block-start: var(--space-10); padding-block-start: var(--space-6); border-block-start: 1px solid var(--color-separator); font-size: var(--text-caption); }

/* ---------- Narrow screens ---------- */
@media (max-width: 39.99rem) {
  .top-in { flex-wrap: wrap; gap: 0; padding-block: 10px 6px; }
  .nav { width: calc(100% + 2 * var(--gutter)); margin-inline: calc(-1 * var(--gutter)); padding-inline: calc(var(--gutter) - 12px); margin-block-start: 4px; }
  .nav-links { overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to left, transparent, #000 32px); mask-image: linear-gradient(to left, transparent, #000 32px); padding-inline-end: 24px; }
  .nav-links::-webkit-scrollbar { display: none; }
  .jobs-panel { inset-inline: var(--gutter); inset-block-start: 100%; width: auto; margin-block-start: 6px; }
  :root { --header-h: 104px; }
}
@media (max-width: 47.99rem) {
  .page-head { padding-block: var(--space-8); }
  .page-head.home { padding-block: var(--space-10) var(--space-8); }
  .layout { padding-block: var(--space-8) var(--space-12); }
  .content > h2, .content > section > h2 { margin-block-start: var(--space-10); }
  .answer { padding: var(--space-5); grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
}

/* ---------- Motion: entrances run only with JS and without the reduced-motion preference ---------- */
.js .head-main > *, .js .head-aside { animation: none; }
@media (prefers-reduced-motion: no-preference) {
  .js .head-main > *, .js .head-aside { animation: rise-in 500ms cubic-bezier(.23, 1, .32, 1) both; }
  .jobs-panel { transition-property: opacity, translate, filter; transition-duration: 300ms; transition-timing-function: ease-out; }
  @starting-style { .jobs[open] .jobs-panel { opacity: 0; translate: 0 -12px; filter: blur(4px); } }
}
@media (prefers-reduced-motion: reduce) {
  .jobs > summary .icon-16, .faq summary .icon-16 { transition: none; }
  .job-card:hover .go, .related-card:hover .icon:last-child { translate: none; }
  .btn:not(:disabled):active { scale: 1; }
  .jobs-panel { transition: opacity 150ms ease-out; }
  @starting-style { .jobs[open] .jobs-panel { opacity: 0; } }
}
.js .head-main > :nth-child(2) { animation-delay: 100ms; }
.js .head-main > :nth-child(3) { animation-delay: 200ms; }
.js .head-main > :nth-child(4) { animation-delay: 300ms; }
.js .head-main > :nth-child(n + 5) { animation-delay: 400ms; }
.js .head-aside { animation-delay: 300ms; }
@keyframes fade-in { from { opacity: 0; } }
/* Hero text: transform only, so it is painted from the first frame. */
@keyframes rise-in { from { transform: translateY(10px); } }
@keyframes fade-in-up { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } }

@media (forced-colors: active) {
  .entry.ours::before, .eyebrow::before { background: CanvasText; }
  .page-head::before { display: none; }
}
@media print {
  .top, .toc, .related, .foot nav { display: none; }
  .page-head::before { display: none; }
}
.nowrap { white-space: nowrap; }
@container (max-width: 34rem) {
  .entry-id { flex-basis: calc(100% - 96px); }
  .entry-head .tag { margin-inline-start: 84px; }
}
@media (max-width: 47.99rem) {
  .answer { grid-template-columns: auto minmax(0, 1fr); }
}

/* ---------- Device pass: long strings, short screens, touch targets ---------- */
a, .host, .cite, .fact-claim, td, th { overflow-wrap: anywhere; }
.psv { font-weight: 600; }
/* Phones held sideways: the header stops sticking so content keeps the short screen. */
@media (max-height: 30rem) and (orientation: landscape) {
  .top { position: relative; }
  :root { --header-h: 0px; }
  .toc { position: static; max-height: none; }
}
@media (pointer: coarse) {
  .nav a, .jobs > summary, .nav .job-link, .brand { min-height: 44px; }
  .crumbs a { display: inline-flex; align-items: center; min-height: 44px; margin-block: -10px; }
  .entry-id h3 a { min-height: 32px; }
  .job-card h3 a { display: inline-block; padding-block: 12px; margin-block: -12px; }
  .answer-list a, .toc a, .foot-col a { display: inline-flex; align-items: center; min-height: 44px; }
  .answer-list { gap: 0; }
  .foot-col ul { gap: 0; }
  td a, .entry-note a { display: inline-flex; align-items: center; min-height: 32px; }
}
@media (pointer: coarse) and (max-width: 39.99rem) { :root { --header-h: 120px; } }
