/* ── Fonts ── */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-italic.woff2') format('woff2');
}

/* ── Reset & Base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:          #faf9f6;
  --bg-card:     #ffffff;
  --bg-panel:    #f3f2ee;
  --border:      #e5e4e0;
  --text:        #1a1a1a;
  --text-muted:  #6b6b6b;
  --text-dim:    #737373;
  --accent:      #c45d3e;
  --accent-soft: #f5ebe6;
  --green:       #2d7a4f;
  --green-bg:    #edf7f0;
  --red:         #c44d4d;
  --red-bg:      #fdf0f0;
  --code-bg:     #f0efeb;
  --terminal-bg: #1e1e2e;
  --terminal-text: #cdd6f4;
  --proof-bg:    #1a1a2e;
  --proof-text:  #e8e6e1;
  --proof-muted: #9a9890;
  --serif: 'Instrument Serif', 'Georgia', 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:  'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--code-bg); padding: 0.15em 0.4em; border-radius: 4px; color: var(--text); }
strong { color: var(--text); font-weight: 600; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 1rem 2.25rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 1rem;
  transition: opacity 0.15s;
}
.btn:hover { text-decoration: none; opacity: 0.85; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.disabled { color: var(--text-dim); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1.5rem; font-size: 0.95rem; cursor: default; opacity: 0.5; }
.cta-row { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(to bottom, var(--bg) 0%, var(--bg-panel) 100%);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('hero-bg.webp') center/cover no-repeat;
  opacity: 0.7;
  z-index: 0;
  mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
}
.hero .container {
  position: relative;
  z-index: 1;
}
.positioning {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
  color: var(--text);
}
.hero .muted { color: var(--text-muted); }
.hero .sub-definition {
  font-size: 1.1rem;
  color: var(--text);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
  font-weight: 500;
}
.hero-oss {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
  letter-spacing: 0.01em;
}
.hero-caught {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  letter-spacing: 0.01em;
}
.hero .cta-row { justify-content: center; }

/* ── Demo (full-width background) ── */
.demo {
  padding: 5rem 0 8rem;
  background: linear-gradient(to bottom, var(--bg-panel) 0%, var(--bg) 100%);
}
.demo-bridge {
  font-family: var(--serif);
  font-size: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 3rem;
}
.demo h2 {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}
.demo-question {
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}
.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
@media (max-width: 700px) {
  .comparison { grid-template-columns: 1fr; }
}
.panel {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.panel-header {
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.panel.without .panel-header { background: var(--red-bg); color: var(--red); }
.panel.with .panel-header { background: var(--green-bg); color: var(--green); }
.panel-body { padding: 1.25rem; background: var(--bg-card); }
.panel-body .card-ref {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.ai-response {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 6px;
  font-style: italic;
}
.issues, .checks { list-style: none; margin-bottom: 1rem; font-size: 1rem; }
.issues li::before { content: '\2717 '; color: var(--red); font-weight: 700; margin-right: 0.35rem; }
.checks li::before { content: '\2713 '; color: var(--green); font-weight: 700; margin-right: 0.35rem; }
.issues li { margin-bottom: 0.5rem; color: var(--red); }
.checks li { margin-bottom: 0.5rem; color: var(--green); }
.conclusion {
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-weight: 600;
}
.conclusion .label { font-weight: 600; }
.conclusion .note { color: var(--text-dim); font-size: 0.8rem; margin-left: 0.25rem; }
.conclusion.wrong { background: var(--red-bg); color: var(--red); }
.conclusion.right { background: var(--green-bg); color: var(--green); }
/* ── Source receipt ── */
.source-receipt {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  font-family: var(--mono);
}
.source-receipt summary {
  color: var(--text-dim);
  cursor: pointer;
  list-style: none;
  letter-spacing: 0.02em;
}
.source-receipt summary::before {
  content: '\25B8 ';
  font-size: 0.7rem;
}
.source-receipt[open] summary::before {
  content: '\25BE ';
}
.source-receipt summary:hover { color: var(--text-muted); }
.receipt-body {
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.receipt-line {
  color: var(--text-dim);
  font-size: 0.75rem;
  line-height: 1.5;
}
.receipt-line em {
  font-style: normal;
  color: var(--text-dim);
  opacity: 0.6;
  margin-left: 0.5rem;
}

.tagline {
  font-size: 0.92rem;
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.8;
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ── How It Works ── */
.how-it-works {
  padding: 8rem 0;
  background: var(--bg);
}
.how-it-works h2 {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.how-it-works .intro { color: var(--text-muted); margin-bottom: 2.5rem; }
.steps { display: flex; flex-direction: column; gap: 2rem; }
.step { display: flex; gap: 1.25rem; align-items: flex-start; }
.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
  color: var(--accent);
}
.step-content h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.step-content code {
  display: block;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  background: var(--code-bg);
  border-radius: 6px;
  margin-bottom: 0.35rem;
  overflow-x: auto;
}
.step-result { font-size: 0.92rem; color: var(--text-dim); }

/* ── What We Cache (merged with Card Examples) ── */
.what-we-cache {
  padding: 8rem 0;
}
.what-we-cache h2 {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.what-we-cache .intro { color: var(--text-muted); margin-bottom: 2.5rem; }
.cache-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}
@media (max-width: 600px) {
  .cache-grid { grid-template-columns: 1fr; }
}
.cache-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.cache-icon {
  font-family: var(--mono);
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 6px;
  flex-shrink: 0;
  color: var(--accent);
}
.cache-item h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.2rem; }
.cache-item p { font-size: 0.88rem; color: var(--text-dim); line-height: 1.5; }

.card-examples-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-weight: 500;
}
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 700px) {
  .card-grid { grid-template-columns: 1fr; }
}
.card-preview {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.card-id {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.card-preview > p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.card-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
}
.candidates { font-weight: 500; color: var(--text-muted); }
.browse-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ── Proof (dark inverted block) ── */
.proof {
  padding: 8rem 0;
  text-align: center;
  background: var(--proof-bg);
  color: var(--proof-text);
}
.proof h2 {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  color: var(--proof-text);
}
.proof .intro { color: var(--proof-muted); margin-bottom: 3rem; max-width: 540px; margin-left: auto; margin-right: auto; }
.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 600px) {
  .metrics { grid-template-columns: 1fr; }
}
.metric { text-align: center; }
.metric-num {
  display: block;
  font-size: 3.2rem;
  font-weight: 400;
  font-family: var(--serif);
  color: #e8a87c;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.metric-label { font-size: 0.92rem; color: var(--proof-muted); }
.proof-summary { color: var(--proof-muted); line-height: 1.7; }

/* ── Trust (inside proof dark block) ── */
.trust-divider {
  width: 40px;
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 3rem auto;
}
.trust-heading {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  color: var(--proof-text);
}
.trust-intro { color: var(--proof-muted); margin-bottom: 2.5rem; }
.trust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  text-align: center;
}
@media (max-width: 700px) {
  .trust-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
.trust-item { }
.trust-num {
  display: block;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  color: #e8a87c;
  margin-bottom: 0.4rem;
}
.trust-label {
  display: block;
  font-size: 0.92rem;
  color: var(--proof-muted);
  line-height: 1.6;
}

/* ── Get Started ── */
.get-started {
  padding: 10rem 0 6rem;
  text-align: center;
  background: linear-gradient(to bottom, var(--bg-panel) 0%, var(--bg) 40%);
}
.get-started h2 {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.get-started .intro { color: var(--text-muted); margin-bottom: 2rem; }
.terminal {
  background: var(--terminal-bg);
  border: 1px solid #313244;
  border-radius: 10px;
  overflow: hidden;
  max-width: 580px;
  margin: 0 auto 1.5rem;
  text-align: left;
}
.terminal-header {
  padding: 0.6rem 0.75rem;
  background: #181825;
  display: flex;
  gap: 0.4rem;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #45475a;
}
.terminal pre {
  padding: 1rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.8;
  overflow-x: auto;
  color: var(--terminal-text);
}
.terminal code { background: none; padding: 0; color: var(--terminal-text); }
.prompt { color: #a6e3a1; }
.comment { color: #6c7086; }
.done { color: var(--text-muted); margin-bottom: 2rem; }
.get-started .cta-row { justify-content: center; }

/* ── Footer ── */
footer {
  padding: 4rem 0 3rem;
  text-align: center;
}
.footer-teaser { color: var(--text-dim); margin-bottom: 1.5rem; line-height: 1.7; }
.subscribe {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.subscribe input {
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.85rem;
  width: 220px;
}
.subscribe input:disabled { opacity: 0.4; cursor: not-allowed; }
.subscribe button {
  padding: 0.6rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: not-allowed;
  opacity: 0.4;
}
.copyright { font-size: 0.75rem; color: var(--text-dim); }

.live-demo-caption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 1.5rem;
  font-style: italic;
}

/* Demo tabs */
.demo-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.demo-tab {
  padding: 0.5rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.demo-tab:hover { border-color: var(--text-dim); }
.demo-tab.active { border-color: var(--accent); color: var(--accent); }
.demo-panel { display: none; }
.demo-panel.active { display: block; }

/* ── Demo chips ── */
.demo-chips {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.demo-chip {
  padding: 0.4rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-family: var(--mono);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.demo-chip:hover { border-color: var(--text-dim); }
.demo-chip.active { border-color: var(--accent); color: var(--accent); }

/* ── Live Demo (animated terminal) ── */
.live-demo {
  padding: 3.5rem 0 4rem;
  background: linear-gradient(to bottom, var(--bg-panel) 0%, var(--bg-panel) 100%);
}
.live-terminal {
  max-width: 800px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #313244;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25), 0 8px 24px rgba(0,0,0,0.15);
}
.live-terminal .terminal-header {
  padding: 0.6rem 0.75rem;
  background: #181825;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.live-terminal .terminal-title {
  margin-left: 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #6c7086;
  letter-spacing: 0.02em;
}
.terminal-body {
  background: var(--terminal-bg);
  padding: 1.25rem 1.5rem;
  font-family: var(--mono);
  min-height: 340px;
  font-size: 0.85rem;
  line-height: 2;
  color: var(--terminal-text);
  min-height: 340px;
}
.term-line { white-space: nowrap; }
@media (max-width: 700px) {
  .term-line { white-space: normal; word-break: break-word; }
}
.term-hidden { display: none; }
.term-muted { color: #6c7086; }
.term-dim { color: #9399b2; }
.term-bright { color: #cdd6f4; }
.term-green { color: #a6e3a1; }
.term-warn { color: #fab387; }
.cursor-blink { animation: blink 0.8s step-end infinite; color: #a6e3a1; }
@keyframes blink { 50% { opacity: 0; } }

/* ── Mobile overrides ── */
@media (max-width: 500px) {
  .hero h1 { font-size: 2.2rem; }
  .hero .sub-definition { font-size: 0.95rem; }
  .hero-oss { font-size: 0.78rem; }
  .hero-caught { font-size: 0.7rem; }
  .cta-row { flex-direction: column; align-items: center; }
  .btn { width: 100%; text-align: center; }
  .btn.disabled { width: 100%; text-align: center; }
  .terminal-body { padding: 1rem; font-size: 0.75rem; min-height: 280px; }
  .live-terminal { max-width: 100%; }
  .demo-chip { font-size: 0.72rem; padding: 0.35rem 0.75rem; }
  .demo-bridge { font-size: 1.2rem; }
  .demo-question { font-size: 0.82rem; }
  .conclusion { font-size: 0.9rem; }
  .proof { padding: 5rem 0; }
  .how-it-works { padding: 5rem 0; }
  .what-we-cache { padding: 5rem 0; }
  .get-started { padding: 6rem 0 4rem; }
  .terminal { max-width: 100%; }
}
