/* The catalogue's pages (/projects/, /projects/<id>, /pricing, /agents): their own content
   inside the shared frame. The frame's stylesheet styles the header, the footer and the
   skip link; this sheet styles only what sits in <main class="cat-main">, with the tokens,
   type and pills of the three.js pages (story/src/base.css). */

@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(/assets/fonts/inter-tight-latin.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/ibm-plex-mono-400-latin.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/ibm-plex-mono-500-latin.woff2) format('woff2'); }
@font-face { font-family: 'RER Display'; font-style: normal; font-weight: 400 700; font-stretch: 75% 125%; font-display: swap; src: url(/assets/fonts/rer-display.woff2) format('woff2'); }

:root {
  color-scheme: dark;
  --cat-ink: #000;
  --cat-panel: #0f0f0e;
  --cat-panel-2: #181816;
  --cat-paper: #f3f1ec;
  --cat-text: #ecebe7;
  --cat-soft: #d9d8d3;
  --cat-faint: #a9a8a4;
  --cat-line: rgba(236, 235, 231, 0.18);
  --cat-line-strong: rgba(236, 235, 231, 0.5);
  --cat-available: #a7e3b4;
  --cat-building: #f0cf8a;
  /* The plain pages' gutter (frame/site/base.css), which the frame's header and
     footer also read, so every page's content starts under the wordmark. */
  --gutter: clamp(16px, 5.21vw, 80px);
  --cat-gutter: var(--gutter);
  --cat-ui: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --cat-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

/* RER Display, the RER lettering as a variable font (frame/site/base.css sets the same
   face and class for the plain pages); its em is the cap height. */
.rer-display { font-family: 'RER Display', var(--cat-ui); font-weight: 700; font-stretch: 100%; font-synthesis: none; font-kerning: normal; line-height: 1.18; letter-spacing: 0; text-transform: uppercase; }
.rer-wordmark-forms { font-feature-settings: 'ss01'; }

html, body.cat-page { margin: 0; background: var(--cat-ink); color: var(--cat-text); font-family: var(--cat-ui); -webkit-font-smoothing: antialiased; }
.cat-main { display: block; padding: var(--rer-space-top) 0 var(--rer-space-end); font-size: 17px; line-height: var(--rer-leading); }
.cat-main *, .cat-main *::before, .cat-main *::after { box-sizing: border-box; }
.cat-wrap { width: 100%; padding: 0 var(--cat-gutter); overflow-wrap: anywhere; }

.cat-main a { color: var(--cat-paper); text-decoration: underline; text-decoration-color: var(--cat-line-strong); text-underline-offset: 0.18em; }
.cat-main a:hover { text-decoration-color: currentColor; }
.cat-main a:focus-visible, .cat-main pre:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 4px; }
.cat-main code, .cat-main pre { font-family: var(--cat-mono); font-size: 0.86em; }
.cat-main p code, .cat-main dd code, .cat-main li code { color: var(--cat-soft); }

/* Headings and the hero */
.cat-main h1, .cat-main h2, .cat-main h3 { color: var(--cat-paper); font-weight: 500; letter-spacing: -0.01em; }
.cat-main h1 { margin: 0; font-size: clamp(40px, 5.4vw, 92px); font-weight: 600; line-height: 1.02; letter-spacing: -0.025em; text-wrap: balance; }
.cat-main h2 { margin: 0 0 16px; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.15; }
.cat-main h3 { margin: 48px 0 14px; font-size: 20px; line-height: 1.3; }
.cat-hero { max-width: 980px; }
.cat-eyebrow, .cat-crumbs { margin: 0 0 clamp(24px, 2.4vw, 36px); font: 400 13px/1.4 var(--cat-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--cat-faint); }
.cat-crumbs a { color: var(--cat-soft); }
.cat-lede { margin: calc(var(--rer-space-inset) + 4px) 0 0; max-width: 34em; font-size: clamp(19px, 1.6vw, 26px); font-weight: 300; line-height: 1.45; color: var(--cat-text); }
.cat-note { margin: 24px 0 0; max-width: var(--rer-measure); color: var(--cat-soft); }
.cat-hero__status { margin: 24px 0 0; }
.cat-none { color: var(--cat-faint); font-style: italic; }

/* Calls to action (the pills of the three.js pages) */
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: calc(var(--rer-space-inset) + 8px); }
.cat-main .cat-pill { --rer-h: 48px; display: inline-flex; align-items: center; gap: 0.5em; min-height: var(--rer-h); padding: 0 26px; border-radius: calc(var(--rer-h) * var(--rer-corner)) var(--rer-radius); font-weight: 500; text-decoration: none; white-space: nowrap; }
.cat-main .cat-pill--solid { background: var(--cat-paper); color: #0d0d0d; }
.cat-main .cat-pill--solid:hover { background: #fff; }
.cat-main .link-arrow { display: inline-flex; align-items: center; gap: 0.4em; min-height: 44px; font-weight: 500; text-decoration: none; }
.cat-main .link-arrow:hover { text-decoration: underline; }

/* Availability */
.cat-status { --rer-h: calc(1lh + 8px); display: inline-block; padding: 3px 10px; border: 1px solid currentColor; border-radius: calc(var(--rer-h) * var(--rer-corner)) var(--rer-radius); font: 500 12px/1.4 var(--cat-mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.cat-status--installable { color: var(--cat-available); }
.cat-status--in-development { color: var(--cat-building); }

/* Sections */
.cat-section { margin-top: var(--rer-space-section); padding-top: var(--rer-space-inset); border-top: 1px solid var(--cat-line); }
.cat-section > p { max-width: var(--rer-measure); color: var(--cat-soft); }
.cat-section--quiet h2 { font-size: 22px; }

/* Facts and rows */
.cat-facts, .cat-rows { margin: calc(var(--rer-space-inset) + 8px) 0 0; padding: 0; }
.cat-facts > div, .cat-rows > div { display: grid; grid-template-columns: minmax(120px, 15em) 1fr; gap: 8px var(--rer-space-label); padding: 18px 0; border-top: 1px solid var(--cat-line); }
.cat-facts dt, .cat-rows dt { color: var(--cat-faint); font-size: 15px; }
.cat-facts dd, .cat-rows dd { margin: 0; }
.cat-sublist { margin: 0; padding-left: 1.1em; }
.cat-key { color: var(--cat-faint); }
.cat-rows .cat-rows { margin-top: 12px; }

/* Lists */
.cat-list { margin: 20px 0 0; padding-left: 1.2em; max-width: var(--rer-measure); }
.cat-list li { margin: 10px 0; }
.cat-tokens { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.cat-tokens li { --rer-h: calc(1lh + 10px); padding: 4px 10px; border: 1px solid var(--cat-line); border-radius: calc(var(--rer-h) * var(--rer-corner)) var(--rer-radius); }
.cat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 32px 0 0; padding: 0; list-style: none; }
.cat-cards li { padding: 28px 32px; background: var(--cat-panel); border: 1px solid var(--cat-line); border-radius: 14px; }
.cat-cards h3 { margin-top: 0; }
.cat-cards p { margin: 0; color: var(--cat-soft); }

/* Code */
/* Commands wrap inside the box, so a long one (a clone URL) stays whole and readable on a
   phone rather than running off its edge; a wrapped command's continuation is indented
   under it (a hanging indent from each command's start), so it never reads as another. */
.cat-code { margin: 24px 0 0; max-width: 100%; padding: 22px 24px; overflow-x: auto; background: var(--cat-panel); border: 1px solid var(--cat-line); border-radius: 12px; color: var(--cat-text); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; text-indent: 2ch hanging each-line; }

/* A project page */
/* Screenshots differ in height (a tall capture beside a wide one): they flow down columns,
   each figure its own image's height, so no row stretches a short one into an empty panel.
   A very tall capture shows its top, at most 5:4 of its width, and links to the whole. */
.cat-shots { columns: 2 360px; column-gap: 24px; margin-top: 32px; }
.cat-shots figure { container-type: inline-size; margin: 0 0 24px; break-inside: avoid; border: 1px solid var(--cat-line); border-radius: 12px; overflow: hidden; background: var(--cat-panel-2); }
.cat-shots a { display: block; }
.cat-shots img { display: block; width: 100%; height: auto; max-height: 125cqw; object-fit: cover; object-position: top left; }
.cat-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.cat-group span { font-size: 14px; font-weight: 400; color: var(--cat-faint); }
.cat-clauses { margin: 0; padding: 0; list-style: none; }
.cat-clauses li { display: grid; grid-template-columns: minmax(100px, 11em) 1fr; gap: 8px 32px; padding: 20px 0; border-top: 1px solid var(--cat-line); }
.cat-clauses li > code { color: var(--cat-faint); }
.cat-clauses strong { color: var(--cat-paper); font-weight: 500; }
.cat-docs dt a { text-decoration: none; }

/* The plans: the slab, its columns and the comparison table are the language's
   (story/src/language/language.css, .rer-plans). Two plan parts stay here: the
   availability tag (a .rer-tag drawn by this class, its capsule a ::before) and
   the call to action's button shape (the rest is .rer-btn). */
.plan__status { --rer-h: 24px; display: inline-flex; align-items: center; gap: 8px; height: var(--rer-h); padding: 0 9px; border: 1px solid var(--rer-line); border-radius: calc(var(--rer-h) * var(--rer-corner)) var(--rer-radius); color: var(--rer-ink); font: 400 12px/1 var(--cat-mono); letter-spacing: 0; text-transform: lowercase; white-space: nowrap; }
.plan__status::before { content: ''; flex: none; width: 10px; height: 4px; border-radius: var(--rer-radius); background: currentColor; }
.plan__cta .btn { --rer-h: 48px; border-radius: calc(var(--rer-h) * var(--rer-corner)) var(--rer-radius); }

@media (max-width: 640px) {
  .cat-main { font-size: 16px; }
  .cat-facts > div, .cat-rows > div, .cat-clauses li { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  :root { --gutter: 16px; }
}

