/* ============================================================
   Keystone Research Group — Design System
   Dark premium financial publisher theme
   ============================================================ */

/* — Reset — */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
button { border: none; cursor: pointer; font-family: inherit; }
ul, ol { list-style: none; }

/* — Tokens — */
:root {
  --bg-primary:    #0a0a0f;
  --bg-secondary:  #101018;
  --bg-tertiary:   #16161f;
  --bg-card:       #12121b;
  --surface-border:#1e1e2a;

  --accent:        #167ef7;
  --accent-hover:  #3d96ff;
  --accent-muted:  rgba(22,126,247,0.12);

  --text-primary:  #f0f0f5;
  --text-secondary:#a0a0b0;
  --text-muted:    #6a6a7a;
  --text-white:    #ffffff;

  --font-body:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading:  'Playfair Display', 'Georgia', 'Times New Roman', serif;

  --fs-xs:   0.75rem;    /* 12 */
  --fs-sm:   0.875rem;   /* 14 */
  --fs-base: 1rem;       /* 16 */
  --fs-md:   1.125rem;   /* 18 */
  --fs-lg:   1.25rem;    /* 20 */
  --fs-xl:   1.5rem;     /* 24 */
  --fs-2xl:  2rem;       /* 32 */
  --fs-3xl:  2.5rem;     /* 40 */
  --fs-4xl:  3.25rem;    /* 52 */
  --fs-5xl:  4rem;       /* 64 */

  --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-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);

  --transition: 200ms ease;
  --container:  1140px;
}

/* — Base — */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* — Typography — */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-white);
}

h1 { font-size: var(--fs-4xl); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-3xl); letter-spacing: -0.01em; }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }

p {
  color: var(--text-secondary);
  font-size: var(--fs-base);
  max-width: 68ch;
}

.label-caps {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* — Layout — */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-24) 0;
}

.section--tight {
  padding: var(--space-16) 0;
}

/* — Dividers — */
.divider {
  width: 100%;
  height: 1px;
  background: var(--surface-border);
  border: none;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav__logo img {
  height: 32px;
  width: auto;
}

.nav__logo-text {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-white);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav__link {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}

.nav__link:hover,
.nav__link--active {
  color: var(--text-white);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav__link:hover::after {
  width: 100%;
}

/* Mobile menu toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  padding: var(--space-2);
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  transition: all var(--transition);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--surface-border);
  padding: var(--space-16) 0 var(--space-8);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer__brand p {
  margin-top: var(--space-4);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  max-width: 36ch;
  line-height: 1.7;
}

.footer__brand img {
  height: 28px;
  width: auto;
}

.footer__col-title {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

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

.footer__link {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer__link:hover {
  color: var(--text-white);
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-8);
  border-top: 1px solid var(--surface-border);
}

.footer__copy {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.footer__bottom-links {
  display: flex;
  gap: var(--space-6);
}

.footer__bottom-links a {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer__bottom-links a:hover {
  color: var(--text-secondary);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

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

.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(22,126,247,0.3);
}

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

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--lg {
  padding: var(--space-4) var(--space-10);
  font-size: var(--fs-base);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input,
.form-textarea {
  background: var(--bg-tertiary);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--text-primary);
  transition: border-color var(--transition);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-textarea {
  resize: vertical;
  min-height: 140px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: var(--space-8);
}

/* ============================================================
   PAGE-SPECIFIC: HERO
   ============================================================ */
.hero {
  padding: calc(72px + var(--space-24)) 0 var(--space-24);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse at center, rgba(22,126,247,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero__label {
  margin-bottom: var(--space-6);
}

.hero h1 {
  margin-bottom: var(--space-6);
}

.hero__sub {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  max-width: 56ch;
  margin: 0 auto var(--space-10);
  line-height: 1.75;
}

.hero__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

/* ============================================================
   PAGE-SPECIFIC: STATS BAR
   ============================================================ */
.stats-bar {
  background: var(--bg-secondary);
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
  padding: var(--space-10) 0;
}

.stats-bar__inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  text-align: center;
}

.stat__value {
  font-family: var(--font-heading);
  font-size: var(--fs-3xl);
  font-weight: 700;
  color: var(--text-white);
}

.stat__label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ============================================================
   PAGE-SPECIFIC: TESTIMONIALS
   ============================================================ */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.testimonial {
  position: relative;
  padding-top: var(--space-10);
}

.testimonial::before {
  content: '\201C';
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-heading);
  font-size: 3.5rem;
  color: var(--accent);
  line-height: 1;
  opacity: 0.5;
}

.testimonial__text {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  line-height: 1.75;
  font-style: italic;
  margin-bottom: var(--space-6);
}

.testimonial__author {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================================
   PAGE-SPECIFIC: CTA SECTION
   ============================================================ */
.cta-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
  text-align: center;
}

.cta-section h2 {
  margin-bottom: var(--space-4);
}

.cta-section p {
  margin: 0 auto var(--space-8);
}

.cta-form {
  display: flex;
  gap: var(--space-3);
  max-width: 480px;
  margin: 0 auto;
}

.cta-form .form-input {
  flex: 1;
}

/* ============================================================
   PAGE-SPECIFIC: ABOUT SECTION
   ============================================================ */
.about-preview {
  text-align: center;
}

.about-preview p {
  margin: 0 auto;
}

.about-preview h2 {
  margin-bottom: var(--space-6);
}

/* ============================================================
   PAGE-SPECIFIC: CONTACT
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-12);
  align-items: start;
}

.contact-info__item {
  margin-bottom: var(--space-8);
}

.contact-info__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.contact-info__value {
  font-size: var(--fs-md);
  color: var(--text-primary);
}

.contact-info__value a {
  color: var(--accent);
  transition: color var(--transition);
}

.contact-info__value a:hover {
  color: var(--accent-hover);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* ============================================================
   PAGE-SPECIFIC: LEGAL PAGES (terms, privacy, disclaimer)
   ============================================================ */
.legal-page {
  padding-top: calc(72px + var(--space-16));
  padding-bottom: var(--space-24);
}

.legal-page__header {
  margin-bottom: var(--space-12);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--surface-border);
}

.legal-page__header h1 {
  margin-bottom: var(--space-3);
}

.legal-page__date {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.legal-content h2 {
  font-size: var(--fs-xl);
  font-family: var(--font-body);
  font-weight: 600;
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--surface-border);
}

.legal-content h3 {
  font-size: var(--fs-lg);
  font-family: var(--font-body);
  font-weight: 600;
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.legal-content p {
  margin-bottom: var(--space-4);
  max-width: none;
}

.legal-content ul,
.legal-content ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.legal-content li {
  list-style: disc;
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--fs-base);
}

.legal-content ol li {
  list-style: decimal;
}

.legal-content a {
  color: var(--accent);
  transition: color var(--transition);
}

.legal-content a:hover {
  color: var(--accent-hover);
}

.legal-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================================
   PAGE HEADER (interior pages)
   ============================================================ */
.page-header {
  padding: calc(72px + var(--space-20)) 0 var(--space-16);
  text-align: center;
  border-bottom: 1px solid var(--surface-border);
}

.page-header h1 {
  margin-bottom: var(--space-4);
}

.page-header p {
  margin: 0 auto;
  font-size: var(--fs-md);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

@media (max-width: 768px) {
  :root {
    --container: 100%;
  }

  h1 { font-size: var(--fs-2xl); }
  h2 { font-size: var(--fs-xl); }

  .section { padding: var(--space-16) 0; }

  /* Nav mobile */
  .nav__links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--surface-border);
    padding: var(--space-6);
    gap: var(--space-4);
  }

  .nav__links.active {
    display: flex;
  }

  .nav__toggle {
    display: flex;
  }

  /* Grids */
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .stats-bar__inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .footer__grid {
    grid-template-columns: 1fr;
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .footer__bottom-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* CTA form */
  .cta-form {
    flex-direction: column;
  }

  /* Hero */
  .hero {
    padding-top: calc(72px + var(--space-16));
  }

  .hero__cta {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-4);
  }

  h1 { font-size: 1.75rem; }
}
