/*
  Orrery design language, v0.2
  "Orrery" is a working title. The name may change; these tokens should not need to.

  Load the three typefaces before this file:
  https://fonts.googleapis.com/css2?family=Syne:wght@400..800&family=Instrument+Sans:wght@400..700&family=DM+Mono:wght@400;500&display=swap

  Put class="o-root" on the outermost element of a page or screen.
  Everything responds to the width of .o-root, not the window, so a screen
  behaves the same in a browser, an embed or a design canvas.

  The page is off-white with chocolate ink. Two blocks change the ground
  for whatever sits inside them, and every part follows:
    .o-on-cocoa   a chocolate block with cream ink
    .o-on-lava    an orange block with chocolate ink

  Rules that hold the look together:
  1. Reading happens on off-white or white, in chocolate.
  2. Orange is for fills, artwork and big type. Small orange text uses --label.
  3. One hard shadow per group, on the thing a person should act on.
*/

.o-root {
  /* colour */
  --ground: #F7F2E8;      /* the page: off-white */
  --surface: #FFFFFF;     /* cards */
  --surface-2: #EFE8DA;   /* fields at rest, key chips, quiet fills */
  --ink: #341E13;         /* chocolate: text and lines */
  --ink-2: #5A4334;       /* secondary text */
  --quiet: #7A6455;       /* captions and hints */
  --line: rgba(52, 30, 19, 0.2);  /* hairlines inside a surface */
  --lead: #FF5A1F;        /* orange: primary fills, artwork */
  --on-lead: #341E13;     /* text on an orange fill */
  --lead-text: #D9430B;   /* orange dark enough for type 24px and up */
  --label: #B5390B;       /* orange dark enough for small labels */
  --attn: #341E13;        /* flags and counts */
  --on-attn: #FFF1DC;
  --shadow: #341E13;      /* the hard shadow */
  --stop: #FF5A1F;        /* the full stop that ends a headline */
  --art-ground: #341E13;  /* behind a liquid strip */

  /* type */
  --font-display: 'Syne', 'Arial Black', Arial, sans-serif;
  --font-body: 'Instrument Sans', system-ui, 'Segoe UI', Arial, sans-serif;
  --font-mono: 'DM Mono', 'SF Mono', Menlo, monospace;

  /* shape */
  --stroke: 1.5px;
  --radius-card: 18px;
  --radius-field: 12px;
  --radius-pill: 999px;
  --shadow-hard: 0 6px 0 var(--shadow);
  --shadow-hard-sm: 0 4px 0 var(--shadow);

  /* space: 4, 8, 12, 16, 20, 24, 28, 40, 56 */
}

/* A chocolate block. Code blocks and run logs always sit on one. */
.o-on-cocoa, .o-root .o-code, .o-root .o-card--cocoa {
  --ground: #341E13;
  --surface: #43291B;
  --surface-2: #4F3323;
  --ink: #FFF1DC;
  --ink-2: #EBD9C3;
  --quiet: #CBB39C;
  --line: rgba(255, 241, 220, 0.26);
  --lead: #FF5A1F;
  --on-lead: #341E13;
  --lead-text: #FF5A1F;
  --label: #FF7A45;
  --attn: #FF5A1F;
  --on-attn: #341E13;
  --shadow: #FF5A1F;
  --stop: #FF5A1F;
  --art-ground: #24140C;
}
.o-on-cocoa { background: var(--ground); color: var(--ink); }

/* An orange block. */
.o-on-lava, .o-root .o-card--lava {
  --ground: #FF5A1F;
  --surface: #FFFFFF;
  --surface-2: #FFE2D3;
  --ink: #341E13;
  --ink-2: #341E13;
  --quiet: #341E13;
  --line: rgba(52, 30, 19, 0.35);
  --lead: #341E13;
  --on-lead: #FFF1DC;
  --lead-text: #341E13;
  --label: #341E13;
  --attn: #341E13;
  --on-attn: #FFF1DC;
  --shadow: #341E13;
  --stop: #FFF1DC;
  --art-ground: #341E13;
}
.o-on-lava { background: var(--ground); color: var(--ink); }

/* ---- base ---------------------------------------------------------------- */

.o-root {
  container-type: inline-size;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.o-root *, .o-root *::before, .o-root *::after { box-sizing: border-box; }
.o-root a { color: var(--ink); text-decoration-color: var(--lead); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.o-root a:hover { color: var(--label); }
.o-root :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.o-root img { max-width: 100%; }
.o-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- type ---------------------------------------------------------------- */

.o-display { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(38px, 8.3cqw, 60px); line-height: 0.98; letter-spacing: -0.02em; }
.o-h1 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 5cqw, 40px); line-height: 1.02; letter-spacing: -0.02em; }
.o-h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 27px; line-height: 1.05; letter-spacing: -0.01em; }
.o-h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.15; }
.o-lead { margin: 0; font-size: 18px; line-height: 1.45; color: var(--ink-2); max-width: 62ch; }
.o-p { margin: 0; }
.o-small { margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.o-quiet { color: var(--quiet); }
.o-kicker { margin: 0; font-family: var(--font-mono); font-weight: 500; font-size: 12px; line-height: 1.3; color: var(--label); }
.o-label { margin: 0; font-family: var(--font-mono); font-weight: 500; font-size: 10.5px; line-height: 1.2; letter-spacing: 0.08em; text-transform: uppercase; color: var(--label); }
.o-mono { font-family: var(--font-mono); font-size: 12.5px; }
.o-stop { color: var(--stop); }
.o-lead-text { color: var(--lead-text); }  /* big type only */

/* ---- layout helpers ------------------------------------------------------ */

.o-stack { display: flex; flex-direction: column; gap: 12px; }
.o-stack--sm { gap: 6px; }
.o-stack--lg { gap: 24px; }
.o-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.o-row--between { justify-content: space-between; }
.o-row--top { align-items: flex-start; }
.o-row--base { align-items: baseline; }
.o-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); }
.o-grid--wide { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.o-split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.o-split > .o-split__main { flex: 3 1 460px; min-width: 0; }
.o-split > .o-split__side { flex: 1 1 280px; min-width: 0; }
.o-page { max-width: 1120px; margin: 0 auto; padding: 28px 32px 56px; }

/* ---- wordmark ------------------------------------------------------------ */

.o-wordmark { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.o-wordmark svg { display: block; width: 28px; height: 28px; flex: none; }
.o-wordmark svg ellipse { stroke: var(--lead); }  /* the mark is orange, and chocolate on an orange block */
.o-wordmark svg circle { fill: var(--lead); }
.o-wordmark--sm { font-size: 22px; gap: 8px; }
.o-wordmark--sm svg { width: 24px; height: 24px; }

/* ---- pills, flags, status ------------------------------------------------ */

.o-pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; line-height: 1; padding: 6px 12px; border: var(--stroke) solid var(--ink); border-radius: var(--radius-pill); white-space: nowrap; }
.o-pill--solid { background: var(--ink); color: var(--ground); }
.o-pill--quiet { border-color: var(--line); color: var(--quiet); }
.o-flag { display: inline-flex; align-items: center; font-family: var(--font-body); font-weight: 700; font-size: 12px; line-height: 1; padding: 6px 11px; border-radius: var(--radius-pill); background: var(--attn); color: var(--on-attn); white-space: nowrap; }
.o-count { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: var(--radius-pill); background: var(--lead); color: var(--on-lead); font-weight: 700; font-size: 12px; line-height: 22px; text-align: center; }
.o-status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; line-height: 1.3; color: var(--ink-2); }
.o-status::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--lead); box-shadow: inset 0 0 0 1.5px var(--ink); }
.o-status--off::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--quiet); }

/* ---- buttons ------------------------------------------------------------- */

.o-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border: var(--stroke) solid var(--ink); border-radius: var(--radius-pill); background: transparent; color: var(--ink); font-family: var(--font-body); font-weight: 700; font-size: 15px; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; }
.o-btn:hover, .o-root a.o-btn:hover { background: var(--ink); color: var(--ground); }
.o-btn--primary { background: var(--lead); color: var(--on-lead); box-shadow: var(--shadow-hard-sm); }
.o-btn--primary:hover, .o-root a.o-btn--primary:hover { background: var(--lead); color: var(--on-lead); transform: translateY(1px); box-shadow: 0 3px 0 var(--shadow); }
.o-btn--primary:active { transform: translateY(4px); box-shadow: none; }
.o-root a.o-btn--primary { color: var(--on-lead); }

/* ---- cards --------------------------------------------------------------- */

.o-card { background: var(--surface); color: var(--ink); border: var(--stroke) solid var(--ink); border-radius: var(--radius-card); padding: 16px 18px; }
.o-card--raised { box-shadow: var(--shadow-hard); }
.o-card--plain { background: transparent; }
.o-root .o-card--cocoa, .o-root .o-card--lava { background: var(--ground); color: var(--ink); border-color: #341E13; }  /* the one loud statement on a page */

/* ---- trust ladder -------------------------------------------------------- */

.o-ladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.o-ladder span { height: 9px; border-radius: var(--radius-pill); border: var(--stroke) solid var(--ink); }
.o-ladder span.on { background: var(--lead); }
.o-rung { font-family: var(--font-mono); font-weight: 500; font-size: 11.5px; line-height: 1.2; color: var(--label); white-space: nowrap; }

/* ---- ruled list ---------------------------------------------------------- */

.o-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border-bottom: var(--stroke) solid var(--ink); }
.o-list > li { display: flex; align-items: baseline; gap: 14px; padding: 9px 0; border-top: var(--stroke) solid var(--ink); }
.o-list .n { flex: none; font-family: var(--font-mono); font-weight: 500; font-size: 11px; line-height: 1; color: var(--label); }
.o-list .t { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.15; }
.o-list--plain { border-bottom: 0; }
.o-list--plain > li { border-top: 1px solid var(--line); padding: 11px 0; }
.o-list--plain > li:first-child { border-top: 0; }

/* ---- fields and keys ----------------------------------------------------- */

.o-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.o-field > label, .o-field > .o-field__label { font-weight: 700; font-size: 13px; line-height: 1.2; }
.o-input { width: 100%; min-height: 46px; padding: 0 14px; border: var(--stroke) solid var(--ink); border-radius: var(--radius-field); background: var(--surface); color: var(--ink); font: inherit; }
.o-input::placeholder { color: var(--quiet); }
.o-key { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.3; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); }

/* ---- code and run logs --------------------------------------------------- */

.o-root .o-code { margin: 0; overflow-x: auto; background: var(--ground); border: var(--stroke) solid #341E13; border-radius: var(--radius-card); padding: 18px 20px; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.o-code .call { color: var(--label); font-weight: 500; }
.o-code .ok { color: var(--label); }
.o-code .dim { color: var(--quiet); }
.o-code .cmd { color: var(--ink); }
.o-note { font-family: var(--font-body); font-size: 15px; line-height: 1.45; color: var(--ink); padding: 10px 14px; border: 1.5px dashed var(--quiet); border-radius: 10px; }

/* ---- tables -------------------------------------------------------------- */

.o-table-wrap { overflow-x: auto; background: var(--surface); border: var(--stroke) solid var(--ink); border-radius: var(--radius-card); }
.o-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.35; }
.o-table th { text-align: left; white-space: nowrap; padding: 12px 14px; border-bottom: var(--stroke) solid var(--ink); font-family: var(--font-mono); font-weight: 500; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--label); }
.o-table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.o-table tbody tr:first-child td { border-top: 0; }
.o-table .num { font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }
.o-table td.miss { background: var(--lead); color: var(--on-lead); font-weight: 500; }
.o-table .strong { font-weight: 700; }

/* ---- app shell ----------------------------------------------------------- */

.o-shell { display: flex; flex-wrap: wrap; align-items: stretch; }
.o-side { flex: 1 1 214px; display: flex; flex-direction: column; gap: 20px; padding: 22px 18px; border-right: var(--stroke) solid #341E13; }
.o-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; padding: 30px 36px 48px; }
.o-company { font-weight: 600; font-size: 14px; line-height: 1.2; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.o-nav { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.o-nav a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px; font-weight: 600; font-size: 15px; line-height: 1; color: var(--ink); text-decoration: none; }
.o-nav a:hover { background: var(--surface-2); color: var(--ink); }
.o-nav a[aria-current="page"] { background: var(--ink); color: var(--ground); }
.o-side__foot { margin-top: auto; }
.o-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 32px; border-bottom: var(--stroke) solid #341E13; }

@container (max-width: 760px) {
  .o-side { border-right: 0; border-bottom: var(--stroke) solid #341E13; }
  .o-nav { flex-direction: row; flex-wrap: wrap; }
  .o-side__foot { margin-top: 0; }
  .o-main { padding: 24px 18px 40px; }
  .o-page { padding: 22px 18px 40px; }
  .o-bar { padding: 16px 18px; }
}

/* ---- steps --------------------------------------------------------------- */

.o-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.o-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: var(--stroke) solid var(--line); border-radius: var(--radius-pill); font-family: var(--font-mono); font-size: 12px; line-height: 1; color: var(--quiet); }
.o-steps li.done { border-color: var(--ink); color: var(--ink); }
.o-steps li.now { border-color: var(--ink); background: var(--lead); color: var(--on-lead); }

/* ---- conversation -------------------------------------------------------- */

.o-chat { display: flex; flex-direction: column; gap: 12px; }
.o-bubble { align-self: flex-start; max-width: 80%; padding: 10px 14px; border: var(--stroke) solid var(--ink); border-radius: 16px 16px 16px 4px; background: var(--surface-2); }
.o-bubble--me { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--ink); color: var(--ground); font-weight: 600; }
.o-toolcall { align-self: flex-start; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 10px; border: 1.5px dashed var(--quiet); border-radius: 8px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.3; color: var(--ink-2); }
.o-toolcall b { font-weight: 500; color: var(--label); }

/* ---- long reading (the book and the essays) ------------------------------ */

.o-prose { max-width: 66ch; font-size: 18px; line-height: 1.65; }
.o-prose > * { margin: 0 0 1.1em; }
.o-prose h2 { margin: 1.8em 0 0.5em; font-family: var(--font-display); font-weight: 800; font-size: 27px; line-height: 1.1; letter-spacing: -0.01em; }
.o-prose strong { font-weight: 700; }
.o-turn { margin: 1.3em 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(25px, 4.4cqw, 34px); line-height: 1.08; letter-spacing: -0.015em; color: var(--lead-text); }

/* ---- artwork ------------------------------------------------------------- */

.o-strip { display: block; width: 100%; height: 40px; object-fit: cover; background: var(--art-ground); }
.o-art { color: var(--ink); }  /* inline artwork draws its lines in currentColor */
