/*
 * LANG-EXCEPTION: hand-authored CSS pending Rust-string migration.
 * Same shape as the slice-026 veldi-id-app migration (style.css → src/style.rs
 * Rust &'static str + leptos <style inner_html> injection). Queued as a
 * follow-up cloud slice — same pattern as slice-026 but in the veldi-web
 * crate. Until then, this file is permitted via per-file LANG-EXCEPTION
 * carve-out per .github/workflows/check-language.yml. Reviewed 2026-05-29.
 */
/*
 * Veldi Web — LAYOUT + COMPONENT styles only.
 *
 * Color tokens are EMITTED from the platform design-system per
 * design-language.md §4.1 ("Rust constants → CSS custom properties →
 * DTCG prose"). This file consumes them via `tokens.css` (loaded
 * separately from each brand's `index.html` as a `<link>`); see
 * `veldi-web/shared/build.rs` for the materialization.
 *
 * What lives here:
 *   - Type / spacing / radii / layout custom properties (not yet in
 *     design-system; promoted in a follow-up slice)
 *   - Reset + base body styles
 *   - Layout containers (.page, .page--low)
 *   - Per-component styles (.hero, .pitch, .footer, .theme-toggle, ...)
 *   - Reduced-motion media query
 *
 * What does NOT live here (now in `tokens.css`):
 *   - 13-tier neutral palette
 *   - Mode-attribute color tokens (`[data-mode="dark"]`, `[data-mode="light"]`)
 *   - `--accent` derivation from per-mode `--accent-dark` / `--accent-light`
 *
 * Honors the ratified visual language (standards/design-language.md):
 *   - Major Third 1.25× type scale anchored at body-L 16px
 *   - 4px spacing scale (0/2/4/8/12/16/24/32/48/64/96/128)
 *   - Spring motion only; ease curves limited to subtle hover affordances
 *   - No backdrop-blur / mica / transparency on chrome (Liquid-Glass-banned)
 *   - .hero__brand gradient text RETIRED per brand-voice-veldi.md §3+§4
 *
 * Per ADR-049: zero third-party network calls. System font stack until
 * Inter Variable self-hosts in a follow-up.
 */

/*
 * Inter Variable self-hosted per ADR-049 (zero third-party network
 * calls) + design-language.md §1.1 (Inter Variable primary stack).
 * Font file is copied into the deploy bundle's dist root by Trunk via
 * `<link data-trunk rel="copy-file" href="../../fonts/InterVariable.woff2" />`.
 *
 * Trunk's `copy-file` flattens path structure — every copied file
 * lands at dist root, so the @font-face URL is bare `InterVariable.woff2`.
 *
 * `font-display: swap` shows the fallback system stack instantly +
 * swaps to Inter Variable when loaded. `format("woff2-variations")`
 * declares the variable-font format so the browser can interpret
 * `wght 100..900`.
 */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("InterVariable.woff2") format("woff2-variations"),
       url("InterVariable.woff2") format("woff2");
}

:root {
  /* ── Type (mode-independent) ───────────────────────────────────── */
  --font-sans: "Inter Variable", "Inter", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Major Third 1.25× anchored at body-L 16 */
  --type-body-m: 14px;
  --type-body-l: 16px;
  --type-title-m: 20px;
  --type-title-l: 25px;
  --type-headline-s: 31px;
  --type-headline-m: 39px;
  --type-headline-l: 49px;
  --type-display-s: 61px;

  /* ── Spacing (4px base; full scale) ─────────────────────────────── */
  --s-2: 2px;
  --s-4: 4px;
  --s-8: 8px;
  --s-12: 12px;
  --s-16: 16px;
  --s-24: 24px;
  --s-32: 32px;
  --s-48: 48px;
  --s-64: 64px;
  --s-96: 96px;
  --s-128: 128px;

  /* ── Radii / chrome ────────────────────────────────────────────── */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Container — max reading width per visual-language §"Reading width" */
  --reading-width: 70ch;
  --page-width: 660px;
}

/*
 * Color tokens — including the per-mode `[data-mode]` selectors that
 * resolve `--color-bg` / `--color-fg` / `--accent` — are emitted from
 * `veldi-design-system::TOKENS_CSS` and loaded via tokens.css per
 * `index.html`.
 *
 * Each brand's `<main>` element sets `--accent-dark` and `--accent-light`
 * inline (per the brand's `BrandColors` constant); tokens.css selects
 * one or the other based on the active `data-mode` and exposes it as
 * `--accent`. Style rules below use `var(--accent)` / `var(--color-fg)`
 * etc. transparently — they don't need to know the mode.
 */

/* ── Reset ────────────────────────────────────────────────────────── */

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

body {
  font-family: var(--font-sans);
  font-size: var(--type-body-l);
  line-height: 1.55;
  background: var(--color-bg);
  color: var(--color-fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-decoration-color: color-mix(in oklab, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
}
a:hover { text-decoration: underline; }

::selection {
  background: color-mix(in oklab, var(--accent) 35%, transparent);
  color: var(--color-fg);
}

/* ── Page container ──────────────────────────────────────────────── */

.page {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: var(--s-32) var(--s-24) var(--s-48);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--s-64);
}

.page--low {
  max-width: 480px;
  gap: var(--s-48);
  justify-content: flex-start;
  padding-top: var(--s-128);
}

@media (min-width: 720px) {
  .page { padding: var(--s-48) var(--s-32) var(--s-64); gap: var(--s-96); }
  .page--low { padding-top: 25vh; }
}

/* ── Top-of-page sign-in (discreet, right-aligned) ──────────────── */

.page__nav {
  display: flex;
  justify-content: flex-end;
  margin-bottom: calc(-1 * var(--s-32));
}

.signin {
  font-size: var(--type-body-m);
  color: var(--color-fg-muted);
  padding: var(--s-8) 0;
  letter-spacing: 0.01em;
  transition: color 180ms ease;
  text-decoration: none;
}

.signin:hover {
  color: var(--accent);
  text-decoration: none;
}

.signin__arrow {
  display: inline-block;
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-left: 2px;
}

.signin:hover .signin__arrow {
  transform: translateX(3px);
}

/*
 * Theme toggle — quiet text-button at top-right of nav. Mutates the
 * `<html data-mode>` attribute via the WASM bundle's ThemeToggle
 * component (no JS authored; first-party Rust per ADR-116).
 */
.theme-toggle {
  font-family: inherit;
  font-size: var(--type-body-m);
  color: var(--color-fg-muted);
  background: transparent;
  border: none;
  padding: var(--s-8) var(--s-12);
  margin-left: var(--s-16);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 180ms ease;
}

.theme-toggle:hover {
  color: var(--accent);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Hero ────────────────────────────────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  gap: var(--s-16);
}

/*
 * Plain neutral foreground — gradient-text treatment retired 2026-05-29
 * per brand-voice-veldi.md §3 + §4.
 */
.hero__brand {
  font-size: clamp(var(--type-headline-l), 7vw, var(--type-display-s));
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--color-fg);
}

/*
 * Brand-glyph dot per brand-voice-atilo.md §3 — lowercase wordmark +
 * accent-colored dot at right is atilo's only constant mark. Rendered
 * only when `Brand.show_brand_dot = true`.
 */
.hero__brand-dot {
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 0.18em;
  vertical-align: 0.32em;
}

.hero__tagline {
  font-size: clamp(var(--type-title-m), 2.6vw, var(--type-title-l));
  line-height: 1.4;
  color: var(--color-fg-muted);
  max-width: 540px;
  font-weight: 400;
  letter-spacing: -0.005em;
}

/* ── Pitch (long-form body copy) ─────────────────────────────────── */

.pitch {
  display: flex;
  flex-direction: column;
  gap: var(--s-16);
  max-width: var(--reading-width);
}

.pitch p {
  font-size: var(--type-body-l);
  color: var(--color-fg);
  line-height: 1.6;
}

.pitch p + p { margin-top: 0; }

/* ── Elsewhere row (quiet, inline) ───────────────────────────────── */

.elsewhere {
  padding-top: var(--s-16);
  border-top: 1px solid var(--color-divider);
}

.elsewhere__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-24);
}

.elsewhere__list a {
  font-size: var(--type-body-m);
  color: var(--color-fg-muted);
  text-decoration: none;
  letter-spacing: 0.005em;
  transition: color 180ms ease;
}

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

/* ── Low-profile contact line ───────────────────────────────────── */

.contact {
  font-size: var(--type-body-l);
  color: var(--color-fg-muted);
}

.contact a {
  font-weight: 500;
}

/* ── Footer ──────────────────────────────────────────────────────── */

.footer {
  margin-top: auto;
  padding-top: var(--s-32);
}

.footer__attr {
  font-size: var(--type-body-m);
  color: var(--color-fg-quiet);
  letter-spacing: 0.02em;
}

.footer__attr + .footer__attr {
  margin-top: var(--s-4);
}

/* ── Focus ───────────────────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Reduced motion ──────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
