/* ============================================================
   Noctis Nova — Safety Portal
   Design system: dark, neon-violet, sleek/modern
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* ---- Brand / theme tokens (overridable by Tweaks) ---- */
  --accent-h: 295;            /* violet */
  --accent: oklch(0.62 0.23 var(--accent-h));
  --accent-2: oklch(0.62 0.23 332);   /* magenta glow, same L/C */
  --accent-soft: oklch(0.62 0.23 var(--accent-h) / 0.14);
  --accent-line: oklch(0.62 0.23 var(--accent-h) / 0.32);

  /* ---- Surfaces (dark, purple-tinted near-black) ---- */
  --bg:        oklch(0.16 0.022 300);
  --bg-deep:   oklch(0.12 0.02 300);
  --surface:   oklch(0.205 0.024 300);
  --surface-2: oklch(0.245 0.026 300);
  --surface-3: oklch(0.30 0.028 300);
  --line:      oklch(1 0 0 / 0.09);
  --line-strong: oklch(1 0 0 / 0.16);

  /* ---- Text ---- */
  --ink:      oklch(0.97 0.006 300);
  --ink-2:    oklch(0.80 0.012 300);
  --ink-3:    oklch(0.64 0.014 300);
  --ink-4:    oklch(0.52 0.016 300);

  /* ---- Semantic (functional — safety product needs these) ---- */
  --danger:   oklch(0.64 0.21 18);
  --danger-soft: oklch(0.64 0.21 18 / 0.14);
  --warn:     oklch(0.78 0.15 75);
  --warn-soft: oklch(0.78 0.15 75 / 0.14);
  --ok:       oklch(0.74 0.16 158);
  --ok-soft:  oklch(0.74 0.16 158 / 0.14);
  --info:     oklch(0.72 0.13 235);
  --info-soft: oklch(0.72 0.13 235 / 0.14);

  /* ---- Type ---- */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --fs-base: 16px;

  /* ---- Geometry ---- */
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --maxw: 1180px;

  --shadow: 0 1px 0 oklch(1 0 0 / 0.04) inset, 0 18px 50px -24px oklch(0 0 0 / 0.8);
  --glow: 0 0 0 1px var(--accent-line), 0 8px 40px -8px oklch(0.62 0.23 var(--accent-h) / 0.45);
}

/* ---- Light theme variant (Tweak) ---- */
[data-theme="light"] {
  --bg:        oklch(0.97 0.006 300);
  --bg-deep:   oklch(0.94 0.008 300);
  --surface:   oklch(1 0 0);
  --surface-2: oklch(0.985 0.006 300);
  --surface-3: oklch(0.95 0.01 300);
  --line:      oklch(0 0 0 / 0.10);
  --line-strong: oklch(0 0 0 / 0.18);
  --ink:   oklch(0.22 0.02 300);
  --ink-2: oklch(0.40 0.02 300);
  --ink-3: oklch(0.52 0.02 300);
  --ink-4: oklch(0.62 0.02 300);
  --accent: oklch(0.52 0.21 var(--accent-h));
  --accent-2: oklch(0.52 0.21 332);
  --shadow: 0 1px 0 oklch(1 0 0 / 0.6) inset, 0 14px 40px -22px oklch(0.4 0.1 300 / 0.4);
  --glow: 0 0 0 1px var(--accent-line), 0 8px 30px -10px oklch(0.52 0.21 var(--accent-h) / 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Ambient starfield / nova glow background */
.nn-aurora {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.nn-aurora::before, .nn-aurora::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.5;
}
.nn-aurora::before {
  width: 60vw; height: 60vw; left: -10vw; top: -20vw;
  background: radial-gradient(circle, var(--accent) 0%, transparent 60%);
  opacity: 0.22;
}
.nn-aurora::after {
  width: 45vw; height: 45vw; right: -8vw; top: 30vh;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 60%);
  opacity: 0.16;
}
[data-theme="light"] .nn-aurora::before { opacity: 0.12; }
[data-theme="light"] .nn-aurora::after { opacity: 0.10; }

.nn-app { position: relative; z-index: 1; }

/* ---- Layout helpers ---- */
.nn-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.nn-section { padding: 84px 0; }
@media (max-width: 720px) { .nn-section { padding: 56px 0; } .nn-wrap { padding: 0 18px; } }

/* ---- Typography ---- */
.nn-h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 5.4vw, 62px); line-height: 1.02; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.nn-h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -0.018em; margin: 0; text-wrap: balance; }
.nn-h3 { font-family: var(--font-display); font-weight: 600; font-size: 21px; line-height: 1.2; letter-spacing: -0.01em; margin: 0; }
.nn-eyebrow { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin: 0; }
.nn-lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); line-height: 1.6; text-wrap: pretty; }
.nn-mono { font-family: var(--font-mono); }
.nn-muted { color: var(--ink-3); }

/* ---- Buttons ---- */
.nn-btn {
  font-family: var(--font-display); font-weight: 500; font-size: 15px;
  display: inline-flex; align-items: center; gap: 9px; justify-content: center;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: all .18s ease; text-decoration: none; white-space: nowrap;
  letter-spacing: -0.005em;
}
.nn-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nn-btn-primary {
  color: white; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 24px -8px oklch(0.62 0.23 var(--accent-h) / 0.65);
}
.nn-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 32px -8px oklch(0.62 0.23 var(--accent-h) / 0.8); filter: brightness(1.06); }
.nn-btn-ghost { color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong); }
.nn-btn-ghost:hover { background: var(--surface-3); border-color: var(--accent-line); }
.nn-btn-danger { color: white; background: var(--danger); border: none; box-shadow: 0 6px 24px -10px oklch(0.64 0.21 18 / 0.7); }
.nn-btn-danger:hover { transform: translateY(-1px); filter: brightness(1.05); }
.nn-btn-lg { padding: 16px 28px; font-size: 16.5px; }
.nn-btn-sm { padding: 9px 15px; font-size: 13.5px; }
.nn-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ---- Cards ---- */
.nn-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

/* ---- Badges / chips ---- */
.nn-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong);
  color: var(--ink-2); background: var(--surface-2); text-transform: uppercase;
}
.nn-badge.is-danger { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.nn-badge.is-warn { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.nn-badge.is-ok { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.nn-badge.is-info { color: var(--info); border-color: var(--info); background: var(--info-soft); }
.nn-badge.is-accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* ---- Inputs ---- */
.nn-field { display: flex; flex-direction: column; gap: 8px; }
.nn-label { font-size: 14px; font-weight: 600; color: var(--ink); font-family: var(--font-body); }
.nn-hint { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.nn-input, .nn-textarea, .nn-select {
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
  background: var(--bg-deep); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 13px 15px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
.nn-input::placeholder, .nn-textarea::placeholder { color: var(--ink-4); }
.nn-input:focus, .nn-textarea:focus, .nn-select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.nn-textarea { resize: vertical; min-height: 110px; line-height: 1.55; }

/* ---- Misc ---- */
.nn-divider { height: 1px; background: var(--line); border: none; margin: 0; }
.nn-link { color: var(--accent); text-decoration: none; font-weight: 500; }
.nn-link:hover { text-decoration: underline; }
a { color: var(--accent); }

::selection { background: var(--accent); color: white; }

/* subtle reveal — transform-only so content is ALWAYS visible even if
   animations are throttled/paused (opacity is never driven to 0 at rest) */
@keyframes nn-rise { from { transform: translateY(16px); opacity: 0.35; } to { transform: none; opacity: 1; } }
.nn-rise { animation: nn-rise .5s cubic-bezier(.2,.7,.3,1) forwards; }
@media (prefers-reduced-motion: reduce) { .nn-rise { animation: none; } }

@keyframes nn-spin { to { transform: rotate(360deg); } }

/* scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
