/* ═══════════════════════════════════════════════════════════════════
   ZTAKORA DOCS · REDESIGN LAYER
   Modern documentation aesthetic (Stripe / Linear / Mintlify lineage):
   precise type, calm surfaces, a living sidebar, and disciplined motion.
   Loaded AFTER style.css to retune the existing markup without touching
   content. Mobile-first responsive.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* Refined palette — cooler, cleaner, more "infrastructure" */
  --rd-ink:        #090d15;
  --rd-ink-2:      #0c1220;
  --rd-ink-3:      #111a2b;
  --rd-surface:    rgba(255, 255, 255, 0.022);
  --rd-surface-2:  rgba(255, 255, 255, 0.05);
  --rd-surface-3:  rgba(255, 255, 255, 0.08);

  --rd-paper:      #eef2f8;
  --rd-paper-2:    #aeb9cb;
  --rd-paper-3:    #6b7689;
  --rd-muted:      #4d586b;

  --rd-gold:       #e6c879;
  --rd-gold-2:     #f3dca0;
  --rd-gold-deep:  #c8a64f;
  --rd-teal:       #43e3c3;
  --rd-blue:       #6ba6ff;

  --rd-line:       rgba(255, 255, 255, 0.075);
  --rd-line-2:     rgba(255, 255, 255, 0.13);
  --rd-line-gold:  rgba(230, 200, 121, 0.32);

  --rd-glow-gold:  0 0 0 1px rgba(230,200,121,0.16), 0 22px 70px -20px rgba(230,200,121,0.22);
  --rd-shadow:     0 24px 70px -24px rgba(0,0,0,0.7);

  --rd-ease:       cubic-bezier(.22, 1, .36, 1);
  --rd-spring:     cubic-bezier(.34, 1.56, .64, 1);
  --rd-measure:    68ch;
}

/* ── Base atmosphere ──────────────────────────────────────────────── */
body.dark {
  background:
    radial-gradient(38rem 38rem at 92% -8%, rgba(230,200,121,0.10), transparent 60%),
    radial-gradient(40rem 40rem at 4% 102%, rgba(67,227,195,0.075), transparent 62%),
    linear-gradient(180deg, var(--rd-ink) 0%, #080c14 45%, #06090f 100%) !important;
  color: var(--rd-paper);
  -webkit-font-smoothing: antialiased;
}

/* faint engineering grid behind everything */
body.dark::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, black, transparent 80%);
  mask-image: radial-gradient(circle at 50% 0%, black, transparent 80%);
}
body.dark > * { position: relative; z-index: 1; }

::selection { background: rgba(230,200,121,0.28); color: #fff; }

/* ══ TOP NAV ══════════════════════════════════════════════════════ */
/* Fixed header so the title bar stays visible while scrolling. It was
   position:sticky, but the overflow-x:hidden guard above (needed for the
   mobile drawer) silently disables sticky, and a mobile media query reset
   it to position:relative. Fixed positioning avoids both problems. */
.topnav {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: var(--nav-h) !important;
  z-index: 200 !important;
  background: rgba(9, 13, 21, 0.72) !important;
  backdrop-filter: blur(20px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(150%) !important;
  border-bottom: 1px solid var(--rd-line) !important;
}
.topnav-inner { height: var(--nav-h); }
/* Push all content below the fixed bar with a single body offset.
   No negative margins (they caused the hero to tuck under the nav and
   clip the first line). The hero's own background still fills its box. */
body.dark { padding-top: var(--nav-h); }

.topnav::before { display: none !important; }
.logo-company { color: var(--rd-paper) !important; letter-spacing: .01em !important; }
.logo-section { color: var(--rd-gold) !important; opacity: .9 !important; }
.logo-mark { border-color: var(--rd-line-gold) !important; }

.top-links {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  gap: .1rem !important;
}
.top-links a {
  color: var(--rd-paper-2) !important;
  font-weight: 500 !important;
  font-size: .82rem !important;
  letter-spacing: .005em !important;
  padding: .5rem .85rem !important;
  position: relative;
}
.top-links a::after {
  content: '';
  position: absolute;
  left: .85rem; right: .85rem; bottom: .28rem;
  height: 1.5px;
  background: linear-gradient(90deg, var(--rd-gold), var(--rd-teal));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--rd-ease);
  border-radius: 2px;
}
.top-links a:hover { background: transparent !important; color: var(--rd-paper) !important; }
.top-links a:hover::after { transform: scaleX(1); }
.top-links a.active {
  color: var(--rd-ink) !important;
  background: linear-gradient(135deg, var(--rd-gold-2), var(--rd-gold)) !important;
  box-shadow: 0 8px 24px -8px rgba(230,200,121,0.5) !important;
}
.top-links a.active::after { display: none; }

.btn-outline {
  border-color: var(--rd-line-2) !important;
  color: var(--rd-paper) !important;
  background: var(--rd-surface) !important;
  font-weight: 600 !important;
  border-radius: 11px !important;
  transition: all .25s var(--rd-ease) !important;
}
.btn-outline:hover {
  border-color: var(--rd-line-gold) !important;
  background: rgba(230,200,121,0.09) !important;
  transform: translateY(-1px);
}

/* ══ HOME HERO — "control center" ════════════════════════════════ */
.hero { isolation: isolate; }
.hero::before { background: radial-gradient(circle, rgba(67,227,195,0.13), transparent 66%) !important; }
.hero::after  { background: radial-gradient(circle, rgba(230,200,121,0.12), transparent 68%) !important; }

.hero-badge {
  background: var(--rd-surface-2) !important;
  border: 1px solid var(--rd-line) !important;
  color: var(--rd-gold) !important;
  font-size: .68rem !important;
  letter-spacing: .16em !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}

.hero-title {
  font-size: clamp(2.9rem, 6.2vw, 5.8rem) !important;
  line-height: .95 !important;
  letter-spacing: -.03em !important;
  color: #fcf8ef !important;
}
.hero-title em {
  background: linear-gradient(120deg, var(--rd-gold-2) 10%, var(--rd-teal) 90%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
}
.hero-sub { color: var(--rd-paper-2) !important; font-size: clamp(1rem, 1.2vw, 1.12rem) !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--rd-gold-2), var(--rd-gold)) !important;
  color: #0a0e16 !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  box-shadow: 0 14px 40px -14px rgba(230,200,121,0.55) !important;
  transition: transform .2s var(--rd-ease), box-shadow .25s var(--rd-ease) !important;
}
.btn-primary:hover { transform: translateY(-2px) !important; box-shadow: 0 20px 50px -16px rgba(230,200,121,0.7) !important; }
.btn-secondary {
  background: var(--rd-surface-2) !important;
  border: 1px solid var(--rd-line-2) !important;
  color: var(--rd-paper) !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
  transition: all .25s var(--rd-ease) !important;
}
.btn-secondary:hover { border-color: var(--rd-line-gold) !important; background: rgba(230,200,121,0.08) !important; transform: translateY(-2px) !important; }

.hero-trust-line { color: var(--rd-paper-3) !important; }
.hero-trust-line span { position: relative; }

/* Hero console — calmer, more "instrument panel" */
.hero-console {
  background: linear-gradient(180deg, var(--rd-ink-2), var(--rd-ink)) !important;
  border: 1px solid var(--rd-line) !important;
  box-shadow: var(--rd-shadow) !important;
  border-radius: 20px !important;
}
.console-top { border-bottom: 1px solid var(--rd-line) !important; }
.console-label { color: var(--rd-paper-3) !important; }
.protocol-card, .flow-card, .mini-card {
  background: var(--rd-surface) !important;
  border: 1px solid var(--rd-line) !important;
  border-radius: 14px !important;
}
.protocol-kicker { color: var(--rd-gold) !important; }
.protocol-title { color: var(--rd-paper) !important; }
.protocol-bars > div { background: rgba(255,255,255,0.05) !important; }
.protocol-bars span { background: linear-gradient(90deg, var(--rd-gold), var(--rd-teal)) !important; }
.flow-node i { color: var(--rd-gold) !important; background: rgba(230,200,121,0.08) !important; border-color: var(--rd-line-gold) !important; }
.flow-node strong { color: var(--rd-paper) !important; }
.flow-node span { color: var(--rd-paper-3) !important; }
.mini-value { color: var(--rd-gold-2) !important; }
.mini-label { color: var(--rd-paper-3) !important; }


/* ══ SECTION RHYTHM ══════════════════════════════════════════════ */
.cards-section, .timeline-strip, .stats-section { padding-block: clamp(4rem, 8vw, 7rem) !important; }
.section-label {
  font-family: var(--font-mono) !important;
  font-size: .68rem !important;
  letter-spacing: .26em !important;
  text-transform: uppercase !important;
  color: var(--rd-gold) !important;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem !important;
}
.section-label::before {
  content: '';
  width: 1.6rem; height: 1px;
  background: linear-gradient(90deg, var(--rd-gold), transparent);
}
.section-title {
  font-family: var(--font-display) !important;
  font-size: clamp(2.1rem, 4.2vw, 3.4rem) !important;
  font-weight: 700 !important;
  letter-spacing: -.02em !important;
  line-height: 1.02 !important;
  color: var(--rd-paper) !important;
  margin-bottom: clamp(2rem, 4vw, 3rem) !important;
  text-wrap: balance;
}

/* ══ DOC INDEX CARDS ═════════════════════════════════════════════ */
.doc-cards { gap: 1rem !important; }
.doc-card {
  background: linear-gradient(180deg, var(--rd-surface), transparent) !important;
  border: 1px solid var(--rd-line) !important;
  border-radius: 18px !important;
  padding: 1.6rem !important;
  position: relative;
  overflow: hidden;
  transition: transform .35s var(--rd-ease), border-color .35s var(--rd-ease), background .35s var(--rd-ease) !important;
}
/* gold sweep on hover */
.doc-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(20rem 20rem at var(--mx, 50%) var(--my, 0%), rgba(230,200,121,0.10), transparent 60%);
  opacity: 0;
  transition: opacity .4s var(--rd-ease);
  pointer-events: none;
}
.doc-card:hover {
  transform: translateY(-4px) !important;
  border-color: var(--rd-line-gold) !important;
  background: linear-gradient(180deg, var(--rd-surface-2), transparent) !important;
}
.doc-card:hover::after { opacity: 1; }
.doc-card-icon {
  font-family: var(--font-mono) !important;
  background: rgba(230,200,121,0.08) !important;
  border: 1px solid var(--rd-line-gold) !important;
  color: var(--rd-gold) !important;
  border-radius: 12px !important;
  font-weight: 500 !important;
}
.doc-card-num {
  font-family: var(--font-mono) !important;
  color: var(--rd-muted) !important;
  font-size: .72rem !important;
}
.doc-card h3 {
  font-family: var(--font-display) !important;
  font-size: 1.55rem !important;
  font-weight: 600 !important;
  color: var(--rd-paper) !important;
  letter-spacing: .005em !important;
}
.doc-card p { color: var(--rd-paper-3) !important; font-size: .9rem !important; line-height: 1.65 !important; }
.doc-card-link {
  color: var(--rd-gold) !important;
  font-weight: 600 !important;
  font-size: .85rem !important;
  transition: gap .2s var(--rd-ease);
}
.doc-card:hover .doc-card-link { color: var(--rd-gold-2) !important; }

/* card media (added by main.js on inner-linked cards) */
.doc-card-media { border-radius: 12px !important; border: 1px solid var(--rd-line) !important; }
.doc-card-media::after { background: linear-gradient(180deg, transparent, rgba(9,13,21,0.7)) !important; }

/* ══ TIMELINE ════════════════════════════════════════════════════ */
.tl-year {
  font-family: var(--font-mono) !important;
  color: var(--rd-gold) !important;
  font-size: .8rem !important;
  letter-spacing: .04em !important;
}
.tl-content {
  background: var(--rd-surface) !important;
  border: 1px solid var(--rd-line) !important;
  border-radius: 14px !important;
  transition: border-color .3s var(--rd-ease), transform .3s var(--rd-ease);
}
.tl-item:hover .tl-content { border-color: var(--rd-line-gold) !important; transform: translateY(-2px); }
.tl-content strong { color: var(--rd-paper) !important; font-family: var(--font-display) !important; font-size: 1.2rem !important; font-weight: 600 !important; }
.tl-content p { color: var(--rd-paper-3) !important; }
.tl-dot { background: var(--rd-paper-3) !important; box-shadow: 0 0 0 4px var(--rd-ink) !important; }
.tl-dot--active { background: var(--rd-teal) !important; box-shadow: 0 0 0 4px var(--rd-ink), 0 0 16px rgba(67,227,195,0.7) !important; }
.tl-dot--gold { background: var(--rd-gold) !important; box-shadow: 0 0 0 4px var(--rd-ink), 0 0 16px rgba(230,200,121,0.7) !important; }
.tl-dot--future { background: transparent !important; border: 2px solid var(--rd-gold) !important; }

/* ══ STATS ═══════════════════════════════════════════════════════ */
.stat {
  background: linear-gradient(180deg, var(--rd-surface), transparent) !important;
  border: 1px solid var(--rd-line) !important;
  border-radius: 16px !important;
  transition: border-color .3s var(--rd-ease), transform .3s var(--rd-ease) !important;
}
.stat:hover { border-color: var(--rd-line-gold) !important; transform: translateY(-3px); }
.stat-value {
  font-family: var(--font-display) !important;
  font-size: clamp(2.4rem, 5vw, 3.4rem) !important;
  font-weight: 700 !important;
  background: linear-gradient(135deg, var(--rd-gold-2), var(--rd-gold-deep)) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  letter-spacing: -.01em !important;
}
.stat-label { color: var(--rd-paper) !important; font-weight: 600 !important; }
.stat-sub { color: var(--rd-paper-3) !important; }


/* ══ INNER PAGE HERO ═════════════════════════════════════════════ */
.page-hero { padding-block: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem) !important; }
.page-hero h1 {
  font-family: var(--font-display) !important;
  font-size: clamp(2.6rem, 6vw, 5rem) !important;
  font-weight: 700 !important;
  letter-spacing: -.03em !important;
  line-height: .98 !important;
  color: #fcf8ef !important;
}
.page-hero p { color: var(--rd-paper-2) !important; max-width: 60ch !important; }
.page-hero .hero-badge, .page-hero .token-hero-badge { margin-bottom: 1.3rem !important; }

/* ══ THE SIGNATURE: living documentation sidebar ═════════════════ */
.doc-layout { gap: clamp(2rem, 4vw, 4rem) !important; }
.doc-sidebar {
  top: calc(var(--nav-h) + 1.5rem) !important;
  padding-right: .5rem;
}
.sidebar-title {
  font-family: var(--font-mono) !important;
  font-size: .62rem !important;
  letter-spacing: .22em !important;
  text-transform: uppercase !important;
  color: var(--rd-paper-3) !important;
  margin-bottom: .75rem !important;
  padding-left: .9rem;
}
/* The sidebar nav gets a continuous rail; the active indicator is a
   gold segment that slides between items (positioned by main.js). */
.doc-sidebar nav, .sidebar-nav, .doc-sidebar .sidebar-group {
  position: relative;
}
.doc-sidebar nav::before, .sidebar-nav::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1.5px;
  background: var(--rd-line);
}
.sidebar-link {
  position: relative;
  color: var(--rd-paper-3) !important;
  font-size: .86rem !important;
  font-weight: 500 !important;
  padding: .5rem .9rem !important;
  border-radius: 0 8px 8px 0 !important;
  transition: color .2s var(--rd-ease), background .2s var(--rd-ease), transform .2s var(--rd-ease) !important;
}
.sidebar-link::before {
  content: '';
  position: absolute;
  left: -.75px; top: 50%;
  width: 1.5px; height: 0;
  background: linear-gradient(180deg, var(--rd-gold-2), var(--rd-gold));
  transform: translateY(-50%);
  transition: height .28s var(--rd-ease);
  border-radius: 2px;
  box-shadow: none !important;
}
.sidebar-link:hover {
  color: var(--rd-paper) !important;
  background: var(--rd-surface) !important;
  transform: none !important;
}
.sidebar-link:hover::before { height: 60%; }
.sidebar-link.active {
  color: var(--rd-gold-2) !important;
  background: linear-gradient(90deg, rgba(230,200,121,0.1), transparent) !important;
}
.sidebar-link.active::before { height: 100%; }
.sidebar-child { opacity: .9; }

/* ══ DOC CONTENT — editorial typography ══════════════════════════ */
.doc-content {
  background: linear-gradient(180deg, rgba(255,255,255,0.012), transparent) !important;
  border: 1px solid var(--rd-line) !important;
  border-radius: 22px !important;
  padding: clamp(1.5rem, 4vw, 3.25rem) !important;
}
.doc-content > *:first-child { margin-top: 0 !important; }
.doc-content h2 {
  font-family: var(--font-display) !important;
  font-size: clamp(1.8rem, 3.2vw, 2.5rem) !important;
  font-weight: 700 !important;
  letter-spacing: -.015em !important;
  color: #fcf8ef !important;
  margin-top: 3rem !important;
  padding-bottom: .65rem !important;
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.doc-content h2::after {
  width: 3rem !important;
  height: 2px !important;
  background: linear-gradient(90deg, var(--rd-gold), var(--rd-teal)) !important;
}
.doc-content h3 {
  font-family: var(--font-display) !important;
  font-size: 1.45rem !important;
  font-weight: 600 !important;
  color: var(--rd-paper) !important;
  margin-top: 2rem !important;
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.doc-content h4 {
  font-family: var(--font-mono) !important;
  font-size: .7rem !important;
  font-weight: 600 !important;
  letter-spacing: .16em !important;
  color: var(--rd-gold) !important;
}
.doc-content p, .doc-content li {
  color: var(--rd-paper-2) !important;
  line-height: 1.8 !important;
  font-size: 1rem !important;
}
.doc-content p { max-width: var(--rd-measure); }
.doc-content li strong, .doc-content p strong { color: var(--rd-paper) !important; font-weight: 600 !important; }
.doc-content a:not(.sidebar-link):not(.doc-card-link) {
  color: var(--rd-gold-2) !important;
  text-decoration: none;
  border-bottom: 1px solid var(--rd-line-gold);
  transition: border-color .2s, color .2s;
}
.doc-content a:not(.sidebar-link):not(.doc-card-link):hover { color: #fff !important; border-color: var(--rd-gold); }

/* lists get a custom gold marker */
.doc-content ul { list-style: none !important; padding-left: 0 !important; }
.doc-content ul > li {
  position: relative;
  padding-left: 1.4rem !important;
  max-width: var(--rd-measure);
}
.doc-content ul > li::before {
  content: '';
  position: absolute;
  left: .1rem; top: .72em;
  width: 5px; height: 5px;
  border-radius: 1.5px;
  background: var(--rd-gold);
  transform: rotate(45deg);
}

/* ══ TABLES ══════════════════════════════════════════════════════ */
.doc-table {
  border: 1px solid var(--rd-line) !important;
  border-radius: 14px !important;
  overflow: hidden;
}
.doc-table th {
  font-family: var(--font-mono) !important;
  font-size: .68rem !important;
  letter-spacing: .1em !important;
  text-transform: uppercase !important;
  color: var(--rd-gold) !important;
  background: rgba(230,200,121,0.05) !important;
  border-bottom: 1px solid var(--rd-line-gold) !important;
}
.doc-table td { color: var(--rd-paper-2) !important; border-bottom: 1px solid var(--rd-line) !important; }
.doc-table tbody tr:hover td { background: rgba(230,200,121,0.04) !important; }

/* ══ INFO BOXES / CALLOUTS ═══════════════════════════════════════ */
.info-box {
  background: var(--rd-surface) !important;
  border: 1px solid var(--rd-line) !important;
  border-radius: 14px !important;
}
.info-box.gold { background: linear-gradient(135deg, rgba(230,200,121,0.09), transparent) !important; border-color: var(--rd-line-gold) !important; }
.info-box.teal { background: linear-gradient(135deg, rgba(67,227,195,0.08), transparent) !important; border-color: rgba(67,227,195,0.25) !important; }
.info-box-title { font-family: var(--font-mono) !important; color: var(--rd-gold) !important; }
.info-box.teal .info-box-title { color: var(--rd-teal) !important; }
.info-box p { color: var(--rd-paper-2) !important; }

/* ══ FOOTER ══════════════════════════════════════════════════════ */
.footer { border-top: 1px solid var(--rd-line) !important; background: rgba(6,9,15,0.5) !important; }
.footer-brand span { color: var(--rd-paper) !important; font-family: var(--font-display) !important; }
.footer-nav a { color: var(--rd-paper-3) !important; }
.footer-nav a:hover { color: var(--rd-gold) !important; }
.footer-bottom p, .footer-disclaimer { color: var(--rd-muted) !important; }


/* ══ MOTION — page load + scroll reveal ══════════════════════════ */
/* Hero entrance: children rise + fade in sequence on load */
.hero-copy > * {
  opacity: 0;
  transform: translateY(16px);
  animation: rd-rise .7s var(--rd-ease) forwards;
}
.hero-copy > *:nth-child(1) { animation-delay: .05s; }
.hero-copy > *:nth-child(2) { animation-delay: .14s; }
.hero-copy > *:nth-child(3) { animation-delay: .23s; }
.hero-copy > *:nth-child(4) { animation-delay: .32s; }
.hero-copy > *:nth-child(5) { animation-delay: .41s; }
.hero-console {
  opacity: 0;
  transform: translateY(24px) scale(.985);
  animation: rd-rise-scale .9s var(--rd-ease) .35s forwards;
}
.page-hero-inner > * {
  opacity: 0;
  transform: translateY(14px);
  animation: rd-rise .65s var(--rd-ease) forwards;
}
.page-hero-inner > *:nth-child(1) { animation-delay: .05s; }
.page-hero-inner > *:nth-child(2) { animation-delay: .13s; }
.page-hero-inner > *:nth-child(3) { animation-delay: .21s; }
.page-hero-inner > *:nth-child(4) { animation-delay: .29s; }

@keyframes rd-rise { to { opacity: 1; transform: translateY(0); } }
@keyframes rd-rise-scale { to { opacity: 1; transform: translateY(0) scale(1); } }

/* Scroll-reveal: elements tagged by main.js fade+rise when in view */
.rd-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--rd-ease), transform .7s var(--rd-ease);
  will-change: opacity, transform;
}
.rd-reveal.rd-in { opacity: 1; transform: translateY(0); }
/* stagger children within a revealed group */
.rd-reveal-group.rd-in > * { animation: rd-rise .6s var(--rd-ease) backwards; }
.rd-reveal-group.rd-in > *:nth-child(1) { animation-delay: .04s; }
.rd-reveal-group.rd-in > *:nth-child(2) { animation-delay: .10s; }
.rd-reveal-group.rd-in > *:nth-child(3) { animation-delay: .16s; }
.rd-reveal-group.rd-in > *:nth-child(4) { animation-delay: .22s; }
.rd-reveal-group.rd-in > *:nth-child(5) { animation-delay: .28s; }
.rd-reveal-group.rd-in > *:nth-child(6) { animation-delay: .34s; }

/* Reading progress line (existing element) retuned */
.progress-line {
  background: linear-gradient(90deg, var(--rd-gold), var(--rd-teal)) !important;
  height: 2px !important;
  box-shadow: 0 0 12px rgba(230,200,121,0.5) !important;
}

/* ══ RESPONSIVE ══════════════════════════════════════════════════ */

/* Global overflow guard. The mobile drawer sits off-screen at
   translateX(100%) when closed; without this it would extend the
   horizontal scroll area. */
html, body { overflow-x: hidden !important; max-width: 100%; }
img, svg, video, canvas, table { max-width: 100%; }
@media (max-width: 1040px) {
  .hero-shell { grid-template-columns: 1fr !important; gap: 2.5rem !important; }
  .hero-console { max-width: 100% !important; }
  /* sidebar is replaced by the mobile drawer; hide the in-page rail */
  .doc-sidebar { display: none !important; }
  .doc-layout { grid-template-columns: 1fr !important; }
}

@media (max-width: 760px) {
  /* tighter hero, balanced type */
  .hero { min-height: auto !important; padding-block: clamp(2.5rem, 9vw, 4rem) 3rem !important; }
  .hero-title { font-size: clamp(2.6rem, 11vw, 3.8rem) !important; }
  .hero-ctas { width: 100%; }
  .hero-ctas .btn-primary, .hero-ctas .btn-secondary { flex: 1 1 auto; justify-content: center; }
  .hero-trust-line { flex-wrap: wrap; gap: .5rem 1.1rem !important; }

  /* The console carries real content (the doc map) — show it on mobile
     below the copy rather than hiding it and leaving dead space. */
  .hero-console {
    display: block !important;
    margin-top: 2rem;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .section-title { font-size: clamp(1.9rem, 8vw, 2.6rem) !important; }
  .doc-cards { grid-template-columns: 1fr !important; }
  .doc-card { padding: 1.4rem !important; }
  .doc-card h3 { font-size: 1.4rem !important; }

  .stats-grid { grid-template-columns: 1fr 1fr !important; gap: .8rem !important; }
  .stat { padding: 1.4rem 1.1rem !important; }

  .page-hero h1 { font-size: clamp(2.4rem, 11vw, 3.4rem) !important; }
  .doc-content { padding: 1.35rem !important; border-radius: 18px !important; }
  .doc-content h2 { font-size: clamp(1.6rem, 7vw, 2.1rem) !important; margin-top: 2.2rem !important; }
  .doc-content h3 { font-size: 1.3rem !important; }
  .doc-content p, .doc-content li { font-size: .96rem !important; }

  /* tables scroll horizontally inside a rounded frame, constrained
     to the content width so they never push the page wider */
  .doc-table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  .doc-content { overflow: hidden !important; }

  /* timeline collapses to a single rail */
  .timeline { gap: 1.25rem !important; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr !important; }
  .hero-badge { font-size: .62rem !important; letter-spacing: .12em !important; }
  .section-label { font-size: .62rem !important; }
}

/* ══ A11Y — focus + reduced motion ═══════════════════════════════ */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--rd-gold);
  outline-offset: 2px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .hero-copy > *, .hero-console, .page-hero-inner > *,
  .rd-reveal, .rd-reveal-group.rd-in > * {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
