/* ============================================================
   Premium Utilitarian Minimalism — cloudprice.eu
   Warm monochrome palette, monospace headlines, no dark mode
   ============================================================ */

:root {
  --bg: #FBFBFA;
  --surface: #FFFFFF;
  --border: #EAEAEA;
  --text: #2F3437;
  --text-secondary: #787774;
  --accent: #111111;
  --accent-hover: #000000;
  --success: #346538;
  --success-bg: #EDF3EC;
  --warning: #7C5E00;
  --warning-bg: #FBF3DB;
  --danger: #8B2222;
  --danger-bg: #FDEBEC;
  --info-bg: #E1F3FE;
  --info: #1A4F7A;

  --badge-red-bg: #FDEBEC;
  --badge-red-text: #8B2222;
  --badge-blue-bg: #E1F3FE;
  --badge-blue-text: #1A4F7A;
  --badge-green-bg: #EDF3EC;
  --badge-green-text: #346538;
  --badge-yellow-bg: #FBF3DB;
  --badge-yellow-text: #7C5E00;

  --grid: #F0F0F0;
  --radius: 6px;
  --radius-lg: 8px;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', monospace;

  --max-width: 1200px;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- Headlines: monospace ---- */
h1, h2, h3 {
  font-family: var(--font-mono);
  font-weight: 500;
  line-height: 1.1;
  color: var(--text);
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.5rem;
  margin: 2rem 0 0.75rem;
}

h3 {
  font-size: 1.125rem;
  margin: 1.5rem 0 0.5rem;
}

p.lead {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ---- Layout ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

main {
  padding: 2rem 0;
}

/* ---- Header ---- */
header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.5rem;
}

.brand {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--accent);
}

/* ---- Navigation ---- */
nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

nav a:hover {
  color: var(--accent);
}

nav a[aria-current="page"] {
  color: var(--text);
  border-bottom: 2px solid var(--text);
}

/* ---- Model column ---- */
.col-model {
  min-width: 200px;
  white-space: normal;
}

/* ---- Tables ---- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 1rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: #F7F6F3;
  border-bottom: 1px solid var(--border);
}

th {
  text-align: left;
  padding: 0.625rem 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}

th:hover {
  background: #EFEFED;
}

th::after {
  content: " \2195";
  opacity: 0.35;
  font-size: 0.7rem;
}

th[data-sort="asc"]::after {
  content: " \2191";
  opacity: 1;
}
th[data-sort="desc"]::after {
  content: " \2193";
  opacity: 1;
}

td {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

/* Zebra striping */
tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}

/* Row hover */
tbody tr:hover td {
  background: rgba(0, 0, 0, 0.03);
}

/* Numeric / price cells */
td.numeric {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

td.price {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--success);
  background: var(--success-bg);
}

/* Per-provider unit under the price (ASR/STT, OCR — where units vary) */
.price-unit {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* Price cells darken on even rows and hover so zebra/hover remain visible */
tbody tr:nth-child(even) td.price {
  background: #DDE8DB;
}
tbody tr:hover td.price {
  background: #D5E0D3;
}
tbody tr:nth-child(even):hover td.price {
  background: #CDDACC;
}

/* Benchmark cells */
td.benchmark {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

td.benchmark.high {
  color: var(--success);
}
td.benchmark.medium {
  color: var(--warning);
}
td.benchmark.low {
  color: var(--danger);
}

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 0.1875rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
}

.badge-red {
  background: var(--badge-red-bg);
  color: var(--badge-red-text);
}
.badge-blue {
  background: var(--badge-blue-bg);
  color: var(--badge-blue-text);
}
.badge-green {
  background: var(--badge-green-bg);
  color: var(--badge-green-text);
}
.badge-yellow {
  background: var(--badge-yellow-bg);
  color: var(--badge-yellow-text);
}

/* ---- Search Input ---- */
.search-box {
  width: 100%;
  max-width: 400px;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  transition: border-color 0.15s;
}

.search-box:focus {
  outline: none;
  border-color: #C0C0C0;
}

/* ---- Cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  background: var(--surface);
  transition: border-color 0.15s;
}

.card:hover {
  border-color: #DADADA;
}

.card h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.card .meta {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.card .details {
  font-size: 0.875rem;
  line-height: 1.55;
}

.card .details a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.card .details a:hover {
  color: var(--accent);
}

/* ---- Provider logo letterhead band ---- */
.logo-band {
  /* Full-width band bleeding to the card edges (card padding is 1.25rem). */
  margin: -1.25rem -1.25rem 0.75rem;
  padding: 1rem 1.25rem;
  height: 28px;
  box-sizing: content-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.logo-band-img {
  height: 28px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.logo-band-monogram {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text);
  text-transform: uppercase;
}

.provider-name {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin: 0 0 0.5rem;
}

/* ---- Canvas / Scatterplot ---- */
.canvas-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 1rem;
  margin: 1rem 0;
}

.canvas-wrap canvas {
  display: block;
  width: 100%;
  max-width: 900px;
  height: 500px;
  margin: 0 auto;
}

/* Tooltip */
#tooltip, .tooltip {
  position: absolute;
  background: var(--text);
  color: #FFFFFF;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  pointer-events: none;
  z-index: 20;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
}

#tooltip.visible, .tooltip.visible {
  opacity: 1;
}

/* Controls */
.controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.controls button {
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
}

.controls button:hover {
  border-color: #C0C0C0;
}

.controls button.active {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.tab-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover {
  border-color: #C0C0C0;
  color: var(--text);
}

.tab-btn.active {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}

.tab-panel.hidden {
  display: none;
}

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 1.5rem 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

footer a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

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

/* ---- Text links ---- */
a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

a:hover {
  color: var(--accent);
}

/* ---- Selection ---- */
::selection {
  background: rgba(47, 52, 55, 0.15);
  color: var(--text);
}

::-moz-selection {
  background: rgba(47, 52, 55, 0.15);
  color: var(--text);
}

/* ---- Focus ---- */
:focus-visible {
  outline: 2px solid var(--text-secondary);
  outline-offset: 2px;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  header .container {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }

  nav ul {
    gap: 1rem;
  }

  .container {
    padding: 0.75rem 1rem;
  }

  main {
    padding: 1.25rem 0;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  th, td {
    padding: 0.5rem 0.625rem;
    font-size: 0.8125rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}