/* FEEVA Fresh Design Tokens: Deep Obsidian, Brushed Titanium, Burnished Vault Gold
 * Contrast verified via WCAG 2.x:
 * #F3F5F8 on #07080B = 18.34:1 (AAA)
 * #A8B1C2 on #0D1015 = 8.83:1  (AAA)
 * #8B95A8 on #0D1015 = 6.32:1  (AA+)
 * #E5A93C on #07080B = 9.61:1  (AAA)
 * #07080B on #E5A93C = 9.61:1  (AAA)
 * #34D399 on #0D1015 = 9.91:1  (AAA)
 * #F87171 on #0D1015 = 6.89:1  (AA+)
 */

:root {
  /* Core Surfaces (2 core neutrals + 1 deliberate accent) */
  --bg-void: #07080b;
  --bg-panel: rgba(13, 16, 21, 0.86);
  --bg-panel-solid: #0d1015;
  --bg-panel-elev: #141922;
  --bg-input: #0a0d12;

  /* Ink */
  --ink-primary: #f3f5f8;
  --ink-secondary: #a8b1c2;
  --ink-muted: #8b95a8;
  --ink-on-accent: #07080b;
  --ink-on-light: #07080b;

  /* Deliberate Accent: Burnished Vault Gold */
  --accent-gold: #e5a93c;
  --accent-gold-hover: #f0bc58;
  --accent-gold-dim: rgba(229, 169, 60, 0.14);
  --accent-gold-line: rgba(229, 169, 60, 0.42);

  /* Semantic State Colors (real states only) */
  --state-live: #34d399;
  --state-live-bg: rgba(52, 211, 153, 0.12);
  --state-warn: #e5a93c;
  --state-warn-bg: rgba(229, 169, 60, 0.12);
  --state-err: #f87171;
  --state-err-bg: rgba(248, 113, 113, 0.12);

  /* Structural Hairlines */
  --line-hairline: rgba(218, 224, 236, 0.13);
  --line-strong: rgba(218, 224, 236, 0.26);
  --line-active: rgba(229, 169, 60, 0.52);

  /* Typography (R-06 deliberate industrial pairing) */
  --font-display: "Archivo", system-ui, -apple-system, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  /* Type Scale (fluid for mobile to desktop) */
  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.25rem, 1.8vw, 1.5rem);
  --text-2xl: clamp(1.75rem, 3vw, 2.5rem);
  --text-3xl: clamp(2.15rem, 4.4vw, 3.6rem);
  --text-hero: clamp(2.35rem, 5.2vw, 4.35rem);

  /* Radii (machined architectural chamfers, never pill-everything) */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;

  /* Layout */
  --max-w: 1320px;
  --header-h: 64px;
  --gutter: clamp(16px, 3vw, 36px);

  /* Elevation (selective use only) */
  --shadow-panel: 0 24px 64px rgba(0, 0, 0, 0.55);

  /* Z-index stack */
  --z-canvas: 1;
  --z-content: 10;
  --z-hud: 30;
  --z-header: 50;
  --z-drawer: 60;
}

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

html {
  background-color: var(--bg-void);
  color: var(--ink-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg-void);
  color: var(--ink-primary);
  overflow-x: clip;
}

/* R-39: Base interactive pointer affordance */
a[href],
button:not(:disabled),
summary,
select:not(:disabled),
label[for],
input[type="checkbox"]:not(:disabled),
input[type="radio"]:not(:disabled),
[role="button"]:not([aria-disabled="true"]),
[role="tab"]:not([aria-disabled="true"]),
[role="switch"]:not([aria-disabled="true"]) {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.52;
}

/* R-32: High-contrast visible keyboard focus ring */
:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -120px;
  left: 16px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--accent-gold);
  color: var(--ink-on-accent);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-xs);
}

.skip-link:focus {
  top: 12px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

[hidden] {
  display: none !important;
}

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