/* ==========================================================================
   Revive - Design System & Global Styles
   ========================================================================== */

:root {
  --bg-primary: #080c14;
  --bg-secondary: #0f172a;
  --bg-tertiary: #141e33;
  --surface-glass: rgba(18, 26, 44, 0.72);
  --surface-glass-border: rgba(255, 255, 255, 0.08);
  --surface-hover: rgba(255, 255, 255, 0.04);
  --surface-card: #111a2e;
  
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.35);
  
  --accent-purple: #a855f7;
  --accent-cyan: #38bdf8;
  --accent-rose: #f43f5e;
  --accent-emerald: #10b981;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 35px var(--primary-glow);
  
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Background Atmosphere Glows */
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.28;
  transition: transform 10s ease-in-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  top: -100px;
  left: 10%;
  background: radial-gradient(circle, #6366f1 0%, rgba(99, 102, 241, 0) 70%);
}

.orb-2 {
  width: 600px;
  height: 600px;
  top: 30%;
  right: -100px;
  background: radial-gradient(circle, #a855f7 0%, rgba(168, 85, 247, 0) 70%);
}

.orb-3 {
  width: 450px;
  height: 450px;
  bottom: 10%;
  left: -50px;
  background: radial-gradient(circle, #0284c7 0%, rgba(2, 132, 199, 0) 70%);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.5rem); letter-spacing: -0.015em; }
h4 { font-size: 1.15rem; }

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-light);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.container-narrow {
  max-width: 900px;
}

.container-legal {
  max-width: 1240px;
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--surface-glass-border);
  transition: all var(--transition-fast);
}

.site-header.scrolled {
  background: rgba(8, 12, 20, 0.95);
  box-shadow: var(--shadow-sm);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-logo svg {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 12px var(--primary-glow));
}

.brand-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--primary-light);
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.75rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  position: relative;
  padding: 0.35rem 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple));
  border-radius: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5);
  color: #ffffff;
}

.btn-secondary {
  background: var(--surface-glass);
  color: var(--text-primary);
  border-color: var(--surface-glass-border);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-sm {
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
}

.btn-lg {
  font-size: 1.05rem;
  padding: 0.85rem 1.85rem;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--surface-glass-border);
}

.btn-outline:hover {
  border-color: var(--primary-light);
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-light);
}

/* Breadcrumb */
.breadcrumb-nav {
  padding: 1.25rem 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-dim);
}

.breadcrumb-nav a {
  color: var(--text-muted);
}

.breadcrumb-nav a:hover {
  color: var(--text-primary);
}

.breadcrumb-separator {
  color: var(--text-dim);
}

.breadcrumb-current {
  color: var(--primary-light);
  font-weight: 500;
}

/* Legal Documents Layout (TOC + Content) */
.legal-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 3rem;
  align-items: start;
  padding: 2rem 0 5rem;
}

/* Sidebar TOC */
.legal-sidebar {
  position: sticky;
  top: 96px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.legal-sidebar-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toc-link {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  line-height: 1.35;
  border-left: 2px solid transparent;
}

.toc-link:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.toc-link.active {
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.12);
  border-left-color: var(--primary);
  font-weight: 600;
}

.sidebar-actions {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--surface-glass-border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Legal Document Main Content */
.legal-content {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow-md);
}

.legal-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--surface-glass-border);
}

.legal-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 30%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.legal-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.meta-badge {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-weight: 500;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

/* Document Search / Filter Bar */
.doc-search-wrapper {
  margin-top: 1.5rem;
  position: relative;
}

.doc-search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background: rgba(10, 15, 26, 0.6);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.doc-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.doc-search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

/* Legal Body Sections */
.legal-section {
  margin-bottom: 2.75rem;
  scroll-margin-top: 100px;
}

.legal-section:last-child {
  margin-bottom: 0;
}

.legal-section-title {
  font-size: 1.6rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-link-anchor {
  opacity: 0;
  color: var(--text-dim);
  font-size: 1.1rem;
  transition: opacity var(--transition-fast);
  cursor: pointer;
  padding: 0 0.5rem;
}

.legal-section-title:hover .section-link-anchor {
  opacity: 1;
}

.legal-subsection-title {
  font-size: 1.2rem;
  color: #e2e8f0;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.legal-body p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1.1rem;
}

.legal-body ul, .legal-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.legal-body li {
  margin-bottom: 0.5rem;
  line-height: 1.65;
}

.legal-body strong {
  color: var(--text-primary);
}

/* Callout Box */
.legal-callout {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.legal-callout.warning {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.25);
  border-left-color: var(--accent-rose);
}

.legal-callout.success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
  border-left-color: var(--accent-emerald);
}

/* Legal Data Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-glass-border);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.legal-table th,
.legal-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-table th {
  background: rgba(20, 30, 50, 0.7);
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-heading);
}

.legal-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.legal-table td strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

/* Contact Card Box */
.contact-highlight-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(168, 85, 247, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.contact-email-badge {
  font-family: monospace;
  font-size: 1.05rem;
  color: var(--accent-cyan);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: #060910;
  border-top: 1px solid var(--surface-glass-border);
  padding: 4rem 0 2rem;
  position: relative;
  z-index: 1;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 1rem 0 1.5rem;
  max-width: 320px;
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-disclaimer {
  max-width: 600px;
  line-height: 1.5;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1e293b;
  color: #f8fafc;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--surface-glass-border);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all var(--transition-smooth);
}

.toast-notice.show {
  opacity: 1;
  transform: translateY(0);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-glass);
  border: 1px solid var(--surface-glass-border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all var(--transition-fast);
  opacity: 0;
  visibility: hidden;
  z-index: 90;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 4px 15px var(--primary-glow);
}

/* Print Styles */
@media print {
  .site-header, .site-footer, .legal-sidebar, .doc-search-wrapper, .bg-ambient, .back-to-top, .toast-notice {
    display: none !important;
  }
  
  body {
    background: #ffffff !important;
    color: #1a1a1a !important;
  }
  
  .legal-layout {
    display: block !important;
    padding: 0 !important;
  }
  
  .legal-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  
  .legal-title {
    color: #000000 !important;
    -webkit-text-fill-color: initial !important;
  }
  
  h1, h2, h3, h4, p, li {
    color: #1a1a1a !important;
  }
  
  .legal-table th, .legal-table td {
    border-color: #e5e5e5 !important;
    color: #1a1a1a !important;
  }
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .legal-sidebar {
    position: static;
    max-height: none;
  }
  
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(8, 12, 20, 0.98);
    backdrop-filter: blur(25px);
    flex-direction: column;
    padding: 1.5rem;
    border-bottom: 1px solid var(--surface-glass-border);
    gap: 1rem;
    align-items: flex-start;
  }
  
  .nav-links.open {
    display: flex;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .legal-content {
    padding: 1.75rem;
  }
  
  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
