:root {
  --bg: #f6efe3;
  --bg-deep: #efe1cb;
  --panel: rgba(255, 252, 246, 0.94);
  --panel-strong: #fffaf2;
  --ink: #1f1a17;
  --muted: #6c6258;
  --line: rgba(72, 53, 36, 0.14);
  --accent: #0f766e;
  --accent-2: #b45309;
  --shadow: 0 18px 56px rgba(75, 56, 40, 0.12);
  --codex: #0f766e;
  --opencode: #b45309;
  --claude: #7c3aed;
  --hermes: #be185d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 19px;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(180, 83, 9, 0.16), transparent 26%),
    linear-gradient(180deg, #fbf6ee 0%, var(--bg) 52%, var(--bg-deep) 100%);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

.page {
  width: min(1440px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.hero,
.panel {
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 247, 236, 0.94));
  border: 1px solid rgba(72, 53, 36, 0.12);
  box-shadow: var(--shadow);
}

.hero { padding: clamp(24px, 3vw, 40px); }

.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 700;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.04;
}

.lede {
  margin: 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: clamp(17px, 1.3vw, 21px);
  line-height: 1.55;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: rgba(72, 53, 36, 0.08);
  padding: 1px 5px;
  border-radius: 6px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 5vw, 64px);
  margin-top: clamp(20px, 2.4vw, 32px);
  padding-top: clamp(18px, 2vw, 26px);
  border-top: 1px solid var(--line);
}

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat strong {
  font-size: clamp(28px, 2.8vw, 40px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel {
  margin-top: 24px;
  padding: clamp(20px, 2.4vw, 32px) clamp(18px, 2.4vw, 32px) clamp(16px, 2vw, 24px);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: clamp(14px, 1.6vw, 22px);
}

h2 { margin: 0; font-size: clamp(21px, 1.8vw, 26px); }

.muted { margin: 0; color: var(--muted); font-size: 15px; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 20px;
}

th,
td {
  text-align: left;
  padding: 19px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(1) td { font-weight: 700; }
tbody tr:nth-child(1) .col-rank { color: var(--accent-2); }
tbody tr { transition: background 140ms ease; }
tbody tr:hover { background: rgba(15, 118, 110, 0.05); }

.col-num { text-align: right; font-variant-numeric: tabular-nums; }
.col-rank {
  width: 72px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.col-name { white-space: normal; overflow-wrap: anywhere; min-width: 150px; font-size: 21px; }
.col-tokens { font-variant-numeric: tabular-nums; min-width: 110px; font-size: 21px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  background: rgba(72, 53, 36, 0.07);
  color: var(--muted);
}

.chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chip-color, var(--muted));
  flex: none;
}

.chip[data-cli="codex"] { --chip-color: var(--codex); }
.chip[data-cli="opencode"] { --chip-color: var(--opencode); }
.chip[data-cli="claude"] { --chip-color: var(--claude); }
.chip[data-cli="hermes"] { --chip-color: var(--hermes); }

.empty {
  margin: 18px 0;
  color: var(--muted);
  text-align: center;
}

.panel-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-top: clamp(14px, 1.6vw, 20px);
  padding-top: clamp(14px, 1.6vw, 20px);
  border-top: 1px solid var(--line);
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(75, 56, 40, 0.16);
}

.footer {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  max-width: 78ch;
}

/* Seven nowrap columns need 1074px, which is wider than a lot of laptop windows.
   Rather than drop straight to cards, shed the secondary columns as space runs
   out and keep a real table for as long as possible. Measured natural widths:
   all 7 = 1074px, without cost = 959px, rank+name+tokens+clis = 727px.
   The ranges are bounded below so these never fight the card layout, where every
   field is shown again with its own label. */
@media (min-width: 541px) and (max-width: 1180px) {
  .col-cost { display: none; }
}

@media (min-width: 541px) and (max-width: 1045px) {
  .col-extra { display: none; }

  /* With full labels the CLIs column measured 372px, 2.4x the next widest
     column and 35% of the whole board. Collapsing each chip to its colour dot
     brings the table to roughly half that, which is what lets a real table
     survive in a narrow window instead of falling back to stacked cards. The
   table is kept down to 541px, which leaves headroom over its 494px need;
   521-522px clipped by 1-2px, so the cards start a little earlier than the
   arithmetic strictly requires. */
  .chip { padding: 5px; gap: 0; }
  .chip::before { width: 11px; height: 11px; }
  .chip-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Below this width four columns stop fitting, so each row becomes a card and
   every value carries its own label. Sideways scrolling hid most of the board
   on a phone, which is worse than no board. Chips show their full labels again
   here, since the dots-only rule above stops at 541px. */
@media (max-width: 540px) {
  .table-wrap { overflow-x: visible; }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: normal;
  }

  /* The hidden header still has nowrap cells, which report phantom width even
     though they are clipped. Reset them so nothing overflows invisibly. */
  thead th {
    padding: 0;
    border: 0;
    white-space: normal;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tbody tr {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 252, 246, 0.72);
    padding: 18px 0 14px;
    margin-bottom: 20px;
    box-shadow: 0 22px 60px -34px rgba(72, 53, 36, 0.5);
  }

  tbody tr:last-child { margin-bottom: 0; }
  tbody tr:nth-child(1) { border-color: rgba(180, 83, 9, 0.4); }

  td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 20px;
    border-bottom: 0;
    white-space: normal;
    text-align: right;
  }

  /* Requests, sessions and cost are metadata beside the headline numbers, so
     they stay a step below the headline figures. */
  .col-extra,
  .col-cost { font-size: 18px; }
  .col-extra::before,
  .col-cost::before { font-size: 13px; }

  td::before {
    content: attr(data-label);
    flex: none;
    font-size: 14px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
  }

  /* Rank and name read as the card heading, so they lead it. */
  .col-rank,
  .col-name {
    justify-content: flex-start;
    text-align: left;
  }

  .col-rank {
    width: auto;
    padding-bottom: 0;
    font-size: 14px;
    letter-spacing: 0.09em;
  }

  .col-rank::before { display: none; }

  .col-name {
    font-size: 24px;
    padding-top: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 6px;
  }

  .col-name::before { display: none; }

  .col-tokens {
    font-size: 27px;
    padding-top: 16px;
  }

  .chips { justify-content: flex-end; }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .page { width: calc(100vw - 24px); padding: 16px 0 40px; }
  .hero, .panel { border-radius: 20px; }
  .hero-meta { gap: 18px 28px; }
  .col-name { font-size: 25px; }
  .col-tokens { font-size: 28px; }
}

/* ------------------------------------------------------------------ install */

/* Kept deliberately small and centred: a call to action, not a second hero. */
.cta {
  max-width: 620px;
  margin: 0 auto;
  padding: 28px 32px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-strong);
  text-align: center;
  box-shadow: 0 26px 70px -40px rgba(72, 53, 36, 0.5);
}

.cta-title {
  margin: 0 0 8px;
  font-size: clamp(21px, 2vw, 25px);
  letter-spacing: -0.01em;
}

.cta-lede {
  margin: 0 auto 18px;
  max-width: 46ch;
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
}

.cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cta-cmd {
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  user-select: all;
}

.cta-copy {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.cta-copy:hover { background: var(--panel-strong); }

.cta-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 0;
  font-size: 15px;
}

.cta-note {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.cta-note code { font-size: 14px; }

.footer a { color: var(--accent); }

@media (max-width: 560px) {
  .cta { padding: 24px 18px 20px; }
  .cta-lede { font-size: 15px; }
  .cta-cmd { font-size: 16px; }
}
