/* ============================================================
   brainpage.ai — Design System
   Editorial, typography-driven. Light theme. Warm and personal.
   ============================================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --color-bg: #FAFAF8;
  --color-surface: #FFFFFF;
  --color-text: #1A1A1A;
  --color-text-secondary: #555555;
  --color-text-muted: #888888;
  --color-accent: #2563EB;
  --color-accent-hover: #1D4ED8;
  --color-border: #E5E5E0;
  --color-border-light: #F0F0EC;
  --color-highlight: #FEF9C3;
  --color-card-bg: #F7F7F5;

  --width-text: 680px;
  --width-wide: 900px;
  --width-max: 1080px;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-2xl: 8rem;
}

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

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-text);
}

h1 { font-size: 3.2rem; letter-spacing: -0.02em; }
h2 { font-size: 2.2rem; letter-spacing: -0.01em; margin-bottom: var(--space-md); }
h3 { font-size: 1.5rem; margin-bottom: var(--space-sm); }
h4 { font-size: 1.2rem; margin-bottom: var(--space-xs); }

p { margin-bottom: 1.4em; }

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--color-accent-hover); text-decoration: underline; }

strong { font-weight: 600; }
em { font-family: var(--font-display); font-style: italic; font-size: 1.05em; }

/* --- Layout --- */
.container {
  max-width: var(--width-text);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--wide {
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--full {
  max-width: var(--width-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
  padding: var(--space-sm) 0;
}

.nav__inner {
  max-width: var(--width-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--color-text);
  text-decoration: none;
}
.nav__logo:hover { color: var(--color-text); text-decoration: none; }

.nav__links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

.nav__links a {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.15s;
}
.nav__links a:hover { color: var(--color-text); text-decoration: none; }
.nav__links a.active { color: var(--color-text); }

.nav__cta {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 1.1rem;
  background: var(--color-text);
  color: var(--color-bg) !important;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: background 0.15s;
}
.nav__cta:hover { background: #333; color: var(--color-bg) !important; text-decoration: none; }

/* --- Sections --- */
.section {
  padding: var(--space-xl) 0;
}

.section--hero {
  padding: var(--space-2xl) 0 var(--space-xl);
}

.section--alt {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.section__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

/* --- Hero --- */
.hero__headline {
  font-size: 3.2rem;
  max-width: 14em;
  margin-bottom: var(--space-md);
}

.hero__sub {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  max-width: 36em;
  margin-bottom: var(--space-lg);
}

.hero__ctas {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.6rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
}

.btn--primary {
  background: var(--color-text);
  color: var(--color-bg);
}
.btn--primary:hover { background: #333; color: var(--color-bg); text-decoration: none; }

.btn--secondary {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}
.btn--secondary:hover { border-color: var(--color-text); text-decoration: none; }

/* --- Cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
}

.card-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--space-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: #CCC;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.card__number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs);
}

.card__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}

.card__text {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.card__text p:last-child { margin-bottom: 0; }

/* --- Stats row --- */
.stats {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin: var(--space-md) 0;
}

.stat__number {
  font-family: var(--font-display);
  font-size: 2.8rem;
  color: var(--color-text);
  line-height: 1;
}

.stat__label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
}

/* --- Flywheel diagram --- */
.flywheel {
  position: relative;
  width: 320px;
  height: 320px;
  margin: var(--space-lg) auto;
}

.flywheel__ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--color-border);
  border-radius: 50%;
}

.flywheel__node {
  position: absolute;
  width: 100px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text);
}

.flywheel__node--use { top: -8px; left: 50%; transform: translateX(-50%); }
.flywheel__node--strategize { bottom: 40px; right: -30px; }
.flywheel__node--build { bottom: 40px; left: -30px; }

.flywheel__center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
  max-width: 160px;
}

/* Arrows on the flywheel */
.flywheel__arrow {
  position: absolute;
  color: var(--color-text-muted);
  font-size: 1.2rem;
}
.flywheel__arrow--1 { top: 55px; right: 30px; transform: rotate(30deg); }
.flywheel__arrow--2 { bottom: 20px; left: 50%; transform: translateX(-50%); }
.flywheel__arrow--3 { top: 55px; left: 30px; transform: rotate(-30deg); }

/* --- Pull quote --- */
.pullquote {
  border-left: 3px solid var(--color-text);
  padding: var(--space-sm) 0 var(--space-sm) var(--space-md);
  margin: var(--space-lg) 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--color-text);
}

.pullquote--centered {
  border-left: none;
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  max-width: 32em;
  margin-left: auto;
  margin-right: auto;
}

/* --- Brain model (3-part) --- */
.brain-model {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin: var(--space-lg) auto;
  max-width: 600px;
  flex-wrap: wrap;
}

.brain-model__node {
  flex: 1;
  min-width: 150px;
  text-align: center;
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.brain-model__node-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.brain-model__node-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.brain-model__plus {
  font-size: 1.5rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* --- Four-quadrant grid --- */
.quad-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  margin: var(--space-lg) auto;
  max-width: 600px;
}

.quad-grid__cell {
  background: var(--color-surface);
  padding: var(--space-md);
}

.quad-grid__label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
}

.quad-grid__text {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

/* --- Email capture --- */
.email-capture {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
}

.email-capture--alt {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.email-capture h2 {
  margin-bottom: var(--space-xs);
}

.email-capture p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--space-md);
}

.email-capture iframe {
  border: none;
  width: 100%;
  max-width: 480px;
  min-height: 150px;
}

/* --- Long-form article (manifesto) --- */
.article { padding: var(--space-xl) 0; }

.article__header {
  text-align: center;
  padding: var(--space-2xl) 0 var(--space-lg);
}

.article__title {
  font-size: 2.8rem;
  max-width: 16em;
  margin: 0 auto var(--space-sm);
}

.article__subtitle {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  max-width: 32em;
  margin: 0 auto var(--space-md);
  line-height: 1.6;
}

.article__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}

.article__body h2 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.article__body p {
  font-size: 1.05rem;
}

.article__body .section-break {
  text-align: center;
  padding: var(--space-lg) 0;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  letter-spacing: 0.3em;
}

/* --- Lane pills --- */
.pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  color: var(--color-text-secondary);
}

/* --- Footer --- */
.footer {
  padding: var(--space-lg) 0;
  text-align: center;
  border-top: 1px solid var(--color-border-light);
}

.footer__tagline {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  max-width: 32em;
  margin-left: auto;
  margin-right: auto;
}

.footer__links {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  list-style: none;
  margin-bottom: var(--space-md);
}

.footer__links a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.footer__links a:hover { color: var(--color-text); }

/* --- Responsive --- */
@media (max-width: 768px) {
  html { font-size: 16px; }

  h1, .hero__headline { font-size: 2.2rem; }
  h2 { font-size: 1.6rem; }
  .article__title { font-size: 2rem; }
  .pullquote { font-size: 1.2rem; }

  .section { padding: var(--space-lg) 0; }
  .section--hero { padding: var(--space-xl) 0 var(--space-lg); }

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

  .stats { gap: var(--space-md); }
  .stat__number { font-size: 2rem; }

  .flywheel { width: 250px; height: 250px; }

  .brain-model { flex-direction: column; }
  .brain-model__plus { transform: rotate(90deg); }

  .quad-grid { grid-template-columns: 1fr; }

  .hero__ctas { flex-direction: column; }
  .hero__ctas .btn { text-align: center; }

  .nav__links { gap: var(--space-sm); }
}

@media (max-width: 480px) {
  h1, .hero__headline { font-size: 1.8rem; }
  .container, .container--wide, .container--full {
    padding: 0 var(--space-sm);
  }
  .nav__inner { padding: 0 var(--space-sm); }
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-sm { margin-bottom: var(--space-sm); }

/* Step cards for build page */
.step {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.step:last-child { border-bottom: none; }

.step__number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--color-border);
  line-height: 1;
  flex-shrink: 0;
  width: 50px;
}

.step__content h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.step__content p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

.step__mistake {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-card-bg);
  border-radius: 6px;
}

.step__time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
}

/* Trap cards */
.trap-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--space-md);
  border-left: 3px solid #E57373;
}

.trap-card__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.trap-card__text {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* Divider */
.divider {
  width: 40px;
  height: 2px;
  background: var(--color-border);
  margin: var(--space-xl) auto;
}
