/* Sterawatt theme */
:root {
  --canvas:        #f0faf4;
  --surface:       #ffffff;
  --ink:           #0f2318;
  --ink-muted:     #4b6858;
  --border:        #d1fae5;
  --primary:       #16a34a;
  --primary-light: #dcfce7;
  --primary-dark:  #15803d;
  --amber:         #d97706;
  --font-sans:     system-ui, -apple-system, sans-serif;
  --font-mono:     monospace;
}
/*
 * base.css — canonical source (xcode)
 *
 * Structural styles for all vjs projects. All colours and fonts reference
 * CSS custom properties defined in theme.css — never hardcode values here.
 *
 * COPY INSTRUCTIONS
 * -----------------
 * Copy to public/css/base.css in each project.
 * Link in HTML *before* theme.css:
 *   <link rel="stylesheet" href="/css/base.css">
 *   <link rel="stylesheet" href="/css/theme.css">
 *
 * When improving, bring the change back here first, then re-copy to projects.
 */

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--canvas);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 640px)  { .wrap { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .wrap { padding: 0 2rem; } }

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.navbar.scrolled { box-shadow: 0 1px 12px rgba(0,0,0,0.1); }
#nav-sentinel    { height: 0; }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.navbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-wordmark {
  font-family: var(--font-logo, var(--font-sans));
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.nav-links {
  display: none;
  align-items: center;
  gap: 28px;
  list-style: none;
}
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-links a {
  font-size: 0.875rem;
  color: var(--ink-muted);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--ink); }

.nav-auth {
  display: none;
  align-items: center;
  gap: 12px;
}
@media (min-width: 768px) { .nav-auth { display: flex; } }
.nav-auth .btn-ghost {
  font-size: 0.875rem;
  color: var(--ink-muted);
  transition: color 0.15s;
}
.nav-auth .btn-ghost:hover { color: var(--ink); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-outline:hover { background: var(--primary-light); }

.btn-primary.lg, .btn-outline.lg { padding: 0.875rem 2rem; }

/* ── Mobile menu button + dropdown ───────────────────────────────────────── */
.menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  position: relative;
  z-index: 60;
  -webkit-appearance: none;
  appearance: none;
}
@media (min-width: 768px) { .menu-btn { display: none; } }
.menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.25s ease, opacity 0.18s ease;
}
.menu-btn.open span:nth-child(1) { transform: translateY(7px)  rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%; right: 1rem;
  margin-top: 0.25rem;
  width: 220px;
  background: var(--ink);
  flex-direction: column;
  padding: 0.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 49;
}
.mobile-nav.open { display: flex; }
@media (min-width: 768px) { .mobile-nav { display: none !important; } }
.mobile-nav a {
  font-size: 0.9375rem; font-weight: 500;
  color: rgba(255,255,255,0.85);
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
}
.mobile-nav a:hover, .mobile-nav a:focus {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.mobile-nav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: transparent;
  cursor: pointer;
  z-index: 48;
}
.mobile-nav-overlay.open { display: block; }
@media (min-width: 768px) { .mobile-nav-overlay { display: none !important; } }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero { padding: 6rem 0 4rem; }
@media (min-width: 1024px) { .hero { padding: 9rem 0 5rem; } }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 1.5rem;
  max-width: 720px;
}
.hero-sub {
  font-size: 1.125rem;
  color: var(--ink-muted);
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 2.5rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Reel ────────────────────────────────────────────────────────────────── */
.reel-wrap { margin-top: 4rem; }
.reel-label {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.reel-sub {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-bottom: 1.25rem;
}
.reel-overflow { overflow: hidden; }

@keyframes reel-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.reel-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: reel-scroll 34s linear infinite;
}
.reel-track:hover { animation-play-state: paused; }

.reel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  flex-shrink: 0;
}
.reel-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.reel-icon svg { width: 16px; height: 16px; stroke: var(--primary); fill: none; stroke-width: 1.5; }
.reel-name  { font-size: 0.875rem; font-weight: 500; color: var(--ink);      white-space: nowrap; }
.reel-context { font-size: 0.75rem;  color: var(--ink-muted); white-space: nowrap; }

/* ── Section shared ──────────────────────────────────────────────────────── */
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.section-heading {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 1rem;
}
.section-sub {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  line-height: 1.7;
}
.section-intro {
  max-width: 640px;
  margin: 0 auto 3rem;
  text-align: center;
}
.section-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Steps ───────────────────────────────────────────────────────────────── */
.steps-section { padding: 3.5rem 0 5rem; background: var(--canvas); }

.steps-grid { display: grid; gap: 1rem; margin-bottom: 2.5rem; }
@media (min-width: 640px)  { .steps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .steps-grid { grid-template-columns: repeat(4, 1fr); } }

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}
.step-num {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: color-mix(in srgb, var(--primary) 40%, transparent);
  margin-bottom: 8px;
}
.step-title { font-size: 0.875rem; font-weight: 600; color: var(--ink);      margin-bottom: 6px; }
.step-body  { font-size: 0.75rem;  color: var(--ink-muted); line-height: 1.6; }

/* ── Publications ────────────────────────────────────────────────────────── */
.publications-section { padding: 3.5rem 0 5rem; }

.pub-grid { display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .pub-grid { grid-template-columns: repeat(2, 1fr); } }

.pub-card {
  display: flex;
  gap: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.15s;
}
.pub-card:hover { border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.pub-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.pub-icon svg { width: 20px; height: 20px; stroke: var(--primary); fill: none; stroke-width: 1.5; }
.pub-strand {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--primary) 60%, transparent);
  margin-bottom: 4px;
}
.pub-title { font-size: 0.875rem; font-weight: 600; color: var(--ink);      margin-bottom: 8px; }
.pub-desc  { font-size: 0.875rem; color: var(--ink-muted); line-height: 1.6; }

/* ── CTA section ─────────────────────────────────────────────────────────── */
.cta-section { padding: 5rem 0 7rem; background: var(--ink); text-align: center; }
.cta-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.5rem;
}
.cta-section h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.cta-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.6);
  max-width: 440px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-primary-inv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary-inv:hover { background: var(--primary-dark); }
.btn-ghost-inv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-ghost-inv:hover { background: rgba(255,255,255,0.2); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}
@media (min-width: 768px)  { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.5fr repeat(5, 1fr); } }

.footer-brand-name {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  display: block;
  margin-bottom: 12px;
}
.footer-brand-desc {
  font-size: 0.75rem;
  color: var(--ink-muted);
  line-height: 1.6;
  max-width: 220px;
}
.footer-col h3 {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a  { font-size: 0.875rem; color: var(--ink-muted); transition: color 0.15s; }
.footer-col a:hover { color: var(--ink); }

.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--ink-muted);
}
@media (min-width: 640px) {
  .footer-bottom { flex-direction: row; align-items: center; justify-content: space-between; }
}
.footer-bottom-links { display: flex; gap: 1rem; }
.footer-bottom-links a { color: var(--ink-muted); transition: color 0.15s; }
.footer-bottom-links a:hover { color: var(--ink); }
/* article.css — Sterawatt article page styles */

/* ── Narrow article wrapper ──────────────────────────────────────────────── */
.article-wrap { max-width: 768px; margin: 0 auto; padding: 3rem 0 6rem; }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.article-breadcrumb {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; color: var(--ink-muted); margin-bottom: 2.5rem;
}
.article-breadcrumb a { transition: color 0.15s; }
.article-breadcrumb a:hover { color: var(--ink); }
.article-breadcrumb-sep { color: var(--border); user-select: none; }
.article-breadcrumb-current { color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

/* ── Article header ──────────────────────────────────────────────────────── */
.article-category {
  font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--primary); display: block; margin-bottom: 0.75rem;
}
.article-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.15; color: var(--ink); margin-bottom: 1rem;
}
.article-subtitle {
  font-size: 1.125rem; color: var(--ink-muted); line-height: 1.65; margin-bottom: 1.5rem;
}
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  font-size: 0.75rem; color: var(--ink-muted);
  border-top: 1px solid var(--border); padding-top: 1.25rem; margin-bottom: 2.5rem;
}
.article-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border); flex-shrink: 0; }

/* ── Image figure ────────────────────────────────────────────────────────── */
.article-figure { margin: 1.5rem 0; }
.article-figure-img { width: 100%; height: auto; border-radius: 10px; display: block; border: 1px solid var(--border); }
.article-figure-placeholder {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 3rem 2rem; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.75rem;
  color: var(--ink-muted); font-size: 0.8125rem; text-align: center; min-height: 220px;
}
.article-figure-placeholder svg { opacity: 0.35; }

/* ── Article prose body ──────────────────────────────────────────────────── */
.article-prose {}
.article-prose .para {
  font-size: 0.9375rem; color: var(--ink-muted); line-height: 1.8; margin-bottom: 1.375rem;
}
.article-prose .para strong { color: var(--ink); font-weight: 600; }
.article-prose .subheader {
  font-size: 1.0625rem; font-weight: 600; color: var(--ink); line-height: 1.35;
  margin: 2.5rem 0 0.875rem;
}
.article-prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

/* ── FAQ section ─────────────────────────────────────────────────────────── */
.faq-section { margin-top: 3rem; padding-top: 3rem; border-top: 1px solid var(--border); }
.faq-section-title {
  font-size: 1.125rem; font-weight: 600; color: var(--ink); margin-bottom: 1.25rem;
}
.faq-list { display: flex; flex-direction: column; gap: 0.5rem; }
details.faq-item {
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--canvas);
}
details.faq-item[open] { background: var(--canvas); }
summary.faq-trigger {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; font-size: 0.875rem; font-weight: 500; color: var(--ink);
  cursor: pointer; list-style: none; gap: 1rem; transition: background 0.15s;
}
summary.faq-trigger:hover { background: var(--primary-light); }
summary.faq-trigger::-webkit-details-marker { display: none; }
.faq-chevron {
  width: 16px; height: 16px; flex-shrink: 0; color: var(--ink-muted);
  transition: transform 0.2s;
}
details[open] .faq-chevron { transform: rotate(180deg); }
.faq-answer {
  padding: 0 1.25rem 1rem; font-size: 0.875rem; color: var(--ink-muted);
  line-height: 1.7; border-top: 1px solid var(--border); background: var(--surface);
}
.faq-answer p { padding-top: 1rem; }

/* ── Share bar ───────────────────────────────────────────────────────────── */
.share-bar {
  margin-top: 2.5rem; margin-bottom: 1.5rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem;
}
.share-bar-label {
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-muted);
}
.share-links { display: flex; gap: 0.5rem; }
.article-share-link {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border);
  color: var(--ink-muted); transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.article-share-link:hover {
  color: var(--ink); border-color: color-mix(in srgb, var(--ink) 40%, transparent); background: var(--surface);
}

/* ── Related articles ────────────────────────────────────────────────────── */
.related-section { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--border); }
.related-section-title { font-size: 1.125rem; font-weight: 600; color: var(--ink); margin-bottom: 1.5rem; }
.related-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }
.related-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--surface);
  transition: border-color 0.15s;
  text-decoration: none; color: inherit;
}
.related-card:hover { border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.related-thumb { aspect-ratio: 16/9; overflow: hidden; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.375rem; flex: 1; }
.related-category { font-family: var(--font-mono); font-size: 0.5625rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary); }
.related-card-title { font-size: 0.875rem; font-weight: 600; color: var(--ink); line-height: 1.35; }
.related-excerpt { font-size: 0.8125rem; color: var(--ink-muted); line-height: 1.6; flex: 1; margin-top: 0.125rem; }
.related-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.75rem; }
.related-meta { font-size: 0.6875rem; color: var(--ink-muted); }
.related-read { font-size: 0.6875rem; font-weight: 600; color: var(--primary); }

/* ── Back link ───────────────────────────────────────────────────────────── */
.article-back-wrap { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.article-back { font-size: 0.875rem; font-weight: 500; color: var(--primary); transition: color 0.15s; }
.article-back:hover { color: var(--primary-dark); }
