/* MetaBa.ai — Shared Site Design System */

/* ========================================
   CSS Variables (Light Mode Default)
   ======================================== */
:root {
  --terra: #C4775A;
  --sage: #7A9E7E;
  --cream: #F5ECE3;
  --golden: #D4A574;
  --umber: #1A1612;
  --body-text: #2D2520;
  --terra-10: rgba(196,119,90,0.1);
  --terra-20: rgba(196,119,90,0.2);
  --sage-10: rgba(122,158,126,0.1);
  --sage-20: rgba(122,158,126,0.2);
  --golden-10: rgba(212,165,116,0.1);
  --golden-20: rgba(212,165,116,0.2);

  /* Semantic */
  --bg-base: var(--cream);
  --bg-raised: #ffffff;
  --bg-elevated: #ffffff;
  --text-primary: var(--body-text);
  --text-secondary: rgba(45,37,32,0.72);
  --text-muted: rgba(45,37,32,0.5);
  --border-color: rgba(196,119,90,0.1);
  --border-strong: rgba(196,119,90,0.2);
  --shadow-soft: 0 20px 60px rgba(26,22,18,0.08);
  --shadow-card: 0 4px 24px rgba(26,22,18,0.06);

  /* Layout */
  --content-width: 780px;
  --wide-width: 1200px;
  --header-height: 60px;

  /* Type */
  --font-heading: 'Nunito', -apple-system, sans-serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
}

/* ========================================
   Dark Mode
   ======================================== */
[data-theme="dark"] {
  --terra: #d4946e;
  --sage: #a8c4aa;
  --golden: #e8c098;
  --umber: #f5e8dc;
  --body-text: #f5e8dc;
  --terra-10: rgba(212,148,110,0.1);
  --terra-20: rgba(212,148,110,0.2);
  --sage-10: rgba(168,196,170,0.1);
  --sage-20: rgba(168,196,170,0.2);
  --golden-10: rgba(232,192,152,0.1);
  --golden-20: rgba(232,192,152,0.2);

  --bg-base: #14110f;
  --bg-raised: #1c1814;
  --bg-elevated: #241f1a;
  --text-primary: #f5e8dc;
  --text-secondary: rgba(245,232,220,0.88);
  --text-muted: rgba(245,232,220,0.5);
  --border-color: rgba(212,148,110,0.1);
  --border-strong: rgba(212,148,110,0.2);
  --shadow-soft: 0 20px 60px rgba(0,0,0,0.3);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.2);
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--terra); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

img { max-width: 100%; height: auto; }

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--umber);
  line-height: 1.2;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin-bottom: 0.75rem; }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.35rem); margin-bottom: 0.5rem; font-weight: 400; }
h4 { font-size: 1.05rem; font-weight: 400; margin-bottom: 0.5rem; }

p { margin-bottom: 1.25rem; }

.label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

/* ========================================
   Layout
   ======================================== */
.container {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container--narrow {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}
.section + .section {
  padding-top: 0;
}

/* ========================================
   Header
   ======================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.logo svg.bloom {
  width: 32px;
  height: 32px;
}
.logo-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--umber);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.site-nav a {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.site-nav a:hover, .site-nav a.active {
  color: var(--terra);
  opacity: 1;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover {
  border-color: var(--terra);
  color: var(--terra);
}
.theme-toggle svg { width: 18px; height: 18px; }

/* Mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 0.5rem;
}
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    box-shadow: var(--shadow-soft);
  }
  .site-nav.open { display: flex; }
  .site-nav a { font-size: 1rem; }
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.footer-brand svg { width: 36px; height: 36px; }
.footer-brand-name {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 300;
  color: var(--umber);
}
.footer-tagline {
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.footer-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.footer-links a:hover { color: var(--terra); }
.footer-fine {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  max-width: 400px;
}
.footer-copyright {
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* ========================================
   Cards
   ======================================== */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}
.card--flat {
  box-shadow: none;
}
.card--flat:hover {
  transform: none;
  box-shadow: none;
}

.card-label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--terra);
  margin-bottom: 0.75rem;
}
.card-title {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: 1.25rem;
  color: var(--umber);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* ========================================
   Hero
   ======================================== */
.hero {
  text-align: center;
  padding: 5rem 0 3rem;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  max-width: 700px;
  margin: 0 auto 1rem;
}
.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}
.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); opacity: 0.9; }
.btn--primary {
  background: var(--terra);
  color: #fff;
}
.btn--sage {
  background: var(--sage);
  color: #fff;
}
.btn--ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

/* ========================================
   Grid Layouts
   ======================================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
}

/* ========================================
   Section Headers
   ======================================== */
.section-header {
  margin-bottom: 2rem;
}
.section-header h2 {
  margin-bottom: 0.5rem;
}
.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 560px;
}

/* ========================================
   CTA / Email Capture
   ======================================== */
.cta-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-color);
  border-radius: 2rem;
  padding: 3rem;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.cta-card h3 {
  font-size: 1.5rem;
  font-weight: 300;
  margin-bottom: 0.75rem;
}
.cta-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.cta-form {
  display: flex;
  gap: 0.75rem;
  max-width: 420px;
  margin: 0 auto;
}
.cta-form input {
  flex: 1;
  padding: 0.75rem 1.25rem;
  border-radius: 2rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.cta-form input:focus {
  border-color: var(--sage);
}
.cta-form input::placeholder {
  color: var(--text-muted);
}
.cta-fine {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* ========================================
   Disclaimer
   ======================================== */
.disclaimer {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 2rem;
}

/* ========================================
   Coming Soon Badge
   ======================================== */
.coming-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--golden);
  background: var(--golden-10);
  padding: 0.3rem 0.75rem;
  border-radius: 1rem;
}

/* ========================================
   Page-specific: Article listing
   ======================================== */
.article-list-card {
  display: block;
  text-decoration: none;
}
.article-list-card .card-title {
  color: var(--umber);
  transition: color 0.2s;
}
.article-list-card:hover .card-title {
  color: var(--terra);
}
.article-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* ========================================
   Category Filters
   ======================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.filter-pill {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.filter-pill:hover, .filter-pill.active {
  background: var(--terra);
  color: #fff;
  border-color: var(--terra);
}

/* ========================================
   Research / Paper Cards
   ======================================== */
.paper-card {
  border-left: 3px solid var(--golden);
}
.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.paper-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  background: var(--terra-10);
  color: var(--terra);
  font-weight: 500;
}

/* ========================================
   About / Author
   ======================================== */
.about-intro {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 680px;
}
.credential-list {
  list-style: none;
  padding: 0;
}
.credential-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.credential-list li strong {
  color: var(--text-primary);
}

/* ========================================
   Bloom Motif (reusable SVG inline)
   ======================================== */
.bloom-decoration {
  opacity: 0.06;
  pointer-events: none;
}

/* ========================================
   Utilities
   ======================================== */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
