/* ===========================================================================
   FulPulse — marketing site stylesheet
   Faithful, static implementation of the FulPulse Design System.
   Tokens → base layer → components (button/badge/card/logo) → page layout.
   Calm, flat SaaS: flat fills, hairline borders, two text weights, no gradients.
   =========================================================================== */

/* ===========================  TOKENS  ===================================== */
:root {
  /* --- Brand blue ramp --- */
  --blue-50:  #E8EEFC;   /* badges, soft fills, tint backgrounds */
  --blue-100: #D3E0FA;
  --blue-200: #AEC5F4;
  --blue-300: #7FA1ED;
  --blue-400: #5685E9;
  --blue-500: #3B6FE5;   /* PRIMARY — links, primary CTAs */
  --blue-600: #2B52B0;   /* hover / active / pressed */
  --blue-700: #214191;

  /* --- Neutrals (navy → white) --- */
  --navy-900: #0F1729;   /* footer, dark sections */
  --ink-900:  #1A2438;   /* headings + body text */
  --ink-700:  #313B52;
  --muted-500:#5A6478;   /* secondary / supporting text */
  --muted-400:#8A93A6;   /* tertiary, placeholders, meta */
  --line-300: #D9E0EC;   /* hairline borders (0.5px) */
  --line-200: #E6EAF2;   /* soft dividers */
  --surface-50:#F6F8FC;  /* alternating section backgrounds */
  --white:    #FFFFFF;   /* base, cards */

  /* --- Semantic status (calm, low-saturation) --- */
  --green-600:#1E8F63;  --green-50:#E4F4EC;
  --amber-600:#B7791F;  --amber-50:#FBF1DE;
  --red-600:  #C7453F;  --red-50:  #FBE9E8;

  /* --- Semantic aliases --- */
  --color-brand:        var(--blue-500);
  --color-brand-hover:  var(--blue-600);
  --color-brand-active: var(--blue-700);
  --color-brand-tint:   var(--blue-50);

  --text-heading:  var(--ink-900);
  --text-body:     var(--ink-700);
  --text-muted:    var(--muted-500);
  --text-subtle:   var(--muted-400);
  --text-on-dark:  var(--white);
  --text-on-dark-muted: #AEB7CC;
  --text-link:     var(--blue-500);
  --text-link-hover: var(--blue-600);

  --surface-base:  var(--white);
  --surface-alt:   var(--surface-50);
  --surface-card:  var(--white);
  --surface-dark:  var(--navy-900);
  --surface-tint:  var(--blue-50);

  --border-hairline: var(--line-300);
  --border-soft:     var(--line-200);
  --border-strong:   #C3CCDC;
  --border-on-dark:  rgba(255,255,255,0.12);

  --focus-ring: rgba(59,111,229,0.35);

  /* --- Typography --- */
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-logo:    600;   /* wordmark lockup only */

  --text-display:   56px;  --lh-display: 1.04;  --ls-display: -0.022em;
  --text-h1:        40px;  --lh-h1:      1.08;  --ls-h1:      -0.02em;
  --text-h2:        32px;  --lh-h2:      1.14;  --ls-h2:      -0.018em;
  --text-h3:        24px;  --lh-h3:      1.25;  --ls-h3:      -0.012em;
  --text-h4:        20px;  --lh-h4:      1.35;  --ls-h4:      -0.008em;
  --text-body-lg:   18px;  --lh-body-lg: 1.6;   --ls-body-lg: -0.003em;
  --text-body-base: 16px;  --lh-body:    1.65;
  --text-sm:        14px;  --lh-sm:      1.55;
  --text-xs:        13px;  --lh-xs:      1.45;
  --text-overline:  12px;  --lh-overline:1.3;   --ls-overline: 0.08em;

  /* --- Spacing & layout (4px grid) --- */
  --container-max: 1120px;
  --container-narrow: 720px;
  --section-y: 96px;
  --gutter: 24px;

  /* --- Radius / borders / elevation --- */
  --radius-xs:  4px;
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(15,23,41,0.05);
  --shadow-sm: 0 1px 3px rgba(15,23,41,0.06), 0 1px 2px rgba(15,23,41,0.04);
  --shadow-md: 0 4px 16px rgba(15,23,41,0.08), 0 1px 3px rgba(15,23,41,0.05);
  --shadow-lg: 0 12px 32px rgba(15,23,41,0.12), 0 2px 8px rgba(15,23,41,0.06);
  --shadow-focus: 0 0 0 3px var(--focus-ring);
}

/* ===========================  BASE LAYER  ================================= */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  font-size: var(--text-body-base);
  line-height: var(--lh-body);
  color: var(--text-body);
  background: var(--surface-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv01','ss01';
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--text-heading);
  font-weight: var(--weight-medium);
  letter-spacing: -0.02em;
}

p { margin: 0; }

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

img, svg { display: block; }

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

::selection { background: var(--blue-100); color: var(--ink-900); }

code, pre, kbd, samp { font-family: var(--font-mono); }

/* Accessibility helpers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 16px; top: -48px;
  z-index: 100;
  background: var(--color-brand);
  color: var(--white);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font: var(--weight-medium) 14px var(--font-sans);
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; color: var(--white); }

/* ===========================  LAYOUT  ==================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.eyebrow {
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  font-size: var(--text-overline);
  line-height: var(--lh-overline);
  letter-spacing: var(--ls-overline);
  text-transform: uppercase;
  color: var(--color-brand);
}

/* ===========================  LOGO  ====================================== */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;                 /* size(24) * 0.42 */
  font-family: var(--font-sans);
  font-weight: var(--weight-logo);
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.03em;
  user-select: none;
}
.logo:hover { color: inherit; }
.logo__mark {
  width: 22px; height: 22px;       /* size * 0.92 */
  border-radius: 6px;              /* size * 0.26 */
  background: var(--color-brand);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 14px;                 /* size * 0.6 */
}
.logo__word { white-space: nowrap; }
.logo__ful   { color: var(--ink-900); }
.logo__pulse { color: var(--color-brand); }
.logo--dark .logo__ful { color: var(--white); }

/* ===========================  BUTTON  ==================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  font-size: 15px;
  line-height: 1;
  letter-spacing: -0.005em;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { color: inherit; }

/* sizes */
.btn--sm { height: 34px; padding: 0 12px; font-size: 14px; gap: 6px; border-radius: var(--radius-sm); }
.btn--lg { height: 48px; padding: 0 22px; font-size: 16px; gap: 8px; }

/* variants */
.btn--primary   { background: var(--color-brand); color: var(--white); border-color: transparent; }
.btn--primary:hover { background: var(--color-brand-hover); color: var(--white); }

.btn--secondary { background: var(--white); color: var(--text-heading); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-alt); color: var(--text-heading); }

.btn--ghost     { background: transparent; color: var(--text-body); border-color: transparent; }
.btn--ghost:hover { background: var(--surface-alt); color: var(--text-body); }

.btn__icon { display: inline-flex; }
.btn__icon svg { width: 16px; height: 16px; }

/* ===========================  BADGE  ===================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: -0.002em;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  white-space: nowrap;
}
.badge--brand { background: var(--color-brand-tint); color: var(--blue-700); }
.badge__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-brand);
  flex: 0 0 auto;
}

/* ===========================  CARD  ====================================== */
.card {
  background: var(--surface-card);
  border: 0.5px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 32px;                 /* padding "lg" = space-8 */
  box-shadow: none;
}

/* ===========================  HEADER  ==================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.82);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 0.5px solid var(--border-hairline);
}
.site-header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav a {
  font: var(--weight-regular) 15px var(--font-sans);
  color: var(--text-body);
}
.site-nav a:hover { color: var(--text-heading); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-heading);
}
.nav-toggle:hover { background: var(--surface-alt); }
.nav-toggle svg { width: 22px; height: 22px; }

/* ===========================  HERO  ====================================== */
.hero {
  background: var(--surface-base);
  padding: 72px var(--gutter) 88px;
}
.hero__inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero h1 {
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  font-size: clamp(2rem, 1.1rem + 4.4vw, 3.5rem);   /* 32px → 56px */
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  color: var(--text-heading);
  margin: 22px 0 0;
  text-wrap: balance;
}
.hero__subhead {
  font: var(--weight-regular) var(--text-body-lg)/var(--lh-body-lg) var(--font-sans);
  color: var(--text-muted);
  max-width: 560px;
  margin: 20px 0 0;
  text-wrap: pretty;
}
.hero__cta {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ===========================  FEATURES  ================================== */
.features {
  padding: var(--section-y) var(--gutter);
  background: var(--surface-alt);
}
.section-head { max-width: 560px; margin-bottom: 48px; }
.section-head h2 {
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2rem);  /* 28px → 32px */
  line-height: var(--lh-h2);
  letter-spacing: var(--ls-h2);
  color: var(--text-heading);
  margin: 12px 0 0;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature__icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--blue-50);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.feature__icon svg { width: 20px; height: 20px; color: var(--color-brand); }
.feature h3 {
  font: var(--weight-medium) var(--text-h4)/var(--lh-h4) var(--font-sans);
  letter-spacing: -0.01em;
  color: var(--text-heading);
  margin: 0 0 8px;
}
.feature p {
  font: var(--weight-regular) 15px/1.6 var(--font-sans);
  color: var(--text-muted);
  margin: 0;
}

/* ===========================  CTA BAND  ================================== */
.cta-band { padding: var(--section-y) var(--gutter); }
.cta-band__box {
  background: var(--navy-900);
  border-radius: var(--radius-xl);
  padding: 64px 48px;
  text-align: center;
}
.cta-band__box h2 {
  font: var(--weight-medium) var(--text-h1)/var(--lh-h1) var(--font-sans);
  letter-spacing: var(--ls-h1);
  color: #fff;
  margin: 0;
  text-wrap: balance;
}
.cta-band__box p {
  font: var(--weight-regular) var(--text-body-lg)/var(--lh-body-lg) var(--font-sans);
  color: var(--text-on-dark-muted);
  margin: 16px auto 0;
  max-width: 460px;
}
.cta-band__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 30px;
}

/* ===========================  FOOTER  ==================================== */
.site-footer {
  background: var(--navy-900);
  color: var(--text-on-dark-muted);
  padding: 56px var(--gutter) 40px;
}
.site-footer__top {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}
.footer-brand { max-width: 280px; }
.footer-brand p {
  font: var(--weight-regular) 14px/1.6 var(--font-sans);
  color: var(--text-on-dark-muted);
  margin: 16px 0 0;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-col__title {
  font: var(--weight-medium) 13px var(--font-sans);
  color: #fff;
  margin-bottom: 4px;
}
.footer-col a,
.footer-col span {
  font: var(--weight-regular) 14px var(--font-sans);
  color: var(--text-on-dark-muted);
}
.footer-col a:hover { color: #fff; }
.footer-col span { line-height: 1.5; }
.site-footer__bottom {
  max-width: var(--container-max);
  margin: 40px auto 0;
  border-top: 1px solid var(--border-on-dark);
  padding-top: 24px;
  font: var(--weight-regular) 13px var(--font-sans);
  color: var(--text-on-dark-muted);
}

/* ===========================  LEGAL PAGE  ================================ */
.legal {
  background: var(--surface-base);
  min-height: 70vh;
  padding-top: 56px;
  padding-bottom: 96px;
}
.legal__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: var(--weight-regular) 14px var(--font-sans);
  color: var(--text-link);
  margin-bottom: 28px;
}
.legal__back svg { width: 15px; height: 15px; }
.legal h1 {
  font: var(--weight-medium) var(--text-h1)/var(--lh-h1) var(--font-sans);
  letter-spacing: var(--ls-h1);
  color: var(--text-heading);
  margin: 0;
}
.legal__updated {
  font: var(--weight-regular) 14px var(--font-sans);
  color: var(--text-subtle);
  margin-top: 12px;
}
.legal__intro {
  font: var(--weight-regular) var(--text-body-lg)/var(--lh-body-lg) var(--font-sans);
  color: var(--text-body);
  margin: 28px 0 0;
}
.legal__section { margin-top: 36px; }
.legal__section h2 {
  font: var(--weight-medium) var(--text-h4)/var(--lh-h4) var(--font-sans);
  color: var(--text-heading);
  margin: 0 0 10px;
}
.legal__section p {
  font: var(--weight-regular) var(--text-body-base)/var(--lh-body) var(--font-sans);
  color: var(--text-body);
  margin: 0;
}

/* ===========================  MODAL  ===================================== */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
}
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,41,0.45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: modal-fade 0.18s ease;
}
.modal__panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 2 * var(--gutter));
  overflow-y: auto;
  background: var(--surface-card);
  border: 0.5px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  animation: modal-rise 0.2s ease;
}
.modal__close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal__close:hover { background: var(--surface-alt); color: var(--text-heading); }
.modal__close svg { width: 18px; height: 18px; }
.modal__title {
  font: var(--weight-medium) var(--text-h3)/var(--lh-h3) var(--font-sans);
  letter-spacing: var(--ls-h3);
  color: var(--text-heading);
  margin: 16px 0 0;
  text-wrap: balance;
}
.modal__desc {
  font: var(--weight-regular) 15px/1.6 var(--font-sans);
  color: var(--text-muted);
  margin: 10px 0 0;
}
.modal__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font: var(--weight-medium) 13px var(--font-sans);
  color: var(--text-heading);
}
.field input,
.field textarea {
  font: var(--weight-regular) 15px var(--font-sans);
  color: var(--text-body);
  background: var(--surface-base);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-subtle); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: var(--shadow-focus);
}
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--red-600); }
.modal__submit { width: 100%; margin-top: 4px; }
.modal__hint {
  font: var(--weight-regular) var(--text-xs)/var(--lh-xs) var(--font-sans);
  color: var(--text-subtle);
  text-align: center;
  margin: 0;
}
body.modal-open { overflow: hidden; }

@keyframes modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modal-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .modal__panel { padding: 24px; }
}

/* ===========================  RESPONSIVE  ================================ */
@media (max-width: 860px) {
  .feature-grid { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 768px) {
  :root { --section-y: 72px; }

  .site-nav,
  .header-actions { display: none; }
  .nav-toggle { display: inline-flex; }

  /* Mobile drop panel */
  .site-header.is-open .mobile-menu { display: flex; }
  .mobile-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 12px var(--gutter) 20px;
    background: rgba(255,255,255,0.97);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 0.5px solid var(--border-hairline);
  }
  /* Plain nav links only — must NOT recolor the .btn anchors (Sign in / Request demo),
     or the primary button's white label gets overridden to dark ink. */
  .mobile-menu a:not(.btn) {
    font: var(--weight-regular) 16px var(--font-sans);
    color: var(--text-body);
    padding: 10px 0;
  }
  .mobile-menu a:not(.btn):hover { color: var(--text-heading); }
  .mobile-menu .btn { margin-top: 8px; width: 100%; }

  .hero { padding: 56px var(--gutter) 64px; }
  .cta-band__box { padding: 48px 24px; }
  .cta-band__box h2 { font-size: var(--text-h2); line-height: var(--lh-h2); }
}

/* Desktop: mobile menu never shows */
@media (min-width: 769px) {
  .mobile-menu { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
