/*
 * Public-site theme contract.
 *
 * Every generated marketing page and the SPA shell load this file. Public
 * page components alias their local semantic names to these tokens, so a new
 * registry page receives both themes from pageShell without page-level work.
 */
/*
 * Public-site type, self-hosted (no third-party font requests on public
 * pages). IBM Plex Sans (display and text, one variable latin file covering
 * wght 100-700) is the signed-in product's face, so the site and the app read
 * as one thing (2026-11-04; Geist 2026-10-23 to 11-04, Zodiak before that).
 * It, Fragment Mono (wordmark) and IBM Plex Mono (labels) are under the SIL
 * Open Font License 1.1; Plex Sans is the @fontsource-variable latin subset.
 * Declared here so every public surface (landing, marketing pages, /signin)
 * shares one set of declarations; a face only downloads when a page actually
 * uses it. Display type is Plex Sans 600 with tight tracking; text is 400.
 * Geist stays declared for any surface not yet moved.
 */
@font-face { font-family: "IBM Plex Sans"; src: url("/https/aq.dev/fonts/IBMPlexSans-variable.woff2") format("woff2"); font-weight: 100 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/https/aq.dev/fonts/Geist-variable.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Fragment Mono"; src: url("/https/aq.dev/fonts/FragmentMono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/https/aq.dev/fonts/IBMPlexMono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/https/aq.dev/fonts/IBMPlexMono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
/*
 * Metric-matched fallbacks: while the web face is still downloading the text
 * paints in a system font scaled to the same advance widths and vertical
 * metrics, so the swap does not reflow the page (measured against Arial via
 * its Liberation twin in Chromium: Plex Sans 2026-11-04, Geist 2026-10-23).
 */
@font-face { font-family: "IBM Plex Sans Fallback"; src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Arimo"), local("Helvetica"); size-adjust: 100.7%; ascent-override: 101.79%; descent-override: 27.31%; line-gap-override: 0%; }
@font-face { font-family: "Geist Fallback"; src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Arimo"), local("Helvetica"); size-adjust: 102.25%; ascent-override: 98.29%; descent-override: 28.85%; line-gap-override: 0%; }

:root {
  --aq-public-bg: #f7f4ec;
  --aq-public-card: #fffdf6;
  --aq-public-deep: #efeadf;
  --aq-public-line: rgba(26, 24, 20, 0.16);
  --aq-public-line-soft: rgba(26, 24, 20, 0.09);
  --aq-public-line-strong: rgba(26, 24, 20, 0.3);
  --aq-public-line-strong-heavy: rgba(26, 24, 20, 0.55);
  --aq-public-text-0: #1a1814;
  --aq-public-text-100: #2c2924;
  --aq-public-text-200: #44403a;
  --aq-public-text-300: #5d584e;
  --aq-public-text-400: #6d675a;
  /* 4.9:1 on the card and 4.6:1 on the page: the footer, crumbs, datelines and
     plan notes render at 13px, which is normal-size text and needs AA 4.5:1. */
  --aq-public-text-500: #746e61;
  --aq-public-accent: #e8501e;
  --aq-public-accent-deep: #b23608;
  --aq-public-accent-soft: rgba(232, 80, 30, 0.08);
  --aq-public-accent-line: rgba(232, 80, 30, 0.35);
  /* 4.9:1 on the card: the price tag is 11.5px text, not a decorative fill. */
  --aq-public-green: #0b7f43;
  --aq-public-green-soft: rgba(14, 143, 77, 0.1);
  --aq-public-ink-rgb: 26, 24, 20;
  --aq-public-nav-bg: rgba(247, 244, 236, 0.82);
  --aq-public-wash: rgba(26, 24, 20, 0.05);
  --aq-public-wash-soft: rgba(26, 24, 20, 0.045);
  --aq-public-tag-neutral-bg: rgba(26, 24, 20, 0.07);
  --aq-public-dot: rgba(26, 24, 20, 0.055);
  --aq-public-code-bg: rgba(26, 24, 20, 0.055);
  --aq-public-primary-hover: #000;
  --aq-public-danger-bg: rgba(220, 38, 38, 0.07);
  --aq-public-danger-line: rgba(220, 38, 38, 0.35);
  --aq-public-danger-text: #b91c1c;
}

html[data-theme="dark"] {
  --aq-public-bg: #101014;
  --aq-public-card: #16161b;
  --aq-public-deep: #0a0a0e;
  --aq-public-line: rgba(255, 255, 255, 0.14);
  --aq-public-line-soft: rgba(255, 255, 255, 0.08);
  --aq-public-line-strong: rgba(255, 255, 255, 0.3);
  --aq-public-line-strong-heavy: rgba(255, 255, 255, 0.42);
  --aq-public-text-0: #f2f1ec;
  --aq-public-text-100: #e4e2da;
  --aq-public-text-200: #c9c9d2;
  --aq-public-text-300: #a3a3ad;
  --aq-public-text-400: #8a8a93;
  /* 4.6:1 against the raised dark card, so even the smallest metadata stays
     readable instead of inheriting the product mock's intentionally faint ink. */
  --aq-public-text-500: #808089;
  --aq-public-accent: #ff6a2b;
  --aq-public-accent-deep: #ff7a45;
  --aq-public-accent-soft: rgba(232, 80, 30, 0.16);
  --aq-public-accent-line: rgba(255, 106, 61, 0.45);
  --aq-public-green: #3ecf6e;
  --aq-public-green-soft: rgba(62, 207, 110, 0.12);
  --aq-public-ink-rgb: 0, 0, 0;
  --aq-public-nav-bg: rgba(16, 16, 20, 0.82);
  --aq-public-wash: rgba(255, 255, 255, 0.06);
  --aq-public-wash-soft: rgba(255, 255, 255, 0.05);
  --aq-public-tag-neutral-bg: rgba(255, 255, 255, 0.07);
  --aq-public-dot: rgba(255, 255, 255, 0.05);
  --aq-public-code-bg: rgba(255, 255, 255, 0.07);
  --aq-public-primary-hover: #fff;
  --aq-public-danger-bg: rgba(248, 113, 113, 0.1);
  --aq-public-danger-line: rgba(248, 113, 113, 0.38);
  --aq-public-danger-text: #fca5a5;
}

/* One theme for the whole surface: public pages and the signed-in product both
   read html[data-theme], so native controls (scrollbars, form widgets, the
   color pickers) follow the same pick everywhere. */
html {
  color-scheme: light;
}
html[data-theme="dark"] {
  color-scheme: dark;
}

/* One toggle implementation for the landing page, /signin, and generated
   marketing nav. Glyph visibility is correct from first paint. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  margin-right: 4px;
  border-radius: 99px;
  border: 1px solid var(--line-soft, var(--line, var(--aq-public-line-soft)));
  background: transparent;
  color: var(--text-300, var(--muted, var(--aq-public-text-300)));
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover {
  color: var(--text-0, var(--ink, var(--aq-public-text-0)));
  background: var(--wash, var(--aq-public-wash));
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent, var(--aq-public-accent));
  outline-offset: 2px;
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}
