/* ==========================================================================
   UPKEEP — Stylesheet
   Follows STYLE_GUIDE.md exactly
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties (tokens)
   -------------------------------------------------------------------------- */

:root {
  /* Brand colors */
  --sage:        #87A878;
  --warm-slate:  #4A5C6A;
  --soft-coral:  #E8826D;
  --amber:       #E8B86D;

  /* Neutrals */
  --charcoal:    #2C2E2F;
  --mid-gray:    #6B7280;
  --light-gray:  #E5E7EB;
  --cream:       #FAF8F5;
  --white:       #FFFFFF;

  /* Semantic */
  --success:     #6B9A7B;
  --warning:     #E8B86D;
  --error:       #C76B5E;

  /* Spacing (4px base unit) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-8:  48px;
  --space-10: 64px;
  --space-12: 96px;

  /* Border radius */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:    0 1px 2px rgba(44, 46, 47, 0.06);
  --shadow-md:    0 4px 12px rgba(44, 46, 47, 0.08);
  --shadow-lg:    0 8px 24px rgba(44, 46, 47, 0.10);
  --shadow-focus: 0 0 0 2px #FAF8F5, 0 0 0 4px #E8826D;

  /* Typography */
  --font-primary: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "DM Sans", Inter, sans-serif;

  /* Layout */
  --container-max: 1120px;
  --container-pad: var(--space-5);
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */

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

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

body {
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--charcoal);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input {
  font-family: inherit;
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */

.display-xl {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--charcoal);
}

.display-xl em {
  font-style: normal;
  color: var(--sage);
}

.display-lg {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--charcoal);
}

.heading-1 {
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.heading-2 {
  font-size: clamp(24px, 2.5vw, 30px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

.heading-3 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}

.heading-4 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}

.body-lg {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--mid-gray);
}

.body {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--charcoal);
}

.body-sm {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.005em;
  color: var(--mid-gray);
}

.caption {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--mid-gray);
}

/* --------------------------------------------------------------------------
   4. Layout Utilities
   -------------------------------------------------------------------------- */

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

.section {
  padding-block: var(--space-12);
}

.section--alt {
  background-color: var(--white);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: var(--space-10);
}

.section-header__sub {
  margin-top: var(--space-4);
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.btn--primary {
  background-color: var(--sage);
  color: var(--cream);
  border: none;
}

.btn--primary:hover {
  background-color: #77966a;
}

.btn--primary:active {
  background-color: #6a8860;
}

.btn--secondary {
  background-color: var(--warm-slate);
  color: var(--cream);
  border: none;
}

.btn--secondary:hover {
  background-color: #3e4f5c;
}

.btn--outline {
  background-color: transparent;
  color: var(--warm-slate);
  border: 1.5px solid var(--warm-slate);
}

.btn--outline:hover {
  background-color: var(--warm-slate);
  color: var(--cream);
}

.btn--ghost {
  background-color: transparent;
  color: var(--warm-slate);
  border: none;
}

.btn--ghost:hover {
  color: var(--sage);
}

.btn--large {
  height: 48px;
  padding: 0 var(--space-6);
  font-size: 16px;
}

.btn--compact {
  height: 32px;
  padding: 0 var(--space-3);
}

.btn:disabled {
  background-color: var(--mid-gray);
  color: rgba(250, 248, 245, 0.6);
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   6. Badges
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  background-color: rgba(135, 168, 120, 0.15);
  color: var(--warm-slate);
  border: 1px solid rgba(135, 168, 120, 0.3);
}

.badge--amber {
  background-color: rgba(232, 184, 109, 0.15);
  color: var(--charcoal);
  border-color: rgba(232, 184, 109, 0.4);
}

/* --------------------------------------------------------------------------
   7. Navigation
   -------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--light-gray);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  height: 64px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  text-decoration: none;
}

.logo-wordmark {
  font-size: 18px;
  font-weight: 700;
  color: var(--warm-slate);
  letter-spacing: -0.01em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-left: auto;
}

.nav__links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--mid-gray);
  transition: color 0.15s ease;
}

.nav__links a:hover {
  color: var(--charcoal);
}

.nav__links a:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: 4px;
}

.nav__cta {
  margin-left: var(--space-4);
}

.nav__hamburger {
  display: none;
  margin-left: auto;
  color: var(--charcoal);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
}

.nav__hamburger:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.mobile-nav {
  border-top: 1px solid var(--light-gray);
  background-color: var(--cream);
  padding: var(--space-4) var(--space-5);
}

.mobile-nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mobile-nav a {
  font-size: 16px;
  font-weight: 500;
  color: var(--charcoal);
  display: block;
  padding: var(--space-2) 0;
}

.mobile-nav .btn {
  width: 100%;
  margin-top: var(--space-2);
}

/* --------------------------------------------------------------------------
   8. Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-block: var(--space-12) var(--space-8);
  position: relative;
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-10);
  align-items: center;
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-5);
}

.hero__lead {
  max-width: 52ch;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero__tagline {
  color: var(--mid-gray);
  letter-spacing: 0.02em;
}

.hero__scroll-hint {
  display: flex;
  justify-content: center;
  margin-top: var(--space-8);
  color: var(--light-gray);
  animation: bounce 2.4s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}

/* --------------------------------------------------------------------------
   9. App Preview (Hero Visual)
   -------------------------------------------------------------------------- */

.hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-preview {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  border: 1px solid var(--light-gray);
}

.app-preview__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
}

.app-preview__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: var(--sage);
  flex-shrink: 0;
}

.app-preview__card {
  background-color: var(--cream);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border: 1px solid var(--light-gray);
}

.app-preview__card--ai {
  border-left: 3px solid var(--sage);
}

.app-preview__icon-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.app-preview__stats {
  display: flex;
  gap: var(--space-3);
}

.stat-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background-color: var(--cream);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-2);
}

.stat-pill--accent {
  background-color: rgba(135, 168, 120, 0.12);
  border-color: rgba(135, 168, 120, 0.3);
}

.stat-pill__value {
  font-size: 18px;
  font-weight: 700;
  color: var(--charcoal);
  font-variant-numeric: tabular-nums;
}

.stat-pill--accent .stat-pill__value {
  color: var(--sage);
}

.stat-pill__label {
  font-size: 11px;
  font-weight: 500;
  color: var(--mid-gray);
  letter-spacing: 0.02em;
}

.app-preview__nudge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background-color: rgba(232, 130, 109, 0.08);
  border: 1px solid rgba(232, 130, 109, 0.2);
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   10. Social Proof Strip
   -------------------------------------------------------------------------- */

.social-proof {
  padding-block: var(--space-6);
  border-block: 1px solid var(--light-gray);
  background-color: var(--white);
}

.social-proof .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.social-proof__label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.integration-logos {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex-wrap: wrap;
  justify-content: center;
}

.integration-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--mid-gray);
  font-size: 14px;
  font-weight: 500;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.integration-logo:hover {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   11. Features Grid
   -------------------------------------------------------------------------- */

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
}

.feature-card {
  background-color: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-card__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(135, 168, 120, 0.1);
  border-radius: var(--radius-md);
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: auto;
}

.feature-list li {
  font-size: 14px;
  color: var(--mid-gray);
  padding-left: var(--space-5);
  position: relative;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background-color: var(--sage);
}

/* --------------------------------------------------------------------------
   12. How It Works (Steps)
   -------------------------------------------------------------------------- */

.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 680px;
  margin-inline: auto;
  counter-reset: steps;
}

.step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--space-5);
  padding-block: var(--space-6);
  position: relative;
}

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 32px;
  top: calc(var(--space-6) + 32px);
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--light-gray), transparent);
  transform: translateX(-0.5px);
}

.step__number {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--sage);
  color: var(--cream);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-sm);
  align-self: start;
  margin-top: 4px;
}

.step__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.step__content .heading-3 {
  font-size: 20px;
}

/* --------------------------------------------------------------------------
   13. Integrations Grid
   -------------------------------------------------------------------------- */

.integrations__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
}

.integration-card {
  background-color: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: box-shadow 0.2s ease;
}

.integration-card:hover {
  box-shadow: var(--shadow-md);
}

.integration-card--coming-soon {
  opacity: 0.7;
  border-style: dashed;
}

.integration-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(74, 92, 106, 0.08);
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   14. Quote Section
   -------------------------------------------------------------------------- */

.brand-quote {
  text-align: center;
  max-width: 800px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.brand-quote p {
  color: var(--warm-slate);
}

.brand-quote footer {
  color: var(--mid-gray);
  font-size: 16px;
}

/* --------------------------------------------------------------------------
   15. Waitlist / CTA
   -------------------------------------------------------------------------- */

.waitlist {
  background: linear-gradient(160deg, var(--cream) 0%, rgba(135, 168, 120, 0.06) 100%);
}

.waitlist__inner {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.waitlist__inner .body-lg {
  max-width: 48ch;
  margin-inline: auto;
}

.waitlist__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: left;
}

.form-row {
  display: flex;
  gap: var(--space-3);
}

.input {
  flex: 1;
  height: 48px;
  padding: 0 var(--space-4);
  border: 1.5px solid var(--light-gray);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 400;
  color: var(--charcoal);
  background-color: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
}

.input::placeholder {
  color: var(--mid-gray);
}

.input:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(135, 168, 120, 0.2);
}

.input.input--error {
  border-color: var(--error);
}

.form-error {
  font-size: 13px;
  color: var(--error);
  min-height: 18px;
}

.waitlist__disclaimer {
  text-align: center;
  color: var(--mid-gray);
}

.waitlist__success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6);
  background-color: rgba(107, 154, 123, 0.08);
  border: 1px solid rgba(107, 154, 123, 0.3);
  border-radius: var(--radius-lg);
}

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */

.footer {
  background-color: var(--warm-slate);
  padding-block: var(--space-8);
}

.footer__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: var(--space-8);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer .logo-wordmark {
  color: var(--cream);
}

.footer__tagline {
  color: rgba(250, 248, 245, 0.6);
  font-style: italic;
}

.footer__nav ul {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
  justify-content: center;
}

.footer__nav a {
  font-size: 14px;
  font-weight: 500;
  color: rgba(250, 248, 245, 0.7);
  transition: color 0.15s ease;
}

.footer__nav a:hover {
  color: var(--cream);
}

.footer__nav a:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: 4px;
}

.footer__legal {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  text-align: right;
}

.footer__legal .caption {
  color: rgba(250, 248, 245, 0.5);
}

/* --------------------------------------------------------------------------
   17. Reduced motion
   -------------------------------------------------------------------------- */

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

/* --------------------------------------------------------------------------
   18. Responsive — Tablet (< 900px)
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .hero__visual {
    order: -1;
  }

  .hero__content {
    align-items: center;
    text-align: center;
  }

  .hero__lead {
    margin-inline: auto;
  }

  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    text-align: center;
  }

  .footer__brand {
    align-items: center;
  }

  .footer__legal {
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   19. Responsive — Mobile (< 640px)
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  :root {
    --container-pad: var(--space-4);
  }

  .section {
    padding-block: var(--space-8);
  }

  .nav__links,
  .nav__cta {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }

  .hero {
    padding-block: var(--space-8);
  }

  .hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row .btn {
    width: 100%;
  }

  .step {
    grid-template-columns: 48px 1fr;
    gap: var(--space-4);
  }

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

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

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

  .footer__nav ul {
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
  }

  .integration-logos {
    gap: var(--space-5);
  }

  .app-preview {
    max-width: 320px;
  }
}
