:root {
  --bg: #f6f1e8;
  --paper: #faf7f2;
  --paper-strong: #fffdf9;
  --ink: #171717;
  --muted: #5f5a52;
  --line: rgba(23, 23, 23, 0.14);
  --accent: #b86a34;
  --accent-dark: #8d4d21;
  --accent-soft: rgba(184, 106, 52, 0.08);
  --shadow: 0 10px 30px rgba(35, 25, 10, 0.05);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f7f2e9 0%, #f3eee5 100%);
}

.page-shell {
  width: min(980px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 80px;
}

.hero {
  padding: 10px 0 18px;
  border-bottom: 1px solid var(--line);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow,
.section-tag,
.stat-label,
.meta-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent-dark);
}

.toplink,
.ghost-button,
.condition-btn,
button,
select,
input {
  transition: 180ms ease;
}

.toplink {
  color: var(--ink);
  text-decoration: none;
  padding: 9px 13px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
}

.hero-copy {
  max-width: 760px;
  padding: 38px 0 18px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-weight: 700;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.article-meta span {
  position: relative;
}

.article-meta span:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.3);
  transform: translateY(-50%);
}

h1,
h2,
h3 {
  margin: 0;
}

h1,
h2 {
  font-family: "Newsreader", serif;
  line-height: 0.96;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.02;
  max-width: 13ch;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.08;
  max-width: 18ch;
}

h3 {
  font-size: 1rem;
}

.lede,
.feature-card p,
.stat-card p,
.panel-copy,
.status-message {
  color: var(--muted);
  line-height: 1.65;
}

.lede {
  max-width: 62ch;
  font-size: 1.05rem;
  margin: 18px 0 0;
}

.hero-grid,
.feature-grid,
.metrics-grid,
.case-study-grid {
  display: grid;
  gap: 16px;
}

.hero-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.stat-card,
.feature-card {
  border-radius: var(--radius-lg);
  padding: 18px 0 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
}

.stat-card strong {
  display: block;
  font-size: 1.5rem;
  margin: 10px 0 6px;
}

.section {
  margin-top: 34px;
}

.section-intro {
  padding: 8px 0;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.compact {
  margin-bottom: 10px;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  background: var(--paper-strong);
  border: 1px solid rgba(23, 23, 23, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 18px;
}

.benchmark-panel,
.case-study-panel {
  overflow: hidden;
}

.section-rule {
  height: 1px;
  background: var(--line);
  margin: 20px 0 22px;
}

.benchmark-lede {
  max-width: 70ch;
  margin-bottom: 20px;
}

.benchmark-lede p,
.case-card p,
.metric-card p {
  color: var(--muted);
  line-height: 1.65;
}

.benchmark-metrics {
  margin-top: 0;
}

.metric-card-strong {
  background: linear-gradient(180deg, rgba(184, 106, 52, 0.08), rgba(255, 255, 255, 0.96));
}

.case-study-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.case-card {
  background: #f8f4ed;
  border: 1px solid rgba(23, 23, 23, 0.07);
  border-radius: 18px;
  padding: 20px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
}

.panel-block {
  min-width: 0;
}

label {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 10px;
}

select,
input[type="search"],
input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf9;
  color: var(--ink);
  font: inherit;
  padding: 14px 16px;
}

.condition-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 22px;
}

.condition-btn,
.ghost-button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf9;
  color: var(--ink);
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.condition-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 10px 30px rgba(216, 107, 45, 0.24);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.meta-grid span:last-child {
  display: block;
  margin-top: 6px;
  font-weight: 700;
}

.prompt-block pre {
  white-space: pre-wrap;
  margin: 14px 0;
  padding: 18px;
  border-radius: 14px;
  background: #201d19;
  color: #f6f1e8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.5;
  min-height: 260px;
}

.dataset-header,
.upload-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf9;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

thead th {
  position: sticky;
  top: 0;
  background: #f6f1e8;
  z-index: 1;
}

tbody tr:hover {
  background: rgba(184, 106, 52, 0.06);
}

.metrics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.metric-card {
  background: #f9f5ef;
  border: 1px solid rgba(23, 23, 23, 0.08);
  border-radius: 16px;
  padding: 18px;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
}

.hidden {
  display: none;
}

.status-message {
  min-height: 1.4em;
  margin-top: 12px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .feature-grid,
  .two-column,
  .metrics-grid,
  .meta-grid,
  .case-study-grid {
    grid-template-columns: 1fr;
  }

  .dataset-header,
  .upload-row,
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    max-width: 13ch;
  }
}
