/**
 * DeepAML shared visual theme — ambient background, header, footer, utilities
 */
:root {
  --bg-primary: #0A0E1A;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.72);
  --bg-elevated: rgba(22, 30, 48, 0.85);
  --accent-blue: #00D4FF;
  --accent-cyan: #00E5FF;
  --accent-green: #00FF88;
  --accent-gold: #FFD700;
  --accent-purple: #8B5CF6;
  --text-primary: #F0F4F8;
  --text-secondary: #8892A6;
  --text-muted: #64748B;
  --border: rgba(0, 212, 255, 0.12);
  --border-hover: rgba(0, 212, 255, 0.28);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow-sm: 0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 48px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 60px rgba(0, 212, 255, 0.08);
  --content-max: 1280px;
  --header-h: 68px;
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Ambient atmosphere */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 60% at 50% -15%, rgba(0, 212, 255, 0.13), transparent 55%),
    radial-gradient(ellipse 55% 45% at 95% 15%, rgba(139, 92, 246, 0.07), transparent 50%),
    radial-gradient(ellipse 45% 35% at 5% 75%, rgba(255, 215, 0, 0.05), transparent 45%),
    var(--bg-primary);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 180, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 180, 255, 0.028) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 15%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 15%, transparent 72%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Shared site header (identical across index, news, article, legal pages) */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  padding: 0 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 14, 26, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), box-shadow var(--transition);
}

.site-header.scrolled {
  background: rgba(10, 14, 26, 0.92);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--text-primary);
  transition: opacity var(--transition);
}

.site-logo:hover { opacity: 0.92; }

.site-logo .logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-gold), #FFA500);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.2);
  flex-shrink: 0;
}

.site-logo span {
  background: linear-gradient(90deg, var(--accent-gold), #FFA500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 40px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.site-nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  transition: color var(--transition);
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  border-radius: 1px;
  transition: width var(--transition);
}

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

.site-nav a:hover::after,
.site-nav a.active::after { width: 100%; }

.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Hamburger toggle for mobile nav (shared across all pages) */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}

.menu-toggle .menu-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle.open .menu-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open .menu-bar:nth-child(2) { opacity: 0; }
.menu-toggle.open .menu-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 998;
  opacity: 0;
  transition: opacity var(--transition);
}

.mobile-nav-backdrop.open { display: block; opacity: 1; }

/* Shared footer */
.site-footer {
  margin-top: auto;
  padding: 56px clamp(20px, 4vw, 48px) 40px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(6, 10, 20, 0.75));
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 70%);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.45), transparent);
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 28px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--accent-cyan); }

/* Section title with accent line */
.section-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.section-heading h2 {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 800;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-hover), transparent);
}

/* Glass card utility */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.glass-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@media (min-width: 1440px) {
  .site-header { padding: 0 64px; }
}

@media (max-width: 1024px) {
  .site-header { padding: 0 20px; gap: 12px; }
  .menu-toggle { display: flex; margin-left: auto; }
  .header-right { gap: 10px; margin-left: 0; }
  .site-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    transform: none;
    height: calc(100vh - var(--header-h));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px 32px;
    background: rgba(10, 14, 26, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    overflow-y: auto;
    z-index: 999;
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    padding: 14px 0;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .site-nav a::after { display: none; }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .site-header { padding: 0 16px; }
  .site-logo { font-size: 18px; }
  .site-logo .logo-icon { width: 34px; height: 34px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 16px 24px; }
}
