/* Nuvela Health landing page.
   Colors, spacing, radii, shadows and type styles come only from assets/brand/tokens.css
   (copied unchanged from brand/tokens/ by scripts/sync-brand.sh). */

@font-face {
  font-family: "Red Hat Display";
  src: url("assets/fonts/RedHatDisplay-VF.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Red Hat Text";
  src: url("assets/fonts/RedHatText-VF.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* Layout width, derived from spacing tokens (18 x 64px = 1152px). */
:root {
  --container: calc(var(--space-8) * 18);
  --touch-min: 44px; /* WCAG / brand: touch targets at least 44 x 44 px */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, figure {
  margin: 0;
}

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

a {
  color: var(--brand-ink);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.muted {
  color: var(--ink-muted);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  z-index: 10;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-raised);
  color: var(--brand-ink);
  border-radius: var(--radius-pill);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Buttons: pills, solid brand blue, no gradient (brand rule). */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch-min);
  padding: var(--space-3) var(--space-5);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
}

.btn-primary:hover {
  background: var(--brand-hover);
}

.btn-secondary {
  background: var(--surface-raised);
  color: var(--brand-ink);
  border-color: var(--brand);
}

.btn-secondary:hover {
  background: var(--brand-soft);
}

/* On the brand gradient: white button with blue text, or white outline. */
.btn-on-brand {
  background: var(--surface-raised);
  color: var(--brand-ink);
}

.btn-on-brand:hover {
  background: var(--brand-soft);
}

.btn-on-brand-outline {
  background: transparent;
  color: var(--on-brand);
  border-color: var(--on-brand);
}

.btn-on-brand-outline:hover {
  background: var(--on-brand);
  color: var(--brand-ink);
}

.hero :focus-visible,
.cta :focus-visible,
.footer :focus-visible {
  outline-color: var(--on-brand);
}

/* Hero on the brand gradient */
.hero {
  background: var(--gradient-brand);
  color: var(--on-brand);
  padding-bottom: var(--space-8);
}

.hero a:not(.btn) {
  color: var(--on-brand);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) 0;
}

.topbar-logo {
  display: inline-block;
  /* Protection zone around the logo */
  padding: var(--space-2) 0;
}

.hero-grid {
  display: grid;
  gap: var(--space-7);
  align-items: center;
  padding-top: var(--space-7);
}

.hero-copy {
  display: grid;
  gap: var(--space-5);
  max-width: calc(var(--space-8) * 9);
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* Mint as accent dot, never as text */
.hero-status::before {
  content: "";
  width: var(--space-2);
  height: var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--mint);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* App illustration */
.phone {
  justify-self: center;
  width: 100%;
  max-width: calc(var(--space-8) * 5);
  display: grid;
  gap: var(--space-3);
  text-align: center;
}

.phone-screen {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-5);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  border-radius: var(--radius-xl);
  border: var(--space-2) solid var(--surface-raised);
  box-shadow: var(--shadow-md);
}

.phone-muted {
  color: var(--ink-muted);
}

.progress {
  height: var(--space-3);
  background: var(--brand-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar {
  display: block;
  width: 72%;
  height: 100%;
  background: var(--brand);
  border-radius: var(--radius-pill);
}

.phone-section {
  margin-top: var(--space-3);
}

.phone-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.phone-list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.phone-cta {
  margin-top: var(--space-2);
  cursor: default;
}

/* Sections */
.section {
  padding: var(--space-8) 0;
}

.section-sunken {
  background: var(--surface-sunken);
}

.section-kicker {
  color: var(--brand-ink);
  margin-bottom: var(--space-3);
}

.section-title {
  max-width: calc(var(--space-8) * 12);
  margin-bottom: var(--space-7);
}

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

.card {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card .body {
  color: var(--ink-muted);
}

.card-icon {
  box-sizing: content-box;
  padding: var(--space-3);
  background: var(--brand-soft);
  border-radius: var(--radius-md);
}

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

.split .section-title {
  margin-bottom: var(--space-4);
}

.checklist {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.checklist li {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  padding: var(--space-5);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.checklist img {
  flex-shrink: 0;
  margin-top: var(--space-1);
}

.panel {
  display: grid;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-6);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.panel .heading-1 {
  margin-bottom: var(--space-3);
}

.panel .btn {
  justify-self: start;
}

/* Final call to action on the brand gradient */
.cta {
  background: var(--gradient-brand);
  color: var(--on-brand);
  padding: var(--space-8) 0;
}

.cta-inner {
  display: grid;
  gap: var(--space-5);
  justify-items: center;
  text-align: center;
}

.cta-inner .body-lg {
  max-width: calc(var(--space-8) * 9);
}

/* Footer on deep blue */
.footer {
  background: var(--brand-deep);
  color: var(--on-brand);
  padding: var(--space-7) 0;
}

.footer a {
  color: var(--on-brand);
}

.footer-inner {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}

.footer-inner > div {
  display: grid;
  gap: var(--space-4);
}

.footer-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
}

/* Legal pages */
.legal-header {
  background: var(--gradient-brand);
}

.legal {
  padding: var(--space-7) 0 var(--space-8);
}

.legal .container {
  max-width: calc(var(--space-8) * 12);
  display: grid;
  gap: var(--space-4);
}

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

.legal h2 {
  margin-top: var(--space-5);
}

.legal h3 {
  margin-top: var(--space-3);
}

.legal ul {
  padding-left: var(--space-5);
  display: grid;
  gap: var(--space-2);
}

.placeholder {
  padding: var(--space-3) var(--space-4);
  background: var(--warning-soft);
  color: var(--warning);
  border-radius: var(--radius-md);
}

/* Survey teaser, fixed bottom right. Our own element (no Tally code until a click).
   --survey-teaser-space is set by main.js to the teaser height while it is visible,
   so focused elements and the end of the footer are never hidden behind it. */
html {
  scroll-padding-bottom: var(--survey-teaser-space, 0px);
}

.footer {
  padding-bottom: calc(var(--space-7) + var(--survey-teaser-space, 0px));
}

.survey-teaser {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 20;
  width: calc(100% - 2 * var(--space-5));
  max-width: calc(var(--space-8) * 5.5);
  padding: var(--space-5);
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: survey-teaser-in 0.3s ease-out both;
}

.survey-teaser[hidden] {
  display: none;
}

.survey-teaser-wave {
  position: absolute;
  top: calc(-1 * var(--space-5));
  left: calc(-1 * var(--space-3));
  font-size: var(--space-7);
  line-height: 1;
  transform-origin: 70% 70%;
  /* Two waves (about 2.5 s), then still: no endless motion. */
  animation: survey-teaser-wave 1.25s ease-in-out 0.3s 2;
}

.survey-teaser-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  padding: 0;
  background: transparent;
  color: var(--ink-muted);
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.survey-teaser-close:hover {
  background: var(--surface-sunken);
  color: var(--ink);
}

.survey-teaser-kicker {
  margin: 0 var(--space-7) var(--space-2) 0;
  color: var(--brand);
}

.survey-teaser-title {
  margin: 0 0 var(--space-2);
}

.survey-teaser-text {
  margin: 0 0 var(--space-4);
}

.survey-teaser-btn {
  width: 100%;
}

@keyframes survey-teaser-in {
  from {
    opacity: 0;
    transform: translateY(var(--space-4));
  }
}

@keyframes survey-teaser-wave {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-8deg); }
  45% { transform: rotate(14deg); }
  60% { transform: rotate(-4deg); }
  75% { transform: rotate(10deg); }
}

/* Small screens: compact bar at the bottom, title next to the button. */
@media (max-width: 599px) {
  .survey-teaser {
    right: var(--space-3);
    bottom: var(--space-3);
    width: calc(100% - 2 * var(--space-3));
    max-width: none;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
  }

  .survey-teaser-wave {
    top: calc(-1 * var(--space-4));
    left: calc(-1 * var(--space-1));
    font-size: var(--space-6);
  }

  .survey-teaser-close {
    top: 0;
    right: 0;
  }

  .survey-teaser-kicker {
    grid-column: 1 / -1;
    margin: 0 var(--space-7) var(--space-1) var(--space-5);
  }

  .survey-teaser-title {
    margin: 0;
  }

  .survey-teaser-text {
    display: none;
  }

  .survey-teaser-btn {
    width: auto;
  }
}

/* Small screens: the brand allows display-xl for one line only.
   Below 600px the hero title uses the "display" token values (40/44) instead. */
@media (max-width: 599px) {
  .hero-title {
    font-size: 40px;
    line-height: 44px;
  }

  .actions .btn {
    width: 100%;
  }
}

@media (min-width: 720px) {
  .cards-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .panel {
    grid-template-columns: 1fr auto;
    padding: var(--space-7);
  }

  .panel .btn {
    justify-self: end;
  }

  .footer-inner {
    grid-template-columns: auto 1fr;
    gap: var(--space-7);
  }
}

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

  .hero-grid {
    grid-template-columns: 1.2fr 1fr;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn {
    transition: none;
  }

  .survey-teaser,
  .survey-teaser-wave {
    animation: none;
  }
}
