/* ═══════════════════════════════════════════════════════════════════════════
   Spotlight — landing page
   Source: the "Landing" screen of spotlight-light.html.

   Everything is scoped under .sl-home (set on <html> by layouts/home), so this
   file is inert on any other page even if the app layout loads every stylesheet.

   THEMES
     light   default
     dark    when the visitor chooses it (data-theme="dark"), or when the OS
             prefers dark and the visitor hasn't explicitly chosen light.
   The second rule is what makes this work without JavaScript, follow the OS
   live, and avoid a flash of the wrong theme on first paint.

   All text/background pairs are WCAG AA or better; body text is AAA.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Light (default) ─────────────────────────────────────────────────────── */
html.sl-home {
  color-scheme: light;

  --paper: #FFFFFF;
  --paper-2: #F7F8F9;
  --paper-3: #EFF1F3;

  --text: #0F1419;        /* 18.5:1 AAA */
  --text-2: #2C3640;      /* 12.4:1 AAA */
  --text-dim: #475561;    /*  8.4:1 AAA */
  --text-mute: #6B7785;   /*  5.0:1 AA  */

  --line: #D8DDE2;
  --line-strong: #B5BCC4;

  --teal: #0A6E6A;        /*  6.4:1 AA  */
  --teal-deep: #064240;   /* 11.2:1 AAA */
  --teal-light: #E6F4F3;

  --chart-grid: #EFF1F3;
  --chart-line: #0A6E6A;
  --preview-shadow: 0 12px 40px rgba(15, 20, 25, 0.08);

  --focus-ring: 0 0 0 3px rgba(10, 110, 106, 0.35), 0 0 0 1px var(--teal-deep);

  --display: "Fraunces", Georgia, serif;
  --sans: "Sora", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

/* ── Dark: explicit choice ───────────────────────────────────────────────── */
html.sl-home[data-theme="dark"] {
  color-scheme: dark;

  --paper: #0A0F14;
  --paper-2: #111821;
  --paper-3: #1A2330;

  --text: #F0F4F7;        /* 17.2:1 AAA */
  --text-2: #D4DCE3;      /* 13.4:1 AAA */
  --text-dim: #9BA8B4;    /*  7.2:1 AAA */
  --text-mute: #6E7C89;   /*  4.6:1 AA  */

  --line: #243042;
  --line-strong: #34425A;

  --teal: #6CFAF3;        /* 13.8:1 AAA */
  --teal-deep: #2EE8E1;   /* 10.6:1 AAA */
  --teal-light: #0E2424;

  --chart-grid: #243042;
  --chart-line: #2EE8E1;
  --preview-shadow: none;

  --focus-ring: 0 0 0 3px rgba(108, 250, 243, 0.45), 0 0 0 1px var(--teal-deep);
}

/* ── Dark: OS preference, unless light was explicitly chosen ──────────────
   Must stay identical to the block above. */
@media (prefers-color-scheme: dark) {
  html.sl-home:not([data-theme="light"]) {
    color-scheme: dark;

    --paper: #0A0F14;
    --paper-2: #111821;
    --paper-3: #1A2330;

    --text: #F0F4F7;
    --text-2: #D4DCE3;
    --text-dim: #9BA8B4;
    --text-mute: #6E7C89;

    --line: #243042;
    --line-strong: #34425A;

    --teal: #6CFAF3;
    --teal-deep: #2EE8E1;
    --teal-light: #0E2424;

    --chart-grid: #243042;
    --chart-line: #2EE8E1;
    --preview-shadow: none;

    --focus-ring: 0 0 0 3px rgba(108, 250, 243, 0.45), 0 0 0 1px var(--teal-deep);
  }
}

/* ── Base ────────────────────────────────────────────────────────────────── */
.sl-home *, .sl-home *::before, .sl-home *::after { box-sizing: border-box; margin: 0; padding: 0; }
html.sl-home { scroll-behavior: smooth; }
.sl-home body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  background: var(--paper);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sl-home .skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 12px 20px;
  background: var(--teal-deep);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-decoration: none;
}
.sl-home .skip-link:focus { left: 12px; top: 12px; outline: 2px solid var(--paper); outline-offset: 2px; }

.sl-home :focus-visible { outline: none; box-shadow: var(--focus-ring); }

@media (prefers-reduced-motion: reduce) {
  .sl-home *, .sl-home *::before, .sl-home *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  html.sl-home { scroll-behavior: auto; }
}

/* ── Header ──────────────────────────────────────────────────────────────
   The prototype hardcoded rgba(255,255,255,0.95) here, which painted a white
   bar over the dark theme. This follows the theme. */
.sl-home .site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.sl-home .site-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.sl-home .site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.sl-home .site-logo-mark {
  position: relative;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 2px solid var(--teal-deep);
}
.sl-home .site-logo-mark::before {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--teal-deep);
}
.sl-home .site-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sl-home form.button_to { display: inline-flex; }

/* ── Theme toggle ────────────────────────────────────────────────────────── */
.sl-home .theme-toggle {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  background: var(--paper);
}
.sl-home .theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.sl-home .theme-toggle-btn:hover { color: var(--teal-deep); }
.sl-home .theme-toggle-btn[aria-pressed="true"],
.sl-home .theme-toggle-btn[aria-pressed="true"]:hover {
  background: var(--teal-deep);
  color: var(--paper);
}
.sl-home .theme-toggle-btn svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.sl-home .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 14px;
  background: var(--paper);
  color: var(--text);
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.sl-home .btn:hover {
  border-color: var(--teal-deep);
  color: var(--teal-deep);
  background: var(--teal-light);
}
.sl-home .btn.primary {
  background: var(--teal-deep);
  color: var(--paper);
  border-color: var(--teal-deep);
  font-weight: 600;
}
.sl-home .btn.primary:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--paper);
}
.sl-home .btn.sm { min-height: 32px; padding: 7px 11px; font-size: 11px; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.sl-home .landing-wrap { max-width: 1280px; margin: 0 auto; padding: 80px 32px 120px; }

.sl-home .landing-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--teal-deep);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sl-home .landing-eyebrow::before {
  content: "";
  width: 32px;
  height: 2px;
  background: var(--teal-deep);
}

.sl-home .landing-h1 {
  max-width: 920px;
  margin-bottom: 24px;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(44px, 5vw, 72px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.025em;
}
/* The underline is a second affordance, so emphasis never relies on colour alone. */
.sl-home .landing-h1 em,
.sl-home .landing-h2 em {
  font-style: italic;
  color: var(--teal-deep);
  text-decoration: underline;
  text-decoration-color: var(--teal);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.sl-home .landing-lede {
  max-width: 680px;
  margin-bottom: 40px;
  color: var(--text-2);
  font-size: 19px;
  line-height: 1.55;
}

.sl-home .landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 80px;
}
.sl-home .landing-cta-row .btn { min-height: 48px; padding: 14px 22px; font-size: 13px; }

/* ── Trust bar ───────────────────────────────────────────────────────────── */
.sl-home .trust-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
  margin-bottom: 80px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.sl-home .trust-bar-label {
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.sl-home .trust-bar-orgs {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  color: var(--text-2);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
}

/* ── Section headings ────────────────────────────────────────────────────── */
.sl-home .landing-h2 {
  max-width: 720px;
  margin-bottom: 16px;
  font-family: var(--display);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.sl-home .landing-h2 em { text-underline-offset: 4px; }
.sl-home .landing-h2--sm { font-size: 32px; margin-bottom: 14px; }
.sl-home .landing-h2--sm em { text-decoration: none; }

.sl-home .landing-section-lede {
  max-width: 680px;
  margin-bottom: 48px;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.55;
}

/* ── Pillars ─────────────────────────────────────────────────────────────── */
.sl-home .feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 80px;
}
.sl-home .feature-card {
  padding: 32px;
  background: var(--paper);
  border: 1px solid var(--line);
  transition: border-color 0.15s, background 0.15s;
}
.sl-home .feature-card:hover { border-color: var(--teal-deep); background: var(--paper-2); }
.sl-home .feature-num {
  width: fit-content;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--teal-deep);
  color: var(--teal-deep);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sl-home .feature-card h3 {
  margin-bottom: 12px;
  color: var(--text);
  font-family: var(--display);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.sl-home .feature-card h3 em { font-style: italic; color: var(--teal-deep); }
.sl-home .feature-card p { color: var(--text-dim); font-size: 15px; line-height: 1.6; }

/* ── Dashboard preview ───────────────────────────────────────────────────── */
.sl-home .preview-intro { max-width: 600px; margin-bottom: 32px; color: var(--text-dim); }

.sl-home .preview {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  box-shadow: var(--preview-shadow);
}
.sl-home .preview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.sl-home .preview-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--line-strong); }
.sl-home .preview-url { margin-left: auto; color: var(--text-mute); font-family: var(--mono); font-size: 10px; }

.sl-home .preview-body { display: grid; grid-template-columns: 180px 1fr; min-height: 320px; }
.sl-home .preview-side { padding: 18px 14px; background: var(--paper-2); border-right: 1px solid var(--line); }
.sl-home .preview-side-item {
  margin-bottom: 4px;
  padding: 7px 10px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
}
.sl-home .preview-side-item.active {
  background: var(--teal-light);
  border-left: 2px solid var(--teal-deep);
  color: var(--teal-deep);
  font-weight: 600;
}

.sl-home .preview-main { padding: 24px; }
.sl-home .preview-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.sl-home .preview-kpi { padding: 12px 14px; border: 1px solid var(--line); }
.sl-home .preview-kpi-label {
  margin-bottom: 4px;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sl-home .preview-kpi-val { font-family: var(--display); font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.sl-home .preview-kpi-val.lit { color: var(--teal-deep); }

.sl-home .preview-chart { display: block; width: 100%; height: 140px; }
.sl-home .chart-grid { stroke: var(--chart-grid); stroke-width: 1; }
.sl-home .chart-line { stroke: var(--chart-line); stroke-width: 2; fill: none; }
.sl-home .chart-area { fill: var(--chart-line); fill-opacity: 0.08; stroke: none; }
.sl-home .chart-dot  { fill: var(--chart-line); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .sl-home .feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .sl-home .site-header-inner { padding: 10px 16px; gap: 10px; }
  .sl-home .theme-toggle-btn span { display: none; }   /* icons only — each button carries an aria-label */
  .sl-home .landing-wrap { padding: 48px 20px 80px; }
  .sl-home .landing-h2 { font-size: 32px; }
  .sl-home .landing-h2--sm { font-size: 28px; }
  .sl-home .preview-body { grid-template-columns: 1fr; }
  .sl-home .preview-side { display: none; }
  .sl-home .preview-kpi-row { grid-template-columns: repeat(2, 1fr); }
}
