:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --primary: #0284c7;
  --primary-soft: #e0f2fe;
  --accent: #059669;
  --accent-soft: #d1fae5;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --radius: 12px;
  --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1.04rem;
}

header.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.15rem 1.5rem;
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
}

.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-badge {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge span.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
}

.meta-pill {
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: #0369a1;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

main {
  max-width: 1040px;
  margin: 2.25rem auto 4rem;
  padding: 0 1.5rem;
}

article.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 4vw, 3.25rem);
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

h1 {
  font-size: clamp(1.85rem, 3.4vw, 2.55rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.lead {
  font-size: 1.18rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  border-left: 4px solid var(--primary);
  padding-left: 1.15rem;
}

.byline {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: var(--text-muted);
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.toc-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.6rem;
  margin-bottom: 2.25rem;
}

.toc-box h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.75rem 0;
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.45rem 1.5rem;
  list-style: none;
  margin: 0;
}

.toc-grid a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.toc-grid a:hover {
  text-decoration: underline;
}

h2 {
  font-size: 1.55rem;
  margin: 2.75rem 0 1rem;
  letter-spacing: -0.015em;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.2rem;
  margin: 1.65rem 0 0.65rem;
  color: var(--text);
}

p {
  margin-bottom: 1.15rem;
}

ul, ol {
  margin: 0 0 1.35rem 1.5rem;
}

li {
  margin-bottom: 0.55rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: var(--surface-alt);
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  font-size: 0.88em;
  border: 1px solid var(--border);
}

pre.code-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1.25rem;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 1rem 0 1.5rem;
}

.formula-box {
  background: var(--surface-alt);
  border-left: 4px solid var(--accent);
  padding: 1.25rem 1.5rem;
  border-radius: 0 10px 10px 0;
  margin: 1.5rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
}

.key-takeaway {
  background: var(--accent-soft);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  padding: 1.6rem;
  margin: 1.75rem 0;
}

.key-takeaway h3 {
  margin-top: 0;
  color: #065f46;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 1rem;
  margin: 1.75rem 0;
}

.stat-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.15rem;
}

.stat-box .num {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-box .lbl {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.2rem;
}

/* Payload Inspector Tabs */
.inspector-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tab-btn {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
}

.tab-btn[aria-expanded="true"] {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.payload-panel-inner {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  background: var(--surface-alt);
}

/* Responsive table per modern-web-guidance */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(580px, 80vh);
  container-type: inline-size;
  margin: 1.75rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  --label-2: "Architecture Type";
  --label-3: "Avg. Compute / Credit Cost";
  --label-4: "10k SKUs (5 Langs) TCO";
  --label-5: "Hallucination Prevention";
  --label-6: "PIM / ETIM Compatibility";
}

caption {
  text-align: left;
  font-weight: 700;
  padding: 1rem 1.25rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
}

thead th {
  background: var(--surface-alt);
  color: var(--text);
  font-weight: 700;
  text-align: left;
  padding: 0.9rem 1rem;
  border-bottom: 2px solid var(--border-strong);
}

tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: var(--surface);
  font-weight: 700;
  text-align: left;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

tr.highlight-row th,
tr.highlight-row td {
  background: #f0fdf4;
}

.badge-winner {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  margin-left: 0.35rem;
}

@container (width < 600px) {
  table, thead, tbody, tr, th, td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    margin-block-end: 1.25rem;
    border: 1px solid var(--border);
  }

  tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: var(--surface-alt);
  }

  td:nth-child(2)::before {
    content: var(--label-2) ": ";
    font-weight: 600;
  }
  td:nth-child(3)::before {
    content: var(--label-3) ": ";
    font-weight: 600;
  }
  td:nth-child(4)::before {
    content: var(--label-4) ": ";
    font-weight: 600;
  }
  td:nth-child(5)::before {
    content: var(--label-5) ": ";
    font-weight: 600;
  }
  td:nth-child(6)::before {
    content: var(--label-6) ": ";
    font-weight: 600;
  }
}

/* Interactive Calculator Box */
.calculator-box {
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin: 2rem 0;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.calc-field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.calc-field input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.calc-results {
  margin-top: 1.35rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 1rem;
}

.result-card {
  background: var(--surface);
  padding: 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.result-card.pimplify-card {
  border: 2px solid var(--accent);
  background: #f0fdf4;
}

.result-card .label {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.result-card .value {
  font-size: 1.45rem;
  font-weight: 800;
  margin-top: 0.25rem;
}

.result-card .sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

details.faq-disclosure {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  background: var(--surface-alt);
}

details.faq-disclosure summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}

details.faq-disclosure p {
  margin-top: 0.75rem;
  margin-bottom: 0;
  color: var(--text-muted);
}

footer.site-footer {
  max-width: 1040px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}
