/* ==========================================================================
   Renovatio — brand tokens, lifted from the app's ui_pass.py.
   Light palette on :root, dark palette layered on for system + manual toggle.
   ========================================================================== */

:root {
  /* Surfaces — light */
  --plane: #f2f2f6;
  --surface-1: #ffffff;
  --surface-2: #f6f6f9;
  --text-primary: #101014;
  --text-secondary: #56565e;
  --muted: #6b6b73;
  --border: rgba(16, 16, 20, 0.09);
  --grid: #e7e7ec;
  --card-shadow: 0 1px 2px rgba(16, 16, 20, 0.04), 0 8px 24px -12px rgba(16, 16, 20, 0.10);

  /* Brand pair — chrome only: the rule above the wordmark. Never a fill. */
  --brand-a: #6a5ae0;
  --brand-b: #d94f7d;

  /* Module hues */
  --hue-time-travel: #6a5ae0;
  --hue-biopulse: #d94f7d;
  --hue-eq-compass: #0f9b7a;
  --hue-opex-hub: #2a78d6;
  --hue-growthscope: #a37800;
  --hue-carlos: #5c6b8a;

  /* Status — reserved, always paired with a label */
  --good: #12802f;
  --warning: #8f5c00;
  --critical: #d0342c;

  /* Type */
  --font-ui: -apple-system, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;

  --t-caption2: 0.688rem;
  --t-caption1: 0.75rem;
  --t-footnote: 0.813rem;
  --t-subhead: 0.938rem;
  --t-body: 1rem;
  --t-headline: 1.063rem;
  --t-title3: 1.25rem;
  --t-title1: 1.75rem;
  --t-large: 2.125rem;
  --t-hero: 3rem;

  /* Shape & space */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-full: 999px;
}

/* Dark palette — system preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --plane: #000000;
    --surface-1: #17171a;
    --surface-2: #202024;
    --text-primary: #ffffff;
    --text-secondary: #a5a5ac;
    --muted: #8c8c94;
    --border: rgba(255, 255, 255, 0.09);
    --grid: #2a2a2f;
    --card-shadow: none;

    --brand-a: #8b7cf6;
    --brand-b: #f0799f;

    --hue-time-travel: #8b7cf6;
    --hue-biopulse: #da668c;
    --hue-eq-compass: #12aa8b;
    --hue-opex-hub: #4898dd;
    --hue-growthscope: #b98a00;
    --hue-carlos: #5c6b8a;
  }
}

/* Dark palette — manual toggle wins in both directions */
:root[data-theme="dark"] {
  --plane: #000000;
  --surface-1: #17171a;
  --surface-2: #202024;
  --text-primary: #ffffff;
  --text-secondary: #a5a5ac;
  --muted: #8c8c94;
  --border: rgba(255, 255, 255, 0.09);
  --grid: #2a2a2f;
  --card-shadow: none;

  --brand-a: #8b7cf6;
  --brand-b: #f0799f;

  --hue-time-travel: #8b7cf6;
  --hue-biopulse: #da668c;
  --hue-eq-compass: #12aa8b;
  --hue-opex-hub: #4898dd;
  --hue-growthscope: #b98a00;
  --hue-carlos: #5c6b8a;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 17px;
  color: var(--text-primary);
  background: var(--plane);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, .num {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--text-primary);
}

h1 { font-size: clamp(var(--t-large), 5vw, var(--t-hero)); }
h2 { font-size: var(--t-title1); }
h3 { font-size: var(--t-title3); }

p { margin: 0 0 1em; color: var(--text-secondary); font-size: var(--t-body); }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  font-size: var(--t-caption1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9em;
}

/* Wordmark */
.wordmark {
  display: inline-block;
  text-decoration: none;
}
.wordmark .rule {
  display: block;
  width: 44px;
  height: 4px;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--brand-a), var(--brand-b));
  margin-bottom: 8px;
}
.wordmark .name {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: var(--t-headline);
  color: var(--text-primary);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--plane) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: var(--t-subhead);
  font-weight: 500;
  color: var(--text-secondary);
}
.nav-links a:hover { color: var(--text-primary); }

.nav-right { display: flex; align-items: center; gap: 16px; }

.theme-toggle {
  font-family: var(--font-ui);
  font-size: var(--t-footnote);
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--r-full);
  padding: 8px 14px;
  min-height: 44px;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text-primary); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  min-height: 44px;
  cursor: pointer;
  color: var(--text-primary);
}

/* Status badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--t-footnote);
  font-weight: 600;
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 12%, var(--surface-2));
  border-radius: var(--r-full);
  padding: 6px 14px;
  margin-bottom: 1.4em;
}
.badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warning);
}

/* Sections */
section { padding: 64px 0; }
section + section { border-top: 1px solid var(--border); }

.section-head { max-width: 640px; margin: 0 0 36px; }

/* Hero */
.hero { padding-top: 72px; padding-bottom: 56px; }
.hero p.lead { font-size: var(--t-headline); max-width: 58ch; color: var(--text-secondary); }

/* Screenshot strip */
.shots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: start;
  gap: 20px;
  max-width: 560px;
  margin: 0 auto;
}
.shot-frame {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: var(--card-shadow);
}
.shot-frame img { width: 100%; height: auto; }

.shot-frame img.shot-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot-frame img.shot-light { display: none; }
  :root:not([data-theme="light"]) .shot-frame img.shot-dark { display: block; }
}
:root[data-theme="dark"] .shot-frame img.shot-light { display: none; }
:root[data-theme="dark"] .shot-frame img.shot-dark { display: block; }

.shot-frame .shot-empty {
  aspect-ratio: 5 / 14;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  font-size: var(--t-caption1);
  color: var(--muted);
}
.shot-caption {
  font-size: var(--t-caption1);
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
}

/* Modules */
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.module-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--card-shadow);
  padding: 24px 24px 24px 22px;
  border-left: 3px solid var(--hue, var(--text-primary));
}

.module-card .module-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.module-card h3 { margin-bottom: 0.3em; font-size: var(--t-title3); }

.module-tag {
  font-size: var(--t-caption2);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hue, var(--text-primary));
  white-space: nowrap;
}

.module-card .module-meta {
  font-size: var(--t-caption1);
  color: var(--muted);
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.module-card .module-meta div { margin-bottom: 4px; }
.module-card .module-meta div:last-child { margin-bottom: 0; }
.module-card .module-meta strong { color: var(--text-secondary); font-weight: 600; }

/* Differentiators */
.trait-list {
  display: grid;
  gap: 24px;
}
.trait {
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.trait:first-child { border-top: none; padding-top: 0; }
.trait h3 { font-size: var(--t-headline); margin-bottom: 0.4em; }
.trait p { margin-bottom: 0; }

/* Facts strip */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.fact .num {
  font-size: var(--t-large);
  display: block;
  margin-bottom: 2px;
}
.fact .fact-label {
  font-size: var(--t-footnote);
  color: var(--muted);
}

/* Sources list */
.source-list {
  columns: 2;
  column-gap: 32px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--t-subhead);
  color: var(--text-secondary);
}
.source-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  break-inside: avoid;
}

/* Company / about card */
.info-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--card-shadow);
  padding: 28px;
}
.info-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 20px;
  margin: 0;
}
.info-card dt {
  font-size: var(--t-caption1);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.info-card dd {
  margin: 0;
  font-size: var(--t-subhead);
  color: var(--text-primary);
}
.info-card dd a { color: var(--hue-opex-hub); text-decoration: none; }
.info-card dd a:hover { text-decoration: underline; }

/* Footer */
.site-footer { padding: 48px 0 40px; }
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.footer-links a { text-decoration: none; color: var(--text-secondary); font-size: var(--t-footnote); }
.footer-links a:hover { color: var(--text-primary); }
.footer-meta { margin-top: 28px; font-size: var(--t-caption1); color: var(--muted); }

/* Simple content pages (privacy/terms) */
.doc { max-width: 680px; margin: 0 auto; padding: 56px 24px 96px; }
.doc h2 { margin-top: 1.7em; font-size: var(--t-title3); }
.doc p, .doc li { color: var(--text-secondary); }
.doc li { margin-bottom: 0.4em; }

.note {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-size: var(--t-footnote);
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .shots { grid-template-columns: repeat(2, 1fr); }
  .module-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .source-list { columns: 1; }
  .footer-grid { flex-direction: column; }

  .nav-links.nav-links-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--plane);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
  }
}

@media (max-width: 480px) {
  .shots { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
}
