/* ===== Claude Mythos — Global Styles ===== */

:root {
  --color-bg: #f8f8f6;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-secondary: #555568;
  --color-accent: #6c5ce7;
  --color-accent-light: #a29bfe;
  --color-border: #e8e8ec;
  --color-hero-bg: #f0efe8;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --max-width: 960px;
  --radius: 8px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

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

a { color: var(--color-accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--color-accent-light); }

img { max-width: 100%; display: block; }

/* ---- Layout ---- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---- Header / Nav ---- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 100;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.logo {
  font-size: 1.1rem; font-weight: 700; color: var(--color-text);
  letter-spacing: -0.02em;
}
.logo span { color: var(--color-accent); }
nav { display: flex; gap: 24px; align-items: center; }
nav a { font-size: 0.88rem; color: var(--color-text-secondary); font-weight: 500; }
nav a:hover, nav a.active { color: var(--color-accent); }

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

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  nav {
    display: none; flex-direction: column; position: absolute;
    top: 60px; left: 0; right: 0; background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 24px; gap: 12px;
  }
  nav.open { display: flex; }
}

/* ---- Hero ---- */
.hero {
  background: var(--color-hero-bg);
  padding: 80px 0 72px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 20px;
  color: var(--color-text);
}
.hero h1 span { color: var(--color-accent); }
.hero .subtitle {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.hero .meta-line {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  opacity: 0.7;
}

/* ---- Home TOC Bar (below hero) ---- */
.home-toc {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0;
  position: sticky;
  top: 60px;
  z-index: 80;
}
.home-toc ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
}
.home-toc li { margin: 0; }
.home-toc a {
  display: block;
  padding: 12px 16px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color .2s, box-shadow .2s;
  border-bottom: 2px solid transparent;
}
.home-toc a:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}
@media (max-width: 768px) {
  .home-toc ul { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .home-toc a { padding: 10px 12px; font-size: 0.8rem; white-space: nowrap; }
}

/* ---- Sections ---- */
section { padding: 64px 0; }
section:nth-child(even) { background: var(--color-surface); }

section h2 {
  font-size: 1.6rem; font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
section h3 {
  font-size: 1.15rem; font-weight: 600;
  margin: 32px 0 8px;
}
section p, section li {
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}
section ul, section ol { padding-left: 20px; }
section li { margin-bottom: 8px; }

/* ---- Cards Grid ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 32px; }
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: box-shadow .25s, transform .25s;
}
.card:hover { box-shadow: 0 4px 24px rgba(0,0,0,.06); transform: translateY(-2px); }
.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.card p { font-size: 0.92rem; margin: 0; }
.card .icon { font-size: 1.6rem; margin-bottom: 12px; display: block; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; margin: 24px 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--color-border); }
th { font-weight: 600; background: var(--color-hero-bg); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
td { color: var(--color-text-secondary); }

/* ---- Blockquote ---- */
blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 16px 20px;
  margin: 24px 0;
  background: rgba(108, 92, 231, .04);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

/* ---- CTA / Button ---- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.92rem;
  transition: background .2s, transform .15s;
}
.btn:hover { background: #5a4bd6; color: #fff; transform: translateY(-1px); }

/* ---- Footer ---- */
.site-footer {
  background: var(--color-text);
  color: rgba(255,255,255,.6);
  padding: 48px 0 32px;
  font-size: 0.85rem;
}
.site-footer a { color: rgba(255,255,255,.8); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-grid h4 { color: #fff; font-size: 0.9rem; margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; text-align: center; }

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero { padding: 56px 0 48px; }
  section { padding: 48px 0; }
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  padding: 16px 0 0;
}
.breadcrumb a { color: var(--color-text-secondary); }
.breadcrumb a:hover { color: var(--color-accent); }

/* ---- Inner page hero (smaller) ---- */
.hero-inner {
  background: var(--color-hero-bg);
  padding: 48px 0 40px;
  text-align: center;
}
.hero-inner h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.hero-inner .subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* ---- Prose ---- */
.prose { max-width: 720px; }
.prose h2 { margin-top: 48px; }
.prose h3 { margin-top: 32px; }
.prose p + p { margin-top: 16px; }

/* ---- Source citation ---- */
.source {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  opacity: 0.7;
  margin-top: 4px;
}

/* ---- FAQ ---- */
.faq-item { border-bottom: 1px solid var(--color-border); padding: 20px 0; }
.faq-item summary {
  font-weight: 600; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--color-accent); }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin-top: 12px; }

/* ---- Sticky TOC (Left, flush with content) ---- */
.sticky-toc {
  position: fixed;
  top: 80px;
  /* Align right edge of TOC flush with left edge of .container (960px centered) */
  left: calc(50% - 480px - 172px);
  z-index: 90;
  width: 164px;
}
.sticky-toc-toggle { display: none; }

.sticky-toc-panel {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}

.sticky-toc-panel h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
  font-weight: 600;
}
.sticky-toc-panel ul { list-style: none; padding: 0; margin: 0; }
.sticky-toc-panel li { margin-bottom: 1px; }
.sticky-toc-panel a {
  display: block;
  padding: 6px 10px;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  border-radius: 4px;
  transition: background .15s, color .15s;
  font-weight: 450;
  line-height: 1.4;
}
.sticky-toc-panel a:hover { background: var(--color-hero-bg); color: var(--color-accent); }
.sticky-toc-panel a.current {
  background: rgba(108, 92, 231, .08);
  color: var(--color-accent);
  font-weight: 600;
}

/* Wide screens: TOC visible, no content shift needed */
@media (max-width: 1340px) {
  /* Not enough room beside content — collapse to floating toggle */
  .sticky-toc {
    left: 0;
    top: 70px;
    width: auto;
  }
  .sticky-toc-toggle {
    display: flex;
    width: 36px; height: 36px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    align-items: center; justify-content: center;
    box-shadow: 2px 2px 8px rgba(0,0,0,.06);
    transition: background .2s;
    color: var(--color-accent);
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font-sans);
  }
  .sticky-toc-toggle:hover { background: var(--color-hero-bg); }
  .sticky-toc-panel {
    display: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    border-left: none;
    min-width: 180px;
    max-width: 200px;
    margin-top: 4px;
  }
  .sticky-toc.open .sticky-toc-panel { display: block; }
}
