/* ============================================
   The Generative Brain — generativebrain.blog
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #1a5f7a;
  --primary-dark: #134a5f;
  --secondary: #2c3e50;
  --text: #2d3748;
  --text-light: #4a5568;
  --text-muted: #718096;
  --bg: #ffffff;
  --bg-alt: #f7fafc;
  --bg-warm: #fafaf8;
  --border: #e2e8f0;
  --accent: #e8f4f8;
  --code-bg: #f1f5f9;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  background: var(--bg);
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

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

/* ---- Navigation ---- */
.site-nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  padding: 0;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-brand:hover { color: var(--primary); }

.nav-links { display: flex; gap: 2rem; align-items: center; }

.nav-links a {
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--primary); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: 0.3s; }

/* ---- Layout ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.narrow { max-width: 760px; margin: 0 auto; }

.page-content { margin-top: 60px; }

/* ---- Hero (Homepage) ---- */
.hero {
  padding: 6rem 0 5rem;
  background: var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-photo img {
  width: 260px;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.hero-text h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.3rem;
}

.hero-titles {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 1.8rem;
  line-height: 1.6;
}

.hero-hook {
  font-size: 1.35rem;
  color: var(--primary);
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.hero-text > p {
  font-size: 1.05rem;
  color: var(--text-light);
  line-height: 1.8;
}

/* ---- Section ---- */
.section {
  padding: 5rem 0;
}

.section--alt { background: var(--bg-alt); }

.section-heading {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.section-sub {
  font-size: 1.15rem;
  color: var(--text-light);
  margin-bottom: 2.5rem;
}

/* ---- Cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.card--accent { border-left: 4px solid var(--primary); }

.card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.card p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
}

.card .status {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--primary);
  margin-top: 0.75rem;
}

/* ---- Prose (theory, blog posts) ---- */
.prose { max-width: 760px; margin: 0 auto; }

.prose h1 { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1rem; }
.prose h2 { font-size: 1.6rem; font-weight: 600; margin: 2.5rem 0 1rem; color: var(--text); }
.prose h3 { font-size: 1.3rem; font-weight: 600; margin: 2rem 0 0.75rem; }

.prose p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.prose ul, .prose ol {
  margin: 0 0 1.5rem 1.5rem;
  color: var(--text-light);
  font-size: 1.05rem;
  line-height: 1.8;
}

.prose li { margin-bottom: 0.5rem; }

.prose blockquote {
  border-left: 4px solid var(--primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--accent);
  border-radius: 0 6px 6px 0;
}

.prose blockquote p { margin-bottom: 0; color: var(--text); }

.prose code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

.prose pre {
  background: var(--code-bg);
  padding: 1.5rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.prose pre code { background: none; padding: 0; }

.prose img {
  border-radius: 6px;
  margin: 1.5rem 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.prose a { text-decoration: underline; text-underline-offset: 2px; }

/* ---- Standalone Prose Headings ---- */
.prose-heading {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  color: var(--text);
}

/* ---- Page Header ---- */
.page-header {
  padding: 4rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.page-header .subtitle {
  font-size: 1.15rem;
  color: var(--text-light);
}

/* ---- Blog List ---- */
.post-list { list-style: none; padding: 0; }

.post-item {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.post-item:first-child { padding-top: 0; }

.post-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-item h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0.3rem 0 0.5rem;
}

.post-item h2 a { color: var(--text); }
.post-item h2 a:hover { color: var(--primary); }

.post-excerpt {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.7;
}

.post-tags { margin-top: 0.5rem; }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  margin-right: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---- Post Layout ---- */
.post-header {
  padding: 4rem 0 1.5rem;
  text-align: center;
}

.post-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  max-width: 760px;
  margin: 0 auto 0.75rem;
}

.post-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.post-body { padding-bottom: 4rem; }

/* ---- Video Grid ---- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
}

.video-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.video-info {
  padding: 1.25rem;
}

.video-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.video-info p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* ---- Callout Box ---- */
.callout {
  background: var(--accent);
  border-left: 4px solid var(--primary);
  padding: 1.5rem 2rem;
  border-radius: 0 8px 8px 0;
  margin: 2rem 0;
}

.callout p { margin-bottom: 0.5rem; }
.callout p:last-child { margin-bottom: 0; }

/* ---- Experiment Box ---- */
.experiment-box {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2.5rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.experiment-box h3 { color: var(--text); margin-bottom: 1rem; }

.conditions {
  background: var(--bg-alt);
  border-radius: 6px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.condition {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.condition:last-child { border-bottom: none; }
.condition-label { font-weight: 600; }
.condition-example { font-style: italic; color: var(--text-light); }

.results {
  background: #f0f9ff;
  border-left: 4px solid var(--primary);
  padding: 1.25rem 1.5rem;
  border-radius: 0 6px 6px 0;
  margin-top: 1.5rem;
}

.results .formula {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  margin: 0.75rem 0;
  font-size: 0.95rem;
}

/* ---- Contact ---- */
.contact-list {
  list-style: none;
  padding: 0;
  font-size: 1.1rem;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.contact-list .label {
  font-weight: 600;
  min-width: 100px;
  color: var(--text);
}

/* ---- Affiliations ---- */
.affiliation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.affiliation-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.affiliation-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.affiliation-card h3 { color: var(--primary); margin-bottom: 0.25rem; }
.affiliation-card .role { font-weight: 500; margin-bottom: 0.75rem; font-size: 0.95rem; }
.affiliation-card p { font-size: 0.95rem; color: var(--text-light); line-height: 1.7; margin-bottom: 0.75rem; }

/* ---- Footer ---- */
.site-footer {
  background: var(--secondary);
  color: #cbd5e0;
  padding: 3rem 0;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-inner a { color: #e2e8f0; }
.footer-inner a:hover { color: #fff; }

.footer-links { display: flex; gap: 1.5rem; }

/* ---- CTA Button ---- */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.btn:hover { background: var(--primary-dark); color: #fff; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .hero-photo { display: flex; justify-content: center; }
  .hero-photo img { width: 200px; height: 200px; }
  .hero-text h1 { font-size: 2rem; }
  .hero-hook { font-size: 1.15rem; }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    gap: 1rem;
  }
  .nav-toggle { display: block; }

  .section { padding: 3rem 0; }
  .container { padding: 0 1.5rem; }
  .section-heading { font-size: 1.75rem; }
  .page-header h1 { font-size: 2rem; }
  .post-header h1 { font-size: 1.8rem; }

  .card-grid { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; }
  .affiliation-grid { grid-template-columns: 1fr; }

  .condition { grid-template-columns: 1fr; gap: 0.25rem; }

  .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }
}
