/* The Bothain design template: tokens and base elements.
 * Taken exactly from Tirith, Joe's AI API cost dashboard
 * (costwatch/frontend/src/app/globals.css and its components), 3 Nov 2026:
 * a white page, near-black type, thin grey rules, blue-edged cards with
 * round corners, and the dark green wordmark.
 * DESIGN.md at the top of the repo explains each choice. A page links the
 * Adobe Fonts kit, then this file, then its own stylesheet, and uses only
 * the tokens below.
 */

/* The fallback body face, served from here, so the page reads before the
 * kit arrives and if it never does. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url(/balcony/fonts/inter-latin.woff2) format('woff2');
}

:root {
  color-scheme: light;

  /* Palette, Tirith's */
  --white: #ffffff;
  --surface-alt: #f8f8f8;
  --ink: #1a1a1a;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --border-light: #ebebeb;
  --border-active: #1a1a1a;
  --gridline: #f0f0f0;
  --green: #1b3a2a;
  --green-fill: #d6ecda;
  --blue: #1d6bff;
  --red: #cc0000;

  /* Roles */
  --bg: var(--white);
  --surface: var(--white);
  --text: var(--ink);
  --text-dim: var(--text-secondary);
  --border: #e5e5e5;
  --accent: var(--green);
  --success: var(--blue);
  --danger: var(--red);

  /* Type: one Adobe Fonts kit (qli0vdb), Inter underneath. */
  --font-wordmark: 'droog', 'Inter', sans-serif;
  --font-label: 'snaga-unicase-display', 'Inter', sans-serif;
  --font-body: 'trust-3a', 'Inter', sans-serif;
  --weight-body: 400;
  --weight-strong: 500;
  --weight-header: 700;
  --size-tiny: 11px;
  --size-small: 12px;
  --size-label: 13px;
  --size-body: 14px;
  --size-medium: 16px;
  --size-large: 18px;
  --size-xlarge: 28px;
  --size-wordmark: 36px;
  --track-tight: -0.025em;
  --track-wide: 0.05em;
  --leading-tight: 1.1;
  --leading-normal: 1.5;

  /* Space */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-base: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-xxl: 32px;
  --space-huge: 48px;

  /* Shape: round corners, 1px edges, the faintest shadows. */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --radius: var(--radius-md);
  --border-thin: 1px;
  --border-pill: 1.5px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-tooltip: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.08);

  /* Motion: quiet colour changes, nothing moves. */
  --dur-fast: 80ms;
  --dur-base: 140ms;
  --ease: ease;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: var(--weight-body);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; font-weight: 400; line-height: var(--leading-tight); }

/* The wordmark: Tirith's, letter for letter, in its green. */
h1, .wordmark {
  font-family: var(--font-wordmark);
  font-size: var(--size-wordmark);
  font-weight: 900;
  font-style: normal;
  letter-spacing: var(--track-tight);
  text-transform: uppercase;
  color: var(--green);
}

/* Section titles and labels: Snaga, regular, sentence case. */
h2, h3, .label {
  font-family: var(--font-label);
  font-weight: 400;
  font-style: normal;
}
h2 { font-size: var(--size-large); }
.label { font-size: var(--size-label); color: var(--text-dim); }

p { margin: 0; }
strong, b { font-weight: var(--weight-header); }

/* A card: white, a blue edge, round corners. */
.card {
  background: var(--surface);
  border: var(--border-thin) solid var(--blue);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

/* A card's title row: title on the left, a tag on the right, a rule under. */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-base) var(--space-xl);
  border-bottom: var(--border-thin) solid var(--border);
}

/* A small tag, as Tirith's "v2.0": a thin rounded box in tertiary type. */
.tag, .badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--size-small);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  color: var(--text-tertiary);
  border: var(--border-thin) solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 2px var(--space-sm);
}
.badge { color: var(--text); }

/* A framed panel inside a card. */
.frame {
  background: var(--surface);
  border: var(--border-thin) solid var(--border-light);
  border-radius: var(--radius-sm);
}

.hint { font-size: var(--size-small); color: var(--text-tertiary); }

/* Buttons are Tirith's filter pills; the chosen one is outlined in ink. */
button, .pill {
  font-family: var(--font-label);
  font-weight: 400;
  font-size: var(--size-body);
  line-height: 1.4;
  padding: var(--space-sm) var(--space-base);
  border-radius: var(--radius-pill);
  border: var(--border-pill) solid transparent;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease),
    color var(--dur-base) var(--ease);
}
button:hover, .pill:hover { color: var(--text); background: var(--surface-alt); }
button.primary, .pill.active {
  border-color: var(--border-active);
  background: var(--surface);
  color: var(--text);
}
button:disabled { opacity: 0.3; cursor: default; }

input[type='checkbox'], input[type='radio'], input[type='range'] { accent-color: var(--ink); }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.hidden { display: none; }

/* Motion pieces a page can use by name. */
@keyframes enter {
  from { background-color: var(--surface-alt); }
  to { background-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 1ms !important;
  }
}
