/* =============================================
   Goldflower Capital — Main Stylesheet
   Clean & Modern with Gold Accents
   ============================================= */

/* --- Reset & Variables --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold: #C8973E;
  --gold-light: #E8C97A;
  --gold-dark: #A07830;
  --navy: #1A2332;
  --navy-light: #243447;
  --slate: #4A5568;
  --gray-50: #F9FAFB;
  --gray-100: #F7FAFC;
  --gray-200: #EDF2F7;
  --gray-300: #E2E8F0;
  --gray-500: #A0AEC0;
  --gray-700: #4A5568;
  --gray-800: #2D3748;
  --gray-900: #1A202C;
  --white: #FFFFFF;
  --green: #276749;
  --green-light: #48BB78;
  --green-bg: #F0FFF4;
  --red: #C53030;
  --red-light: #FC8181;
  --amber-bg: #FFFBEB;
  --amber-border: #F6E05E;
  --amber-text: #744210;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1140px;
  --transition: 0.25s ease;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--gold-dark); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }
img { max-width: 100%; display: block; }

/* --- Typography --- */
h1, h2, h3, h4, h5 { font-family: var(--font); font-weight: 700; line-height: 1.25; color: var(--navy); }
h1 { font-size: 2.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { margin-bottom: 1rem; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* =============================================
   HEADER / NAVIGATION
   ============================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  transition: box-shadow var(--transition);
}
.header.scrolled { box-shadow: var(--shadow-md); }

.header > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}
.logo-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}
.logo-icon img {
  width: 100%;
  height: 100%;
}
.logo h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  letter-spacing: -0.01em;
}

/* Nav links */
.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--slate);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  transition: all var(--transition);
  position: relative;
}
.nav-link:hover {
  color: var(--gold-dark);
  background: rgba(200,151,62,0.06);
}
.nav-link.active {
  color: var(--gold-dark);
  font-weight: 600;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}
.nav-cta {
  background: var(--gold) !important;
  color: var(--white) !important;
  padding: 0.5rem 1.25rem !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  margin-left: 0.5rem;
  transition: all var(--transition);
}
.nav-cta:hover {
  background: var(--gold-dark) !important;
  color: var(--white) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(200,151,62,0.3);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  transition: var(--transition);
  border-radius: 1px;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main {
  min-height: calc(100vh - 68px - 200px);
  padding-bottom: 2rem;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: var(--navy);
  color: var(--gray-500);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}
.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}
.footer-section h3 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}
.footer-section h4 {
  color: var(--gray-300);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.8rem;
}
.footer-section p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--gray-500);
}
.footer-section ul {
  list-style: none;
  padding: 0;
}
.footer-section ul li {
  margin-bottom: 0.5rem;
}
.footer-section ul a {
  color: var(--gray-500);
  font-size: 0.9rem;
  transition: color var(--transition);
}
.footer-section ul a:hover {
  color: var(--gold-light);
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}
.footer .disclaimer {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.25);
  max-width: 700px;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* =============================================
   BASELINE PORTFOLIO PAGE OVERRIDES
   ============================================= */

/* Hero section */
.bp-hero {
  padding: 2.5rem 0 1.5rem;
}
.bp-hero h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--navy);
}

/* Stat cards row */
.bp-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.bp-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: all var(--transition);
}
.bp-card:hover {
  border-color: var(--gold-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.bp-card-value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}
.bp-card-label {
  font-size: 0.82rem;
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.bp-card-sub {
  font-size: 0.78rem;
  color: var(--gray-500);
}
.bp-green { color: var(--green); }
.bp-red { color: var(--red); }
.bp-muted { color: var(--gray-500); }

.bp-period {
  text-align: center;
  color: var(--gray-500);
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

/* Performance comparison bars */
.bp-bars {
  margin: 2.5rem 0;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.bp-bars h3 {
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
}
.bp-bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 0.75rem;
}
.bp-bar-label {
  width: 80px;
  font-weight: 600;
  font-size: 0.88rem;
  flex-shrink: 0;
  color: var(--navy);
}
.bp-bar-track {
  flex: 1;
  background: var(--gray-200);
  border-radius: 6px;
  height: 36px;
  position: relative;
  overflow: hidden;
}
.bp-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.bp-bar-fill-baseline {
  background: linear-gradient(90deg, var(--green), var(--green-light));
}
.bp-bar-fill-spy {
  background: linear-gradient(90deg, var(--gray-500), #CBD5E0);
}
.bp-bar-value {
  width: 90px;
  text-align: right;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Methodology (collapsible) */
.bp-methodology {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--slate);
  line-height: 1.7;
}
.bp-methodology summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--navy);
  font-size: 0.95rem;
  padding: 0.25rem 0;
}
.bp-methodology summary:hover { color: var(--gold-dark); }
.bp-methodology ul {
  margin: 0.75rem 0 0 1.25rem;
}
.bp-methodology li {
  margin-bottom: 0.35rem;
}

/* Tables */
.bp-metrics { margin: 2.5rem 0; }
.bp-metrics h3, .bp-top20 h3, .bp-holdings h3 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.bp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0.75rem 0;
  font-size: 0.88rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}
.bp-table th {
  background: var(--navy);
  color: var(--white);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bp-table th:not(:first-child) { text-align: right; }
.bp-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-700);
}
.bp-table td:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.bp-table tbody tr { transition: background var(--transition); }
.bp-table tr:nth-child(even) { background: var(--gray-50); }
.bp-table tr:hover { background: var(--gray-100); }
.bp-table .bp-highlight { font-weight: 700; color: var(--navy); }

/* Top 20 */
.bp-top20 { margin: 2.5rem 0; }
.bp-top20-table th { cursor: pointer; user-select: none; transition: background var(--transition); }
.bp-top20-table th:hover { background: var(--navy-light); }
.bp-top3 { background: var(--green-bg) !important; }

/* Holdings */
.bp-holdings { margin: 2.5rem 0; }
.bp-updated {
  color: var(--gray-500);
  font-size: 0.85rem;
  margin-top: 0.6rem;
}

/* Disclaimer */
.bp-disclaimer {
  margin: 3rem 0 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--amber-text);
  line-height: 1.7;
}

/* Loading / error */
.bp-loading {
  color: var(--gray-500);
  padding: 1.5rem 0;
  font-size: 0.9rem;
}
.bp-error {
  color: var(--red);
  padding: 0.5rem 0;
  display: none;
  font-size: 0.9rem;
}

/* =============================================
   SUBSCRIBE BOX
   ============================================= */
.subscribe-box {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: 16px;
  padding: 3rem;
  color: white;
  text-align: center;
  margin: 2.5rem 0;
}
.subscribe-box h3 { color: white; margin-bottom: 0.6rem; font-size: 1.4rem; }
.subscribe-box p { color: var(--gray-500); margin-bottom: 1.5rem; font-size: 0.95rem; }
.subscribe-form { display: flex; gap: 0.6rem; max-width: 440px; margin: 0 auto; }
.subscribe-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: white;
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition);
}
.subscribe-form input::placeholder { color: rgba(255,255,255,0.4); }
.subscribe-form input:focus { border-color: var(--gold); }
.subscribe-form button {
  background: var(--gold);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.subscribe-form button:hover {
  background: var(--gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(200,151,62,0.3);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  h1 { font-size: 2rem; }
  .bp-hero h2 { font-size: 1.6rem; }
  .footer-content { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .bp-cards { grid-template-columns: repeat(2, 1fr); }
  .bp-card-value { font-size: 1.6rem; }
  .bp-bar-label { width: 65px; font-size: 0.82rem; }
  .bp-bar-value { width: 70px; font-size: 0.88rem; }
  .bp-table { font-size: 0.82rem; }
  .bp-table th, .bp-table td { padding: 0.55rem 0.7rem; }
}

@media (max-width: 640px) {
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    gap: 0.25rem;
  }
  .nav.open .nav-link {
    padding: 0.65rem 0.9rem;
  }
  .mobile-menu-toggle { display: flex; }
  .bp-cards { grid-template-columns: 1fr 1fr; }
  .bp-bar-row { flex-wrap: wrap; }
  .bp-bar-track { order: 3; width: 100%; flex: none; }
  .footer-content { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  .subscribe-form { flex-direction: column; }
}

@media (max-width: 480px) {
  .bp-cards { grid-template-columns: 1fr; }
  .logo h1 { font-size: 1rem; }
}
