/* ============================================================
   PromptRx Design System
   Palette: Ink Navy / Warm Paper / Refined Gold / Diagnostic Green+Red
   Type: Space Grotesk (display) / Inter (body) / IBM Plex Mono (data)
   ============================================================ */

:root {
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --surface-2: #EFEBE2;
  --ink: #10151F;
  --ink-soft: #2A3242;
  --muted: #5B6472;
  --border: #E1DDD1;
  --accent: #B4863E;
  --accent-ink: #7A5B2A;
  --green: #2F8F5F;
  --red: #C4523F;
  --green-text: #256E45;
  --red-text: #A8472F;
  --mono-bg: #10151F;
  --mono-text: #E7E9ED;

  --shadow-sm: 0 1px 2px rgba(16, 21, 31, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 21, 31, 0.08);
  --shadow-lg: 0 24px 64px rgba(16, 21, 31, 0.14);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;

  --container: 1180px;
  --nav-h: 72px;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0B0F14;
  --surface: #131922;
  --surface-2: #1A2130;
  --ink: #EDEFF2;
  --ink-soft: #C7CCD6;
  --muted: #8A93A3;
  --border: #232B3A;
  --accent: #D7B372;
  --accent-ink: #F0DBAE;
  --green: #4FC98A;
  --red: #E2776A;
  --green-text: #4FC98A;
  --red-text: #E2776A;
  --mono-bg: #0B0F14;
  --mono-text: #E7E9ED;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 600; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); font-weight: 600; }
h3 { font-size: 1.35rem; font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
@media (max-width: 720px) {
  .section { padding: 64px 0; }
  .section-tight { padding: 44px 0; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.lede { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
html[data-theme="dark"] .btn-primary { background: var(--accent); color: #10151F; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-crypto {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}
.btn-crypto:hover { border-color: var(--accent); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--border);
  padding: 11px 20px;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--ink); }

.btn-sm { padding: 9px 16px; font-size: 0.85rem; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-left { display: flex; align-items: center; gap: 32px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.brand svg { height: 26px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { font-size: 0.92rem; font-weight: 500; color: var(--muted); transition: color 0.15s ease; white-space: nowrap; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.mobile-cta-item { display: none; }
.nav-right { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
}
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none;
  width: 38px; height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 1100px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.mobile-open {
    display: flex;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px 28px;
    gap: 18px;
    box-shadow: var(--shadow-md);
  }
  .nav-links.mobile-open::after {
    content: "";
    display: block;
    margin-top: 6px;
  }
  .nav-links.mobile-open .mobile-cta-item { display: block; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
}
@media (max-width: 480px) {
  .nav-right .btn-primary { display: none; }
  .brand { font-size: 1rem; }
  .nav-right { gap: 8px; }
}

/* ---------- Hero ---------- */
.hero { padding: 76px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { margin-bottom: 20px; }
.hero-sub { font-size: 1.15rem; color: var(--muted); max-width: 540px; margin-bottom: 32px; }
.trust-row { margin-top: 28px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); }
.trust-row .divider { width: 1px; height: 14px; background: var(--border); }

/* Diagnostic terminal (signature hero element) */
.terminal {
  background: var(--mono-bg);
  border-radius: var(--radius-lg);
  padding: 26px 26px 22px;
  box-shadow: var(--shadow-lg);
  border: 1px solid #232B3A;
  position: relative;
  overflow: hidden;
}
.terminal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.r { background: #E2776A; }
.terminal-dot.y { background: #E3B25C; }
.terminal-dot.g { background: #4FC98A; }
.terminal-label { margin-left: auto; font-family: var(--font-mono); font-size: 0.72rem; color: #8A93A3; letter-spacing: 0.06em; }
.terminal-body { font-family: var(--font-mono); font-size: 0.86rem; color: var(--mono-text); }
.terminal-row { margin-bottom: 16px; }
.terminal-tag { display: inline-block; font-size: 0.68rem; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 4px; margin-bottom: 8px; font-weight: 600; }
.terminal-tag.before { background: rgba(226,119,106,0.15); color: #E2776A; }
.terminal-tag.after { background: rgba(79,201,138,0.15); color: #4FC98A; }
.terminal-text { color: #C7CCD6; line-height: 1.55; }
.terminal-text.strike { color: #6B7280; text-decoration: line-through; }
.cursor { display: inline-block; width: 7px; height: 15px; background: #D7B372; vertical-align: middle; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Logo strip ---------- */
.tool-strip { display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap; padding: 28px 0; opacity: 0.75; }
.tool-strip span { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); border: 1px solid var(--border); padding: 6px 14px; border-radius: 999px; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 940px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-ink);
  margin-bottom: 18px;
}
.card-icon svg { width: 20px; height: 20px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.94rem; margin-bottom: 0; }

.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Stat row ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
@media (max-width: 720px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 20px 0; }
.stat-num { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; color: var(--ink); }
.stat-label { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

/* ---------- Diagnosis list ---------- */
.diagnosis {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.diagnosis:first-child { padding-top: 0; }
.diagnosis-num { font-family: var(--font-mono); color: var(--accent); font-size: 0.95rem; padding-top: 4px; }
.diagnosis h4 { margin-bottom: 6px; }
.diagnosis-cause { color: var(--muted); font-size: 0.92rem; margin-bottom: 8px; }
.diagnosis-fix { display: flex; gap: 8px; align-items: flex-start; font-size: 0.9rem; }
.diagnosis-fix .tag { font-family: var(--font-mono); font-size: 0.68rem; color: var(--green-text); border: 1px solid color-mix(in srgb, var(--green) 40%, transparent); padding: 1px 7px; border-radius: 4px; flex-shrink: 0; margin-top: 2px; }

/* ---------- Pricing ---------- */
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 460px;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
  position: relative;
}
.pricing-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em;
  padding: 5px 14px; border-radius: 999px;
}
html[data-theme="dark"] .pricing-badge { background: var(--accent); color: #10151F; }
.price-line { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 6px; }
.price-amount { font-family: var(--font-display); font-size: 3.2rem; font-weight: 700; color: var(--ink); }
.price-note { color: var(--muted); font-size: 0.9rem; margin-bottom: 26px; }
.check-list { list-style: none; margin: 0 0 30px; padding: 0; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 0.94rem; }
.check-list svg { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; margin-top: 2px; }
.payment-options { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0; background: none; border: none; text-align: left;
  font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; color: var(--ink);
}
.faq-q svg { width: 18px; height: 18px; flex-shrink: 0; transition: transform 0.2s ease; color: var(--muted); }
.faq-item.open .faq-q svg { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.faq-item.open .faq-a { max-height: 400px; }
.faq-a p { padding-bottom: 22px; color: var(--muted); margin: 0; max-width: 680px; }

/* ---------- Testimonials ---------- */
.testimonial { padding: 26px; }
.testimonial-stars { display: flex; gap: 2px; margin-bottom: 14px; color: var(--accent); }
.testimonial-stars svg { width: 15px; height: 15px; }
.testimonial p { font-size: 0.95rem; color: var(--ink-soft); }
.testimonial-name { font-size: 0.85rem; color: var(--muted); font-family: var(--font-mono); margin-top: 14px; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--ink);
  border-radius: var(--radius-lg);
  padding: 64px;
  text-align: center;
  color: var(--bg);
}
.cta-band h2 { color: var(--bg); }
.cta-band p { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.cta-band .btn-primary { background: var(--accent); color: #10151F; }
@media (max-width: 640px) { .cta-band { padding: 40px 24px; } }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 64px 0 32px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; margin-bottom: 48px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand p { color: var(--muted); font-size: 0.9rem; max-width: 260px; }
.footer-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 16px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 0.9rem; color: var(--ink-soft); }
.footer-col a:hover { color: var(--accent-ink); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 28px; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--muted); flex-wrap: wrap; gap: 12px; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; bottom: 26px; right: 26px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 90;
  border: none;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-2px); }
.back-to-top svg { width: 18px; height: 18px; }
html[data-theme="dark"] .back-to-top { background: var(--accent); color: #10151F; }

/* ---------- Page header (interior pages) ---------- */
.page-header { padding: 64px 0 20px; }
.page-header .eyebrow { margin-bottom: 16px; }
.page-header p.lede { margin: 0 auto; }
.page-header.center { text-align: center; }
.page-header.center .lede { margin-left: auto; margin-right: auto; }

/* ---------- Table (comparison) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: 14px 18px; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
th { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: none; }

/* ---------- Category chips (what's included) ---------- */
.chip-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { font-family: var(--font-mono); font-size: 0.82rem; padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; color: var(--ink-soft); background: var(--surface); }

/* ---------- Long-form prose (used by About and legal pages) ---------- */
.article-body { max-width: 720px; margin: 0 auto; }
.article-body h2 { margin-top: 2em; }
.article-body h3 { margin-top: 1.6em; }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li { margin-bottom: 0.5em; }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.6em 0; padding: 0.4em 0 0.4em 20px;
  color: var(--muted); font-style: italic;
}
.article-cta { margin: 48px 0; }

/* ---------- Legal pages ---------- */
.legal-body { max-width: 760px; margin: 0 auto; }
.legal-body h2 { margin-top: 2em; }
.legal-body p, .legal-body li { color: var(--muted); }
.legal-updated { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); margin-bottom: 40px; }

/* ---------- 404 ---------- */
.error-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.error-code { font-family: var(--font-mono); font-size: 6rem; color: var(--accent); font-weight: 700; line-height: 1; }

/* ---------- Repeated inline patterns, promoted to classes ---------- */
/* Single-letter card icon (used for framework-step cards, e.g. B-R-I-E-F) */
.card-icon-letter { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }

/* Before/after prompt-example pairs (Features, What's Included) */
.example-label { font-family: var(--font-mono); font-size: 0.85rem; margin-bottom: 4px; }
.example-label.before { color: var(--red-text); }
.example-label.after { color: var(--green-text); }
.example-prompt { font-size: 0.9rem; margin-bottom: 14px; }
.example-prompt.raw { font-style: italic; color: var(--muted); }
.example-prompt.tuned { margin-bottom: 0; }

/* ---------- Utility ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--bg); padding: 12px 18px; z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
