/*
 * Qtum Wallet Snap — docs styles
 *
 * Rebuilt around the QTUM v2 brand system used in signuploginpage:
 *   brand-tokens.css     → colors, typography, gradients
 *   icons.js             → outline-SVG icon set (data-icon="name")
 *   ambient.js           → drifting-orbs + grain backdrop
 *
 * Class surface is unchanged (.sidebar / .card / .hero / .badge /
 * .info-box / .flow-step / .page-nav-link / .diagram / .tab / table /
 * syntax .token-*), so every HTML page picks up the new look without
 * markup changes beyond <head> + emoji → <i data-icon> substitutions.
 */

@import url('brand-tokens.css');

:root {
  --sidebar-width: 280px;
  --content-max: 900px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-family-body);
  font-weight: var(--font-weight-body);
  color: var(--color-text-primary);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Midnight navy base + static corner washes (top-left electric blue,
   * bottom-right halo pale-blue). Reading-site calibration — orbs were
   * retired in favor of these tighter localized washes. */
  background-color: var(--color-bg-page);
  background-image:
    radial-gradient(
      circle 40vmax at 0% 0%,
      rgba(6, 69, 247, 0.18) 0%,
      transparent 28%
    ),
    radial-gradient(
      circle 38vmax at 100% 100%,
      rgba(197, 215, 255, 0.10) 0%,
      transparent 28%
    );
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* ------------------------------------------------------------------
 * Ambient backdrop — injected by ambient.js
 * ------------------------------------------------------------------ */
.ambient-backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.ambient-orb {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(110px);
  will-change: transform;
  opacity: 0.55;
}

.ambient-orb--primary {
  top: -12%;
  left: -8%;
  width: 58vmax;
  height: 58vmax;
  background: var(--qtum-gradient-primary);
  animation: ambient-drift-a 11s ease-in-out infinite alternate;
}

.ambient-orb--cyan {
  bottom: -15%;
  right: -10%;
  width: 52vmax;
  height: 52vmax;
  background: var(--qtum-gradient-secondary-1);
  opacity: 0.32;
  animation: ambient-drift-b 14s ease-in-out infinite alternate;
}

.ambient-orb--halo {
  top: 35%;
  left: 42%;
  width: 40vmax;
  height: 40vmax;
  background: var(--qtum-gradient-halo);
  opacity: 0.40;
  animation: ambient-drift-c 9s ease-in-out infinite alternate;
}

.ambient-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

@keyframes ambient-drift-a { 0% { transform: translate3d(0,0,0) scale(1); } 100% { transform: translate3d(18vw,12vh,0) scale(1.18); } }
@keyframes ambient-drift-b { 0% { transform: translate3d(0,0,0) scale(1); } 100% { transform: translate3d(-20vw,-14vh,0) scale(1.14); } }
@keyframes ambient-drift-c { 0% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(-14vw,10vh,0) scale(1.22); } 100% { transform: translate3d(12vw,-10vh,0) scale(0.9); } }

@media (prefers-reduced-motion: reduce) {
  .ambient-orb { animation: none !important; }
}

/* Stack site chrome above the backdrop */
.layout, .mobile-toggle { position: relative; z-index: 1; }

/* ------------------------------------------------------------------
 * Liquid-glass base — translucent panels sitting on the backdrop.
 * ------------------------------------------------------------------ */
.glass {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 24px 64px -16px rgba(4, 4, 40, 0.7),
    0 2px 8px rgba(4, 4, 40, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}

.glass-subtle {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

/* ------------------------------------------------------------------
 * Layout
 * ------------------------------------------------------------------ */
.layout { display: flex; min-height: 100vh; }

/* ------------------------------------------------------------------
 * Sidebar
 * ------------------------------------------------------------------ */
.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
  background: rgba(4, 4, 40, 0.55);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text-primary);
}

.sidebar-logo-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(6, 69, 247, 0.45));
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-family: var(--font-family-display);
  font-weight: var(--font-weight-display);
  font-size: 1rem;
  letter-spacing: -0.01em;
  display: block;
}

.sidebar-logo-sub {
  font-family: var(--font-family-body);
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  display: block;
  margin-top: 2px;
}

.sidebar-nav { padding: 1rem 0 2rem; }

.nav-section {
  padding: 1rem 1.5rem 0.5rem;
  font-family: var(--font-family-display);
  font-weight: var(--font-weight-display);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.5rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 400;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
  border-left: 2px solid transparent;
}

.nav-link:hover {
  color: var(--color-text-primary);
  background: rgba(6, 69, 247, 0.08);
}

.nav-link.active {
  color: var(--color-text-primary);
  background: rgba(6, 69, 247, 0.14);
  border-left-color: var(--qtum-blue);
}

.nav-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  font-size: 1rem;
  color: var(--qtum-pale);
  flex-shrink: 0;
}

.nav-link.active .nav-link-icon { color: var(--qtum-blue); }

.nav-group { display: flex; flex-direction: column; }

.nav-subnav {
  display: none;
  padding: 0.25rem 0 0.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  margin-left: 2.4rem;
}

.sidebar[data-section="dice"] .nav-group[data-section="dice"] .nav-subnav,
.sidebar[data-section="spin"] .nav-group[data-section="spin"] .nav-subnav {
  display: flex;
  flex-direction: column;
}

.sidebar[data-section="dice"] .nav-group[data-section="dice"] > .nav-link,
.sidebar[data-section="spin"] .nav-group[data-section="spin"] > .nav-link {
  color: var(--color-text-primary);
  font-weight: 700;
}

.nav-sublink {
  padding-left: 1rem;
  font-size: 0.82rem;
}

/* ------------------------------------------------------------------
 * Main content
 * ------------------------------------------------------------------ */
.main { margin-left: var(--sidebar-width); flex: 1; min-width: 0; background: var(--color-bg-page); }

.content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2.5rem 3rem;
}

/* Mobile menu toggle */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: rgba(4, 4, 40, 0.65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-primary);
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ------------------------------------------------------------------
 * Typography
 * ------------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-display);
  font-weight: var(--font-weight-display);
  letter-spacing: -0.01em;
  color: var(--color-text-primary);
}

h1 {
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
  line-height: 1.15;
}

h2 {
  font-size: 1.7rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  font-family: var(--font-family-body);
}

h4 {
  font-size: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-weight: 700;
}

p {
  margin-bottom: 1rem;
  color: var(--color-text-secondary);
  font-weight: 400;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
  font-weight: 400;
  line-height: 1.55;
}

a {
  color: var(--qtum-pale);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--qtum-white);
  text-decoration: underline;
}

strong { color: var(--color-text-primary); font-weight: 700; }

/* ------------------------------------------------------------------
 * Hero
 * ------------------------------------------------------------------ */
.hero { padding: 3rem 0 2rem; }

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  font-family: var(--font-family-mono);
}

.badge-blue   { background: rgba(6, 69, 247, 0.14);  color: var(--qtum-pale); border-color: rgba(6, 69, 247, 0.4); }
.badge-purple { background: rgba(197, 215, 255, 0.1); color: var(--qtum-pale); border-color: rgba(197, 215, 255, 0.35); }
.badge-green  { background: rgba(61, 255, 239, 0.1); color: var(--qtum-cyan); border-color: rgba(61, 255, 239, 0.35); }
.badge-orange { background: rgba(204, 255, 0, 0.08); color: var(--qtum-lime); border-color: rgba(204, 255, 0, 0.3); }

/* ------------------------------------------------------------------
 * Cards
 * ------------------------------------------------------------------ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.card {
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(48px) saturate(140%);
  -webkit-backdrop-filter: blur(48px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: transform 0.25s ease, border-color 0.2s ease, box-shadow 0.25s ease;
  box-shadow:
    0 32px 80px -24px rgba(0, 0, 0, 0.55),
    0 2px 12px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}

/* Clickable card — swap out of frosted, into solid elevated dark.
 * Resting state is visually distinct from the frosted .card at first
 * glance (flatter, darker, no blur), signalling interactivity before
 * the user even hovers. */
.card-link .card {
  background: rgba(4, 4, 40, 0.7);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 8px 24px -12px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card-link:hover .card {
  transform: translateY(-3px);
  border-color: rgba(6, 69, 247, 0.45);
  box-shadow:
    0 24px 56px -20px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 0 var(--qtum-blue);
}

/* Press state — card settles back toward the surface with a punchier
 * shadow, blue underline thickens. Snappy (60ms) for immediate feel. */
.card-link:active .card {
  transform: translateY(-1px) scale(0.995);
  border-color: rgba(6, 69, 247, 0.65);
  box-shadow:
    0 12px 32px -16px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -3px 0 var(--qtum-blue);
  transition-duration: 60ms;
}

@media (prefers-reduced-motion: reduce) {
  .card-link:hover .card,
  .card-link:active .card {
    transform: none;
  }
}

.card-link { text-decoration: none; color: inherit; display: block; }
.card-link:hover { text-decoration: none; }

.card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.card-icon-blue   { background: rgba(6, 69, 247, 0.14);  color: var(--qtum-pale); border-color: rgba(6, 69, 247, 0.35); }
.card-icon-purple { background: rgba(197, 215, 255, 0.1); color: var(--qtum-pale); border-color: rgba(197, 215, 255, 0.3); }
.card-icon-green  { background: rgba(61, 255, 239, 0.1); color: var(--qtum-cyan); border-color: rgba(61, 255, 239, 0.3); }
.card-icon-orange { background: rgba(204, 255, 0, 0.08); color: var(--qtum-lime); border-color: rgba(204, 255, 0, 0.28); }

.card h3 { margin-top: 0; margin-bottom: 0.5rem; font-size: 1.05rem; color: var(--color-text-primary); }
.card p { font-size: 0.88rem; color: var(--color-text-secondary); margin: 0; }

/* ------------------------------------------------------------------
 * Code
 * ------------------------------------------------------------------ */
pre {
  background: rgba(2, 2, 26, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  font-size: 0.85rem;
  line-height: 1.65;
}

code {
  font-family: var(--font-family-mono);
  font-size: 0.88em;
}

:not(pre) > code {
  background: rgba(6, 69, 247, 0.12);
  padding: 0.14em 0.42em;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--qtum-pale);
  border: 1px solid rgba(6, 69, 247, 0.22);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 0.5rem 1rem;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-family: var(--font-family-mono);
  letter-spacing: 0.04em;
}

.code-header + pre {
  margin-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* Syntax highlighting — remapped to QTUM palette */
.token-keyword   { color: var(--qtum-blue);  font-weight: 700; }
.token-string    { color: var(--qtum-cyan); }
.token-number    { color: var(--qtum-lime); }
.token-comment   { color: var(--color-text-muted); font-style: italic; }
.token-function  { color: var(--qtum-pale); }
.token-type      { color: var(--qtum-lime); }
.token-operator  { color: #8FA0CF; }
.token-property  { color: var(--qtum-pale); }
.token-variable  { color: var(--qtum-pale); }
.token-decorator { color: var(--qtum-lime); }
.token-tag       { color: var(--qtum-coral); }
.token-attr      { color: var(--qtum-lime); }
.token-builtin   { color: var(--qtum-cyan); }
.token-punctuation { color: #8894C2; }

/* ------------------------------------------------------------------
 * Info boxes
 * ------------------------------------------------------------------ */
.info-box {
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left-width: 4px;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(12px);
}

.info-box p { margin-bottom: 0.5rem; color: var(--color-text-secondary); }
.info-box p:last-child { margin-bottom: 0; }

.info-box-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-family-body);
}

.info-box-info    { background: rgba(6, 69, 247, 0.07);   border-left-color: var(--qtum-blue);  }
.info-box-info .info-box-title    { color: var(--qtum-pale);  }
.info-box-warning { background: rgba(204, 255, 0, 0.05);  border-left-color: var(--qtum-lime);  }
.info-box-warning .info-box-title { color: var(--qtum-lime);  }
.info-box-success { background: rgba(61, 255, 239, 0.06); border-left-color: var(--qtum-cyan);  }
.info-box-success .info-box-title { color: var(--qtum-cyan);  }
.info-box-danger  { background: rgba(255, 107, 87, 0.07); border-left-color: var(--qtum-coral); }
.info-box-danger .info-box-title  { color: var(--qtum-coral); }

/* ------------------------------------------------------------------
 * Tables
 * ------------------------------------------------------------------ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
  background: rgba(6, 69, 247, 0.08);
  color: var(--color-text-primary);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-family-display);
}

td { color: var(--color-text-secondary); }

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(6, 69, 247, 0.05); }

/* ------------------------------------------------------------------
 * Lists
 * ------------------------------------------------------------------ */
ul, ol {
  margin: 0.5rem 0 1.5rem 1.5rem;
  color: var(--color-text-secondary);
}

li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

li code { font-size: 0.82rem; }

/* ------------------------------------------------------------------
 * Diagrams & file tree (ASCII art containers)
 * ------------------------------------------------------------------ */
.diagram,
.file-tree {
  background: rgba(2, 2, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 1.5rem 2rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  font-family: var(--font-family-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
  white-space: pre;
  backdrop-filter: blur(10px);
}

.file-tree { padding: 1.25rem 1.5rem; line-height: 1.8; }
.file-tree .dir { color: var(--qtum-pale); font-weight: 700; }
.file-tree .file { color: var(--color-text-secondary); }
.file-tree .comment { color: var(--color-text-muted); font-style: italic; }

/* ------------------------------------------------------------------
 * Flow steps
 * ------------------------------------------------------------------ */
.flow-steps { display: flex; flex-direction: column; margin: 1.5rem 0; }

.flow-step { display: flex; gap: 1rem; position: relative; }

.flow-step-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 32px;
  flex-shrink: 0;
}

.flow-step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-display);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--qtum-midnight);
  flex-shrink: 0;
  z-index: 1;
  box-shadow: 0 0 0 4px rgba(4, 4, 40, 1), 0 0 20px -4px currentColor;
}

.flow-step-connector {
  width: 2px;
  flex: 1;
  min-height: 20px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.18), rgba(255,255,255,0.04));
}

.flow-step-content { padding-bottom: 1.5rem; flex: 1; }
.flow-step-content h4 { margin-top: 0.25rem; margin-bottom: 0.35rem; }
.flow-step-content p { font-size: 0.9rem; margin-bottom: 0.5rem; }

.step-blue   .flow-step-dot { background: var(--qtum-blue); color: var(--qtum-white); }
.step-purple .flow-step-dot { background: var(--qtum-pale); }
.step-green  .flow-step-dot { background: var(--qtum-cyan); }
.step-orange .flow-step-dot { background: var(--qtum-lime); }

/* ------------------------------------------------------------------
 * Tabs
 * ------------------------------------------------------------------ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0;
}

.tab {
  padding: 0.55rem 1.25rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
  font-weight: 700;
}

.tab:hover { color: var(--color-text-primary); }
.tab.active {
  color: var(--qtum-pale);
  border-bottom-color: var(--qtum-blue);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ------------------------------------------------------------------
 * Page navigation (prev / next)
 * ------------------------------------------------------------------ */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 1rem;
}

.page-nav-link {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s;
  min-width: 0;
  max-width: 50%;
  backdrop-filter: blur(10px);
}

.page-nav-link:hover {
  border-color: rgba(6, 69, 247, 0.6);
  text-decoration: none;
  transform: translateY(-1px);
}

.page-nav-label {
  font-family: var(--font-family-mono);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-nav-title {
  color: var(--qtum-pale);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-nav-next { text-align: right; margin-left: auto; }

/* ------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------ */
.footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* ------------------------------------------------------------------
 * SVG icon defaults (set by icons.js via data-icon="..." elements)
 * Scoped to inline <i> and the specific icon-container classes so we
 * don't override display rules on buttons like .mobile-toggle.
 * ------------------------------------------------------------------ */
i[data-icon],
.nav-link-icon[data-icon],
.card-icon[data-icon],
.info-box-title [data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

[data-icon] svg {
  width: 1em;
  height: 1em;
}

.nav-link-icon[data-icon] svg { width: 16px; height: 16px; }
.card-icon[data-icon] svg     { width: 22px; height: 22px; }
.info-box-title [data-icon] svg { width: 16px; height: 16px; }
.mobile-toggle[data-icon] svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-toggle { display: flex; }
  .main { margin-left: 0; }
  .content { padding: 2rem 1.5rem; padding-top: 4rem; }
  h1 { font-size: 2rem; }
  .hero h1 { font-size: 2.2rem; }
  .card-grid { grid-template-columns: 1fr; }
  .page-nav { flex-direction: column; }
  .page-nav-link { max-width: 100%; }
}

@media (max-width: 600px) {
  .content { padding: 1.5rem 1rem; padding-top: 4rem; }
  .hero h1 { font-size: 1.9rem; }
  h2 { font-size: 1.35rem; }
}
