/* ==========================================================================
   Growth Hub — shared design system
   One token set / typography / component library used by every module.
   Each module sets `--accent` (and optionally `--accent-soft`) to its own
   color from the palette below; everything else (surfaces, type, spacing,
   components) stays identical across fitness / bjj / guitar / finance.
   ========================================================================== */

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

:root {
  /* Neutral surfaces — warm near-black, shared by every module */
  --bg: #141210;
  --surface: #1b1815;
  --card: #221e19;
  --card-hover: #29241d;
  --border: #35302a;
  --border-soft: #26221c;

  /* Text */
  --text: #ece8e1;
  --text-dim: #9c9488;
  --text-faint: #6b6459;

  /* Module accent palette (pick one per module via --accent) */
  --accent-fitness: #c9a84c;
  --accent-bjj: #2f6bb8;
  --accent-guitar: #c98a3e;
  --accent-finance: #3e8c82;
  --accent-sentinel: #5c6b7a;
  --accent-hearth: #b1532e;

  /* Default accent (overridden per-module) */
  --accent: var(--accent-fitness);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-text: #14120f;

  /* Type */
  --font-heading: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', monospace;

  /* Scale */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.01em;
}

h1 { font-size: 2.25rem; font-weight: 500; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { line-height: 1.55; color: var(--text-dim); margin: 0 0 var(--space-3); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono, .stat-value { font-family: var(--font-mono); }

::selection { background: var(--accent-soft); color: var(--text); }

/* ---- Layout ------------------------------------------------------------ */

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
}

.grid {
  display: grid;
  gap: var(--space-3);
}

/* ---- Header + tab nav (shared shell across every module) --------------- */
/* Pattern: a thin "back to Hub" strip, then a branded sticky header row,   */
/* then (where a module has sections/pages to switch between) an underline */
/* tab row. Every module renders its own version — own icon/title/tagline  */
/* and own set of tabs — but all share this exact structure and styling.   */

/* Wraps hub-strip + header + tabs as one sticky unit so they stack        */
/* naturally regardless of content height — avoids independently-sticky    */
/* siblings needing hardcoded pixel offsets that drift out of sync.        */
.gh-nav-shell {
  position: sticky;
  top: 0;
  z-index: 101;
  background: var(--bg);
}

/* Sticky by default for standalone use (e.g. fitness's thin link above its
   own independently-sticky app header). Inside a .gh-nav-shell it's
   overridden to static below, since the shell itself handles stickiness. */
.hub-strip {
  position: sticky;
  top: 0;
  z-index: 102;
  display: block;
  padding: 6px 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 1px;
  text-decoration: none;
}

.gh-nav-shell .hub-strip { position: static; }

.hub-strip:hover { color: var(--accent); text-decoration: none; }

.gh-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.gh-header .brand-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--text);
}

.gh-header .brand-sub {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 2px;
}

.gh-tabs {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.gh-tabs a, .gh-tabs button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 14px 20px;
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}

.gh-tabs a:hover, .gh-tabs button:hover { color: var(--text); text-decoration: none; }
.gh-tabs a.active, .gh-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- Cards -------------------------------------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}

/* ---- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}

.btn:hover { background: var(--card-hover); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover { filter: brightness(1.08); background: var(--accent); }

/* ---- Stats / progress ---------------------------------------------------- */

.stat-value {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
}

.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.progress-track {
  height: 8px;
  background: var(--border-soft);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .3s ease;
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---- Dashboard tiles (root index page) ---------------------------------- */

.tile {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: border-color .15s, transform .1s;
}

.tile:hover {
  border-color: var(--tile-accent, var(--accent));
  transform: translateY(-2px);
  text-decoration: none;
}

.tile .tile-icon {
  font-size: 1.6rem;
  margin-bottom: var(--space-2);
}

.tile h3 {
  color: var(--text);
  margin-bottom: var(--space-1);
}

.tile p { margin-bottom: 0; font-size: 0.9rem; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.tile.placeholder {
  opacity: .55;
  border-style: dashed;
  cursor: default;
}

.tile.placeholder:hover {
  transform: none;
  border-color: var(--border);
}

.placeholder-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
  margin-top: 8px;
}

/* Scrollbar (subtle, matches dark theme) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
