/* Bobcat Live Captions – shared look. Colours come from config/settings.json (see theme.js). */
@font-face {
  font-family: "Bobcat Display";
  src: url("/assets/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-024F, U+2000-206F, U+20AC, U+2122;
}
:root {
  /* Palette built in OKLCH (lightness, chroma, hue) so equal lightness really looks equal.
     The main colours can be changed in config/settings.json → look. */
  --red: oklch(0.56 0.21 25);          /* Bobcat red */
  --red-dark: oklch(0.43 0.17 24);
  --ink: oklch(0.18 0.006 60);         /* near-black text */
  --paper: oklch(0.98 0.015 80);       /* warm cream page */
  --gold: oklch(0.85 0.16 80);
  --white: oklch(1 0 0);
  --screen-bg: oklch(0.15 0.005 50);   /* dark surfaces: each step up is a lighter, "raised" layer */
  --surface-1: oklch(0.19 0.006 50);
  --surface-2: oklch(0.23 0.007 50);
  --surface-3: oklch(0.28 0.008 50);
  --screen-text: oklch(1 0 0);
  --screen-second: oklch(0.89 0.14 88);
  --ok-bg: oklch(0.95 0.05 150);  --ok-ink: oklch(0.42 0.12 150);
  --warn-bg: oklch(0.96 0.07 90); --warn-ink: oklch(0.48 0.11 75);
  /* Borders are alpha colours so they blend into whatever is behind them */
  --outline: oklch(0.18 0.006 60 / 0.88);       /* the bold "sticker" outline */
  --line-soft: oklch(0.18 0.006 60 / 0.12);
  --line-on-dark: oklch(1 0 0 / 0.12);
  --line-on-dark-strong: oklch(1 0 0 / 0.25);
  --font: "Bobcat Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK SC", system-ui, sans-serif;
  /* Nested corners: inner radius = outer radius − padding */
  --radius: 26px;
  --pad: 18px;
  --radius-inner: calc(var(--radius) - var(--pad));
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; }
.paw { display: inline-block; width: 1em; height: 1em; background: currentColor;
  -webkit-mask: url("/assets/paw.svg") center / contain no-repeat; mask: url("/assets/paw.svg") center / contain no-repeat; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* jersey stripe used on all three screens */
.stripe { height: 10px;
  background: repeating-linear-gradient(-45deg, var(--red) 0 14px, var(--red-dark) 14px 28px);            /* older browsers */
  background: repeating-linear-gradient(-45deg in oklch, var(--red) 0 14px, var(--red-dark) 14px 28px); }

.live-pill { display: inline-flex; align-items: center; gap: .45em; padding: .3em .8em .3em .65em;
  border-radius: 999px; background: var(--red); color: var(--white); font-weight: 800; letter-spacing: .08em;
  font-size: .8em; text-transform: uppercase; }
.live-pill::before { content: ""; width: .6em; height: .6em; border-radius: 50%; background: var(--white); animation: pulse 1.4s infinite; }
.live-pill.off { background: oklch(0.5 0.01 50); }
.live-pill.off::before { animation: none; opacity: .5; }
.live-pill.paused { background: var(--gold); color: var(--ink); }
.live-pill.paused::before { background: var(--ink); animation: none; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .35; transform: scale(.7);} }

.partial { opacity: .62; }
.typing::after { content: "▍"; animation: blink 1s steps(1) infinite; color: var(--red); margin-left: .1em; }
@keyframes blink { 50% { opacity: 0; } }

/* Icon swaps: the outgoing icon blurs as it fades, then the new one fades in */
.ic { display: inline-block; transition: opacity .18s ease, filter .18s ease; }
.ic.out { opacity: 0; filter: blur(4px); }

/* ---------------- Typography rules ---------------- */
/* Labels and buttons: trim the text box to cap-height/baseline so text sits truly centred */
button, .btn, .chip, .lang, .live-pill, kbd, label.f, .pane-head, .card h2 {
  text-box-trim: trim-both; text-box-edge: cap alphabetic;   /* longhands */
  text-box: trim-both cap alphabetic;                         /* shorthand */
}
/* Links: underline clears descenders (g, y) */
a { text-underline-offset: 0.2em; }
/* Superscripts don't push lines apart */
sup { line-height: 0; position: relative; vertical-align: baseline; top: -0.5em; }
/* Acronyms (CISB, PYP, AI…) in small caps rather than shouting capitals */
abbr { font-variant-caps: all-small-caps; letter-spacing: 0.03em; text-decoration: none; }
/* Headlines scale smoothly instead of jumping at breakpoints */
.headline { font-size: clamp(2rem, 1rem + 5vw, 4rem); }
/* Narrow columns hyphenate (needs lang="en" on <html>) */
.narrow { hyphens: auto; -webkit-hyphens: auto; }
/* Card titles: at most two lines */
.card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
/* Tabs / toggle chips: reserve the bold width so selecting one doesn't shift the layout */
.tab { display: inline-grid; }
.tab > .tab-label, .tab::after { grid-area: 1 / 1; }
.tab::after { content: attr(data-text); font-weight: 800; visibility: hidden; height: 0; overflow: hidden; }
/* File names: truncate in the middle of a flex row so the end / extension stays visible */
.file { display: flex; min-width: 0; white-space: nowrap; }
.file .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .ext { flex-shrink: 0; }
