/* Assay Static Site Stylesheet */

/* Light theme (default) */
:root {
  --bg: #ffffff;
  --bg-secondary: #f6f8fa;
  --text: #24292f;
  --text-secondary: #57606a;
  --accent: #e6662a;
  --accent-hover: #ff7a3d;
  --border: #d0d7de;
  --code-bg: #f6f8fa;
  --code-text: #0550ae;
  color-scheme: light dark;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-secondary: #161b22;
    --text: #c9d1d9;
    --text-secondary: #8b949e;
    --border: #30363d;
    --code-bg: #161b22;
    --code-text: #79c0ff;
  }
}

/* Manual overrides — doubled selector beats :root inside @media */
html[data-theme="dark"][data-theme="dark"] {
  --bg: #0d1117;
  --bg-secondary: #161b22;
  --text: #c9d1d9;
  --text-secondary: #8b949e;
  --border: #30363d;
  --code-bg: #161b22;
  --code-text: #79c0ff;
}

html[data-theme="light"][data-theme="light"] {
  --bg: #ffffff;
  --bg-secondary: #f6f8fa;
  --text: #24292f;
  --text-secondary: #57606a;
  --border: #d0d7de;
  --code-bg: #f6f8fa;
  --code-text: #0550ae;
}

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

html {
  scroll-behavior: smooth;
}

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

/* Header & Navigation */
header {
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: color-mix(in srgb, var(--bg) 85%, transparent);
}

nav {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  height: 2.75rem;
}

nav a.logo {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-right: auto;
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
}

nav li {
  display: flex;
  align-items: center;
}

nav ul a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}

nav ul a:hover {
  color: var(--text);
  background-color: var(--bg-secondary);
}

/* Active page — subtle background pill instead of underline.
   :not(.logo) prevents the logo from getting the active pill on the home page. */
body.page-home      nav a[href="/index.html"]:not(.logo),
body.page-comparison nav a[href="/comparison.html"],
body.page-agents    nav a[href="/agent-guides.html"],
body.page-modules   nav a[href="/modules.html"],
body.page-changelog nav a[href="/changelog.html"] {
  color: var(--accent);
  font-weight: 600;
  background-color: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.3rem 0.45rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
  transition: color 0.15s, background-color 0.15s;
}

.theme-toggle:hover,
.search-toggle:hover {
  color: var(--text);
  background-color: var(--bg-secondary);
}

/* Search toggle */
.search-toggle {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.3rem 0.45rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1;
  transition: color 0.15s, background-color 0.15s;
}

/* Search overlay */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.search-overlay.active {
  display: flex;
  justify-content: center;
  padding-top: 10vh;
}

.search-container {
  width: 100%;
  max-width: 640px;
  background: var(--bg);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  padding: 1rem;
  max-height: 70vh;
  overflow-y: auto;
}

/* Pagefind UI theme overrides */
:root {
  --pagefind-ui-scale: 0.9;
  --pagefind-ui-primary: var(--accent);
  --pagefind-ui-text: var(--text);
  --pagefind-ui-background: var(--bg);
  --pagefind-ui-border: var(--border);
  --pagefind-ui-tag: var(--bg-secondary);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: 8px;
  --pagefind-ui-font: inherit;
}

/* Main Content */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: calc(100vh - 200px);
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text);
}

h2 {
  font-size: 1.8rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.3rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

h4 {
  font-size: 1.1rem;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

p {
  margin-bottom: 1rem;
  color: var(--text);
}

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

a:hover {
  color: var(--accent-hover);
}

/* Code & Pre */
code {
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", "Courier New", monospace;
  font-size: 0.9em;
}

pre {
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  font-family: "SF Mono", "Fira Code", "Cascadia Code", "Courier New", monospace;
  font-size: 0.9em;
  line-height: 1.5;
}

pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

th {
  background-color: var(--bg-secondary);
  color: var(--text);
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

tr:hover {
  background-color: var(--bg-secondary);
}

/* Lists */
ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Cards */
.card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--bg);
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--accent);
}

/* Footer */
footer {
  background-color: var(--bg);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  margin-top: 3rem;
}

footer p {
  margin-bottom: 0.5rem;
}

footer a {
  color: var(--accent);
}

footer a:hover {
  color: var(--accent-hover);
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  nav {
    flex-direction: column;
    align-items: flex-start;
  }

  nav ul {
    gap: 1rem;
    width: 100%;
  }

  main {
    padding: 1.5rem 1rem;
  }

  table {
    font-size: 0.9em;
  }

  th, td {
    padding: 0.5rem;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
