/* ═══════════════════════════════════════════════
   Herb Expert — Victorian Botanical Field Guide
   ═══════════════════════════════════════════════ */

:root {
  --c-bg:         #0c110e;
  --c-surface:    #141c16;
  --c-surface-2:  #1a2520;
  --c-border:     #2a3d30;
  --c-text:       #c4d4c8;
  --c-text-muted: #6b8a72;
  --c-heading:    #e8f0ea;
  --c-accent:     #5fa67a;
  --c-accent-dim: #3d7a54;
  --c-gold:       #c9a84c;
  --c-gold-dim:   #8a7235;
  --c-red:        #c45c5c;
  --c-parchment:  #f5ecd7;

  --f-display: 'Cormorant Garamond', 'Georgia', serif;
  --f-body:    'DM Sans', 'Helvetica Neue', sans-serif;
  --f-mono:    'JetBrains Mono', 'Menlo', monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --space: clamp(1rem, 3vw, 2rem);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--c-accent); text-decoration: none; }
a:hover { color: var(--c-gold); }
code {
  font-family: var(--f-mono);
  font-size: 0.82em;
  background: var(--c-surface-2);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--c-accent);
}

/* ── Grain Overlay ── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(12, 17, 14, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--c-border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.nav-brand {
  font-family: var(--f-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--c-heading);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-brand:hover { color: var(--c-accent); }
.nav-icon { font-size: 1.4rem; color: var(--c-accent); }
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--c-text-muted);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--c-heading); }

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(56px + 3rem) var(--space) 4rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hero-botanical {
  position: absolute;
  width: 100%;
  height: 100%;
  color: var(--c-accent);
}
.hero-content {
  position: relative;
  max-width: 800px;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-gold);
  border: 1px solid var(--c-gold-dim);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 2rem;
  animation: fadeIn 0.8s ease;
}
.hero-title {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}
.hero-title-line {
  display: block;
  font-size: clamp(2.8rem, 7vw, 5rem);
  color: var(--c-heading);
  animation: slideUp 0.8s ease backwards;
}
.hero-title-line:nth-child(1) { animation-delay: 0.1s; }
.hero-title-line:nth-child(2) { animation-delay: 0.2s; }
.hero-title-line:nth-child(3) { animation-delay: 0.3s; }
.hero-title-accent {
  color: var(--c-accent);
  font-style: italic;
}
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--c-text-muted);
  max-width: 600px;
  margin: 0 auto 3rem;
  line-height: 1.8;
  animation: fadeIn 1s ease 0.4s backwards;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  animation: fadeIn 1s ease 0.6s backwards;
}
.stat { text-align: center; }
.stat-value {
  display: block;
  font-family: var(--f-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-heading);
}
.stat-label {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-muted);
}

/* ── Sections ── */
.section {
  padding: clamp(4rem, 8vw, 7rem) var(--space);
}
.section-alt {
  background: var(--c-surface);
}
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.section-header {
  margin-bottom: 3rem;
}
.section-number {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--c-gold);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.5rem;
}
.section-header h2 {
  font-family: var(--f-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--c-heading);
  margin-bottom: 0.5rem;
}
.section-header p {
  font-size: 1.05rem;
  color: var(--c-text-muted);
  max-width: 600px;
}

/* ── Diagram Cards ── */
.diagram-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 2rem;
}
.diagram-title {
  padding: 1rem 1.5rem;
  font-family: var(--f-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--c-text-muted);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.diagram-icon { color: var(--c-accent); }

/* ── Concept Diagram ── */
.concept-diagram {
  padding: 2.5rem 1.5rem;
  overflow-x: auto;
}
.pipeline-flow {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 900px;
  justify-content: center;
}
.pipeline-node {
  text-align: center;
  padding: 1.2rem 1rem;
  border-radius: var(--r-md);
  border: 1.5px solid var(--c-border);
  background: var(--c-surface-2);
  min-width: 120px;
  position: relative;
  transition: border-color 0.3s, transform 0.3s;
}
.pipeline-node:hover {
  border-color: var(--c-accent);
  transform: translateY(-3px);
}
.pipeline-input { border-color: var(--c-gold-dim); }
.pipeline-model { border-color: var(--c-accent-dim); }
.pipeline-output { border-color: var(--c-accent); background: rgba(95,166,122,0.08); }
.node-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
.node-label {
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-heading);
  margin-bottom: 0.25rem;
}
.node-desc {
  font-size: 0.72rem;
  color: var(--c-text-muted);
  line-height: 1.4;
}
.node-tag {
  position: absolute;
  top: -8px;
  right: -8px;
  font-family: var(--f-mono);
  font-size: 0.6rem;
  background: var(--c-accent-dim);
  color: var(--c-heading);
  padding: 2px 6px;
  border-radius: 100px;
}
.pipeline-arrow {
  font-size: 1.5rem;
  color: var(--c-border);
  padding: 0 0.5rem;
  flex-shrink: 0;
}

/* ── BPMN Diagram ── */
.bpmn-diagram {
  padding: 1.5rem;
  overflow-x: auto;
}
.bpmn-svg {
  width: 100%;
  min-width: 700px;
  height: auto;
}
.bpmn-legend {
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--c-border);
  font-size: 0.72rem;
  color: var(--c-text-muted);
}
.bpmn-legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.legend-line {
  display: inline-block;
  width: 20px;
  height: 0;
  border-top: 1.5px solid var(--c-text-muted);
}
.legend-line-dashed { border-top-style: dashed; }

/* ── Model Grid ── */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.model-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 1.5rem;
  transition: border-color 0.3s, transform 0.3s;
}
.model-card:hover {
  border-color: var(--c-accent-dim);
  transform: translateY(-2px);
}
.model-card-safety {
  border-color: var(--c-gold-dim);
  background: rgba(201, 168, 76, 0.03);
}
.model-card-safety:hover { border-color: var(--c-gold); }
.model-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.model-badge {
  font-family: var(--f-mono);
  font-size: 0.65rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 100px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.model-badge-vision { background: rgba(95,166,122,0.15); color: var(--c-accent); }
.model-badge-ner { background: rgba(108,140,200,0.15); color: #8ab0e0; }
.model-badge-chem { background: rgba(180,120,200,0.15); color: #c090d8; }
.model-badge-qa { background: rgba(201,168,76,0.15); color: var(--c-gold); }
.model-badge-safety { background: rgba(201,168,76,0.2); color: var(--c-gold); }
.model-size {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--c-text-muted);
}
.model-card h3 {
  font-family: var(--f-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--c-heading);
  margin-bottom: 0.25rem;
}
.model-card code {
  display: block;
  font-size: 0.7rem;
  margin-bottom: 0.75rem;
  word-break: break-all;
}
.model-card p {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  margin-bottom: 0.75rem;
}
.model-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.72rem;
  color: var(--c-text-muted);
}

/* ── Herb Grid ── */
.herb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.herb-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  transition: border-color 0.3s, transform 0.3s;
}
.herb-card:hover {
  border-color: var(--c-accent-dim);
  transform: translateY(-2px);
}
.herb-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.herb-card h3 {
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--c-heading);
  margin-bottom: 0.15rem;
}
.herb-latin {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--c-accent);
  margin-bottom: 0.25rem;
}
.herb-parts {
  font-size: 0.72rem;
  color: var(--c-text-muted);
  margin-bottom: 0.5rem;
}
.herb-uses {
  font-size: 0.85rem;
  color: var(--c-text);
  margin-bottom: 0.5rem;
}
.herb-compounds {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  color: var(--c-text-muted);
  padding-top: 0.5rem;
  border-top: 1px solid var(--c-border);
}

/* ── Usage Grid ── */
.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.usage-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 1.5rem;
}
.usage-card h3 {
  font-family: var(--f-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--c-heading);
  margin-bottom: 0.5rem;
}
.usage-card > p {
  font-size: 0.88rem;
  color: var(--c-text-muted);
  margin-bottom: 1rem;
}

/* ── Code Blocks ── */
.code-block {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.code-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--c-border);
  background: rgba(0,0,0,0.15);
}
.code-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-border);
}
.code-label {
  font-family: var(--f-mono);
  font-size: 0.65rem;
  color: var(--c-text-muted);
  margin-left: auto;
}
.code-block pre {
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.8;
}
.code-block code {
  font-family: var(--f-mono);
  background: none;
  padding: 0;
  color: var(--c-text);
}
.code-comment { color: var(--c-text-muted); }
.code-var { color: var(--c-gold); }

/* ── Safety Callout ── */
.safety-callout {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
  background: rgba(201, 168, 76, 0.05);
  border: 1px solid var(--c-gold-dim);
  border-radius: var(--r-md);
  align-items: flex-start;
}
.safety-icon { font-size: 2rem; flex-shrink: 0; }
.safety-callout h3 {
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-gold);
  margin-bottom: 0.25rem;
}
.safety-callout p {
  font-size: 0.88rem;
  color: var(--c-text-muted);
  line-height: 1.7;
}
.verdict-green { color: var(--c-accent); font-weight: 600; }
.verdict-yellow { color: var(--c-gold); font-weight: 600; }
.verdict-red { color: var(--c-red); font-weight: 600; }

/* ── Footer ── */
.footer {
  padding: 3rem var(--space);
  border-top: 1px solid var(--c-border);
  text-align: center;
}
.footer-inner { max-width: 600px; margin: 0 auto; }
.footer-brand {
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-heading);
  margin-bottom: 0.5rem;
}
.footer p {
  font-size: 0.82rem;
  color: var(--c-text-muted);
  margin-bottom: 1rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}
.footer-links a {
  font-size: 0.78rem;
  color: var(--c-text-muted);
}
.footer-links a:hover { color: var(--c-accent); }

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-stats { flex-wrap: wrap; }
  .pipeline-flow { flex-direction: column; min-width: 0; }
  .pipeline-arrow { transform: rotate(90deg); }
  .usage-grid { grid-template-columns: 1fr; }
  .model-grid { grid-template-columns: 1fr; }
}
