/* ==============================================================
 * Nexim Foundation — BASE (Mission Control design system).
 * Dark Obsidian di base. I child theme cambiano solo l'accento.
 * ============================================================== */

:root, body {
  /* Obsidian palette */
  --nx-bg:        #0a0b0f;
  --nx-bg-2:      #0d0f15;
  --nx-bg-soft:   #13151c;
  --nx-bg-alt:    #1a1d27;
  --nx-surf:      #13151c;
  --nx-surf-2:    #1a1d27;

  /* Lines (hairline su scuro) */
  --nx-line:      rgba(255,255,255,.08);
  --nx-line-2:    rgba(255,255,255,.14);
  --nx-line-3:    rgba(255,255,255,.22);

  /* Ink */
  --nx-ink:       #f2f4f8;
  --nx-ink-2:     #cbd1de;
  --nx-ink-soft:  #8a91a3;
  --nx-ink-dim:   #5c6373;

  /* Brand accents — default Signal blue. I child overridano. */
  --nx-brand:     #3e8bff;
  --nx-brand-2:   #1f5cd1;
  --nx-accent:    #43e0ff;

  /* Status (live indicators) */
  --nx-live:      #38e08a;
  --nx-standby:   #ffb23e;
  --nx-alert:     #ff5c5c;
  --nx-success:   #38e08a;
  --nx-warning:   #ffb23e;
  --nx-danger:    #ff5c5c;

  /* Geometry */
  --nx-radius:    4px;
  --nx-radius-lg: 8px;
  --nx-radius-sm: 2px;
  --nx-shadow-sm: 0 1px 0 rgba(0,0,0,.4);
  --nx-shadow:    0 8px 30px rgba(0,0,0,.4);
  --nx-shadow-lg: 0 24px 60px rgba(0,0,0,.5), 0 8px 20px rgba(0,0,0,.3);
  --nx-maxw:      1320px;

  /* Typography Mission Control */
  --nx-font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --nx-font-body:    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nx-font-mono:    "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --nx-font-arabic:  "IBM Plex Sans Arabic", "Cairo", system-ui, sans-serif;
}

html[dir="rtl"] {
  --nx-font-display: var(--nx-font-arabic);
  --nx-font-body:    var(--nx-font-arabic);
}

/* ========================================================================
 * Reset
 * ===================================================================== */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--nx-bg); }
body {
  margin: 0;
  background: var(--nx-bg);
  color: var(--nx-ink);
  font-family: var(--nx-font-body);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
}

/* Subtle global scanline overlay — control-room mood */
body::after {
  content: "";
  position: fixed; inset: 0;
  background-image: repeating-linear-gradient(0deg, transparent 0, transparent 2px, rgba(255,255,255,.012) 2px, rgba(255,255,255,.012) 3px);
  pointer-events: none; z-index: 1; mix-blend-mode: overlay;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--nx-brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--nx-accent); }
:focus-visible { outline: 1px solid var(--nx-brand); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--nx-font-display);
  letter-spacing: -.02em;
  font-weight: 600;
  line-height: 1.1;
  color: var(--nx-ink);
  margin: 0 0 .6em;
}
h1 { font-size: clamp(36px, 5vw, 60px); font-weight: 700; }
h2 { font-size: clamp(28px, 3.5vw, 44px); font-weight: 700; }
h3 { font-size: clamp(20px, 2.2vw, 26px); }
p { margin: 0 0 1em; color: var(--nx-ink-2); }
strong { color: var(--nx-ink); font-weight: 600; }

/* ========================================================================
 * Layout
 * ===================================================================== */
.nx-container { max-width: var(--nx-maxw); margin: 0 auto; padding: 0 32px; }
@media (max-width: 720px) { .nx-container { padding: 0 20px; } }

.nx-section { padding: 96px 0; position: relative; }
.nx-section--alt { background: var(--nx-surf); }
.nx-section--dense { padding: 56px 0; }

.nx-skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--nx-bg-soft); color: var(--nx-ink);
  padding: 10px 14px; z-index: 9999;
  border: 1px solid var(--nx-line-2);
}
.nx-skip:focus { left: 8px; top: 8px; }

/* ========================================================================
 * Utility Mission Control
 * ===================================================================== */
.nx-mono {
  font-family: var(--nx-font-mono);
  font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--nx-ink-soft); font-weight: 500;
}
.nx-code {
  font-family: var(--nx-font-mono);
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--nx-ink-soft);
}
.nx-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; background: var(--nx-live);
  box-shadow: 0 0 0 3px rgba(56,224,138,.18);
  vertical-align: middle;
}
.nx-dot--amber { background: var(--nx-standby); box-shadow: 0 0 0 3px rgba(255,178,62,.18); }
.nx-dot--red   { background: var(--nx-alert);   box-shadow: 0 0 0 3px rgba(255,92,92,.18); }

/* ========================================================================
 * Brackets agli angoli (UI puntamento Mission Control)
 * Usato wrappando un elemento in <div class="nx-brk">...</div>
 * ===================================================================== */
.nx-brk { position: relative; }
.nx-brk::before, .nx-brk::after,
.nx-brk > .nx-brk-c::before, .nx-brk > .nx-brk-c::after {
  content: ""; position: absolute;
  width: 12px; height: 12px;
  border: 1px solid var(--nx-brand);
  pointer-events: none; opacity: .8;
}
.nx-brk::before { top: -1px; left: -1px;  border-right: none; border-bottom: none; }
.nx-brk::after  { top: -1px; right: -1px; border-left: none;  border-bottom: none; }
.nx-brk > .nx-brk-c { position: absolute; inset: 0; pointer-events: none; }
.nx-brk > .nx-brk-c::before { bottom: -1px; left: -1px;  border-top: none; border-right: none; }
.nx-brk > .nx-brk-c::after  { bottom: -1px; right: -1px; border-top: none; border-left: none; }

/* ========================================================================
 * Bottoni Mission Control
 * ===================================================================== */
.nx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--nx-radius);
  font-family: var(--nx-font-body); font-weight: 500; font-size: 13.5px;
  letter-spacing: .01em; cursor: pointer; line-height: 1.2; white-space: nowrap;
  border: 1px solid transparent; text-decoration: none;
  transition: transform .15s, background .15s, border-color .15s, color .15s;
}
.nx-btn--lg { padding: 14px 22px; font-size: 14.5px; }
.nx-btn--primary { background: var(--nx-brand); color: #06122a; border-color: var(--nx-brand); font-weight: 600; }
.nx-btn--primary:hover { background: var(--nx-accent); border-color: var(--nx-accent); color: #06122a; transform: translateY(-1px); }
.nx-btn--ghost { background: transparent; color: var(--nx-ink); border-color: var(--nx-line-2); }
.nx-btn--ghost:hover { border-color: var(--nx-brand); color: var(--nx-brand); }
.nx-btn--white { background: #fff; color: var(--nx-bg); border-color: #fff; }
.nx-btn--white:hover { background: var(--nx-ink); }

/* ========================================================================
 * Reduced motion
 * ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
