/* ========================================== */
/* DESIGN SYSTEM & ROOT VARIABLES             */
/* ========================================== */

:root {
  /* Fonts */
  --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;

  /* Colors (Pointful Vibrant Dark Theme) */
  --bg-primary: #0e0c1e;          /* App Background */
  --bg-secondary: #1a1730;        /* Card & Containers (Dark Grape) */
  --bg-sidebar-hover: rgba(73, 69, 90, 0.2);
  
  --text-primary: #e8e2fc;        /* Primary Text (Soft off-white/lilac) */
  --text-secondary: #ada8c1;      /* Secondary Text (Lavender-grey) */
  --text-muted: rgba(173, 168, 193, 0.5);
  
  /* Brand Accents */
  --accent-primary: #bd9dff;      /* Violet/Purple */
  --accent-primary-rgb: 189, 157, 255;
  --accent-secondary: #699cff;    /* Blue */
  --accent-tertiary: #8ce7ff;     /* Cyan (Facts) */
  
  /* Status Colors */
  --color-pro: #4ade80;           /* Vibrant Green */
  --color-con: #ff6e84;           /* Soft Red */
  --color-con-rgb: 255, 110, 132;
  
  /* Borders & Dividers */
  --border-color: rgba(73, 69, 90, 0.3); /* Muted lavender-grey */
  --border-focus: rgba(189, 157, 255, 0.5);
  
  /* Shadows & Globs */
  --card-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  --blob-1: rgba(189, 157, 255, 0.08);
  --blob-2: rgba(140, 231, 255, 0.06);
}

/* ========================================== */
/* BASE & RESET                               */
/* ========================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px; /* Offset for sticky header */
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.625;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ========================================== */
/* BACKGROUND GLOWING DECORATIONS             */
/* ========================================== */

.blob-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  animation: float-blob 25s infinite alternate ease-in-out;
}

.blob-1 {
  top: -10%;
  right: -5%;
  width: 45vw;
  height: 45vw;
  background-color: var(--blob-1);
}

.blob-2 {
  bottom: -10%;
  left: -5%;
  width: 40vw;
  height: 40vw;
  background-color: var(--blob-2);
  animation-delay: -8s;
}

@keyframes float-blob {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(30px, -50px) scale(1.08);
  }
}

/* ========================================== */
/* HEADER & NAVIGATION                        */
/* ========================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  background-color: rgba(14, 12, 30, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.logo-icon {
  color: var(--accent-primary);
  filter: drop-shadow(0 0 6px rgba(var(--accent-primary-rgb), 0.4));
}

.header-nav {
  display: flex;
  gap: 24px;
}

.nav-link {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.nav-link:hover {
  color: var(--accent-primary);
  text-shadow: 0 0 8px rgba(var(--accent-primary-rgb), 0.3);
}

/* ========================================== */
/* MAIN LAYOUT                                */
/* ========================================== */

.main-layout {
  max-width: 1200px;
  width: 100%;
  margin: 104px auto 0 auto;
  padding: 0 24px 80px 24px;
  flex: 1;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
}

/* Sticky Sidebar */
.sidebar {
  position: relative;
}

.sidebar-sticky {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  padding-right: 12px;
}

.sidebar-group {
  margin-bottom: 32px;
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-primary);
  margin-bottom: 12px;
  padding-left: 12px;
}

.sidebar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-list a {
  display: block;
  padding: 6px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
}

.sidebar-list a:hover {
  color: var(--text-primary);
  background-color: var(--bg-sidebar-hover);
  border-left-color: var(--border-color);
}

.sidebar-list a:active,
.sidebar-list a:focus {
  border-left-color: var(--accent-primary);
}

/* ========================================== */
/* DOCUMENT CONTENTS                          */
/* ========================================== */

.document-container {
  min-width: 0;
  background-color: var(--bg-secondary);
  padding: 48px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
}

.doc-block {
  scroll-margin-top: 104px;
}

.doc-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
  margin-bottom: 36px;
}

.main-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.meta-info {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.meta-info strong {
  color: var(--accent-tertiary);
}

.doc-intro {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* Document Sections */
.doc-section {
  margin-bottom: 40px;
}

.doc-section h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.sub-section {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.sub-section .num {
  font-weight: 700;
  color: var(--accent-primary);
  flex-shrink: 0;
  min-width: 28px;
}

.sub-section p {
  color: var(--text-secondary);
  margin: 0;
}

/* Styled Lists */
.styled-list {
  list-style: none;
  margin: 12px 0 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.styled-list li {
  position: relative;
  color: var(--text-secondary);
}

.styled-list li::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-tertiary);
  box-shadow: 0 0 6px var(--accent-tertiary);
}

/* Warning Box (Disclaimer) */
.warning-box {
  background-color: rgba(var(--color-con-rgb), 0.05);
  border: 1px solid rgba(var(--color-con-rgb), 0.25);
  padding: 18px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.warning-box strong {
  display: block;
  color: var(--color-con);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.warning-box p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Contact Card */
.contact-card {
  margin-top: 24px;
  padding: 20px;
  border-radius: 12px;
  background-color: rgba(73, 69, 90, 0.15);
  border: 1px solid var(--border-color);
  transition: border-color 0.2s ease;
}

.contact-card:hover {
  border-color: var(--accent-primary);
}

.contact-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.contact-email {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent-primary);
  text-decoration: none;
  transition: text-shadow 0.2s ease;
}

.contact-email:hover {
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(var(--accent-primary-rgb), 0.4);
}

/* Document Dividers */
.doc-divider {
  border: 0;
  height: 1px;
  background: var(--border-color);
  margin: 64px 0;
}

/* Code Styles */
code {
  font-family: monospace;
  background-color: rgba(73, 69, 90, 0.2);
  color: var(--accent-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ========================================== */
/* FOOTER                                     */
/* ========================================== */

.footer {
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  padding: 24px 0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.footer p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ========================================== */
/* RESPONSIVE LAYOUTS                         */
/* ========================================== */

@media (max-width: 1024px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .sidebar {
    display: none; /* Hide TOC on smaller screens */
  }
}

@media (max-width: 640px) {
  .header-container {
    padding: 0 16px;
  }
  
  .logo span {
    font-size: 1.15rem;
  }
  
  .header-nav {
    gap: 16px;
  }
  
  .nav-link {
    font-size: 0.875rem;
  }
  
  .document-container {
    padding: 24px;
  }
  
  .main-title {
    font-size: 1.75rem;
  }
  
  .doc-section h2 {
    font-size: 1.2rem;
  }
}
