/* AgentTune landing — clean, opinionated, auto dark/light */

:root {
  --bg: #fafaf9;
  --bg-elevated: #ffffff;
  --bg-code: #f3f1ee;
  --fg: #1a1a1a;
  --fg-muted: #6a6a6a;
  --fg-subtle: #a0a0a0;
  --border: #e5e2dd;
  --border-strong: #c8c4bd;
  --accent: #d35400;
  --accent-hover: #b04300;
  --accent-soft: #fff4ec;
  --max-width: 720px;
  --radius: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0e;
    --bg-elevated: #161617;
    --bg-code: #1c1c1e;
    --fg: #ededed;
    --fg-muted: #9a9a9a;
    --fg-subtle: #5a5a5a;
    --border: #2a2a2c;
    --border-strong: #3d3d40;
    --accent: #ff8a3d;
    --accent-hover: #ffa566;
    --accent-soft: #2a1a0e;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

em {
  font-style: italic;
}

strong {
  font-weight: 600;
}

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

/* Header */
.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.05rem;
}

.logo-mark {
  font-size: 1.4rem;
  color: var(--accent);
}

.logo-text {
  letter-spacing: -0.01em;
}

.site-header nav {
  display: flex;
  gap: 24px;
  font-size: 0.95rem;
}

.site-header nav a {
  color: var(--fg-muted);
  border-bottom: none;
}

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

/* Main */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: none;
}

h1 {
  font-size: 2.6rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  font-weight: 700;
}

h2 {
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  font-weight: 600;
}

h3 {
  font-size: 1.15rem;
  margin: 0 0 4px;
  font-weight: 600;
}

p {
  margin: 0 0 16px;
}

p:last-child {
  margin-bottom: 0;
}

/* Hero */
.hero {
  padding-top: 80px;
  padding-bottom: 72px;
}

.lede {
  font-size: 1.1rem;
  color: var(--fg-muted);
  margin-bottom: 18px;
}

.lede em {
  color: var(--fg);
}

.cta-row {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.98rem;
  border: 1px solid var(--border-strong);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--fg);
  border-bottom: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  color: var(--fg);
  border-color: var(--fg-muted);
  border-bottom-color: var(--fg-muted);
}

.hero-evidence {
  margin-top: 28px;
  font-size: 0.93rem;
  color: var(--fg-muted);
}

.hero-evidence a {
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border-strong);
}

.hero-evidence a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Demo */
.demo-prompt {
  color: var(--fg-muted);
  margin-bottom: 12px;
}

.user-prompt {
  margin: 0 0 32px;
  padding: 16px 22px;
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-style: italic;
  color: var(--fg);
}

.responses {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.response {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.response-tuned {
  border-color: var(--accent);
}

.response-header {
  padding: 10px 18px;
  background: var(--bg-code);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--fg-muted);
  letter-spacing: 0.01em;
}

.response-tuned .response-header {
  background: var(--accent-soft);
  color: var(--accent);
}

.response-label {
  font-weight: 500;
}

.response-body {
  padding: 18px 22px;
  font-size: 0.97rem;
}

.response-body p,
.response-body ol {
  margin: 0 0 10px;
}

.response-body ol {
  padding-left: 24px;
}

.response-body p:last-child,
.response-body ol:last-child {
  margin-bottom: 0;
}

.demo-caption {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin-top: 24px;
}

/* Systems */
.section-lede {
  color: var(--fg-muted);
  margin-bottom: 32px;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

@media (max-width: 600px) {
  .system-grid {
    grid-template-columns: 1fr;
  }
}

.system-card {
  padding: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.system-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-tag {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  background: var(--bg-code);
  color: var(--fg-muted);
  border-radius: 999px;
}

.system-sub {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}

.system-card p:not(.system-sub) {
  flex: 1;
  font-size: 0.97rem;
}

.system-link {
  font-size: 0.92rem;
  margin-top: 14px;
  align-self: flex-start;
  border-bottom: 1px solid currentColor;
  border-bottom-color: transparent;
}

.system-link:hover {
  border-bottom-color: var(--accent);
}

/* How */
.steps {
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 26px;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps ul {
  list-style: disc;
  padding-left: 22px;
  margin: 10px 0 0;
  font-size: 0.96rem;
  color: var(--fg-muted);
}

.steps ul li {
  margin-bottom: 4px;
}

/* Library */
.library {
  text-align: center;
  padding: 80px 0;
}

.library h2 {
  margin-bottom: 12px;
}

.library p {
  color: var(--fg-muted);
  margin-bottom: 28px;
}

.library .btn {
  font-family: var(--font-mono);
}

.library-meta {
  margin-top: 24px;
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 48px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.site-footer p {
  margin: 0 0 8px;
}

.site-footer a {
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
}

.site-footer a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.footer-credit {
  font-size: 0.85rem;
  color: var(--fg-subtle);
}

/* Responsive tweaks */
@media (max-width: 600px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  body {
    font-size: 16px;
  }

  section {
    padding: 48px 0;
  }

  .hero {
    padding-top: 56px;
    padding-bottom: 48px;
  }

  .site-header {
    padding-top: 24px;
  }
}

/* ============================================================
   Research page
   ============================================================ */

.research-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

.research-page .site-header,
.research-page .site-footer {
  max-width: 880px;
}

.research-hero {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--border);
}

.research-hero h1 {
  font-size: 2.4rem;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.research-section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

.research-section:last-child {
  border-bottom: none;
}

.research-section h2 {
  font-size: 1.7rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}

.research-section h3.subhead {
  font-size: 1.15rem;
  margin: 40px 0 14px;
  letter-spacing: -0.005em;
}

/* Stat row in hero */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 40px 0 0;
}

@media (max-width: 640px) {
  .stat-row {
    grid-template-columns: 1fr;
  }
}

.stat {
  padding: 24px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
  font-family: var(--font-mono);
}

.stat-divider {
  font-weight: 400;
  color: var(--fg-subtle);
  margin: 0 4px;
}

.stat-label {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.4;
}

.stat-label strong {
  color: var(--fg);
}

/* Method list */
.method-list {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.method-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 16px;
}

.method-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}

/* Finding summary callout */
.finding-summary {
  font-size: 1.1rem;
  line-height: 1.55;
  padding: 20px 24px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  margin: 20px 0 32px;
}

.finding-summary strong {
  color: var(--accent);
  font-weight: 600;
}

/* Chart container */
.chart {
  margin: 32px 0;
  padding: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.chart canvas {
  max-height: 420px !important;
  width: 100% !important;
}

.chart figcaption {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--fg-muted);
}

/* Research quotes */
.research-quote {
  margin: 32px 0;
  padding: 24px 28px;
  border-left: 3px solid var(--accent);
  font-size: 1.25rem;
  line-height: 1.4;
  font-weight: 500;
  font-style: italic;
  color: var(--fg);
  background: transparent;
}

/* External link to original blog */
.external-link {
  margin: 32px 0 0;
  font-size: 0.92rem;
  color: var(--fg-muted);
}

.external-link a {
  border-bottom: 1px solid var(--border-strong);
}

/* Profile cards (4 enneagram cards) */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 32px 0;
}

@media (max-width: 800px) {
  .profile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

.profile-card {
  padding: 22px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-top: 3px solid var(--border-strong);
}

.profile-claude { border-top-color: #d97706; }
.profile-gemini { border-top-color: #2563eb; }
.profile-gpt    { border-top-color: #059669; }
.profile-grok   { border-top-color: #dc2626; }

@media (prefers-color-scheme: dark) {
  .profile-claude { border-top-color: #fbbf24; }
  .profile-gemini { border-top-color: #60a5fa; }
  .profile-gpt    { border-top-color: #34d399; }
  .profile-grok   { border-top-color: #f87171; }
}

.profile-type {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.profile-model {
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin: 4px 0 12px;
  letter-spacing: 0.02em;
}

.profile-desc {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--fg);
}

/* Instrument resolution stack */
.resolution-stack {
  margin: 32px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.resolution-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 40px 2fr;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  gap: 16px;
}

.resolution-row:last-child {
  border-bottom: none;
}

@media (max-width: 640px) {
  .resolution-row {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .resolution-arrow {
    display: none;
  }
}

.resolution-tool {
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--fg);
}

.resolution-note {
  display: block;
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-top: 2px;
  letter-spacing: 0.01em;
}

.resolution-arrow {
  color: var(--accent);
  font-size: 1.2rem;
  text-align: center;
}

.resolution-finding {
  font-size: 0.97rem;
  color: var(--fg);
  line-height: 1.45;
}

/* CTA section */
.cta-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 36px !important;
  margin: 32px 0;
  text-align: center;
  border-bottom: 1px solid var(--border) !important;
}

.cta-section h2 {
  margin-bottom: 16px;
}

.cta-section p {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.02rem;
}

.cta-section .cta-row {
  justify-content: center;
}

/* Data tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 28px;
  font-size: 0.92rem;
}

.data-table.small {
  font-size: 0.86rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-weight: 600;
  color: var(--fg);
  background: var(--bg-code);
  letter-spacing: 0.01em;
}

.data-table tbody tr:hover {
  background: var(--bg-code);
}

.data-table td:not(:first-child) {
  font-family: var(--font-mono);
  font-size: 0.88em;
  text-align: right;
}

.data-table.small td:last-child,
.data-table td:last-child {
  font-family: var(--font-sans);
  text-align: left;
}

.data-table .total-row {
  font-weight: 600;
  background: var(--bg-code);
}

.data-table .total-row td {
  border-top: 2px solid var(--border-strong);
}

.caption {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin: -16px 0 24px;
  line-height: 1.5;
}

/* Responsive: smaller hero on mobile */
@media (max-width: 600px) {
  .research-hero h1 {
    font-size: 1.7rem;
  }
  .research-section h2 {
    font-size: 1.35rem;
  }
  .stat-number {
    font-size: 1.8rem;
  }
  .research-quote {
    font-size: 1.05rem;
    padding: 18px 20px;
  }
  .chart {
    padding: 14px;
  }
  .chart canvas {
    max-height: 320px !important;
  }
}
