/* ══════════════════════════════════════════════════════════════════════════
   Nexura V3 Enterprise Architecture – Core Design System Tokens
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── 1. Color Palette (Dark Theme Default) ───────────────────────────── */
  --bg: #0B1220;
  --bg-subtle: #0E1627;
  --surface-1: #121A2E;
  --surface-2: #182241;
  --surface-3: #1F2B4A;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Brand Accents */
  --brand-blue: #2563EB;
  --brand-blue-light: #60A5FA;
  --brand-purple: #7C3AED;
  --brand-purple-light: #A78BFA;
  --brand-teal: #0E5749;
  --brand-teal-light: #34D399;
  --brand-coral: #F5793B;

  /* Text & Ink Tokens */
  --ink: #FFFFFF;
  --ink-subtle: #F3F4F6;
  --muted: #9CA3AF;
  --muted-2: #6B7280;

  /* State Tokens */
  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #3B82F6;
  --info-bg: rgba(59, 130, 246, 0.12);

  /* ── 2. Typography Tokens ────────────────────────────────────────────── */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-heading: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  /* ── 3. Spacing Tokens ───────────────────────────────────────────────── */
  --container: 1280px;
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.35);

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 150ms var(--ease);
  --t-base: 250ms var(--ease);
  --t-slow: 600ms var(--ease);
}

/* ── 4. Global Reset & Base Typography ─────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--ink-subtle);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ── 5. Headings Scale ─────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: #fff;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin: 0;
  font-weight: 700;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 800; letter-spacing: -0.03em; }
h3 { font-size: clamp(1.5rem, 2.2vw, 2rem); }
h4 { font-size: clamp(1.2rem, 1.6vw, 1.4rem); }
h5 { font-size: 1.1rem; }
h6 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

p { margin: 0 0 16px; color: var(--muted); max-width: 68ch; }

/* ── 6. Layout Grid & Containers ──────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 32px;
}

.v3-grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

/* ── 7. Universal Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--r-pill);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14.5px;
  border: 1px solid transparent;
  transition: all var(--t-base);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
}
.btn-primary:hover {
  background: #1D4ED8;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.btn-glow {
  box-shadow: 0 0 24px rgba(37, 99, 235, 0.45);
}

/* ── 8. Cards System ───────────────────────────────────────────────────── */
.v3-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  transition: all var(--t-base);
}

.v3-card-interactive:hover {
  transform: translateY(-4px);
  border-color: var(--brand-blue);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* ── 9. Status Badges & Pills ──────────────────────────────────────────── */
.v3-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.v3-badge-info {
  background: var(--info-bg);
  color: var(--brand-blue-light);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.v3-badge-success {
  background: var(--success-bg);
  color: var(--brand-teal-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ── 10. Forms Engine ──────────────────────────────────────────────────── */
.v3-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.v3-label {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.v3-input, .v3-select, .v3-textarea {
  width: 100%;
  padding: 13px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 14.5px;
  color: #fff;
  transition: all var(--t-fast);
}

.v3-input:focus, .v3-select:focus, .v3-textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* ── 11. Accessibility Focus Ring ─────────────────────────────────────── */
*:focus-visible {
  outline: 2px solid var(--brand-blue-light);
  outline-offset: 2px;
}

/* ── 12. Animations & Scroll Reveal ────────────────────────────────────── */
.fade-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--t-slow), transform var(--t-slow);
}
.js-observer-active .fade-in {
  opacity: 0;
  transform: translateY(20px);
}
.js-observer-active .fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── 13. Responsive Breakpoints ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .container { padding-inline: 24px; }
  .v3-grid-12 { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 640px) {
  .container { padding-inline: 16px; }
  .v3-grid-12 { grid-template-columns: 1fr; }
}
