/* ==========================================================================
   FI Compass — shared design tokens
   Same palette/type system as the tool components (net-worth-tracker.jsx,
   fi-calculator.jsx) so marketing pages, the app shell, and every tool read
   as one product. If the palette changes, it changes here once.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --paper: #F6F9F9;
  --paper-raised: #FFFFFF;
  --ink: #16181C;
  --ink-muted: #6B7078;
  --forest: #0FA3A3;       /* turquoise — data / brand accent */
  --forest-soft: #D6F3F1;
  --brass: #F2732E;        /* orange — interactive accent, CTAs */
  --brass-soft: #FFE7D6;
  --rust: #E5484D;
  --gain: #1FAA6D;
  --hairline: #E3ECEB;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

h1, h2, h3, .num {
  font-family: 'Fraunces', serif;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

p { line-height: 1.65; color: var(--ink); }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- buttons ---- */

.btn-primary {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  background: var(--brass);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: background .15s ease;
}
.btn-primary:hover { background: #D9601E; }

.btn-ghost {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--hairline);
  background: var(--paper-raised);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}
.btn-ghost:hover { border-color: var(--ink); }

/* ---- brand mark: the FI Compass logo ---- */

.mark {
  display: inline-block;
  flex-shrink: 0;
  object-fit: contain;
}

/* ---- site nav ---- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 249, 249, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-word {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  font-size: 14px;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color .15s ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"] { font-weight: 500; }

.nav-actions { display: flex; align-items: center; gap: 20px; }

.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  display: flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px; color: var(--ink-muted);
  padding: 0;
}
.nav-dropdown-trigger:hover, .nav-dropdown.open .nav-dropdown-trigger { color: var(--ink); }
.nav-dropdown-trigger svg { width: 11px; height: 11px; transition: transform .15s ease; }
.nav-dropdown.open .nav-dropdown-trigger svg { transform: rotate(180deg); }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(22, 24, 28, 0.08);
  z-index: 30;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a, .nav-dropdown-menu .nav-dropdown-soon {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--ink);
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 8px;
}
.nav-dropdown-menu a:hover { background: var(--paper); }
.nav-dropdown-menu .nav-dropdown-soon { color: var(--ink-muted); opacity: 0.6; cursor: default; }
.nav-dropdown-menu svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--forest); }
.nav-dropdown-menu .nav-dropdown-soon svg { color: var(--ink-muted); }
.nav-dropdown-divider { height: 1px; background: var(--hairline); margin: 5px 4px; }

@media (max-width: 720px) {
  .nav-dropdown-menu { position: static; transform: none; box-shadow: none; border: none; padding: 2px 0 2px 4px; min-width: 0; margin-top: 2px; }
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block;
  width: 16px;
  height: 1.6px;
  background: var(--ink);
  position: relative;
  transition: transform .15s ease;
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; }
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-inner { padding: 14px 16px; }
  .nav-actions { gap: 10px; }
  .nav-actions .btn-primary { padding: 9px 12px; font-size: 12.5px; }
  .site-nav.open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper-raised);
    border-bottom: 1px solid var(--hairline);
    padding: 8px 24px 16px;
  }
  .site-nav.open .nav-links a { padding: 8px 0; width: 100%; }
}

/* ---- footer ---- */

.site-footer {
  border-top: 1px solid var(--hairline);
  margin-top: 96px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 56px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Fraunces', serif;
  font-size: 15px;
  color: var(--ink);
}
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--ink-muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.footer-note {
  font-size: 12px;
  color: var(--ink-muted);
  max-width: 640px;
  line-height: 1.7;
}

/* ---- app sidebar (dashboard module/tool nav) ---- */

/* The marketing pages' .wrap is capped at 1100px for prose readability, but
   that same cap was squeezing the sidebar + tool content on every /app/
   page well below what each tool's own inner width (900-1180px) was
   designed for. Widen just the app-shell context; marketing pages are
   untouched. */
.wrap:has(> .app-shell) {
  max-width: 1500px;
}

.app-shell {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.app-sidebar {
  width: 232px;
  flex-shrink: 0;
  position: sticky;
  top: 84px;
  border: 1px solid var(--hairline);
  background: var(--paper-raised);
  border-radius: 16px;
  padding: 8px;
}
.sidebar-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink-muted);
  text-transform: uppercase;
  padding: 10px 12px 6px;
}
.sidebar-group + .sidebar-group { border-top: 1px solid var(--hairline); margin-top: 2px; padding-top: 2px; }
.sidebar-group-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: none;
  text-align: left;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
}
.sidebar-group-btn:hover { background: var(--paper); }
.sidebar-group-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--forest); flex-shrink: 0; }
.sidebar-group-dot.muted { background: var(--ink-muted); opacity: 0.5; }
.sidebar-group-name { flex: 1; }
.sidebar-chev {
  width: 13px; height: 13px; color: var(--ink-muted);
  transition: transform .15s ease;
  flex-shrink: 0;
}
.sidebar-group.open .sidebar-chev { transform: rotate(90deg); }
.sidebar-group-items {
  display: none;
  flex-direction: column;
  padding: 2px 10px 8px 29px;
  gap: 1px;
}
.sidebar-group.open .sidebar-group-items { display: flex; }
.sidebar-group-items a, .sidebar-item-disabled {
  font-size: 13px;
  padding: 7px 8px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-group-items a:hover { background: var(--paper); color: var(--ink); }
.sidebar-item-disabled { color: var(--ink-muted); opacity: 0.55; cursor: default; }
.sidebar-item-disabled em { font-style: normal; font-size: 10.5px; border: 1px solid var(--hairline); border-radius: 20px; padding: 2px 7px; }

.app-main { flex: 1; min-width: 0; }

.mobile-tool-select { display: none; }

@media (max-width: 880px) {
  .app-shell { flex-direction: column; gap: 20px; }
  .app-sidebar { width: 100%; position: static; padding: 10px; }
  .app-sidebar .sidebar-label, .app-sidebar .sidebar-nav { display: none; }
  .mobile-tool-select {
    display: block; width: 100%;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 13.5px; color: var(--ink);
    border: 1px solid var(--hairline); border-radius: 9px; padding: 9px 10px;
    background: var(--paper-raised);
  }
}

.sidebar-group-icon {
  width: 16px; height: 16px; flex-shrink: 0;
  color: var(--forest);
  display: flex; align-items: center; justify-content: center;
}
.sidebar-group-icon.muted { color: var(--ink-muted); opacity: 0.55; }
.sidebar-group-items a.active { background: var(--forest-soft); color: var(--ink); font-weight: 500; }

/* ---- app top / dashboard content (shared by dashboard + tool pages) ---- */

.app-top {
  padding: 0 0 8px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
}
.app-top h1 { font-size: 26px; font-weight: 500; }
.app-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.subtle { color: var(--ink-muted); font-size: 13px; margin-bottom: 22px; }

.category { margin-top: 28px; }
.category-label {
  font-size: 12.5px; font-weight: 500; color: var(--ink-muted);
  margin-bottom: 12px; padding-bottom: 7px; border-bottom: 1px solid var(--hairline);
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.card {
  border: 1px solid var(--hairline); background: var(--paper-raised);
  border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-title { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; }
.dot-badge { width: 22px; height: 22px; border-radius: 50%; background: var(--forest-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--forest); flex-shrink: 0; }
.card-link {
  font-size: 11px; color: var(--ink-muted); text-decoration: none;
  border: 1px solid var(--hairline); border-radius: 7px; padding: 4px 8px;
  transition: border-color .15s ease, color .15s ease;
}
.card-link:hover { color: var(--ink); border-color: var(--ink); }
.updated { font-size: 10.5px; color: var(--ink-muted); }
.card-graphic { display: flex; align-items: center; justify-content: center; padding: 0 0 2px; }
.metric { padding: 6px 0; border-top: 1px solid var(--hairline); }
.metric:first-of-type { border-top: none; padding-top: 0; }
.metric-label { font-size: 11px; color: var(--ink-muted); margin-bottom: 2px; }
.metric-asof { font-size: 10px; color: var(--ink-muted); opacity: 0.75; margin-left: 5px; }
.metric-value { font-size: 16.5px; font-weight: 500; letter-spacing: -0.01em; }
.metric-delta { font-size: 11px; margin-top: 2px; display: flex; align-items: center; gap: 3px; }
.metric-delta.up { color: var(--gain); }
.metric-delta.down { color: var(--rust); }
.metric-delta.flat { color: var(--ink-muted); }
.no-data-note {
  font-size: 11.5px; color: var(--ink-muted); line-height: 1.5;
  background: var(--paper); border-radius: 8px; padding: 8px 9px; margin-top: 2px;
}
.no-data-note a { color: var(--forest); text-decoration: none; }
.no-data-note a:hover { text-decoration: underline; }

.empty {
  border: 1px dashed var(--hairline); border-radius: 16px; background: var(--paper-raised);
  padding: 40px 24px; text-align: center; color: var(--ink-muted); font-size: 14px; line-height: 1.7;
  margin-top: 24px;
}
.empty code { background: var(--paper); border: 1px solid var(--hairline); border-radius: 5px; padding: 1px 6px; font-size: 13px; }

.roadmap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.card.soon { opacity: 0.55; }
.card.soon .dot-badge { background: var(--hairline); }
.card.soon .dot { background: var(--ink-muted); }
