/* ccbrief docs. One page, no build step.
   The page borrows its look from the product: terminal blocks use the same GitHub Dark
   palette as the demo GIF, and the only bright colors are the ones the status line
   itself prints (context magenta, timer green, tokens yellow, model cyan). Everything
   around them stays quiet so the docs are easy to read. */

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('fonts/atkinson-hyperlegible-next.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --page: #f6f7f9;
  --ink: #1b1f24;
  --muted: #57606a;
  --rule: #dde2e7;
  --raised: #ffffff;
  --code-bg: #e9edf1;
  --accent: #0a6870;
  --cc: #c15f3c;

  /* The terminal: identical in both page themes, as a real terminal would be. */
  --term: #101216;
  --term-ink: #c9d1d9;
  --term-dim: #8b949e;
  --term-rule: #30363d;
  --term-edge: transparent;
  --t-mag: #db61a2;
  --t-grn: #56d364;
  --t-yel: #e3b341;
  --t-cyn: #39c5cf;

  --sans: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --gutter: 16px;
  --wide: 64rem;
  color-scheme: light dark;
}

/* Dark follows the OS until the reader picks a theme with the header button, which
   sets data-theme on <html>. The dark values are written twice (once for the OS
   setting, once for the button) because the page has no build step to share them. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #16191d;
    --ink: #e2e6ea;
    --muted: #9aa4af;
    --rule: #2b3138;
    --raised: #1f242a;
    --code-bg: #242a31;
    --accent: #4fc3cc;
    --cc: #d97757;
    /* The page is already dark, so the terminal needs an edge to stand apart. */
    --term-edge: #30363d;
  }
}
:root[data-theme="dark"] {
  --page: #16191d;
  --ink: #e2e6ea;
  --muted: #9aa4af;
  --rule: #2b3138;
  --raised: #1f242a;
  --code-bg: #242a31;
  --accent: #4fc3cc;
  --cc: #d97757;
  --term-edge: #30363d;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

@media (min-width: 40rem) {
  :root { --gutter: 24px; }
}

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

html { scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  z-index: 20;
  padding: .5rem .75rem;
  background: var(--ink);
  color: var(--page);
}
.skip:focus { top: .5rem; }

/* ---------- Top bar ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--page);
  border-bottom: 1px solid var(--rule);
}
.top-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: .7rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* The logo is the word itself: Claude Code's orange on "cc", fading into the text
   color across "brief". site/favicon.svg carries the same orange "cc". */
.brand {
  font: 800 1.3125rem/1 var(--sans);
  letter-spacing: -.03em;
  color: var(--ink);
  text-decoration: none;
}
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .brand {
    background: linear-gradient(90deg, var(--cc) 0 28%, var(--ink) 78%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
/* High-contrast modes drop backgrounds, so the clipped text would vanish. */
@media (forced-colors: active) {
  .brand { background: none; color: LinkText; }
}

.top-links {
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .9375rem;
}
.top-links a { color: var(--muted); text-decoration: none; }
.top-links a:hover { color: var(--ink); text-decoration: underline; }
/* Push the links right so the theme button sits after them, not between. */
.top-links { margin-left: auto; }

/* Theme button. It shows the theme you would switch to: a moon on light, a sun on
   dark. Hidden in the HTML and revealed by the script, so it never shows without JS. */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
.theme-toggle svg { width: 1rem; height: 1rem; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
@media (max-width: 24rem) {
  .top-links { gap: .9rem; }
}

/* ---------- Hero ---------- */

.hero {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 3.5rem var(--gutter) 1rem;
}

h1, h2, h3 { color: var(--ink); text-wrap: balance; }

.hero h1 {
  font-size: clamp(2.25rem, 1.3rem + 3.8vw, 3.5rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.025em;
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 38rem;
  margin: 0 0 2.25rem;
}

/* The annotated status line. */
.anatomy { margin: 0; }

.term {
  background: var(--term);
  color: var(--term-ink);
  border: 1px solid var(--term-edge);
  border-radius: 10px;
  padding-bottom: 1.4rem;
  overflow: hidden;
}
.term-bar { display: flex; gap: 7px; padding: .8rem 1rem .4rem; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }

.prompt {
  font: 1rem/1.5 var(--mono);
  margin: 0 0 1.1rem;
  padding: .5rem 1.25rem .9rem;
  border-bottom: 1px solid var(--term-rule);
}
.cursor {
  display: inline-block;
  width: .55em;
  height: 1.15em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--term-ink);
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.t-dim { color: var(--term-dim); }
.t-mag { color: var(--t-mag); }
.t-grn { color: var(--t-grn); }
.t-cyn { color: var(--t-cyn); font-weight: 700; }

.line {
  list-style: none;
  margin: 0;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  row-gap: 1rem;
  font: 1.125rem/1.5 var(--mono);
}
.line li { display: flex; }
.line li + li::before {
  content: '│' / '';
  color: var(--term-dim);
  padding: 0 .6ch;
}
.seg { display: inline-flex; flex-direction: column; }
.v { white-space: pre; }

/* Each label sits under a bracket the exact width of its segment, so it is clear
   which characters belong to which field. `width: 0; min-width: 100%` lets a long
   label wrap instead of widening the segment. */
.k {
  width: 0;
  min-width: 100%;
  margin-top: .45rem;
  font: .8125rem/1.3 var(--sans);
  color: var(--term-dim);
}
.k::before {
  content: '';
  display: block;
  height: 6px;
  margin-bottom: .4rem;
  border: 1px solid #484f58;
  border-top: 0;
}

/* On a phone the line can't fit, so it becomes a key: value, then what it is. */
@media (max-width: 40rem) {
  .line { flex-direction: column; gap: .7rem; font-size: 1rem; }
  .line li + li::before { display: none; }
  .seg { flex-direction: row; align-items: baseline; gap: 1rem; }
  .v { min-width: 14ch; }
  .k { width: auto; min-width: 0; margin: 0; font-size: .875rem; }
  .k::before { display: none; }
}

.get {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.5rem;
  margin: 1.5rem 0 0;
}
.get pre { margin: 0; }
.get p { margin: 0; color: var(--muted); font-size: .9375rem; max-width: 30rem; }

.demo { margin: 3rem 0 0; }
.demo img { border-radius: 10px; }

.note {
  margin: 2rem 0 0;
  max-width: 42rem;
  padding: .1rem 0 .1rem 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
  font-size: .9375rem;
}
.note strong { color: var(--ink); }

/* ---------- Docs: contents + body ---------- */

.docs {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter) 4rem;
}
.content { max-width: 42rem; min-width: 0; }

.toc {
  margin: 3rem 0 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: .9375rem;
}
.toc h2 { font-size: .9375rem; color: var(--muted); margin: 0 0 .5rem; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

/* Phones: just the top-level sections, wrapped onto a couple of lines. */
@media (max-width: 59.99rem) {
  .toc > ul { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; }
  .toc ul ul { display: none; }
}

/* Wide screens: the contents stay in view beside the text. */
@media (min-width: 60rem) {
  .docs {
    display: grid;
    grid-template-columns: 11rem minmax(0, 42rem);
    gap: 4rem;
  }
  .toc {
    position: sticky;
    top: 4.5rem;
    align-self: start;
    margin-top: 4rem;
    padding: 0;
    border: 0;
  }
  .toc li { margin: .15rem 0; }
  .toc ul ul { margin: .15rem 0 .35rem; padding-left: .9rem; border-left: 1px solid var(--rule); }
  .toc ul ul a { color: var(--muted); }
}

.content section { padding-top: 3rem; }
.content section + section { border-top: 1px solid var(--rule); margin-top: 3rem; }

h2 { font-size: 1.625rem; font-weight: 750; line-height: 1.2; letter-spacing: -.015em; margin: 0 0 1rem; }
h3 { font-size: 1.1875rem; font-weight: 700; line-height: 1.3; margin: 2.25rem 0 .5rem; }

p { margin: 0 0 1rem; }

.small { font-size: .9375rem; color: var(--muted); }

.callout {
  padding: .8rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--accent) 8%, var(--page));
}

/* ---------- Code ---------- */

code, kbd, pre { font-family: var(--mono); }

:not(pre) > code {
  font-size: .85em;
  background: var(--code-bg);
  padding: .12em .36em;
  border-radius: 4px;
}

kbd {
  display: inline-block;
  min-width: 1.75em;
  padding: .05em .45em;
  font-size: .8125em;
  line-height: 1.5;
  text-align: center;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 5px;
}

/* Every code block is terminal output or a command, so it looks like the terminal.
   Long status lines scroll inside their block, never the page. */
pre {
  margin: 1rem 0 1.25rem;
  padding: .9rem 1.1rem;
  overflow-x: auto;
  background: var(--term);
  color: var(--term-ink);
  border: 1px solid var(--term-edge);
  border-radius: 8px;
  font-size: .875rem;
  line-height: 1.6;
}
pre code { font-size: inherit; }

pre.cmd { position: relative; padding-right: 5.5rem; font-size: .9375rem; }
pre.cmd::before { content: '$ '; color: var(--term-dim); user-select: none; }

.copy {
  position: absolute;
  top: 50%;
  right: .5rem;
  transform: translateY(-50%);
  padding: .2rem .65rem;
  font: .8125rem/1.4 var(--sans);
  color: var(--term-ink);
  background: transparent;
  border: 1px solid #4b535d;
  border-radius: 6px;
  cursor: pointer;
}
.copy:hover { background: #21262d; }

/* ---------- Media ---------- */

figure { margin: 1.5rem 0; }
img { display: block; max-width: 100%; height: auto; border-radius: 8px; }
figcaption { margin-top: .6rem; font-size: .875rem; color: var(--muted); }

/* A small square in the field's terminal color, next to the color's name. */
.swatch { white-space: nowrap; }
.swatch::before {
  content: '';
  display: inline-block;
  width: .7em;
  height: .7em;
  margin-right: .3em;
  border-radius: 2px;
  background: var(--c);
}
.s-mag { --c: var(--t-mag); }
.s-yel { --c: var(--t-yel); }
.s-grn { --c: var(--t-grn); }
.s-cyn { --c: var(--t-cyn); }

/* ---------- Tables ---------- */

.table-scroll { overflow-x: auto; margin: 1.25rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
caption { text-align: left; font-weight: 700; padding-bottom: .5rem; }
th, td {
  text-align: left;
  vertical-align: top;
  padding: .55rem .9rem .55rem 0;
  border-bottom: 1px solid var(--rule);
}
th { font-weight: 600; color: var(--muted); border-bottom-color: var(--muted); }
td:first-child { white-space: nowrap; }

/* ---------- FAQ ---------- */

dt { font-weight: 700; margin-top: 1.5rem; }
dd { margin: .3rem 0 0; }

/* ---------- Footer ---------- */

.foot { border-top: 1px solid var(--rule); }
.foot-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 3rem;
}
.made { font-size: 1.0625rem; max-width: 36rem; }
.links {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
.foot .small { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}
