/* ardana.ai's materials, at work: white paper, near-black ink, one gray, hairlines, and a pale terminal gray behind
   everything the API reads or returns. Onest for words, Geist Mono for what a terminal or the API reads. No hue but
   one red, for a fault. The dark scheme is the brand kit's inverse (white on #0a0a0a) and follows the system. */

:root {
  color-scheme: light dark;

  /* The landing's tokens (ardana.ai `src/app.css`), names and values kept. */
  --bg: #ffffff;
  --ink: #0a0a0a;
  --muted: #666666;
  --line: #ececec;
  --accent: #0a0a0a;
  --accent-hover: #2b2b2b;
  --on-accent: #ffffff;
  --code-bg: #f4f4f4;
  --code-ink: #0a0a0a;
  --code-muted: #8a8a8a;
  --code-hover: rgb(10 10 10 / 0.07);
  --focus: #0a0a0a;
  --selection: rgb(10 10 10 / 0.12);

  /* The playground's own, each derived from the landing's: a bar's track is its hairline; a bar that is not the answer
     is its code gray one step darker, the nearest value that holds 3:1 on that track (WCAG 1.4.11); the drawer's scrim
     is its ink at 40%; and one red, with two tints, for faults only. */
  --track: #ececec;
  --bar: #858585;
  --scrim: rgb(10 10 10 / 0.4);
  --danger: #b42318;
  --danger-tint: #fdf0ef;
  --danger-tint-2: #f9dcd9;

  --font: "Onest Variable", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono Variable", ui-monospace, "SF Mono", Menlo, monospace;

  --text-12: 0.75rem;
  --text-13: 0.8125rem;
  --text-14: 0.875rem;
  --text-15: 0.9375rem;
  --text-17: 1.0625rem;
  --text-22: 1.375rem;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;

  --radius: 10px;
  --radius-inner: 6px;
  --radius-pill: 999px;

  --sidebar: 256px;
  --topbar: 70px;
  --gutter: clamp(16px, 4vw, 48px);
  /* The top bar's and the banner's rendered heights, and the height of the banner's last row when its download bar and
     Stop take a row of their own, which the page keeps current (`ui::topbar::follow_heights`): the bar wraps on the
     narrowest screens and with large text, and the banner's lines follow its words. */
  --topbar-height: var(--topbar);
  --banner-height: 0px;
  --banner-row-height: 0px;
  /* What of them stays on screen while the page scrolls under them: the bar, and of the in-flight banner all of it, or
     its last row, or nothing, whatever keeps them within a third of the viewport (the root's `banner-row`,
     `banner-loose` and `topbar-loose`, kept by the same function). */
  --topbar-stuck: var(--topbar-height);
  --banner-stuck: var(--banner-height);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 150ms;
  --normal: 200ms;
}

/* The logo kit's inverse: the brand's ink turns white (the logo, the Run pill, the focus ring), text a soft white. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --ink: #ededed;
    --muted: #a1a1a1;
    --line: #262626;
    --accent: #ffffff;
    --accent-hover: #dedede;
    --on-accent: #0a0a0a;
    --code-bg: #171717;
    --code-ink: #ededed;
    --code-muted: #7a7a7a;
    --code-hover: rgb(255 255 255 / 0.08);
    --focus: #ffffff;
    --selection: rgb(255 255 255 / 0.2);

    --track: #262626;
    --bar: #7a7a7a;
    --scrim: rgb(0 0 0 / 0.6);
    --danger: #ff7b72;
    --danger-tint: #2a1311;
    --danger-tint-2: #4a1d19;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Past a third of the viewport the bars let go: the banner's words scroll away under the bar, then the whole banner,
   then the bar itself (a page zoomed far, or its text enlarged on a small screen). */
:root.banner-row {
  --banner-stuck: var(--banner-row-height);
}

:root.banner-loose {
  --banner-stuck: 0px;
}

:root.topbar-loose {
  --topbar-stuck: 0px;
}

/* Whatever the page scrolls to, by a jump or by Tab in either direction, lands under the sticky top bar, never behind
   it (WCAG 2.4.11). */
html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-stuck) + var(--space-3));
  scrollbar-color: var(--code-muted) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--text-15) / 1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: var(--ink);
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
pre {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  margin: 0;
}

a {
  color: inherit;
}

/* Inline code: a string the API reads, in the terminal's voice on its gray. */
code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--code-ink);
}

::selection {
  background: var(--selection);
  color: var(--ink);
}

/* The landing's focus: a 2px ink ring, 3px out. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* Thin scrollbars on the panes that scroll, in the page's own grays. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--code-muted) transparent;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Secondary text: the pencil-gray voice. */
.muted {
  color: var(--muted);
}

/* A fault line under a field: red only for what was refused. It is text tied to its field, never a live region. */
.fault-line {
  color: var(--danger);
  font-size: var(--text-13);
  line-height: 1.4;
}

.fault-line:empty {
  display: none;
}

/* Icons are drawn like the landing's: a 16-unit grid, one round stroke, current colour. */
.icon {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 14px;
  height: 14px;
}

/* The logo kit's horizontal lockup, inline in the brand's ink: #0a0a0a, white on dark (the kit allows nothing else);
   never recoloured, stretched or outlined. */
.logo {
  display: inline-flex;
  flex: none;
  color: var(--accent);
}

.logo > svg {
  display: block;
  height: 26px;
  width: auto;
}

/* The lockup's one drawing, which every logo uses: it takes no room of its own. */
.logo-symbol {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* The landing's one ornament: a blinking block caret, here while a run is in flight. */
.caret {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 0.18em;
  vertical-align: -0.14em;
  background: currentColor;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Reduced motion keeps every state and drops only the movement: each stylesheet turns its own transitions off, and
   the caret holds steady after the label, so a run in flight still shows. */
@media (prefers-reduced-motion: reduce) {
  .caret {
    animation: none;
  }
}

@media (forced-colors: active) {
  :focus-visible {
    outline-color: Highlight;
  }

  .caret {
    forced-color-adjust: none;
    background: ButtonText;
  }
}
