/* ==========================================================================
   Pharmakon — Texas Local Rules Engine
   Design Language: "Digital Amphora" (Light Mode)
   Hellenic antiquity meets technology. Warm, editorial, trust-building.
   ========================================================================== */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Design Tokens --- */
:root {
  /* Surfaces */
  --bg: #f7f3ec;
  --bg-deep: #f0ebe2;
  --surface: #eee9df;
  --surface-raised: #faf8f4;
  --surface-inset: #e8e2d7;

  /* Text */
  --text: #2a2420;
  --text-secondary: #6b5f54;
  --text-dim: #9c8f82;
  --text-on-gold: #faf8f4;

  /* Brand */
  --gold: #8b7225;
  --gold-hover: #735e1d;
  --gold-light: rgba(139, 114, 37, 0.08);
  --gold-accent: rgba(139, 114, 37, 0.12);
  --navy: #2d3a50;
  --navy-light: rgba(45, 58, 80, 0.07);
  --patina: #4a8b7f;
  --patina-light: rgba(74, 139, 127, 0.08);

  /* Functional */
  --border: rgba(42, 36, 32, 0.1);
  --border-strong: rgba(42, 36, 32, 0.18);
  --shadow-sm: 0 1px 3px rgba(42, 36, 32, 0.06);
  --shadow-md: 0 4px 12px rgba(42, 36, 32, 0.08);

  /* Type scale (fluid) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.2vw, 0.9375rem);
  --text-base: clamp(0.9375rem, 0.88rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.0625rem, 0.98rem + 0.35vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem);
  --text-2xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  --text-3xl: clamp(1.875rem, 1.4rem + 1.8vw, 3rem);
  --text-4xl: clamp(2.25rem, 1.6rem + 2.5vw, 3.75rem);

  /* Spacing */
  --space-xs: clamp(0.5rem, 0.4rem + 0.3vw, 0.75rem);
  --space-sm: clamp(0.75rem, 0.6rem + 0.5vw, 1rem);
  --space-md: clamp(1rem, 0.8rem + 0.8vw, 1.5rem);
  --space-lg: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
  --space-xl: clamp(2rem, 1.2rem + 2.5vw, 4rem);
  --space-2xl: clamp(3rem, 1.5rem + 4vw, 6rem);
  --space-3xl: clamp(4rem, 2rem + 5.5vw, 8rem);

  /* Layout */
  --max-width: 72rem;
  --content-width: 42rem;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: 'Crimson Pro', serif;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text);
}

h1 {
  font-size: var(--text-4xl);
  letter-spacing: 0.02em;
  font-weight: 400;
}

h2 {
  font-size: var(--text-2xl);
  letter-spacing: 0.04em;
}

h3 {
  font-size: var(--text-xl);
  letter-spacing: 0.03em;
}

h4 {
  font-size: var(--text-lg);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}

p { max-width: 65ch; }

a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color 0.2s ease;
}
a:hover { color: var(--gold); }

strong { font-weight: 600; }

code, .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
}

/* Section label — uppercase, tracked, gold rule */
.section-label {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--space-sm);
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gold-light);
  max-width: 6rem;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.container--narrow {
  max-width: var(--content-width);
}

section {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

/* Greek Key divider */
.divider {
  height: 1px;
  background: var(--border);
  position: relative;
  margin: 0 auto;
  max-width: var(--max-width);
}
.divider::after {
  content: '';
  position: absolute;
  left: 0;
  top: -2px;
  width: 4rem;
  height: 5px;
  background: linear-gradient(90deg, var(--navy) 25%, transparent 25%, transparent 50%, var(--navy) 50%, var(--navy) 75%, transparent 75%);
  background-size: 8px 5px;
  opacity: 0.5;
}

/* --- Header / Nav --- */
.site-header {
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 243, 236, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Crimson Pro', serif;
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.06em;
}
.logo span {
  color: var(--gold);
}
.logo .logo-suffix {
  color: var(--text-dim);
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
  align-items: center;
}
.nav-links a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--gold); }
.nav-links li { display: flex; align-items: center; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn--primary {
  background: var(--gold);
  color: var(--text-on-gold);
}
.btn--primary:hover {
  background: var(--gold-hover);
  color: var(--text-on-gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139, 114, 37, 0.3);
}

.btn--secondary {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn--secondary:hover {
  background: var(--gold-light);
  color: var(--gold-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
}
.btn--ghost:hover {
  color: var(--gold);
}

/* --- Hero --- */
.hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
  position: relative;
}

.hero-content {
  max-width: 38rem;
}

.hero h1 {
  margin-bottom: var(--space-md);
}

.hero .lead {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-lg);
  max-width: 34rem;
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  align-items: center;
}

.hero-meta {
  margin-top: var(--space-xl);
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}
.hero-stat .value {
  font-family: 'Crimson Pro', serif;
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.hero-stat .label {
  font-size: var(--text-xs);
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

/* --- Problem Section --- */
.problem {
  background: var(--surface);
}

.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.problem-text h2 {
  margin-bottom: var(--space-md);
}

.problem-text p {
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.problem-aside {
  background: var(--surface-raised);
  padding: var(--space-lg);
  border-left: 3px solid var(--gold);
  margin-top: var(--space-sm);
}

.problem-aside p {
  font-family: 'Crimson Pro', serif;
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- How It Works --- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.step {
  position: relative;
  padding-top: var(--space-md);
}
.step::before {
  content: attr(data-step);
  font-family: 'Crimson Pro', serif;
  font-size: var(--text-3xl);
  font-weight: 300;
  color: var(--gold);
  opacity: 0.3;
  line-height: 1;
  display: block;
  margin-bottom: var(--space-xs);
}

.step h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-xs);
}

.step p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* --- What's Inside --- */
.database-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
  max-width: 36rem;
}

.db-stat {
  padding: var(--space-md);
  background: var(--surface-raised);
  border-bottom: 2px solid var(--border);
  transition: border-color 0.3s ease;
}
.db-stat:hover { border-color: var(--gold); }

.db-stat .number {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--text);
  display: block;
}
.db-stat .desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* --- Sample Output --- */
.sample {
  background: var(--surface);
}

.sample-output {
  background: var(--surface-raised);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
  border: 1px solid var(--border);
  max-width: 48rem;
  font-size: var(--text-sm);
  line-height: 1.7;
}

.sample-output blockquote {
  border-left: 3px solid var(--gold);
  padding-left: var(--space-md);
  margin: var(--space-md) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.sample-output .citation {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--patina);
}

/* --- Pricing --- */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  max-width: 44rem;
}

.price-card {
  padding: var(--space-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.price-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.price-card.featured {
  border-color: var(--gold);
  position: relative;
}
.price-card.featured::before {
  content: 'Best value';
  position: absolute;
  top: 0;
  right: var(--space-md);
  transform: translateY(-50%);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-on-gold);
  background: var(--gold);
  padding: 0.2rem 0.75rem;
}

.price-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-xs);
}

.price-amount {
  font-family: 'Crimson Pro', serif;
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}
.price-amount .period {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--text-dim);
}

.price-note {
  font-size: var(--text-sm);
  color: var(--text-dim);
  margin-top: var(--space-xs);
  margin-bottom: var(--space-md);
}

.price-card .btn {
  width: 100%;
  justify-content: center;
}

.pricing-disclosure {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--gold-light);
  border-left: 3px solid var(--gold);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 44rem;
}

/* --- FAQ --- */
.faq-list {
  margin-top: var(--space-lg);
  max-width: 42rem;
}

.faq-item {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}

.faq-item h3 {
  font-size: var(--text-base);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--text);
}

.faq-item p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* --- Footer --- */
.site-footer {
  padding: var(--space-xl) 0 var(--space-lg);
  border-top: 1px solid var(--border);
  margin-top: var(--space-2xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-xl);
}

.footer-brand .logo {
  display: inline-block;
  margin-bottom: var(--space-sm);
}

.footer-brand p {
  font-size: var(--text-sm);
  color: var(--text-dim);
  max-width: 28ch;
}

.footer-links h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--space-sm);
}

.footer-links ul {
  list-style: none;
}
.footer-links li { margin-bottom: var(--space-xs); }
.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
}
.footer-links a:hover { color: var(--gold); }

.footer-bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer-bottom p {
  font-size: var(--text-xs);
  color: var(--text-dim);
}

.payment-logos {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}
.payment-logos span {
  font-size: var(--text-xs);
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 2px;
}

/* --- Legal Pages --- */
.legal-page {
  padding: var(--space-2xl) 0;
}

.legal-page h1 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-xs);
}

.legal-page .effective-date {
  font-size: var(--text-sm);
  color: var(--text-dim);
  margin-bottom: var(--space-xl);
}

.legal-page h2 {
  font-size: var(--text-xl);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.legal-page h3 {
  font-size: var(--text-lg);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xs);
}

.legal-page p,
.legal-page li {
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.legal-page ul, .legal-page ol {
  padding-left: 1.5rem;
}

.legal-page table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
  font-size: var(--text-sm);
}
.legal-page th,
.legal-page td {
  text-align: left;
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--border);
}
.legal-page th {
  font-weight: 600;
  color: var(--text);
}
.legal-page td {
  color: var(--text-secondary);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .problem-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: var(--space-md); }
  .database-stats { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-lg); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .nav-links { display: none; }
  .hero-meta { flex-direction: column; gap: var(--space-sm); }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
