/* ============================================================
   Sella Health — landing page
   Brand tokens lifted from the prototype's design system,
   adapted for marketing-display scale.
   ============================================================ */

:root {
  /* Brand */
  --primary-500: #E96424;
  --primary-600: #D54E0E;
  --primary-700: #B23E08;

  /* Cool ink (text) */
  --cool-700: #2D2942;
  --cool-500: #3D3A55;
  --cool-400: #58566A;
  --cool-300: #8A8893;
  --cool-200: #BEBDC4;
  --cool-100: #DDDDE1;
  --cool-50:  #F0F0F2;

  /* Warm canvas (surfaces) */
  --warm-50:  #FFFFFF;
  --warm-100: #F2EFEC;
  --warm-200: #DDDAD4;
  --warm-300: #BAB6AE;

  /* Semantic accents (used sparingly — never as fills on big areas) */
  --success-500: #2E9667;
  --warning-500: #F7A337;
  --warning-700: #C77A0E;
  --error-500: #E94B4B;

  /* Rhythm */
  --section-y: 144px;
  --section-y-tight: 96px;
  --container-max: 1200px;
  --container-pad: 32px;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Type scale */
  --t-mega:    clamp(56px, 9.5vw, 112px);   /* hero H1 */
  --t-h2:      clamp(36px, 5.6vw, 64px);    /* section H2 */
  --t-h2-edit: clamp(28px, 3.4vw, 40px);    /* editorial / softer H2 */
  --t-h3:      clamp(20px, 2.4vw, 26px);
  --t-lede:    clamp(17px, 1.5vw, 20px);
  --t-body:    17px;
  --t-small:   15px;
  --t-eyebrow: 11px;
}

* { box-sizing: border-box; }
*:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 3px;
  border-radius: 3px;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.55;
  color: var(--cool-700);
  background: var(--warm-100);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Atmospheric canvas — quiet radial wash from the upper-left */
body {
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.7), transparent 55%),
    radial-gradient(circle at 92% 18%, rgba(233, 100, 36, 0.04), transparent 50%),
    var(--warm-100);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img, svg { max-width: 100%; display: block; }

/* ============================================================
   Layout primitives
   ============================================================ */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  position: relative;
}

.section-header {
  max-width: 720px;
  margin-bottom: 72px;
}
.section-lede {
  font-size: var(--t-lede);
  color: var(--cool-400);
  margin: 24px 0 0;
  max-width: 56ch;
  line-height: 1.5;
}

/* ============================================================
   Typography
   ============================================================ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 1.8px;
  color: var(--cool-400);
  margin: 0 0 24px;
  text-transform: uppercase;
}
.eyebrow__pip {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-500);
}
.eyebrow__pip--neutral { background: var(--cool-300); }
.eyebrow--inverted { color: rgba(242, 239, 236, 0.6); }

/* The recurring orange answer-dot — used as period replacement on H1/H2/etc */
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-500);
  margin-left: 4px;
  vertical-align: 6px;
}
.dot--md { width: 14px; height: 14px; vertical-align: 8px; }
.dot--lg { width: 24px; height: 24px; margin-left: 10px; vertical-align: 14px; }

.section-h2 {
  font-size: var(--t-h2);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0;
  color: var(--cool-700);
  max-width: 22ch;
}
.section-h2--editorial {
  font-size: var(--t-h2-edit);
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.18;
  max-width: 32ch;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: 12px;
  transition:
    background 180ms var(--ease-out),
    color 180ms var(--ease-out),
    border-color 180ms var(--ease-out),
    transform 180ms var(--ease-out);
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn--lg {
  padding: 16px 26px;
  font-size: 15.5px;
  border-radius: 14px;
}

.btn--primary {
  background: var(--cool-700);
  color: var(--warm-50);
}
.btn--primary:hover {
  background: var(--cool-500);
  transform: translateY(-1px);
}
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
  background: transparent;
  color: var(--cool-700);
  border: 1px solid var(--cool-200);
}
.btn--ghost:hover {
  border-color: var(--cool-700);
  background: var(--warm-50);
}
.btn__arrow {
  display: inline-block;
  transition: transform 180ms var(--ease-out);
}
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ============================================================
   NAV
   ============================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--container-pad);
  background: rgba(242, 239, 236, 0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease-out), background 200ms var(--ease-out);
}
.nav.is-scrolled {
  border-bottom-color: rgba(141, 136, 147, 0.16);
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--cool-700);
}
.nav__mark {
  width: 18px;
  height: 32px;
  display: block;
}
.nav__wordmark {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--cool-700);
}

.nav__cta {
  padding: 10px 18px;
  font-size: 14px;
  border-radius: 10px;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding-top: 168px;
  padding-bottom: 120px;
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero__copy { max-width: 600px; }

.hero__title {
  font-size: var(--t-mega);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.96;
  color: var(--cool-700);
  margin: 0 0 32px;
}

.hero__sub {
  font-size: var(--t-lede);
  color: var(--cool-400);
  line-height: 1.5;
  margin: 0 0 40px;
  max-width: 52ch;
}

.hero__ctas {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.hero__trust {
  font-size: 13px;
  color: var(--cool-300);
  margin: 0;
  letter-spacing: 0.1px;
}

.hero__art {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero__art-frame {
  width: 100%;
  max-width: 420px;
  position: relative;
}
.hero__art-frame::before {
  content: "";
  position: absolute;
  inset: -40px -60px -60px -60px;
  background:
    radial-gradient(circle at 30% 30%, rgba(233, 100, 36, 0.08), transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(75, 108, 233, 0.04), transparent 60%);
  z-index: -1;
}

/* ============================================================
   PROBLEM
   ============================================================ */

.problem {
  background: var(--warm-50);
  border-top: 1px solid var(--cool-100);
  border-bottom: 1px solid var(--cool-100);
}

.problem__body {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px;
  max-width: 1000px;
}
.problem__body p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--cool-500);
  margin: 0;
}
.problem__verdict {
  grid-column: 1 / -1;
  font-weight: 500;
  color: var(--cool-700) !important;
  font-size: 20px !important;
  border-top: 1px solid var(--cool-100);
  padding-top: 36px;
}

/* ============================================================
   PRODUCT
   ============================================================ */

.cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 88px;
}
.card-shell {
  background: var(--warm-50);
  border: 1px solid var(--cool-100);
  border-radius: 24px;
  padding: 18px;
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}
.card-shell:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(45, 41, 66, 0.08), 0 4px 8px rgba(45, 41, 66, 0.04);
}
.card-shell img {
  width: 100%;
  height: auto;
  display: block;
}

.system-error-note {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  align-items: center;
  border-top: 1px dashed var(--cool-200);
  padding-top: 72px;
}
.sysnote__h {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.18;
  margin: 0 0 16px;
  max-width: 26ch;
}
.sysnote__body {
  font-size: 17px;
  color: var(--cool-400);
  line-height: 1.55;
  margin: 0;
  max-width: 56ch;
}
.sysnote__body em {
  color: var(--cool-700);
  font-style: italic;
  font-weight: 500;
}
.system-error-note__art img {
  width: 100%;
  max-width: 320px;
  margin-left: auto;
}

/* ============================================================
   POSITIONING
   ============================================================ */

.comparison {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--cool-100);
}
.compare-item {
  padding: 40px 36px 40px 0;
  border-right: 1px solid var(--cool-100);
}
.compare-item:last-child { border-right: none; }
.compare-item:not(:first-child) { padding-left: 36px; }
.compare-item__h {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--cool-300);
  margin: 0 0 16px;
  font-style: italic;
}
.compare-item__body {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--cool-700);
  margin: 0;
}

/* ============================================================
   HOW IT WORKS
   ============================================================ */

.how { background: var(--warm-50); border-top: 1px solid var(--cool-100); border-bottom: 1px solid var(--cool-100); }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  counter-reset: step;
}
.step {
  position: relative;
  padding-top: 48px;
  border-top: 1px solid var(--cool-100);
}
.step__num {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.4px;
  color: var(--primary-500);
  position: absolute;
  top: 0;
  left: 0;
  padding-top: 16px;
}
.step__h {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.25;
  margin: 0 0 16px;
}
.step__body {
  font-size: 16px;
  color: var(--cool-400);
  line-height: 1.55;
  margin: 0;
  max-width: 36ch;
}

/* ============================================================
   FIELD — feature grid
   ============================================================ */

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px 64px;
  border-top: 1px solid var(--cool-100);
  padding-top: 56px;
}
.feature__h {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.018em;
  margin: 0 0 12px;
  color: var(--cool-700);
}
.feature__body {
  font-size: 16px;
  color: var(--cool-400);
  line-height: 1.55;
  margin: 0;
  max-width: 50ch;
}

/* ============================================================
   MISSION — full-bleed brand moment, mirrors the canvas-mark composition
   ============================================================ */

.mission {
  padding: 0;
  background: var(--warm-100);
}
.mission__canvas {
  background: var(--cool-700);
  margin: 0 var(--container-pad);
  border-radius: 32px;
  padding: clamp(72px, 10vw, 144px) clamp(32px, 6vw, 96px);
  position: relative;
  overflow: hidden;
}
.mission__canvas::after {
  content: "";
  position: absolute;
  bottom: clamp(40px, 6vw, 80px);
  right: clamp(40px, 6vw, 80px);
  width: clamp(20px, 2.6vw, 32px);
  height: clamp(20px, 2.6vw, 32px);
  border-radius: 50%;
  background: var(--primary-500);
}
.mission__inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.mission__h {
  font-size: clamp(34px, 4.8vw, 64px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: var(--warm-100);
  margin: 0;
  max-width: 22ch;
}
/* ============================================================
   TRUST
   ============================================================ */

.trust__body {
  max-width: 760px;
  border-top: 1px solid var(--cool-100);
  padding-top: 48px;
}
.trust__body p {
  font-size: 19px;
  line-height: 1.55;
  color: var(--cool-500);
  margin: 0 0 24px;
}
.trust__roadmap { color: var(--cool-300) !important; font-size: 16px !important; }

/* ============================================================
   FINAL CTA
   ============================================================ */

.cta-final {
  background: var(--warm-50);
  border-top: 1px solid var(--cool-100);
  text-align: center;
}
.cta-final__inner {
  max-width: 720px;
  text-align: center;
  margin: 0 auto;
}
.cta-final__h {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 24px;
}
.cta-final__body {
  font-size: var(--t-lede);
  color: var(--cool-400);
  margin: 0 0 40px;
  line-height: 1.5;
}

/* ============================================================
   FOOTER
   ============================================================ */

.foot {
  padding: 56px 0 64px;
  border-top: 1px solid var(--cool-100);
  background: var(--warm-100);
}
.foot__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 48px;
  align-items: center;
}
.foot__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.foot__mark { width: 14px; height: 24px; display: block; }
.foot__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--cool-500);
}
.foot__nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.foot__nav a {
  font-size: 14px;
  color: var(--cool-400);
  transition: color 150ms var(--ease-out);
}
.foot__nav a:hover { color: var(--cool-700); }

.foot__copy {
  font-size: 13px;
  color: var(--cool-300);
  margin: 0;
  text-align: right;
}

/* ============================================================
   MODAL — qualifying form
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 41, 66, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 200ms var(--ease-out);
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--warm-50);
  border-radius: 22px;
  box-shadow: 0 32px 80px rgba(45, 41, 66, 0.24), 0 8px 16px rgba(45, 41, 66, 0.08);
  animation: panelIn 280ms var(--ease-out);
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
  color: var(--cool-400);
  transition: background 150ms var(--ease-out), color 150ms var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal__close:hover { background: var(--warm-100); color: var(--cool-700); }

.modal__body { padding: 40px 36px 36px; }
.modal__title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 12px;
}
.modal__lede {
  font-size: 15px;
  color: var(--cool-400);
  line-height: 1.5;
  margin: 0 0 28px;
}
.modal__lede a { color: var(--cool-700); border-bottom: 1px solid var(--cool-200); }

/* Form */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--cool-500);
  text-transform: uppercase;
}
.form__input {
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--cool-700);
  background: var(--warm-50);
  border: 1px solid var(--cool-200);
  border-radius: 10px;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
.form__input::placeholder { color: var(--cool-300); }
.form__input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(233, 100, 36, 0.15);
}
.form__select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%2358566A' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  padding-right: 36px;
}
.form__actions {
  margin-top: 8px;
  display: flex;
  gap: 12px;
}
.form__actions .btn { width: 100%; }
.form__fineprint {
  font-size: 12px;
  color: var(--cool-300);
  margin: 4px 0 0;
  line-height: 1.4;
}

/* ============================================================
   MOTION — page-load, scroll reveals
   ============================================================ */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroArtIn {
  from { opacity: 0; transform: translateY(24px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hero__copy > * {
  opacity: 0;
  animation: heroFadeUp 700ms var(--ease-out) forwards;
}
.hero__copy > *:nth-child(1) { animation-delay: 80ms; }
.hero__copy > *:nth-child(2) { animation-delay: 180ms; }
.hero__copy > *:nth-child(3) { animation-delay: 280ms; }
.hero__copy > *:nth-child(4) { animation-delay: 360ms; }
.hero__copy > *:nth-child(5) { animation-delay: 440ms; }

.hero__art {
  opacity: 0;
  animation: heroArtIn 900ms var(--ease-out) 320ms forwards;
}

/* Reveal-on-scroll utility, bound by IntersectionObserver in landing.js */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 720ms var(--ease-out), transform 720ms var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .hero__copy > *, .hero__art, .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  :root {
    --section-y: 112px;
    --section-y-tight: 80px;
  }
  .hero__inner { gap: 48px; }
}

@media (max-width: 880px) {
  :root {
    --section-y: 88px;
    --container-pad: 24px;
  }
  .hero {
    padding-top: 132px;
    padding-bottom: 80px;
  }
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .hero__art-frame { max-width: 320px; margin: 0 auto; }

  .problem__body { grid-template-columns: 1fr; gap: 28px; }
  .problem__verdict { padding-top: 28px; }

  .cards-row { grid-template-columns: 1fr; gap: 20px; }
  .system-error-note { grid-template-columns: 1fr; gap: 32px; padding-top: 56px; }
  .system-error-note__art img { margin: 0 auto; }

  .comparison { grid-template-columns: 1fr; }
  .compare-item {
    padding: 28px 0;
    border-right: none;
    border-bottom: 1px solid var(--cool-100);
  }
  .compare-item:not(:first-child) { padding-left: 0; }
  .compare-item:last-child { border-bottom: none; padding-bottom: 0; }

  .steps { grid-template-columns: 1fr; gap: 40px; }
  .features { grid-template-columns: 1fr; gap: 36px; padding-top: 40px; }

  .mission__canvas { margin: 0 var(--container-pad); border-radius: 24px; }

  .foot__inner {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
    justify-items: center;
  }
  .foot__copy { text-align: center; }
}

@media (max-width: 540px) {
  .nav { padding: 14px 18px; }
  .nav__cta { padding: 8px 14px; font-size: 13px; }
  .hero__title { line-height: 1.0; }
  .modal__body { padding: 32px 24px 28px; }
  .modal__title { font-size: 24px; }
}
