/*
 * DigitalWealthSource — Shared Stylesheet
 * Extracted from 161 inline page styles
 * Consolidates: reset, typography, nav, footer, accessibility, 
 *               mobile drawer, search, bottom bar, TOC, share, breadcrumbs
 */

/* ═══════════════════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════════════════ */
:root {
  /* Core palette */
  --dws-navy: #0a0f1e;
  --dws-navy-mid: #111827;
  --dws-navy-light: #1e293b;
  --dws-card-bg: #131c2e;
  --dws-emerald: #00e5a0;
  --dws-emerald-dim: #00c488;
  --dws-gold: #f5c842;
  --dws-coral: #ff6b6b;
  --dws-amber: #fb923c;
  --dws-purple: #a855f7;
  --dws-blue: #38bdf8;
  --dws-slate: #94a3b8;
  --dws-white: #f8fafc;

  /* Typography — unified across all pages */
  --dws-font-display: 'ClashDisplay', 'Syne', system-ui, sans-serif;
  --dws-font-body: 'Satoshi', 'DM Sans', system-ui, sans-serif;
  --dws-font-mono: 'DM Mono', 'Courier New', monospace;

  /* Spacing scale (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;

  /* Border */
  --dws-card-border: rgba(0,229,160,0.12);
  --dws-border-subtle: rgba(255,255,255,0.06);
  --dws-border-medium: rgba(255,255,255,0.1);
}


/* ═══════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--dws-font-body);
  background: var(--dws-navy);
  color: var(--dws-white);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

img { max-width: 100%; height: auto; }
a { color: inherit; }


/* ═══════════════════════════════════════════════════════════
   TYPOGRAPHY — UNIFIED
   ═══════════════════════════════════════════════════════════ */

/* Map legacy variables to unified tokens */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--dws-font-display);
  line-height: 1.15;
  letter-spacing: -0.5px;
}


/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════ */

/* Skip link */
.dws-skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10000;
  background: var(--dws-emerald);
  color: var(--dws-navy);
  padding: 12px 24px;
  border-radius: 0 0 10px 10px;
  font-family: var(--dws-font-body);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.2s ease;
}
.dws-skip-link:focus {
  top: 0 !important;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Focus visible */
*:focus-visible {
  outline: 2px solid var(--dws-emerald) !important;
  outline-offset: 2px !important;
  border-radius: 4px;
}


/* ═══════════════════════════════════════════════════════════
   MOBILE NAV DRAWER
   ═══════════════════════════════════════════════════════════ */
.dws-mobile-drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 9998;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.dws-mobile-drawer-overlay.open { opacity: 1; pointer-events: auto; }

.dws-mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 85%; max-width: 360px;
  background: #0d1220;
  z-index: 9999;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.16,1,.3,1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
  border-left: 1px solid rgba(255,255,255,.08);
}
.dws-mobile-drawer.open { transform: translateX(0); }

.dws-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.dws-drawer-close {
  width: 40px; height: 40px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; background: none;
  color: #94a3b8; font-size: 1.2rem;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all .2s;
}
.dws-drawer-close:hover { color: #fff; border-color: rgba(255,255,255,.25); }

.dws-drawer-search { padding: 16px 20px 8px; flex-shrink: 0; position: relative; }
.dws-drawer-search input {
  width: 100%; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; padding: 12px 14px 12px 40px;
  color: #f8fafc; font-family: var(--dws-font-body);
  font-size: .9rem; outline: none;
}
.dws-drawer-search input:focus { border-color: rgba(0,229,160,.4); }
.dws-drawer-search input::placeholder { color: #64748b; }
.dws-drawer-search-icon {
  position: absolute; left: 34px; top: 50%;
  transform: translateY(-50%); color: #64748b;
  font-size: .9rem; pointer-events: none;
}

.dws-drawer-body { flex: 1; padding: 8px 12px 100px; overflow-y: auto; }

.dws-drawer-section { margin-bottom: 4px; }
.dws-drawer-section-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; font-family: var(--dws-font-display);
  font-weight: 700; font-size: .8rem; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 1.2px;
  cursor: pointer; border-radius: 8px; transition: all .2s;
  -webkit-tap-highlight-color: transparent;
}
.dws-drawer-section-title:hover,
.dws-drawer-section-title:active { background: rgba(255,255,255,.04); color: #fff; }
.dws-drawer-section-title .dws-chevron { transition: transform .25s ease; font-size: .7rem; color: #475569; }
.dws-drawer-section-title.expanded .dws-chevron { transform: rotate(180deg); }

.dws-drawer-links { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.dws-drawer-links.expanded { max-height: 500px; }

.dws-drawer-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: #94a3b8; text-decoration: none;
  font-size: .88rem; border-radius: 8px; transition: all .15s;
  min-height: 44px; -webkit-tap-highlight-color: transparent;
}
.dws-drawer-link:hover,
.dws-drawer-link:active { color: #fff; background: rgba(0,229,160,.06); }
.dws-drawer-link .dws-link-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,.15); flex-shrink: 0;
}

.dws-drawer-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 16px 12px 8px;
  background: linear-gradient(135deg, #00e5a0, #00c488);
  color: #0a0f1e; text-align: center;
  padding: 14px; border-radius: 12px;
  font-family: var(--dws-font-display);
  font-weight: 700; font-size: .92rem;
  text-decoration: none; min-height: 44px;
}

/* Hamburger */
.dws-hamburger {
  display: none; width: 44px; height: 44px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; background: none;
  cursor: pointer; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px; padding: 0;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.dws-hamburger span {
  display: block; width: 20px; height: 2px;
  background: #f8fafc; border-radius: 2px;
  transition: all .3s ease;
}

/* Desktop nav links wrapper */
.dws-nav-links-wrap {
  display: flex; align-items: center; gap: 4px;
}
.dws-nav-links-wrap a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 8px 13px !important;
}


/* ═══════════════════════════════════════════════════════════
   MOBILE BOTTOM NAV BAR
   ═══════════════════════════════════════════════════════════ */
.dws-bottom-bar {
  display: none; position: fixed;
  bottom: 0; left: 0; right: 0; z-index: 9990;
  background: rgba(10,15,30,.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
  font-family: var(--dws-font-body);
}
.dws-bottom-bar-inner {
  display: flex; justify-content: space-around;
  align-items: center; max-width: 500px; margin: 0 auto;
}
.dws-bottom-bar a {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px; color: #64748b;
  text-decoration: none; font-size: .65rem;
  font-weight: 500; padding: 6px 12px; min-width: 60px;
  -webkit-tap-highlight-color: transparent;
  transition: color .2s;
}
.dws-bottom-bar a:active,
.dws-bottom-bar a.active { color: #00e5a0; }
.dws-bottom-bar .bb-icon { font-size: 1.2rem; line-height: 1; }


/* ═══════════════════════════════════════════════════════════
   GLOBAL SEARCH MODAL
   ═══════════════════════════════════════════════════════════ */
.dws-search-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7); z-index: 10001;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.dws-search-modal-overlay.open { opacity: 1; pointer-events: auto; }

.dws-search-modal {
  position: fixed; top: 12%; left: 50%;
  transform: translateX(-50%);
  width: 90%; max-width: 580px;
  background: #131c2e;
  border: 1px solid rgba(0,229,160,.15);
  border-radius: 18px; z-index: 10002;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
.dws-search-modal.open { opacity: 1; pointer-events: auto; }

.dws-search-input-wrap { padding: 20px 20px 0; position: relative; }
.dws-search-input-wrap input {
  width: 100%; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; padding: 14px 16px 14px 44px;
  color: #f8fafc; font-family: var(--dws-font-body);
  font-size: 1rem; outline: none;
}
.dws-search-input-wrap input:focus { border-color: rgba(0,229,160,.4); }
.dws-search-input-wrap input::placeholder { color: #64748b; }
.dws-search-input-wrap .dws-si {
  position: absolute; left: 36px; top: 50%;
  transform: translateY(-50%); color: #64748b;
  font-size: 1.1rem; pointer-events: none; padding-top: 20px;
}

.dws-search-results { padding: 12px 20px 20px; max-height: 50vh; overflow-y: auto; }
.dws-search-result {
  display: block; padding: 12px 14px; border-radius: 10px;
  text-decoration: none; transition: background .15s; margin-bottom: 2px;
}
.dws-search-result:hover { background: rgba(0,229,160,.06); }
.dws-search-result-title {
  font-family: var(--dws-font-display);
  font-weight: 700; font-size: .9rem; color: #f8fafc; margin-bottom: 2px;
}
.dws-search-result-desc { font-size: .78rem; color: #64748b; line-height: 1.4; }
.dws-search-empty { padding: 20px; text-align: center; color: #64748b; font-size: .9rem; }
.dws-search-hint { padding: 8px 20px 16px; font-size: .72rem; color: #475569; text-align: center; }


/* ═══════════════════════════════════════════════════════════
   BREADCRUMBS
   ═══════════════════════════════════════════════════════════ */
.dws-breadcrumb {
  font-size: .75rem;
  color: #64748b;
  padding: 12px 5% 0;
  max-width: 800px;
  margin: 0 auto;
}
.dws-breadcrumb a {
  color: #64748b;
  text-decoration: none;
  transition: color .2s;
}
.dws-breadcrumb a:hover { color: var(--dws-emerald); }


/* ═══════════════════════════════════════════════════════════
   ARTICLE TABLE OF CONTENTS
   ═══════════════════════════════════════════════════════════ */
.dws-toc {
  position: sticky; top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto; padding: 16px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.dws-toc-title {
  font-family: var(--dws-font-display);
  font-weight: 700; font-size: .78rem;
  color: #64748b; text-transform: uppercase;
  letter-spacing: 1.2px; margin-bottom: 12px; padding: 0 16px;
}
.dws-toc a {
  display: block; padding: 7px 16px; font-size: .82rem;
  color: #64748b; text-decoration: none;
  border-left: 2px solid transparent;
  transition: all .15s; line-height: 1.4;
}
.dws-toc a:hover { color: #f8fafc; background: rgba(255,255,255,.03); }
.dws-toc a.active {
  color: var(--dws-emerald);
  border-left-color: var(--dws-emerald);
  background: rgba(0,229,160,.04);
}

.dws-toc-mobile {
  display: none;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; padding: 14px 18px; margin-bottom: 24px;
}
.dws-toc-mobile summary {
  font-family: var(--dws-font-display);
  font-weight: 700; font-size: .85rem; color: #94a3b8;
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
.dws-toc-mobile summary::-webkit-details-marker { display: none; }
.dws-toc-mobile[open] summary {
  margin-bottom: 10px; padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.dws-toc-mobile a {
  display: block; padding: 6px 0; font-size: .82rem;
  color: #64748b; text-decoration: none;
}
.dws-toc-mobile a:hover { color: var(--dws-emerald); }


/* ═══════════════════════════════════════════════════════════
   SHARE BAR
   ═══════════════════════════════════════════════════════════ */
.dws-share-bar { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.dws-share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  font-size: .78rem; font-weight: 600; cursor: pointer;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04); color: #94a3b8;
  text-decoration: none; transition: all .2s;
  font-family: var(--dws-font-body); min-height: 36px;
}
.dws-share-btn:hover {
  border-color: rgba(0,229,160,.3); color: #f8fafc;
  background: rgba(0,229,160,.06);
}
.dws-share-toast {
  position: fixed; bottom: 90px; left: 50%;
  transform: translateX(-50%);
  background: var(--dws-emerald); color: var(--dws-navy);
  padding: 10px 20px; border-radius: 10px;
  font-size: .85rem; font-weight: 700;
  font-family: var(--dws-font-body);
  z-index: 10000; opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.dws-share-toast.show { opacity: 1; }


/* ═══════════════════════════════════════════════════════════
   SOCIAL PROOF
   ═══════════════════════════════════════════════════════════ */
.dws-social-proof {
  max-width: 800px; margin: 12px auto;
  padding: 8px 16px; font-size: .75rem;
  color: #64748b; text-align: center;
  background: rgba(0,229,160,.04);
  border: 1px solid rgba(0,229,160,.08);
  border-radius: 8px;
}


/* ═══════════════════════════════════════════════════════════
   SCROLL REVEAL
   ═══════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .dws-hamburger { display: flex !important; }
  .dws-nav-links-wrap { display: none !important; }
  .dws-bottom-bar { display: block !important; }
  body { padding-bottom: 72px; }

  /* Touch targets */
  nav a, nav button { min-height: 44px !important; min-width: 44px !important; }
  .footer-links a, .dws-drawer-link { min-height: 44px !important; }
}

@media (min-width: 769px) {
  .dws-mobile-drawer, .dws-mobile-drawer-overlay { display: none !important; }
  .dws-bottom-bar { display: none !important; }
}

@media (max-width: 900px) {
  .dws-toc { display: none !important; }
  .dws-toc-mobile { display: block !important; }
}
@media (min-width: 901px) {
  .dws-toc-mobile { display: none !important; }
}
