/*
 * Veldi marketing — design tokens + base styles.
 *
 * 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)
 *   - Brand seed colors applied via `--accent` set per page
 *   - Dark default; light is a toggle via prefers-color-scheme
 *   - WCAG-AAA contrast on body text
 *   - Spring motion only; ease curves limited to subtle hover affordances
 *   - No backdrop-blur / mica / transparency on chrome (Liquid-Glass-banned)
 *
 * Per ADR-049: zero third-party network calls. System font stack until
 * Inter Variable self-hosts in a follow-up (file ships with the bundle;
 * not a CDN fetch).
 */

:root {
  /* ── Type ──────────────────────────────────────────────────────── */
  --font-sans: "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;

  /* ── Color (dark default per visual-language §"Mode default") ──── */
  --color-bg: #0b0f14;
  --color-bg-soft: #0f151c;
  --color-fg: #f3f5f7;
  --color-fg-muted: #8a929b;
  --color-fg-quiet: #5a6168;
  --color-border: #1c252e;
  --color-divider: #141b22;

  /* Per-page accent overrides via `style="--accent: ..."` on the root */
  --accent: #4ea3ff;

  /* ── 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;
}

@media (prefers-color-scheme: light) {
  :root {
    --color-bg: #fafbfc;
    --color-bg-soft: #f3f5f7;
    --color-fg: #0b0f14;
    --color-fg-muted: #4a5159;
    --color-fg-quiet: #7c848c;
    --color-border: #e1e5e9;
    --color-divider: #ebeef1;
  }
}

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

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

html { color-scheme: dark light; }

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);
}

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

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

.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);
  background: linear-gradient(135deg, var(--color-fg) 0%, color-mix(in oklab, var(--accent) 40%, var(--color-fg)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.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; } /* gap on the flex parent already */

/* ── 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;
}

/* ── 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;
  }
}
