/**
 * RMG–NexGN Software - Base & Typography Stylesheet
 */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-navy-darkest);
  color: var(--color-slate-200);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Background Subtle Grid & Depth */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(rgba(11, 99, 229, 0.08) 1px, transparent 1px),
    radial-gradient(rgba(0, 210, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px, 80px 80px;
  background-position: 0 0, 20px 20px;
  pointer-events: none;
  z-index: -1;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-white);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
}

h2 {
  font-size: clamp(1.85rem, 3.5vw, 2.75rem);
  margin-bottom: var(--space-md);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

h4 {
  font-size: 1.15rem;
}

p {
  color: var(--color-slate-300);
  font-size: 1rem;
}

a {
  color: var(--color-electric-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-white);
}

ul, ol {
  list-style: none;
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.section {
  padding-top: var(--space-4xl);
  padding-bottom: var(--space-4xl);
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-3xl);
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(11, 99, 229, 0.12);
  border: 1px solid var(--color-cyan-glow);
  color: var(--color-electric-blue);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
}

.section-tag.gold {
  background: rgba(229, 169, 60, 0.12);
  border-color: var(--glass-border-gold);
  color: var(--color-gold);
}

.text-gradient {
  background: var(--gradient-tech);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-gradient-gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
  }
  .grid-cols-4, .grid-cols-3, .grid-cols-2 {
    grid-template-columns: 1fr;
  }
  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--color-electric-blue);
  outline-offset: 3px;
}

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

/* ==========================================================================
   SECURITY-HARDENING-04: Browser-Level Protection & Deterrence
   ========================================================================== */

/* Protected marketing, narrative, and technical content */
.protected-content,
.brand-narrative,
.hero-showcase,
.technical-spec-table,
.proprietary-spec,
.nx-doc-sheet {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* WORKSTREAM C: Text selection protection active on protected content */
.protected-content,
.brand-narrative,
.hero-showcase,
.technical-spec-table,
.proprietary-spec,
.nx-doc-sheet {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Image drag-to-desktop prevention */
img.protected-image,
.nom-container img,
.hero-showcase img,
.nx-doc-sheet img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

/* Strict Accessibility & Interactive Exceptions: Never block form inputs */
input,
textarea,
select,
[contenteditable="true"],
.allow-select,
.selectable-text,
.code-block,
pre,
code {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* Dynamic Visual Watermark Overlay for Protected Documents & Views */
.rmg-watermark-overlay {
  position: relative;
}
.rmg-watermark-overlay::after {
  content: 'RMG–NexGN Software • Proprietary & Confidential • https://rmgsoftech.com';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-family: var(--font-mono, monospace);
  font-size: clamp(1rem, 2.5vw, 1.8rem);
  font-weight: 700;
  color: rgba(15, 23, 42, 0.04);
  letter-spacing: 0.15em;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

/* ==========================================================================
   SH-04.7: Print Governance & Controlled Presentation
   ========================================================================== */
@media print {
  /* Hide non-printable interactive elements and administrative controls */
  #nomMouseLight,
  #nxSmartCircleBtn,
  #nxChatTriggerBtn,
  .nx-smart-menu-modal,
  #nxVijayModal,
  #nxClientChatModal,
  .btn-nom-black,
  .btn-nom-primary,
  .btn-nom-outline,
  [data-action="open-lead-modal"],
  .nom-nav-action,
  .nom-mobile-trigger,
  .no-print {
    display: none !important;
  }

  /* Body & Container print adjustments */
  body {
    background: #FFFFFF !important;
    color: #0F172A !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
  }

  /* Controlled watermarked header/footer on printed pages */
  body::before {
    content: '© RMG–NexGN Software — Licensed Material — Sourced from https://rmgsoftech.com';
    display: block;
    text-align: center;
    font-family: monospace;
    font-size: 8pt;
    color: #64748B;
    border-bottom: 1px solid #CBD5E1;
    padding-bottom: 4px;
    margin-bottom: 12px;
  }

  body::after {
    content: 'Proprietary & Confidential • Unauthorized reproduction or automated redistribution prohibited • https://rmgsoftech.com';
    display: block;
    text-align: center;
    font-family: monospace;
    font-size: 8pt;
    color: #64748B;
    border-top: 1px solid #CBD5E1;
    padding-top: 6px;
    margin-top: 16px;
  }

  /* Prevent page breaks inside important cards */
  .nx-doc-sheet,
  .nom-card,
  table,
  tr,
  img {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}

