/* ========================================================================
   VELDRA REDESIGN — Shared design tokens across all 3 variants
   Color lineage from current site: deep navy/black ground + amber accent
   Each variant overrides via [data-variant] selectors.
   ======================================================================== */

:root {
  /* Veldra ember (kept from current site) */
  --ember-100: oklch(86% 0.10 70);
  --ember-200: oklch(78% 0.13 65);
  --ember-300: oklch(72% 0.15 60);
  --ember-400: oklch(65% 0.16 55);
  --ember-500: oklch(58% 0.16 50);   /* primary amber */
  --ember-600: oklch(50% 0.14 50);
  --ember-700: oklch(40% 0.11 50);

  /* Ink / ground */
  --ink-0:    oklch(8% 0.012 250);
  --ink-50:   oklch(11% 0.014 248);
  --ink-100:  oklch(14% 0.016 246);
  --ink-200:  oklch(18% 0.018 244);
  --ink-300:  oklch(24% 0.020 242);
  --ink-400:  oklch(35% 0.018 240);
  --ink-500:  oklch(50% 0.014 238);
  --ink-600:  oklch(65% 0.012 236);
  --ink-700:  oklch(78% 0.010 234);
  --ink-800:  oklch(88% 0.008 232);
  --ink-900:  oklch(96% 0.006 230);

  /* Status */
  --good:    oklch(72% 0.16 145);
  --warn:    oklch(78% 0.15 85);
  --bad:     oklch(64% 0.20 25);

  /* Type stacks */
  --sans: "Inter Tight", "Söhne", -apple-system, system-ui, sans-serif;
  --display: "Fraunces", "Tiempos Headline", Georgia, serif;
  --mono: "JetBrains Mono", "Berkeley Mono", "IBM Plex Mono", ui-monospace, monospace;
  --grotesk: "Space Grotesk", "Geist", -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; }
/* Global horizontal overflow guard — any rogue child wider than the viewport
   stays clipped instead of pushing the page off-center. Pages that need to
   scroll horizontally (none currently) opt back in with `overflow-x: auto`. */
html, body { margin: 0; padding: 0; overflow-x: hidden; }

.variant-page {
  /* Was hardcoded `width: 1440px` from the design-canvas era, which made the
     page wider than the viewport on every laptop and shifted content
     left-of-center. Now fluid up to the original 1440 max, centered via
     auto margins. */
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv01";
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow: hidden;
}

/* Shared utility */
.mono { font-family: var(--mono); font-feature-settings: "calt", "ss02"; }
.tabular { font-variant-numeric: tabular-nums; }
.dim { opacity: 0.55; }
.dim-2 { opacity: 0.35; }

/* Subtle noise texture overlay (used by some variants) */
.noise {
  position: absolute; inset: 0; pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* Striped image placeholder used across variants */
.placeholder-stripes {
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255,255,255,0.04) 0,
    rgba(255,255,255,0.04) 1px,
    transparent 1px,
    transparent 8px
  );
  border: 1px dashed rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* === Variant A: OPERATOR TELEMETRY === */
[data-variant="telemetry"],
[data-variant="datasheet"] {
  --bg: oklch(8% 0.012 250);
  --bg-2: oklch(11% 0.014 248);
  --bg-3: oklch(14% 0.016 246);
  --fg: oklch(94% 0.005 230);
  --fg-dim: oklch(62% 0.012 238);
  --line: oklch(22% 0.018 244);
  --accent: var(--ember-500);
  --accent-dim: oklch(58% 0.16 50 / 0.15);
}

/* === Variant B: EDITORIAL DARK === */
[data-variant="editorial"] {
  --bg: oklch(10% 0.008 70);  /* warm near-black */
  --bg-2: oklch(13% 0.010 68);
  --bg-3: oklch(16% 0.012 66);
  --fg: oklch(94% 0.008 80);
  --fg-dim: oklch(60% 0.014 75);
  --line: oklch(22% 0.014 70);
  --accent: var(--ember-400);
  --accent-dim: oklch(65% 0.16 55 / 0.18);
}

/* === ATLAS variants (Failure Atlas) === */
[data-variant="casefile"] {
  --bg: oklch(96% 0.006 75);          /* warm paper */
  --bg-2: oklch(93% 0.008 75);
  --bg-3: oklch(90% 0.010 72);
  --fg: oklch(18% 0.010 60);
  --fg-dim: oklch(38% 0.012 60);
  --line: oklch(78% 0.010 70);
  --accent: oklch(45% 0.18 28);       /* deep red — case stamp */
  --accent-2: oklch(55% 0.14 50);     /* ember secondary */
  --accent-dim: oklch(45% 0.18 28 / 0.12);
  --paper-stamp: oklch(45% 0.18 28 / 0.7);
}

[data-variant="timeline"] {
  --bg: oklch(7% 0.014 248);
  --bg-2: oklch(10% 0.016 246);
  --bg-3: oklch(13% 0.018 244);
  --fg: oklch(95% 0.004 230);
  --fg-dim: oklch(58% 0.012 240);
  --line: oklch(20% 0.020 244);
  --accent: var(--ember-500);
  --accent-2: oklch(72% 0.16 145);
  --accent-3: oklch(70% 0.14 220);
  --accent-bad: oklch(64% 0.20 25);
  --accent-warn: oklch(78% 0.15 85);
  --accent-dim: oklch(58% 0.16 50 / 0.15);
}

[data-variant="mortuary"] {
  --bg: oklch(11% 0.004 250);          /* near-black */
  --bg-2: oklch(14% 0.006 248);
  --bg-3: oklch(17% 0.008 246);
  --fg: oklch(94% 0.002 230);
  --fg-dim: oklch(50% 0.008 240);
  --line: oklch(24% 0.010 244);
  --accent: oklch(94% 0.002 230);      /* white-on-black brutalist */
  --accent-2: oklch(58% 0.16 50);
  --accent-dim: oklch(94% 0.002 230 / 0.12);
}

[data-variant="rcmap"] {
  --bg: oklch(9% 0.012 248);
  --bg-2: oklch(12% 0.014 246);
  --bg-3: oklch(15% 0.016 244);
  --fg: oklch(94% 0.005 230);
  --fg-dim: oklch(60% 0.012 238);
  --line: oklch(22% 0.018 244);
  --accent: var(--ember-500);
  --accent-good: oklch(72% 0.16 145);
  --accent-bad: oklch(64% 0.20 25);
  --accent-warn: oklch(78% 0.15 85);
  --accent-dim: oklch(58% 0.16 50 / 0.15);
}

/* === Variant C: TRUST LAYERS (concept-led) === */
[data-variant="layers"],
[data-variant="deck"] {
  --bg: oklch(7% 0.014 248);
  --bg-2: oklch(10% 0.016 246);
  --bg-3: oklch(13% 0.018 244);
  --fg: oklch(95% 0.004 230);
  --fg-dim: oklch(60% 0.012 240);
  --line: oklch(20% 0.020 244);
  --accent: var(--ember-500);
  --accent-2: oklch(72% 0.16 145);  /* good */
  --accent-3: oklch(70% 0.14 220);  /* signal blue, only on this variant */
  --accent-dim: oklch(58% 0.16 50 / 0.15);
}

/* Common section primitives */
.section { padding: 96px 80px; position: relative; }
.section-tight { padding: 64px 80px; }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 14px; font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--ink-0);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Animations shared */
@keyframes pulse-soft {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes scan {
  0%, 100% { transform: translateY(0); opacity: 0; }
  50% { opacity: 1; }
}

/* ── Scroll-driven reveal effects ──
   Wired up by shared/scroll-effects.js. CSS-only opt-in: add `.fade-up`
   to any element that should rise into view, or `.section-reveal` to a
   section that should drift in. The observer adds `.section-visible`
   when in viewport. Reduced-motion users see static state. */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up {
  animation: fadeUp 0.6s ease forwards;
  opacity: 0;
}
.fade-up-d1 { animation-delay: 0.10s; }
.fade-up-d2 { animation-delay: 0.20s; }
.fade-up-d3 { animation-delay: 0.30s; }
.fade-up-d4 { animation-delay: 0.40s; }

.section-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  will-change: opacity, transform;
}
.section-reveal.section-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-up { animation: none; opacity: 1; }
  .section-reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Auth form treatment ──
   Shared across /login/, /register/, /verify/, /forgot-password/,
   /reset-password/, /account/ (each served as index.html at that path
   so the URL contract matches the legacy site). Centered card sitting
   on the dark page surface, mono labels, accent CTA. */
.auth-card {
  max-width: 460px;
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 40px 44px;
  margin: 64px auto;
}
.auth-card h1 {
  font-family: var(--grotesk);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.auth-card .auth-lede {
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.55;
  margin: 0 0 28px;
}
.auth-field {
  margin-bottom: 18px;
}
.auth-field label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 8px;
}
.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  border-radius: 2px;
  transition: border-color 0.15s ease;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
}
.auth-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #0a0d14;
  border: none;
  font-family: var(--grotesk);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 2px;
  transition: filter 0.15s ease;
}
.auth-btn:hover { filter: brightness(1.08); }
.auth-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.auth-msg {
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--fg-dim);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
}
.auth-msg.error   { border-left-color: #e58181; color: #f3a1a1; }
.auth-msg.success { border-left-color: #7ed4a8; color: #a8e2c4; }
.auth-links {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--fg-dim);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.auth-links a {
  color: var(--accent);
  text-decoration: none;
}
.auth-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-links .sep { color: var(--line); }
