/* ================================================
   Modo AI — Design System
   Palette: CCC-inspired indigo + lavender + chartreuse
   Typography: RunwayML system (Inter, tight tracking)
   ================================================ */

:root {
  --canvas: #E2DDF2;
  --ink: #4F30E8;
  --ink-hover: #6B50F5;
  --accent: #7AFF15;
  --accent-dark: #65D912;
  --muted: #8880B8;
  --surface: #EDEAF8;
  --white: #FFFFFF;
  --border: rgba(79, 48, 232, 0.12);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --display-size: 3rem;
  --display-weight: 400;
  --display-lh: 1.0;
  --display-ls: -1.2px;
  --body-size: 1rem;
  --body-weight: 400;
  --body-lh: 1.5;
  --body-ls: -0.16px;
  --label-size: 0.8125rem;
  --label-weight: 500;
  --label-ls: 0.35px;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 48px;
  --space-2xl: 78px;

  --radius-sm: 4px;
  --radius-md: 8px;

  --container: 880px;
  --container-wide: 1100px;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: var(--body-size);
  font-weight: var(--body-weight);
  line-height: var(--body-lh);
  letter-spacing: var(--body-ls);
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Grain texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  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.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* ---- NAV ---- */

.nav { padding: var(--space-lg) 0; }

.nav-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--ink);
  text-decoration: none;
}

.nav-links { display: flex; gap: var(--space-lg); }

.nav-links a {
  font-size: 0.875rem;
  font-weight: var(--label-weight);
  color: var(--muted);
  text-decoration: none;
  letter-spacing: var(--label-ls);
  text-transform: uppercase;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--ink); }

/* ---- HERO ---- */

.hero {
  padding: var(--space-2xl) 0 var(--space-xl);
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.label {
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: var(--label-ls);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-lg);
}

.hero h1 {
  font-size: var(--display-size);
  font-weight: var(--display-weight);
  line-height: var(--display-lh);
  letter-spacing: var(--display-ls);
  color: var(--ink);
  max-width: 16ch;
  margin-bottom: var(--space-lg);
}

.hero-sub {
  font-size: 1.125rem;
  line-height: 1.45;
  letter-spacing: -0.2px;
  color: var(--muted);
  max-width: 48ch;
}

/* ---- WAVEFORM VISUAL ---- */

.waveform-visual {
  width: 100%;
  overflow: hidden;
  padding: var(--space-lg) 0;
}

.waveform-visual svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ---- CONTAINERS ---- */

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

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

/* ---- ARTICLES ---- */

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

.article-header {
  margin-bottom: var(--space-xl);
}

.article-date {
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: var(--label-ls);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-md);
}

.article-title {
  font-size: 2.25rem;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.9px;
  color: var(--ink);
  margin-bottom: var(--space-md);
}

.article-title a {
  color: var(--ink);
  text-decoration: none;
}

.article-title a:hover { color: var(--ink-hover); }

.article-excerpt {
  font-size: 1.125rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: 52ch;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.article-body p {
  margin-bottom: var(--space-md);
  line-height: 1.55;
}

.article-body strong { font-weight: 600; }

.article-body a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}

.article-body a:hover { text-decoration-color: var(--ink); }

/* ---- HOME ARTICLE ---- */

.home-article {
  border-top: 1px solid var(--border);
  padding-top: var(--space-xl);
}

/* ---- HIGHLIGHT ---- */

.highlight {
  background: var(--accent);
  color: var(--ink);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* ---- ABOUT ---- */

.about-content {
  padding: var(--space-2xl) 0;
}

.about-content h1 {
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--ink);
  margin-bottom: var(--space-xl);
  max-width: 18ch;
}

.about-content p {
  margin-bottom: var(--space-md);
  line-height: 1.55;
  max-width: 55ch;
}

/* ---- BLOG INDEX ---- */

.blog-list {
  padding: var(--space-2xl) 0;
}

.blog-list h1 {
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--ink);
  margin-bottom: var(--space-xl);
}

.blog-entry {
  border-top: 1px solid var(--border);
  padding: var(--space-lg) 0;
}

.blog-entry .date {
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: var(--label-ls);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

.blog-entry h2 {
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.blog-entry h2 a {
  color: var(--ink);
  text-decoration: none;
}

.blog-entry h2 a:hover { color: var(--ink-hover); }

.blog-entry .excerpt {
  margin-top: var(--space-sm);
  color: var(--muted);
  line-height: 1.5;
}

/* ---- ARTICLE PAGE ---- */

.article-page {
  padding: var(--space-2xl) 0;
}

.back-link {
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  letter-spacing: var(--label-ls);
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  margin-bottom: var(--space-xl);
}

.back-link:hover { color: var(--ink); }

/* ---- FOOTER ---- */

.footer {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 0.875rem;
  color: var(--ink);
}

.footer-links { display: flex; gap: var(--space-md); }

.footer-links a {
  font-size: 0.875rem;
  color: var(--ink);
  text-decoration: none;
}

.footer-links a:hover { color: var(--ink-hover); }

/* ---- ERROR PAGE ---- */

.error-page {
  padding: var(--space-2xl) 0;
  text-align: center;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.error-page h1 {
  font-size: var(--display-size);
  font-weight: var(--display-weight);
  line-height: var(--display-lh);
  letter-spacing: var(--display-ls);
  color: var(--ink);
  margin-bottom: var(--space-md);
}

.error-page p { color: var(--muted); margin-bottom: var(--space-lg); }
.error-page a { color: var(--ink); }

/* ---- RESPONSIVE ---- */

@media (max-width: 768px) {
  :root {
    --display-size: 2.25rem;
    --display-ls: -0.8px;
  }

  .hero {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-lg);
  }

  .hero h1 { max-width: 100%; }
  .article-title { font-size: 1.75rem; }
  .about-content h1, .blog-list h1 { font-size: 2rem; }

  .footer-inner {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --display-size: 1.875rem;
    --space-xl: 32px;
    --space-2xl: 48px;
  }

  .nav-inner,
  .hero,
  .container,
  .container-wide {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
}
