/* ==========================================================================
   Investor Second Brain -- base layer: vendored fonts, reset, typography.
   Fonts are self-hosted (dashboard/static/brain_v2/fonts/) so the pages
   render the same with no third-party CDN reachable:
     Satoshi 400/500/700, Cabinet Grotesk 500/700/800 -- Fontshare (ITF
     Free Font License), used by the 2026-09-29 redesign;
     Inter Variable -- fallback that carries the rupee sign (U+20B9);
     Geist Mono -- code / tabular figures.
   ========================================================================== */

@font-face {
  font-family: "Satoshi";
  src: url("/brain_v2/static/fonts/Satoshi-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("/brain_v2/static/fonts/Satoshi-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("/brain_v2/static/fonts/Satoshi-Bold.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cabinet Grotesk";
  src: url("/brain_v2/static/fonts/CabinetGrotesk-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cabinet Grotesk";
  src: url("/brain_v2/static/fonts/CabinetGrotesk-Bold.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cabinet Grotesk";
  src: url("/brain_v2/static/fonts/CabinetGrotesk-Extrabold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Variable";
  src: url("/brain_v2/static/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/brain_v2/static/fonts/GeistMonoVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  /* keep focused controls clear of the sticky top bar (WCAG 2.4.11) */
  scroll-padding-top: calc(var(--topbar-h) + 8px);
}
body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: var(--text-base) / 1.48 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
ul[role="list"], ol[role="list"] { list-style: none; }
table { border-collapse: collapse; }
::selection { background: var(--accent-soft); color: var(--text); }
/* Component classes set display:grid/flex, which would otherwise beat the
   UA's [hidden] rule and leave filtered-out rows visible. */
[hidden] { display: none !important; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-base); }
h4 { font-size: var(--text-sm); }
p { text-wrap: pretty; }
strong, b { font-weight: 700; }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.92em; }
.tabular, .num { font-variant-numeric: tabular-nums; }

/* ---------- Focus + accessibility ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--on-accent); font-weight: 700;
}
.skip:focus { top: 12px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Print: the brief / a research note on paper ---------- */
@media print {
  :root, [data-theme="dark"] {
    --bg: #fff; --panel: #fff; --panel-2: #fff; --panel-3: #f1f1f1;
    --text: #000; --muted: #333; --faint: #555; --border: #ccc;
  }
  .sidebar, .topbar, .mobile-nav, .menu-overlay, .drawer-backdrop, .toast,
  .skip, .no-print { display: none !important; }
  .shell { display: block !important; }
  .content { padding: 0 !important; max-width: none !important; }
  .card { box-shadow: none !important; break-inside: avoid; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
