/* ═══════════════════════════════════════════════════════════
   hub.css — Finance Tools Hub shared stylesheet
   Consumed by: index.html
   ═══════════════════════════════════════════════════════════ */

/* ── Design tokens ── */
:root {
  --bg:      #0a0c10;
  --surface: #111318;
  --card:    #161920;
  --border:  #232730;
  --accent:  #c8a96e;
  --accent2: #5c9eff;
  --accent3: #4ecb8a;
  --accent4: #e06b6b;
  --accent5: #b67fff;
  --accent6: #ff9f43; /* nation-state orange */
  --text:    #e8e3d8;
  --muted:   #7a7f8e;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'Manrope', sans-serif;
  --font-mono:    'DM Mono', monospace;
  --radius: 12px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Grain overlay ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: .4;
}

/* ── Page shell ── */
.shell {
  position: relative; z-index: 1;
  max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px;
}

/* ── Header ── */
header {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: 20px;
  margin-bottom: 36px; padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.brand h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 36px);
  color: var(--accent); font-style: italic; font-weight: 400;
}
.brand p { color: var(--muted); font-size: 13px; margin-top: 6px; max-width: 480px; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Buttons ── */
.btn {
  padding: 8px 16px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--card); color: var(--text);
  font-size: 12px; font-family: var(--font-body);
  cursor: pointer; font-weight: 500; transition: all .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-accent { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }
.btn-accent:hover { background: #d4b87a; border-color: #d4b87a; color: #000; }

/* ── App strip ── */
.app-strip-wrap { margin-bottom: 32px; }
.app-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* 6 cards */
  gap: 14px;
}
.app-strip-dots { display: none; }

@media (max-width: 900px) {
  .app-strip { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .app-strip {
    display: flex; overflow-x: auto;
    scroll-snap-type: x mandatory; scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 12px; margin: 0 -24px; padding: 4px 24px 8px;
    scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .app-strip::-webkit-scrollbar { display: none; }
  .app-card {
    flex: 0 0 min(88vw, 340px);
    scroll-snap-align: center; scroll-snap-stop: always;
  }
  .app-card:hover { transform: none; }
  .app-strip-dots {
    display: flex; justify-content: center;
    align-items: center; gap: 8px; margin-top: 14px;
  }
  .app-strip-dot {
    width: 7px; height: 7px; border-radius: 50%;
    border: none; padding: 0;
    background: var(--border); cursor: pointer;
    transition: background .2s, transform .2s;
  }
  .app-strip-dot.active { background: var(--accent); transform: scale(1.15); }
  .app-strip-dot:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
}

/* ── App cards ── */
.app-card {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
}
.app-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.app-card .icon { font-size: 28px; line-height: 1; }
.app-card strong { display: block; color: var(--accent); font-size: 15px; margin-bottom: 2px; }
.app-card span { font-size: 12px; color: var(--muted); }

/* App card colour accents (top border) */
.app-card.personal     { border-top: 2px solid var(--accent3); }
.app-card.smsf         { border-top: 2px solid var(--accent2); }
.app-card.analysis     { border-top: 2px solid var(--accent5); }
.app-card.listed       { border-top: 2px solid var(--accent4); }
.app-card.trust        { border-top: 2px solid var(--accent);  }
.app-card.nation-state { border-top: 2px solid var(--accent6); }

/* ── Layout ── */
.layout {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 28px; align-items: start;
}
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } }
.sidebar { position: sticky; top: 24px; }
@media (max-width: 800px) { .sidebar { position: static; display: flex; flex-wrap: wrap; gap: 8px; } }

/* ── Category nav ── */
.cat-nav { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 800px) { .cat-nav { flex-direction: row; flex-wrap: wrap; } }
.cat-btn {
  text-align: left; padding: 10px 14px;
  border: none; border-radius: 8px;
  background: transparent; color: var(--muted);
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s;
  border-left: 2px solid transparent;
}
@media (max-width: 800px) {
  .cat-btn { border-left: none; border-bottom: 2px solid transparent; padding: 8px 12px; }
}
.cat-btn:hover { color: var(--text); background: rgba(255,255,255,.03); }
.cat-btn.active { color: var(--accent); background: rgba(200,169,110,.08); border-left-color: var(--accent); }
@media (max-width: 800px) { .cat-btn.active { border-bottom-color: var(--accent); } }

/* ── Tool sections ── */
.section { margin-bottom: 40px; scroll-margin-top: 24px; }
.section-head { margin-bottom: 18px; }
.section-head h2 {
  font-family: var(--font-display); font-size: 22px;
  color: var(--text); font-style: italic; font-weight: 400;
}
.section-head p { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 1.2px; }

/* ── Calc cards ── */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.calc-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.calc-card.hidden { display: none; }
.calc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.calc-title { font-size: 15px; font-weight: 700; color: var(--text); }

/* App badge on calc cards */
.calc-app {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  padding: 3px 8px; border-radius: 4px; font-weight: 700; white-space: nowrap;
}
.calc-app.personal     { background: rgba(78,203,138,.12);  color: var(--accent3); border: 1px solid rgba(78,203,138,.25);  }
.calc-app.smsf         { background: rgba(92,158,255,.12);  color: var(--accent2); border: 1px solid rgba(92,158,255,.25);  }
.calc-app.analysis     { background: rgba(182,127,255,.12); color: var(--accent5); border: 1px solid rgba(182,127,255,.25); }
.calc-app.listed       { background: rgba(224,107,107,.12); color: var(--accent4); border: 1px solid rgba(224,107,107,.25); }
.calc-app.trust        { background: rgba(200,169,110,.12); color: var(--accent);  border: 1px solid rgba(200,169,110,.25); }
.calc-app.nation-state { background: rgba(255,159,67,.12);  color: var(--accent6); border: 1px solid rgba(255,159,67,.25);  }

/* ── Model tags ── */
.models { display: flex; flex-wrap: wrap; gap: 6px; }
.model-tag {
  font-family: var(--font-mono); font-size: 10px; padding: 3px 8px;
  border-radius: 4px; background: var(--surface); color: var(--muted); border: 1px solid var(--border);
}

/* ── Written guide ── */
.guide-written {
  font-size: 13px; color: var(--muted); line-height: 1.55;
  border-left: 2px solid var(--border); padding-left: 12px;
}
.guide-written strong {
  color: var(--text); font-weight: 600; display: block;
  margin-bottom: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
}

/* ── Calc actions ── */
.calc-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.calc-actions .btn {
  flex: 1; text-align: center; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.calc-actions .btn-play { flex: 0 0 auto; min-width: 44px; padding: 8px 12px; }

/* ── Video strip ── */
.video-strip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--surface);
  border-radius: 8px; border: 1px solid var(--border);
  cursor: pointer; transition: border-color .15s;
}
.video-strip:hover { border-color: var(--accent2); }
.video-thumb {
  width: 72px; height: 40px; border-radius: 4px;
  background: linear-gradient(135deg, #1a2030, #2a3548);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px;
}
.video-meta { font-size: 12px; }
.video-meta span { display: block; color: var(--muted); font-size: 11px; }

/* ── Video modal ── */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0,0,0,.75); backdrop-filter: blur(6px);
}
.modal.open { display: flex; }
.modal-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); max-width: 720px; width: 100%; overflow: hidden;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 0; }
.modal-body .ratio { position: relative; padding-bottom: 56.25%; height: 0; background: #000; }
.modal-body iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.modal-foot { padding: 14px 20px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.modal-placeholder { padding: 40px 24px; text-align: center; color: var(--muted); }
.modal-placeholder a { color: var(--accent2); }

/* ── Misc ── */
.filter-hint { font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.empty-filter { display: none; text-align: center; padding: 48px; color: var(--muted); }
.empty-filter.show { display: block; }
