/* docs/assets/base.css */
:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --text: #1f2937;          /* slate-800 */
  --muted: #6b7280;         /* gray-500 */
  --bg: #ffffff;
  --surface: rgba(255,255,255,0.92);

  --border: rgba(17,24,39,0.10);
  --shadow: 0 8px 24px rgba(17,24,39,0.10);

  --brand: #5A9BD4;
  --brand-text: #2d7bb5;         /* WCAG AA on white (4.5:1+) */
  --brand-ink: #0b2a3d;
  --brand-hover: #2f4156;

  --radius: 14px;
  --radius-sm: 10px;

  /* Sub-surfaces */
  --surface-2: rgba(255, 240, 243, 0.92);     /* soft rose (header dropdowns) */
  --surface-3: rgba(252, 234, 238, 0.72);     /* rose nav pill bg */

  /* Component-specific surfaces */
  --sidebar-bg: rgba(255, 255, 255, 0.96);          /* clean white body */
  --sidebar-session-bg: rgba(15, 23, 42, 0.09);     /* cool slate tint for session area */
  --nav-pill-bg: var(--surface-3);
  --nav-pill-border: rgba(15, 23, 42, 0.10);  
}

html, body {
  height: 100%;
}

/* Scale down on large displays (TVs, ultra-wide monitors) so content
   breathes. Laptops and standard monitors stay at 100%.
   Uses zoom (universally supported) so px values also scale. */
@media (min-width: 1800px) {
  html { zoom: 0.92; }
}
@media (min-width: 2400px) {
  html { zoom: 0.85; }
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Global typography harmony */
h1, h2, h3 {
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: clamp(2.0rem, 2.8vw, 3.0rem); line-height: 1.1; }
h2 { font-size: 1.6rem; line-height: 1.2; }
h3 { font-size: 1.15rem; line-height: 1.3; }

p, li {
  line-height: 1.6;
  color: var(--text);
}

a {
  color: var(--brand-text, #2d7bb5);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* A shared “card” feel you can reuse */
.hp-card {
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Deep-link emphasis flash */
.haiphen-nav-flash{
  outline: 3px solid rgba(90,155,212,0.55);
  border-radius: 10px;
  background: rgba(255, 248, 176, 0.9);
  transition: background 1.6s ease, outline-color 1.6s ease;
}

/* Nice anchor landing behavior even without JS scrolling */
.haiphen-nav-target{
  scroll-margin-top: calc(var(--header-h, 70px) + 16px);
}

/* optional: highlight current page link */
.nav-links a.active {
  background: #ecf0f1;
  border-radius: 4px;
}

/* Sidebar-collapsed mode (API docs full-width) */
body.sidebar-collapsed .main-container {
  padding-left: 16px;
}

/* Fade-into-focus reveal (global, reusable) */
.hp-section-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}
.hp-section-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* General mobile overflow prevention */
.main-container {
  min-width: 0;
}

body {
  overflow-x: hidden;
}

/* ============================================================
   Finance lens — dark theme overrides
   ============================================================ */

html[data-lens="finance"] {
  --text: #f8fafc;
  --muted: #94a3b8;
  --bg: #0f172a;
  --surface: rgba(30,41,59,0.95);
  --border: rgba(148,163,184,0.20);
  --shadow: 0 8px 24px rgba(0,0,0,0.35);
  --brand: #5A9BD4;
  --brand-text: #5A9BD4;         /* fine on dark bg */
  --brand-ink: #c8ddf0;
  --brand-hover: #8bb8e0;
  --surface-2: rgba(30,41,59,0.95);
  --surface-3: rgba(51,65,85,0.80);
  --sidebar-bg: rgba(15,23,42,0.98);
  --sidebar-session-bg: rgba(148,163,184,0.08);
  --nav-pill-bg: rgba(51,65,85,0.70);
  --nav-pill-border: rgba(148,163,184,0.18);
}

html[data-lens="finance"] body {
  background: var(--bg);
}

html[data-lens="finance"] .hp-card {
  background: rgba(30,41,59,0.85);
  border-color: rgba(148,163,184,0.18);
}

html[data-lens="finance"] .main-container {
  background: var(--bg);
}

/* Featured section intro */
.trades-intro {
  max-width: 860px;
  margin: 0 auto 2rem;
  text-align: center;
}
.trades-intro h2 {
  font-size: 1.8rem;
  font-weight: 900;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}
.trades-intro p {
  font-size: 1.05rem;
  color: #555;
  line-height: 1.6;
}

/* Smooth lens transition */
html.lens-transition,
html.lens-transition *,
html.lens-transition *::before,
html.lens-transition *::after {
  transition: background-color 0.5s ease, color 0.5s ease,
              border-color 0.5s ease, box-shadow 0.5s ease !important;
}

/* ============================================================
   Reduced motion — respect OS accessibility setting
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hp-section-reveal,
  .hp-contact-reveal {
    opacity: 1;
    transform: none;
  }

  html.lens-transition,
  html.lens-transition *,
  html.lens-transition *::before,
  html.lens-transition *::after {
    transition: none !important;
  }
}