/* ==============================================
   Interactive Investor Referral — Design Tokens
   ============================================== */

:root {
  /* Type Scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 720px;
  --content-default: 1000px;
  --content-wide: 1200px;

  /* Fonts */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;
}

/* ==============================================
   Color Palette — Finance / Trust / Authority
   Navy, slate, and a confident teal accent
   ============================================== */

:root, [data-theme="light"] {
  /* Surfaces */
  --color-bg:             #f8f9fb;
  --color-surface:        #ffffff;
  --color-surface-2:      #f3f5f8;
  --color-surface-offset: #edf0f5;
  --color-divider:        #dde1e8;
  --color-border:         #c8ced8;

  /* Text */
  --color-text:           #1a1e2e;
  --color-text-muted:     #5c6478;
  --color-text-faint:     #9ca3b4;
  --color-text-inverse:   #f8f9fb;

  /* Primary — Financial Teal */
  --color-primary:        #0a6e5c;
  --color-primary-hover:  #085a4b;
  --color-primary-active: #064a3d;
  --color-primary-bg:     #e8f5f1;

  /* Accent — Deep Navy */
  --color-navy:           #1a2744;
  --color-navy-light:     #2b3d5e;

  /* Semantic */
  --color-success:        #0a6e5c;
  --color-warning:        #b45309;
  --color-error:          #dc2626;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26,30,46,0.06);
  --shadow-md: 0 4px 16px rgba(26,30,46,0.08);
  --shadow-lg: 0 12px 40px rgba(26,30,46,0.12);
}

/* Dark Mode */
[data-theme="dark"] {
  --color-bg:             #0f1219;
  --color-surface:        #171b26;
  --color-surface-2:      #1d2233;
  --color-surface-offset: #1a1f2e;
  --color-divider:        #2a3042;
  --color-border:         #3a4158;

  --color-text:           #d8dce6;
  --color-text-muted:     #8b93a8;
  --color-text-faint:     #5c6478;
  --color-text-inverse:   #1a1e2e;

  --color-primary:        #34c5a6;
  --color-primary-hover:  #2aad92;
  --color-primary-active: #249880;
  --color-primary-bg:     #132e27;

  --color-navy:           #8b93a8;
  --color-navy-light:     #a5adbe;

  --color-success:        #34c5a6;
  --color-warning:        #f59e0b;
  --color-error:          #f87171;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #0f1219;
    --color-surface:        #171b26;
    --color-surface-2:      #1d2233;
    --color-surface-offset: #1a1f2e;
    --color-divider:        #2a3042;
    --color-border:         #3a4158;
    --color-text:           #d8dce6;
    --color-text-muted:     #8b93a8;
    --color-text-faint:     #5c6478;
    --color-text-inverse:   #1a1e2e;
    --color-primary:        #34c5a6;
    --color-primary-hover:  #2aad92;
    --color-primary-active: #249880;
    --color-primary-bg:     #132e27;
    --color-navy:           #8b93a8;
    --color-navy-light:     #a5adbe;
    --color-success:        #34c5a6;
    --color-warning:        #f59e0b;
    --color-error:          #f87171;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
  }
}

/* ==============================================
   Header
   ============================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-divider);
}

.header__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  white-space: nowrap;
}

.logo-bg {
  fill: var(--color-primary);
}

.header nav {
  margin-left: auto;
}

.header nav ul {
  display: flex;
  gap: var(--space-5);
  list-style: none;
}

.header nav a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
}

.header nav a:hover {
  color: var(--color-primary);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

@media (max-width: 768px) {
  .header nav { display: none; }
  .header__inner { justify-content: space-between; }
}

/* ==============================================
   Hero
   ============================================== */

.hero {
  padding: clamp(var(--space-16), 10vw, var(--space-32)) var(--space-6);
  text-align: center;
  background: linear-gradient(180deg, var(--color-surface-2) 0%, var(--color-bg) 100%);
}

.hero__inner {
  max-width: 780px;
  margin: 0 auto;
}

.hero__badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  background: var(--color-primary-bg);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-text);
  margin-bottom: var(--space-6);
  font-weight: 400;
  line-height: 1.1;
}

.accent {
  color: var(--color-primary);
}

.hero__subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 640px;
  margin: 0 auto var(--space-8);
  line-height: 1.7;
}

.hero__cta-group {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.hero__disclaimer {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.hero__disclaimer a {
  color: var(--color-text-muted);
}

/* ==============================================
   Buttons
   ============================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-primary-hover);
}

.btn--primary:active {
  background: var(--color-primary-active);
}

.btn--secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-surface-2);
  border-color: var(--color-text-muted);
}

.btn--large {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

/* ==============================================
   Sections
   ============================================== */

.section {
  padding: clamp(var(--space-12), 6vw, var(--space-24)) var(--space-6);
}

.section--alt {
  background: var(--color-surface-2);
}

.section__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
}

.section__inner--narrow {
  max-width: var(--content-narrow);
}

.section__intro {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 720px;
  margin-bottom: var(--space-10);
  line-height: 1.7;
}

.section h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  margin-bottom: var(--space-4);
  font-weight: 400;
}

/* ==============================================
   Cards (What You Get)
   ============================================== */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary-bg);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.card__icon svg {
  display: inline;
}

.card h3 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ==============================================
   Features Grid (Why ii)
   ============================================== */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

.feature {
  padding: var(--space-6);
  border-left: 3px solid var(--color-primary);
  background: var(--color-surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

[data-theme="dark"] .feature {
  background: var(--color-surface-offset);
}

.feature h3 {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.feature p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ==============================================
   Comparison Table
   ============================================== */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-divider);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-6);
}

table {
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

thead {
  background: var(--color-navy);
  color: #fff;
}

[data-theme="dark"] thead {
  background: var(--color-surface-2);
  color: var(--color-text);
}

th {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

td {
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--color-divider);
  white-space: nowrap;
}

tbody tr:hover {
  background: var(--color-surface-offset);
}

.table-highlight {
  background: var(--color-primary-bg);
}

.table-highlight:hover {
  background: var(--color-primary-bg) !important;
}

.table-note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.7;
  max-width: 100%;
  margin-bottom: var(--space-6);
}

.comparison-callout {
  background: var(--color-primary-bg);
  border-left: 4px solid var(--color-primary);
  padding: var(--space-5) var(--space-6);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.comparison-callout p {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.7;
  max-width: 100%;
}

/* Mobile table */
@media (max-width: 640px) {
  table, thead, tbody, th, td, tr {
    display: block;
  }
  thead { display: none; }
  tr {
    margin-bottom: var(--space-4);
    border-bottom: 2px solid var(--color-divider);
    padding-bottom: var(--space-3);
  }
  td {
    padding: var(--space-2) var(--space-4);
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: normal;
  }
  td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text);
    margin-right: var(--space-4);
    flex-shrink: 0;
  }
  td:first-child {
    background: var(--color-surface-offset);
    font-weight: 700;
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
  }
  td:first-child::before { display: none; }
}

/* ==============================================
   Pros & Cons
   ============================================== */

.pros-cons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
}

.pros-cons-col {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  border: 1px solid var(--color-divider);
}

.pros-cons-col h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-6);
}

.pros-col h3 { color: var(--color-success); }
.cons-col h3 { color: var(--color-error); }

.pros-cons-col h3 svg { display: inline; flex-shrink: 0; }

.pros-cons-col ul {
  list-style: none;
  padding: 0;
}

.pros-cons-col li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
  max-width: 100%;
}

.pros-cons-col li:last-child {
  border-bottom: none;
}

.pros-cons-col li strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ==============================================
   Plans Grid
   ============================================== */

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.plan-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.plan-card--featured {
  border-color: var(--color-primary);
  border-width: 2px;
  box-shadow: var(--shadow-md);
}

.plan-card__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.plan-card__header {
  margin-bottom: var(--space-4);
}

.plan-card__header h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  margin-bottom: var(--space-2);
  font-weight: 400;
}

.plan-card__price {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-body);
}

.plan-card__price span {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text-muted);
}

.plan-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

.plan-card ul {
  list-style: none;
  padding: 0;
  margin-bottom: var(--space-6);
}

.plan-card li {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-divider);
  max-width: 100%;
}

.plan-card li:last-child { border-bottom: none; }

.plan-card__savings {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-bg);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  text-align: center;
}

/* ==============================================
   CTA Banner
   ============================================== */

.cta-banner {
  background: var(--color-navy);
  color: #fff;
  padding: clamp(var(--space-12), 6vw, var(--space-24)) var(--space-6);
  text-align: center;
}

[data-theme="dark"] .cta-banner {
  background: var(--color-surface-2);
}

.cta-banner__inner {
  max-width: 700px;
  margin: 0 auto;
}

.cta-banner h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: #fff;
  margin-bottom: var(--space-4);
  font-weight: 400;
}

[data-theme="dark"] .cta-banner h2 {
  color: var(--color-text);
}

.cta-banner p {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.8);
  margin-bottom: var(--space-8);
  line-height: 1.7;
  max-width: 100%;
}

[data-theme="dark"] .cta-banner p {
  color: var(--color-text-muted);
}

.cta-banner .btn--primary {
  background: var(--color-primary);
  margin-bottom: var(--space-6);
}

[data-theme="dark"] .cta-banner .btn--primary {
  color: var(--color-text-inverse);
}

.cta-banner__terms {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.5);
  margin-bottom: var(--space-2);
}

[data-theme="dark"] .cta-banner__terms {
  color: var(--color-text-faint);
}

.cta-banner__terms code {
  font-size: var(--text-xs);
  background: rgba(255,255,255,0.1);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  word-break: break-all;
}

.cta-banner__terms a {
  color: rgba(255,255,255,0.7);
}

[data-theme="dark"] .cta-banner__terms a {
  color: var(--color-primary);
}

/* ==============================================
   FAQ
   ============================================== */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-item summary {
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: var(--text-lg);
  font-weight: 300;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: transform var(--transition-interactive);
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item summary:hover {
  color: var(--color-primary);
}

.faq-answer {
  padding: 0 var(--space-6) var(--space-6);
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.faq-answer p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.8;
  max-width: 100%;
}

.faq-answer a {
  color: var(--color-primary);
}

/* ==============================================
   Footer
   ============================================== */

.footer {
  background: var(--color-surface-2);
  padding: var(--space-10) var(--space-6);
  border-top: 1px solid var(--color-divider);
}

.footer__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
}

.footer__disclaimer {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.8;
  max-width: 100%;
  margin-bottom: var(--space-4);
}

.footer__disclaimer strong {
  color: var(--color-text);
}

.footer__meta {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-8);
}

.footer__bottom {
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}

.footer__attribution {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: none;
}

.footer__attribution:hover {
  color: var(--color-text-muted);
}

/* ==============================================
   Utilities
   ============================================== */

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

code {
  font-family: 'JetBrains Mono', monospace;
}
