/* ============================================
   factq — Pixel Determinism Design System
   Brand colors from factq-pixel-brand-sheet
   ============================================ */

:root {
  /* Brand palette */
  --fq-ink: #0c0f14;
  --fq-surface: #171b23;
  --fq-accent: #5b9a6b;
  --fq-verify: #20c858;
  --fq-warn: #f0a808;
  --fq-fail: #ef4444;
  --fq-think: #3b82f6;
  --fq-stone: #6b7280;

  /* Light mode — clean, airy header */
  --md-primary-fg-color: #ffffff;
  --md-primary-bg-color: #2d2d2d;
  --md-accent-fg-color: var(--fq-accent);
  --md-typeset-a-color: var(--fq-accent);
}

[data-md-color-scheme="slate"] {
  /* Dark mode — header blends with the page */
  --md-primary-fg-color: var(--fq-surface);
  --md-primary-bg-color: #e0e0e0;
  --md-accent-fg-color: var(--fq-verify);
  --md-default-bg-color: var(--fq-ink);
  --md-typeset-a-color: var(--fq-accent);
}

/* ============================================
   Brand fonts (from factq-pixel-brand-sheet)
   Instrument Sans — Body text (loaded by Material via mkdocs.yml)
   JetBrains Mono Bold — Headings
   JetBrains Mono Regular — Code & Terminal
   PixelifySans — Pixel display accents
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;700&display=swap");

/* Headings: JetBrains Mono Bold */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
}

/* ============================================
   Pixel Determinism grid background
   ============================================ */

body {
  background-image:
    linear-gradient(rgba(107, 114, 128, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(107, 114, 128, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
}

[data-md-color-scheme="slate"] body {
  background-image:
    linear-gradient(rgba(91, 154, 107, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 154, 107, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ============================================
   Header & navbar
   ============================================ */

.md-header {
  background: rgba(12, 15, 20, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: none;
}

[data-md-color-scheme="default"] .md-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.md-tabs {
  background: transparent;
}

/* Dark mode header text */
[data-md-color-scheme="slate"] .md-header,
[data-md-color-scheme="slate"] .md-header .md-header__title,
[data-md-color-scheme="slate"] .md-header .md-header__topic,
[data-md-color-scheme="slate"] .md-tabs {
  color: #e0e0e0;
}

[data-md-color-scheme="slate"] .md-search__input {
  background: rgba(255, 255, 255, 0.06);
}

/* Navbar logo: factq wordmark sized to fit header */
.md-header__button.md-logo {
  padding: 0.1rem 0;
}

.md-header__button.md-logo img {
  height: 1.2rem;
  width: auto;
  image-rendering: pixelated;
}

/* Dark mode: invert the dark wordmark to white */
[data-md-color-scheme="slate"] .md-header__button.md-logo img {
  filter: brightness(0) invert(1);
}

/* Hide the "factq" text since the logo wordmark replaces it */
.md-header__title .md-header__topic {
  font-size: 0;
  visibility: hidden;
  width: 0;
  overflow: hidden;
}

/* ============================================
   Home page hero
   ============================================ */

.fq-hero {
  position: relative;
  padding: 6rem 2rem 4rem;
  text-align: center;
}

/* Theme-aware hero logos */
.fq-hero__logo {
  max-width: 480px;
  height: auto;
  margin: 0 auto 2.5rem;
  display: block;
  image-rendering: pixelated;
}

/* Dark mode: show dark logo (white text), hide light */
[data-md-color-scheme="slate"] .fq-hero__logo--light { display: none; }
[data-md-color-scheme="slate"] .fq-hero__logo--dark { display: block; }

/* Light mode: show light logo (dark text), hide dark */
[data-md-color-scheme="default"] .fq-hero__logo--dark { display: none; }
[data-md-color-scheme="default"] .fq-hero__logo--light { display: block; }

.fq-hero__tagline {
  font-family: "Pixelify Sans", "JetBrains Mono", monospace;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--fq-accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.fq-hero__subtitle {
  font-size: 1.15rem;
  max-width: 640px;
  margin: 0 auto 3rem;
  line-height: 1.8;
  color: var(--md-typeset-color);
  opacity: 0.8;
}

[data-md-color-scheme="default"] .fq-hero__subtitle {
  color: #333;
  opacity: 0.9;
}

.fq-hero__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.fq-hero__actions a {
  text-decoration: none;
}

/* ============================================
   Buttons
   ============================================ */

.fq-btn {
  display: inline-block;
  padding: 0.8rem 2.2rem;
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
  cursor: pointer;
}

.fq-btn--primary {
  background: var(--fq-accent);
  color: #ffffff;
  border: 1px solid var(--fq-accent);
}

.fq-btn--primary:hover {
  background: var(--fq-verify);
  border-color: var(--fq-verify);
  color: var(--fq-ink);
  box-shadow: 0 4px 24px rgba(32, 200, 88, 0.2);
}

.fq-btn--secondary {
  background: transparent;
  color: var(--md-typeset-color);
  border: 1px solid var(--fq-stone);
}

.fq-btn--secondary:hover {
  border-color: var(--fq-accent);
  color: var(--fq-accent);
}

/* ============================================
   Install snippet
   ============================================ */

.fq-install {
  text-align: center;
  margin: 2.5rem auto 0;
  max-width: 400px;
}

.fq-install code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  background: rgba(23, 27, 35, 0.6);
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  display: inline-block;
  color: var(--fq-stone);
  border: 1px solid rgba(107, 114, 128, 0.2);
}

[data-md-color-scheme="default"] .fq-install code {
  background: rgba(0, 0, 0, 0.04);
  color: #555;
  border-color: rgba(0, 0, 0, 0.08);
}

/* ============================================
   Feature grid
   ============================================ */

.fq-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.fq-feature {
  padding: 1.75rem;
  border-radius: 8px;
  border: 1px solid rgba(107, 114, 128, 0.12);
  background: rgba(23, 27, 35, 0.3);
  transition: border-color 0.2s ease, background 0.2s ease;
}

[data-md-color-scheme="default"] .fq-feature {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.06);
}

.fq-feature:hover {
  border-color: var(--fq-accent);
  background: rgba(91, 154, 107, 0.04);
}

.fq-feature h3 {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.fq-feature p {
  font-size: 0.9rem;
  opacity: 0.75;
  line-height: 1.65;
}

[data-md-color-scheme="default"] .fq-feature p {
  opacity: 0.85;
  color: #444;
}

/* ============================================
   Comparison table
   ============================================ */

.fq-comparison table {
  width: 100%;
}

.fq-comparison th {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================
   Architecture flow
   ============================================ */

.fq-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  padding: 1.5rem 0;
}

.fq-flow__step {
  text-align: center;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid rgba(107, 114, 128, 0.12);
  background: rgba(23, 27, 35, 0.3);
}

[data-md-color-scheme="default"] .fq-flow__step {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.06);
}

.fq-flow__step strong {
  font-family: "JetBrains Mono", monospace;
  display: block;
  margin-bottom: 0.5rem;
  color: var(--fq-accent);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 600px) {
  .fq-hero {
    padding: 4rem 1.5rem 3rem;
  }

  .fq-hero__logo {
    max-width: 280px;
  }

  .fq-hero__tagline {
    font-size: 1rem;
  }

  .fq-hero__subtitle {
    font-size: 1rem;
  }

  .fq-features {
    grid-template-columns: 1fr;
  }
}
