/* ==========================================================================
   Universal header — standalone build for pages that don't load the
   homepage bundle stylesheet (blog, MQL indicators, data feed, legal).
   Same look as the homepage header; every rule and token is scoped to
   .hdr so it neither depends on nor leaks into the page's own CSS.
   Markup: views/home/partials/site-header.php · behaviour: assets/js/site.js
   ========================================================================== */

.hdr {
  --ink: #0a1020; --ink-2: #344054; --faint: #98a2b3; --line: #e4e8ef; --line-2: #d5dbe5;
  --bg: #f5f7fa; --bg-2: #eef1f6; --surface: #fff;
  --brand: #1a5fd6; --brand-50: #edf3fe; --wa: #0e7c3e;
  --wrap: 1200px; --pad: clamp(16px, 4vw, 32px);
  --hdr-h: 64px; --hdr-gap: clamp(10px, 1.6vw, 16px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  position: fixed; inset: 0 0 auto; z-index: 1000; padding: var(--hdr-gap) var(--pad) 0; pointer-events: none;
  font-family: 'Geist Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink); line-height: 1.4; -webkit-font-smoothing: antialiased;
}
.hdr *, .hdr *::before, .hdr *::after { box-sizing: border-box; }
.hdr ul { list-style: none; margin: 0; padding: 0; }
.hdr li { margin: 0; padding: 0; }
.hdr a { color: inherit; text-decoration: none; }
.hdr button { font: inherit; color: inherit; cursor: pointer; margin: 0; }
.hdr svg { display: block; flex: none; }
.hdr a:focus-visible, .hdr button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.hdr .hdr-card {
  pointer-events: auto; position: relative; z-index: 2;
  display: flex; align-items: center; gap: 16px;
  max-width: calc(var(--wrap) - 2 * var(--pad)); height: var(--hdr-h); margin-inline: auto;
  padding: 0 10px 0 clamp(14px, 2vw, 20px);
  border-radius: 18px; border: 1px solid rgba(228, 232, 239, 0.9);
  background: #fff;   /* opaque: identical on light and dark sections */
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 30px -14px rgba(16, 24, 40, 0.18);
  transition: box-shadow 0.3s var(--ease), background-color 0.3s, height 0.3s var(--ease);
}
.hdr.is-scrolled .hdr-card {
  height: 58px; background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 18px 40px -18px rgba(16, 24, 40, 0.3);
}
.hdr .hdr-brand { display: flex; align-items: center; margin-right: auto; min-height: 44px; }
.hdr .hdr-brand img { height: 34px; width: auto; max-width: none; }
.hdr .hdr-word { font-weight: 650; font-size: 19px; letter-spacing: -0.03em; }

.hdr .hdr-nav { display: none; }
.hdr .hdr-nav ul { display: flex; gap: 2px; }
.hdr .hdr-nav a {
  position: relative; display: inline-flex; align-items: center; height: 38px; padding: 0 clamp(10px, 1vw, 14px);
  border-radius: 10px; font-size: 14.5px; font-weight: 500; color: var(--ink-2);
  transition: color 0.2s, background-color 0.2s;
}
.hdr .hdr-nav a:hover { color: var(--ink); background: var(--bg-2); }
.hdr .hdr-nav a[aria-current] { color: var(--brand); background: var(--brand-50); }
.hdr .hdr-actions { display: flex; align-items: center; gap: 8px; }

/* Buttons (only the two the header uses) */
.hdr .btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid transparent; font-family: inherit; font-weight: 550; letter-spacing: -0.01em; white-space: nowrap; color: #fff; text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
}
.hdr .btn:hover { transform: translateY(-1px); color: #fff; }
.hdr .btn--sm { min-height: 40px; padding: 0 15px; font-size: 14px; border-radius: 11px; }
.hdr .btn--lg { min-height: 52px; padding: 0 22px; font-size: 15.5px; border-radius: 14px; }
.hdr .btn--primary {
  background: linear-gradient(180deg, #2a6fe6 0%, var(--brand) 100%); border-color: #1550b8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 2px rgba(16, 24, 40, 0.12), 0 8px 20px -8px rgba(26, 95, 214, 0.6);
}
.hdr .btn--wa {
  background: linear-gradient(180deg, #11904a 0%, var(--wa) 100%); border-color: #0a6332;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(16, 24, 40, 0.12), 0 8px 20px -8px rgba(14, 124, 62, 0.55);
}
.hdr .btn-trail { transition: transform 0.25s var(--ease); }
.hdr .btn:hover .btn-trail { transform: translateX(3px); }
.hdr .hdr-cta { display: none; }

.hdr .hdr-burger {
  position: relative; width: 44px; height: 44px; padding: 0; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface);
}
.hdr .hdr-burger span {
  position: absolute; left: 13px; right: 13px; height: 1.6px; border-radius: 2px; background: var(--ink);
  transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}
.hdr .hdr-burger span:first-child { top: 17px; }
.hdr .hdr-burger span:last-child { top: 25px; }
.hdr.is-menu .hdr-burger span:first-child { top: 21px; transform: rotate(45deg); }
.hdr.is-menu .hdr-burger span:last-child { top: 21px; transform: rotate(-45deg); }

/* Mobile sheet */
.hdr .sheet-scrim { position: fixed; inset: 0; z-index: 1; background: rgba(7, 11, 22, 0.32); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); pointer-events: auto; }
.hdr .sheet {
  pointer-events: auto; position: relative; z-index: 2;
  max-width: calc(var(--wrap) - 2 * var(--pad)); margin: 10px auto 0; padding: 10px;
  border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.05), 0 40px 90px -30px rgba(10, 20, 50, 0.42);
}
.hdr .sheet[hidden], .hdr .sheet-scrim[hidden] { display: none; }
.hdr.is-menu .sheet { animation: hdr-drop 0.28s var(--ease); }
@keyframes hdr-drop { from { opacity: 0; transform: translateY(-10px) scale(0.98); } }
.hdr .sheet ul { display: grid; }
.hdr .sheet li + li { border-top: 1px solid var(--line); }
.hdr .sheet a:not(.btn) {
  display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 12px;
  font-size: 18px; font-weight: 550; letter-spacing: -0.02em; border-radius: 12px;
}
.hdr .sheet a:not(.btn) svg { color: var(--faint); transition: transform 0.25s var(--ease), color 0.2s; }
.hdr .sheet a:not(.btn):hover { background: var(--bg); }
.hdr .sheet a:not(.btn):hover svg { transform: translateX(3px); color: var(--brand); }
.hdr .sheet a[aria-current] { color: var(--brand); }
.hdr .sheet-cta { width: 100%; margin-top: 10px; }

@media (min-width: 1100px) {
  .hdr .hdr-nav { display: block; }
  .hdr .hdr-cta { display: inline-flex; }
  .hdr .hdr-burger, .hdr .sheet, .hdr .sheet-scrim { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .hdr *, .hdr *::before, .hdr *::after { transition: none !important; animation: none !important; }
}

/* Page offset: older pages size their top spacing from --nav-height. */
body.has-site-hdr { --nav-height: calc(64px + clamp(10px, 1.6vw, 16px) + 8px); }
