/* ==================================================
 * MSP Revenue Architecture — Global Styles
 * Mobile-first, component-driven design system
 * ================================================== */

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

/* ---- CSS Custom Properties ---- */
:root {
  /* Core Brand Colors */
  --primary: #7426FF;
  --neutral: #14191C;
  --body-text: #4F4E4E;
  --base: #F8F8F7;
  --white: #FFFFFF;
  --black: #000000;

  /* Primary (Violet) Scale */
  --primary-50: #EADEFF;
  --primary-100: #DDC9FF;
  --primary-200: #C2A0FF;
  --primary-300: #A878FF;
  --primary-400: #8E4FFF;
  --primary-500: #7426FF;
  --primary-600: #5500ED;
  --primary-700: #4100B5;
  --primary-800: #2D007D;
  --primary-900: #190045;
  --primary-950: #0F0029;

  /* Neutral Scale */
  --neutral-ultra-light: #f7f8f8;
  --neutral-light: #d5dadd;
  --neutral-semi-light: #9da9af;
  --neutral-500: #14191C;
  --neutral-semi-dark: #6f7d85;
  --neutral-dark: #394346;
  --neutral-ultra-dark: #151b1e;

  /* Base Scale */
  --base-ultra-light: #f8f8f7;
  --base-light: #dbdbd6;
  --base-semi-light: #acaca0;
  --base-500: #F2F2F0;
  --base-semi-dark: #5f5f53;
  --base-dark: #44443b;
  --base-ultra-dark: #1b1b18;

  /* Semantic Tokens */
  --background-color: var(--base);
  --text-color: var(--body-text);
  --heading-color: var(--neutral);
  --link-color: var(--primary);
  --link-hover-color: var(--primary-600);
  --button-bg-color: var(--primary);
  --button-text-color: var(--white);
  --border-color: var(--neutral-light);

  /* Typography */
  --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-size-base: 1rem;
  --line-height-base: 1.65;
  --line-height-heading: 1.2;

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

  /* Container */
  --container-max: 1200px;
  --container-padding: 1.5rem;

  /* Card system */
  --card-radius: 12px;
  --card-border: 2px solid var(--neutral);
  --card-shadow: 6px 6px 0px 0px var(--neutral);
  --card-shadow-hover: 9px 9px 0px 0px var(--neutral);
}

/* ---- Base ---- */
html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

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

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

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

/* ==================================================
 * Typography Rhythm (Lead Web Developer Spec)
 * ================================================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
  font-weight: 700;
  line-height: var(--line-height-heading);
}

h1 {
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.625rem;
  letter-spacing: -0.01em;
  margin-top: 3rem;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.25rem;
  line-height: 1.65;
  max-width: 70ch;
}

ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.35rem;
}

.content {
  max-width: 70ch;
}

.label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  display: block;
  margin-bottom: var(--space-xs);
}

.lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--neutral-semi-dark);
  max-width: 70ch;
}

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

/* Section Spacing */
section {
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

/* Section header: eyebrow + heading + description + CTA pattern */
.section__header {
  margin-bottom: var(--space-lg);
}

.section__header h2 {
  margin-top: 0;
}

.section__header p {
  margin-bottom: 0;
}

.section__footer {
  margin-top: var(--space-lg);
}

.section--dark {
  background-color: var(--neutral);
  color: var(--neutral-light);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--white);
}

.section--dark .label {
  color: var(--primary-200);
}

.section--dark p {
  color: var(--neutral-light);
}

.section--dark .lead {
  color: var(--neutral-light);
}

.section--tint {
  background-color: var(--base-500);
}

.section--violet {
  background-color: var(--primary-950);
  color: var(--primary-100);
}

.section--violet h2,
.section--violet h3 {
  color: var(--white);
}

.section--violet p {
  color: var(--primary-100);
}

.section--violet .lead {
  color: var(--primary-100);
}

.section--violet .label {
  color: var(--primary-300);
}

.grid {
  display: grid;
  gap: var(--space-md);
}

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

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

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

/* ==================================================
 * Buttons — Poke-Out Effect (same as cards)
 * Primary = violet fill, Secondary = outline
 * ================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-family);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  border: 2px solid var(--neutral);
  box-shadow: 4px 4px 0px 0px var(--neutral);
  transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              background-color 0.2s ease,
              border-color 0.2s ease;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px 0px var(--neutral);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0px 0px var(--neutral);
}

/* Primary: violet fill */
.btn--primary {
  background-color: var(--primary);
  color: var(--white);
  border-color: var(--neutral);
}

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

/* Secondary: outline */
.btn--secondary {
  background-color: var(--white);
  color: var(--neutral);
  border-color: var(--neutral);
}

.btn--secondary:hover {
  background-color: var(--neutral);
  color: var(--white);
}

/* Light variants for dark/violet sections */
.btn--outline-light {
  background-color: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.4);
  box-shadow: 4px 4px 0px 0px rgba(255,255,255,0.2);
}

.btn--outline-light:hover {
  background-color: rgba(255,255,255,0.1);
  border-color: var(--white);
  color: var(--white);
  box-shadow: 6px 6px 0px 0px rgba(255,255,255,0.3);
}

.btn--lg {
  padding: 1rem 2.25rem;
  font-size: 1rem;
}

.btn--sm {
  padding: 0.625rem 1.25rem;
  font-size: 0.8125rem;
  box-shadow: 3px 3px 0px 0px var(--neutral);
}

.btn--sm:hover {
  box-shadow: 5px 5px 0px 0px var(--neutral);
}

/* ==================================================
 * Card — ONE universal poke-out card
 * Structure: .card > .card__icon? + .card__content
 * .card__content: .label (eyebrow) + h3 + p
 * ================================================== */
.card {
  background-color: var(--white);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--card-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Scroll entrance — starts hidden */
  opacity: 0;
  transform: translateY(24px);
}

/* Visible state after scroll trigger */
.card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Hover: lift + grow shadow (same as buttons) */
.card.is-visible:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--card-shadow-hover);
}

/* Staggered entrance */
.grid .card:nth-child(2) { transition-delay: 0.1s; }
.grid .card:nth-child(3) { transition-delay: 0.2s; }
.grid .card:nth-child(4) { transition-delay: 0.3s; }

/* Card icon (heroicons) */
.card__icon {
  padding: var(--space-md) var(--space-md) 0;
}

.card__icon svg {
  width: 32px;
  height: 32px;
  color: var(--primary);
  stroke-width: 1.5;
}

/* Card content */
.card__content {
  padding: var(--space-md);
  flex: 1;
}

.card__content .label {
  margin-bottom: var(--space-xs);
}

.card__content h3 {
  margin-top: 0;
  margin-bottom: var(--space-xs);
}

.card__content p {
  margin-bottom: 0;
  color: var(--body-text);
  max-width: none;
}

/* When icon is present, reduce top padding on content */
.card__icon + .card__content {
  padding-top: var(--space-sm);
}

/* ==================================================
 * Pillar Block (with scroll animation)
 * ================================================== */
.pillar {
  padding: var(--space-md);
  border-left: 4px solid var(--primary);
  margin-bottom: var(--space-md);
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.pillar.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.pillar:nth-child(2) { transition-delay: 0.1s; }
.pillar:nth-child(3) { transition-delay: 0.2s; }

.pillar__number {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--space-xs);
}

.pillar h3 {
  margin-top: 0;
  margin-bottom: var(--space-xs);
}

/* ==================================================
 * Nav
 * ================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: rgba(248, 248, 247, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(20, 25, 28, 0.08);
}

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

.site-header__logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--neutral);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-header__logo span {
  color: var(--primary);
}

.site-nav {
  display: none;
  gap: var(--space-lg);
  align-items: center;
}

.site-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--neutral-semi-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--neutral);
}

/* Nav CTA — ensure white text on violet */
.site-nav .btn--primary {
  color: var(--white);
  margin-left: var(--space-sm);
}

.site-nav .btn--primary:hover {
  color: var(--white);
}

/* Mobile menu toggle */
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--neutral);
  transition: all 0.3s ease;
}

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--base);
  z-index: 99;
  padding: var(--space-lg) var(--container-padding);
  flex-direction: column;
  gap: var(--space-sm);
}

.mobile-nav.is-open {
  display: flex;
}

.mobile-nav a {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--neutral);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-color);
  display: block;
  text-decoration: none;
}

.mobile-nav .btn {
  margin-top: var(--space-sm);
  text-align: center;
}

/* ==================================================
 * Footer
 * ================================================== */
.site-footer {
  background-color: var(--neutral);
  color: var(--neutral-semi-light);
  padding: var(--space-xl) 0 var(--space-lg);
}

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

.site-footer h4 {
  color: var(--white);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0;
  margin-bottom: var(--space-sm);
}

.site-footer p {
  max-width: none;
  color: var(--neutral-semi-light);
}

.site-footer a {
  color: var(--neutral-semi-light);
  font-size: 0.875rem;
  display: block;
  margin-bottom: var(--space-xs);
}

.site-footer a:hover {
  color: var(--white);
}

.site-footer__bottom {
  border-top: 1px solid var(--neutral-dark);
  padding-top: var(--space-md);
  font-size: 0.8125rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.site-footer__bottom a {
  display: inline;
}

/* ==================================================
 * Hero
 * ================================================== */
.hero {
  padding: calc(64px + clamp(3rem, 6vw, 5rem)) 0 clamp(3rem, 6vw, 5rem);
  text-align: center;
}

.hero .label {
  margin-bottom: var(--space-sm);
}

.hero h1 {
  max-width: 720px;
  margin: 0 auto 1.5rem;
}

.hero h2 {
  margin-top: 0;
}

.hero .lead {
  max-width: 600px;
  margin: 0 auto var(--space-lg);
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
}

/* Hero dark */
.hero--dark {
  background-color: var(--neutral);
  color: var(--neutral-light);
}

.hero--dark h1 {
  color: var(--white);
}

.hero--dark .lead {
  color: var(--neutral-light);
}

.hero--dark .label {
  color: var(--primary-200);
}

/* ==================================================
 * Comparison Table
 * ================================================== */
.comparison-table {
  width: 100%;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.comparison-table th,
.comparison-table td {
  padding: var(--space-sm);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
  font-weight: 700;
  color: var(--neutral);
  background-color: var(--base-500);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.comparison-table td:first-child {
  font-weight: 600;
  color: var(--neutral);
}

/* ==================================================
 * Form
 * ================================================== */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--neutral);
  margin-bottom: var(--space-xs);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-family);
  font-size: 0.9375rem;
  border: 2px solid var(--neutral-light);
  border-radius: 8px;
  background-color: var(--white);
  color: var(--neutral);
  transition: border-color 0.2s ease;
}

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

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

.form-group .form-hint {
  font-size: 0.8125rem;
  color: var(--neutral-semi-dark);
  margin-top: 0.25rem;
}

/* ==================================================
 * Step list
 * ================================================== */
.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.steps li {
  counter-increment: step;
  padding: var(--space-md) 0;
  padding-left: 3.5rem;
  position: relative;
  border-bottom: 1px solid var(--border-color);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: var(--space-md);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.steps li h4 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

/* ==================================================
 * Bento Grid
 * ================================================== */
.bento {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

/* The featured/hero card spans full width and gets a highlight */
.bento__featured {
  background-color: var(--primary-950);
  border-color: var(--primary-700);
  box-shadow: 6px 6px 0px 0px var(--primary-700);
}

.bento__featured .card__icon svg {
  color: var(--primary-200);
}

.bento__featured .card__content .label {
  color: var(--primary-300);
}

.bento__featured .card__content h3 {
  color: var(--white);
}

.bento__featured .card__content p {
  color: var(--primary-100);
}

.bento__featured.is-visible:hover {
  box-shadow: 9px 9px 0px 0px var(--primary-700);
}

@media (min-width: 640px) {
  .bento {
    grid-template-columns: repeat(3, 1fr);
  }

  .bento__featured {
    grid-column: 1 / -1;
  }
}

/* ==================================================
 * About: Bio layout with photo
 * ================================================== */
.bio {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.bio__photo {
  width: 100%;
  max-width: 320px;
  border-radius: var(--card-radius);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}

@media (min-width: 640px) {
  .bio {
    flex-direction: row;
    align-items: flex-start;
  }

  .bio__photo {
    flex-shrink: 0;
    width: 280px;
  }

  .bio__text {
    flex: 1;
  }
}

/* ==================================================
 * Blockquote
 * ================================================== */
blockquote {
  border-left: 4px solid var(--primary);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  font-style: italic;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--neutral-semi-dark);
}

blockquote p {
  max-width: none;
  margin-bottom: var(--space-sm);
}

blockquote cite {
  font-style: normal;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--neutral);
  display: block;
  margin-top: var(--space-sm);
}

/* ==================================================
 * Divider
 * ================================================== */
.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: var(--space-lg) 0;
}

/* ==================================================
 * Utility
 * ================================================== */
.text-center { text-align: center; }
.text-center p { margin-left: auto; margin-right: auto; }
.text-left { text-align: left; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card,
  .pillar {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .card:hover,
  .btn:hover {
    transform: none;
  }
}

/* ==================================================
 * Responsive: Tablet (640px+)
 * ================================================== */
@media (min-width: 640px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.375rem; }

  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }

  .hero__actions {
    flex-direction: row;
    justify-content: center;
  }

  .site-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ==================================================
 * Responsive: Desktop (960px+)
 * ================================================== */
@media (min-width: 960px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 2.25rem; }

  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }

  .site-nav {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

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