/**
 * ==============================================================================
 * ADIT.EXE — BASE STYLES, ATMOSPHERE & TYPOGRAPHY
 * ==============================================================================
 */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-deep-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background-color: var(--bg-deep-void);
  background-image: 
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(2, 24, 97, 0.45) 0%, transparent 80%),
    radial-gradient(circle at 10% 30%, rgba(37, 93, 206, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 90% 70%, rgba(222, 17, 16, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
  transition: background-color var(--theme-transition-speed) ease,
              color 0.4s ease;
}

/* Universal Smooth Theme Transitions for Surfaces */
.dossier-card,
.particle-stage-wrap,
.memory-card,
.terminal-workstation,
.report-folder,
.envelope-trigger-card,
.countdown-unit-box,
.hud-navbar,
.btn-cyber,
.hud-achievement-pill,
.hud-btn-icon,
.theme-reactor-btn {
  transition: background-color var(--theme-transition-speed) ease,
              border-color var(--theme-transition-speed) ease,
              box-shadow var(--theme-transition-speed) ease,
              color 0.35s ease;
}

/* ----------------------------------------------------------------------------
 * BACKGROUND ATMOSPHERE: TECH GRID & CRT SCANLINES
 * ---------------------------------------------------------------------------- */
.atmosphere-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(37, 93, 206, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(37, 93, 206, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: var(--z-background);
}

.atmosphere-scanline {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 9999;
}

.atmosphere-vignette {
  position: fixed;
  inset: 0;
  box-shadow: inset 0 0 140px rgba(1, 6, 25, 0.95);
  pointer-events: none;
  z-index: 9998;
}

/* ----------------------------------------------------------------------------
 * CUSTOM SCROLLBAR
 * ---------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep-void);
  border-left: 1px solid var(--border-subtle);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-cobalt-blue), var(--color-bright-red));
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-bright-red);
}

/* ----------------------------------------------------------------------------
 * TYPOGRAPHY HIERARCHY
 * ---------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.font-editorial {
  font-family: var(--font-editorial);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.font-mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
  letter-spacing: 0.05em;
}

.display-title {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  font-family: var(--font-mono);
  color: var(--text-accent-blue);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.section-subtitle::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 2px;
  background: var(--color-bright-red);
}

.lead-text {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 65ch;
  line-height: 1.7;
}

/* ----------------------------------------------------------------------------
 * CUSTOM DESKTOP CURSOR
 * ---------------------------------------------------------------------------- */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--color-bright-red);
  border-radius: 50%;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition: transform 0.05s ease, opacity 0.3s ease;
  box-shadow: 0 0 12px var(--color-bright-red);
}

.custom-cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-cobalt-blue);
  border-radius: 50%;
  pointer-events: none;
  z-index: calc(var(--z-cursor) - 1);
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease-out, width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 0 16px rgba(37, 93, 206, 0.4);
}

.custom-cursor.hovering {
  transform: translate(-50%, -50%) scale(2);
  background: #ffffff;
}

.custom-cursor-follower.hovering {
  width: 52px;
  height: 52px;
  border-color: var(--color-bright-red);
  background: rgba(222, 17, 16, 0.08);
}

@media (pointer: coarse) {
  .custom-cursor, .custom-cursor-follower {
    display: none !important;
  }
}

/* ----------------------------------------------------------------------------
 * CHAPTER SECTIONS & CONTAINERS
 * ---------------------------------------------------------------------------- */
.chapter-section {
  position: relative;
  min-height: 100vh;
  padding: 100px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: var(--z-content);
}

.chapter-section.compact-pad {
  padding-top: 60px;
  padding-bottom: 60px;
}

.container-custom {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

/* ----------------------------------------------------------------------------
 * TECHNICAL MICRO DETAILS & BADGES
 * ---------------------------------------------------------------------------- */
.hud-meta-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hud-meta-label .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-cobalt-blue);
  box-shadow: 0 0 8px var(--color-cobalt-blue);
  animation: pulseDot 2s infinite ease-in-out;
}

.hud-meta-label .dot.red {
  background: var(--color-bright-red);
  box-shadow: 0 0 8px var(--color-bright-red);
}

.hud-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius-sm);
  background: rgba(37, 93, 206, 0.15);
  border: 1px solid var(--border-medium);
  color: var(--text-accent-blue);
}

.hud-badge.red {
  background: rgba(222, 17, 16, 0.15);
  border-color: var(--border-red-bright);
  color: var(--text-accent-red);
}

/* ----------------------------------------------------------------------------
 * UTILITY BUTTONS & INTERACTIVE STATES
 * ---------------------------------------------------------------------------- */
.btn-cyber {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(2, 24, 97, 0.9), rgba(37, 93, 206, 0.6));
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-smooth);
  box-shadow: 0 4px 20px rgba(1, 6, 25, 0.5), inset 0 0 12px rgba(37, 93, 206, 0.3);
  text-decoration: none;
}

.btn-cyber::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s ease;
}

.btn-cyber:hover {
  border-color: #ffffff;
  box-shadow: 0 0 25px var(--glow-cobalt-strong);
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-cyber:hover::before {
  left: 100%;
}

.btn-cyber-red {
  background: linear-gradient(135deg, rgba(222, 17, 16, 0.8), rgba(2, 24, 97, 0.9));
  border-color: var(--border-red-bright);
  box-shadow: 0 4px 20px rgba(1, 6, 25, 0.5), inset 0 0 12px rgba(222, 17, 16, 0.4);
}

.btn-cyber-red:hover {
  border-color: #ffffff;
  box-shadow: 0 0 30px var(--glow-red-strong);
}

.btn-cyber-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-cyber-outline:hover {
  border-color: var(--color-cobalt-blue);
  color: #ffffff;
  background: rgba(37, 93, 206, 0.15);
}

/* Corner bracket embellishments */
.corner-brackets {
  position: relative;
}

.corner-brackets::before, .corner-brackets::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  pointer-events: none;
}

.corner-brackets::before {
  top: -2px;
  left: -2px;
  border-top: 2px solid var(--color-bright-red);
  border-left: 2px solid var(--color-bright-red);
}

.corner-brackets::after {
  bottom: -2px;
  right: -2px;
  border-bottom: 2px solid var(--color-cobalt-blue);
  border-right: 2px solid var(--color-cobalt-blue);
}
