/* Usage — built in the journal's design language so the two sites read as one
   system: Inter + JetBrains Mono, dark panels, one accent per card, large
   tabular figures over a thin track.

   Deliberately no background image: the panels carry the look. */

@font-face {
  font-family: "Usage Sans";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Usage Mono";
  src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #121624;
  --panel: #1c2030;
  --panel-2: #23283b;
  --line: #373d54;

  --text: #eeeaf7;
  --muted: #b5b1c9;

  --purple-lift: #c6a5ee;
  --purple: #55406f;
  --error: #f3a4ad;
  --good: #a1ceb2;

  --surface: rgb(26 30 45 / 0.94);
  --hairline: rgb(180 170 218 / 0.19);

  --radius: 14px;
  --radius-sm: 8px;

  --sans: "Usage Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "Usage Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--sans);
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(1.25rem, 5vh, 3rem) 1.5rem 3rem;
}

a { color: var(--purple-lift); }

:focus-visible {
  outline: 2px solid var(--purple-lift);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- shared panel recipe ---------- */

.panel,
.topbar {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgb(5 8 19 / 0.12);
}

/* ---------- header ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 0.875rem;
}

.brand {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.2;
}
.brand span { color: var(--purple-lift); }

.refresh {
  flex: none;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
}
.refresh:hover { border-color: var(--purple-lift); color: var(--purple-lift); }

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

.cards {
  display: grid;
  gap: 0.875rem;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  align-content: start;
  /* Cards size to their own content. Without this the one-window ChatGPT
     cards stretch to match Claude's two and trail visible dead space. */
  align-items: start;
}

/* One accent per card, cycled — the journal gives each metric its own colour
   so a glance tells them apart before the label is read. */
.card {
  --accent: #c6a5ee;
  display: flex;
  flex-direction: column;
  padding: 1.125rem 1.25rem 1rem;
  transition: border-color 150ms ease;
}
.card:nth-child(3n + 2) { --accent: #96bdf6; }
.card:nth-child(3n + 3) { --accent: #a1ceb2; }

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.card h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 550;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.subtitle {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font: 0.75rem/1.5 var(--mono);
  overflow-wrap: anywhere;
}

.tag {
  flex: none;
  padding: 0.2rem 0.55rem;
  border-radius: 7px;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tag-live {
  border: 1px solid rgb(161 206 178 / 0.25);
  background: rgb(161 206 178 / 0.09);
  color: var(--good);
}
.tag-stale {
  border: 1px solid rgb(243 164 173 / 0.25);
  background: rgb(243 164 173 / 0.09);
  color: var(--error);
}

/* ---------- meters ---------- */

.meter { margin-top: 1.125rem; }

.meter-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.meter-label {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
}

.meter-value {
  font: 400 2rem/1.2 var(--mono);
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.meter-unit {
  margin-left: 0.15rem;
  color: #cac5dc;
  font: 0.95rem var(--mono);
  letter-spacing: 0;
}
.meter-none { color: #74758e; }

/* The track: the journal's 4px rule, filled in the card's accent. */
.track {
  height: 4px;
  margin-top: 0.75rem;
  border-radius: 2px;
  background: #393b51;
  overflow: hidden;
}

.track i {
  display: block;
  height: 100%;
  width: var(--fill, 0%);
  border-radius: 2px;
  background: var(--accent);
  transition: width 240ms ease, background-color 240ms ease;
}

/* Running out is the one state worth a colour change of its own. */
.meter-low .track i { background: #e0aac1; }
.meter-low .meter-value { color: #e0aac1; }

.age {
  min-height: 1.25rem;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font: 0.75rem/1.5 var(--mono);
}

.meter:last-child .age { min-height: 0; }

.status { margin: 0.75rem 0 0; font-size: 0.8rem; }
.status-error { color: var(--error); }

/* ---------- login ---------- */

.gate {
  display: grid;
  place-items: center;
  min-height: 80vh;
}

.panel-login { width: min(22rem, 100%); padding: 1.5rem; }
.panel-login .brand { font-size: 1.5rem; }

.eyebrow {
  display: block;
  margin: 0.35rem 0 1.4rem;
  color: var(--muted);
  font: 0.8rem/1.5 var(--mono);
}

label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

input[type="password"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}
input[type="password"]:focus {
  outline: none;
  border-color: var(--purple-lift);
}

button {
  width: 100%;
  margin-top: 1rem;
  padding: 0.7rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--purple);
  color: var(--text);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
}
button:hover { background: #6b5189; }

@media (max-width: 40rem) {
  main { padding: 1.25rem 1rem 2rem; }
  .cards { grid-template-columns: 1fr; }
}
