/* ============================================
   Keystone Design System
   Professional styling for enterprise finance
   ============================================ */

/* CSS Variables */
:root {
  /* Colors - Charcoal + Teal */
  --color-navy-900: #18181b;
  --color-navy-800: #27272a;
  --color-navy-700: #3f3f46;
  --color-slate-600: #52525b;
  --color-slate-500: #71717a;
  --color-slate-400: #a1a1aa;
  --color-slate-200: #e4e4e7;
  --color-slate-100: #f4f4f5;
  --color-white: #ffffff;
  --color-accent: #0d9488;
  --color-accent-hover: #0f766e;
  --color-accent-glow: rgba(13, 148, 136, 0.08);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Container */
  --container-max: 1200px;
  --container-narrow: 800px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-navy-800);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-sm) 0;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-navy-900);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin: 0 0 var(--space-sm) 0;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

img {
  max-width: 100%;
  height: auto;
}

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

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

section {
  padding: var(--space-3xl) 0;
}

/* ============================================
   Header & Navigation
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-slate-200);
}

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

.header__cta {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-white);
  background: var(--color-navy-900);
  border-radius: 6px;
  transition: background 0.2s ease;
}

.header__cta:hover {
  color: var(--color-white);
  background: var(--color-navy-700);
}

/* ============================================
   Logo / Wordmark
   ============================================ */
.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.logo__icon {
  width: 36px;
  height: 36px;
  position: relative;
}

/* Keystone shape - the wedge that holds the arch */
.logo__icon::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 32px solid var(--color-accent);
}

.logo__text {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-navy-900);
}

.logo__text span {
  color: var(--color-slate-500);
  font-weight: 400;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  position: relative;
  padding-top: calc(72px + var(--space-3xl) + 2rem);
  padding-bottom: calc(var(--space-3xl) + 2rem);
  background: linear-gradient(180deg, var(--color-slate-100) 0%, var(--color-white) 100%);
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  width: 45%;
  height: 120%;
  background: radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero__content {
  max-width: 520px;
}

.hero__title {
  font-size: 3.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: var(--space-md);
}

.hero__title strong {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-accent);
}

.hero__subtitle {
  font-size: 1.25rem;
  color: var(--color-slate-600);
  margin-bottom: var(--space-xl);
  max-width: 600px;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-white);
  background: var(--color-navy-900);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.hero__cta:hover {
  color: var(--color-white);
  background: var(--color-navy-700);
  transform: translateY(-1px);
}

.hero__cta svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   Problem Section
   ============================================ */
.problem {
  background: var(--color-white);
}

.problem__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.problem__label {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-slate-500);
  margin-bottom: var(--space-sm);
}

.problem__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 768px) {
  .problem__grid {
    grid-template-columns: 1fr;
  }
}

.problem__card {
  padding: var(--space-lg);
  background: var(--color-slate-100);
  border-radius: 12px;
  border: 1px solid var(--color-slate-200);
}

.problem__card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-white);
  border-radius: 10px;
  margin-bottom: var(--space-sm);
  color: var(--color-navy-800);
}

.problem__card-icon svg {
  width: 24px;
  height: 24px;
}

.problem__card h3 {
  font-size: 1.125rem;
  margin-bottom: var(--space-xs);
}

.problem__card p {
  font-size: 0.9375rem;
  color: var(--color-slate-600);
  margin: 0;
}

/* ============================================
   Solution Section
   ============================================ */
.solution {
  background: var(--color-navy-900);
  color: var(--color-white);
}

.solution__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.solution__header h2 {
  color: var(--color-white);
}

.solution__label {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-slate-400);
  margin-bottom: var(--space-sm);
}

.solution__description {
  font-size: 1.125rem;
  color: var(--color-slate-400);
  max-width: 600px;
  margin: 0 auto;
}

.solution__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  overflow: visible;
  padding-top: 2rem;
}

.solution__card {
  position: relative;
  padding: var(--space-lg);
  padding-top: 3rem;
  padding-left: 2.5rem;
  min-height: 180px;
  background: var(--color-navy-800);
  border-radius: 12px;
  border: 1px solid var(--color-navy-700);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.solution__card::before {
  content: attr(data-number);
  position: absolute;
  top: -1.75rem;
  left: -1rem;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-accent);
}

.solution__card h3 {
  font-size: 1.125rem;
  color: var(--color-white);
  margin-bottom: var(--space-xs);
  white-space: nowrap;
}

.solution__card p {
  font-size: 0.9375rem;
  color: var(--color-slate-400);
  margin: 0;
}

/* ============================================
   Technology Section
   ============================================ */
.technology {
  background: var(--color-slate-100);
}

.technology__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.technology__label {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-slate-500);
  margin-bottom: var(--space-sm);
}

.technology__description {
  font-size: 1.125rem;
  color: var(--color-slate-600);
  max-width: 600px;
  margin: 0 auto;
}

.technology__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

@media (max-width: 768px) {
  .technology__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.technology__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-lg);
  background: var(--color-white);
  border-radius: 12px;
  border: 1px solid var(--color-slate-200);
  text-align: center;
}

.technology__item-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
  color: var(--color-navy-800);
}

.technology__item-icon svg {
  width: 40px;
  height: 40px;
}

.technology__item h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.technology__item p {
  font-size: 0.875rem;
  color: var(--color-slate-500);
  margin: 0;
}

/* ============================================
   Benefits Section
   ============================================ */
.benefits {
  background: var(--color-white);
}

.benefits__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.benefits__label {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-slate-500);
  margin-bottom: var(--space-sm);
}

.benefits__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 768px) {
  .benefits__grid {
    grid-template-columns: 1fr;
  }
}

.benefits__card {
  padding: var(--space-lg);
  border-radius: 12px;
  border: 1px solid var(--color-slate-200);
}

.benefits__card-role {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.benefits__card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.benefits__card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.benefits__card li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  color: var(--color-slate-600);
}

.benefits__card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
}

/* ============================================
   CTA Section
   ============================================ */
.cta {
  background: linear-gradient(180deg, var(--color-white) 0%, var(--color-slate-100) 100%);
}

.cta__inner {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.cta__title {
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
}

.cta__description {
  font-size: 1.125rem;
  color: var(--color-slate-600);
  margin-bottom: var(--space-xl);
}

.cta__button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-white);
  background: var(--color-navy-900);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.cta__button:hover {
  color: var(--color-white);
  background: var(--color-navy-700);
  transform: translateY(-1px);
}

.cta__button svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: var(--space-xl) 0;
  background: var(--color-navy-900);
  color: var(--color-slate-400);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 640px) {
  .footer__inner {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer__logo-icon {
  width: 24px;
  height: 24px;
  position: relative;
}

.footer__logo-icon::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 22px solid var(--color-slate-400);
}

.footer__logo-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-slate-400);
}

.footer__copyright {
  font-size: 0.875rem;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }

  .hero__title {
    font-size: 2.5rem;
  }

  .hero__title strong {
    font-size: 2.5rem;
  }

  .hero__subtitle {
    font-size: 1.125rem;
  }

  section {
    padding: var(--space-2xl) 0;
  }

  .cta__title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .hero__title {
    font-size: 2rem;
  }

  .container {
    padding: 0 var(--space-sm);
  }
}

/* ============================================
   Scroll Animations
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for grid children */
.fade-in-stagger > *:nth-child(1) { transition-delay: 0ms; }
.fade-in-stagger > *:nth-child(2) { transition-delay: 100ms; }
.fade-in-stagger > *:nth-child(3) { transition-delay: 200ms; }
.fade-in-stagger > *:nth-child(4) { transition-delay: 300ms; }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
