/* Pawpresso — pawpresso.com
   Design system ported 1:1 from the iOS app
   (Pawpresso/DesignSystem/Colors.swift, Typography.swift, Spacing.swift).
   Type: Fraunces (display) + DM Sans (body). */

:root {
  /* ---- Primitives — Brand: Lavender ---- */
  --lavender-500: #3F3691; /* Primary brand lavender */
  --lavender-100: #EEE8FF; /* Lavender tint container */
  --lavender-50:  #F8F7FF; /* Near-white lavender surface */

  /* ---- Primitives — Brand: Coral ---- */
  --coral-500: #E85D3F; /* Accent — CTAs, selection */
  --coral-300: #FF7A5C; /* Hover / active press state */
  --coral-200: #FFA194; /* Wordmark accent */
  --coral-50:  #FFF5F3; /* Selected card fill */

  /* ---- Primitives — Brand: Green (success) ---- */
  --green-500: #2D9E6B;
  --green-50:  #E8F7F0;

  /* ---- Primitives — Brand: Gold (security / trust) ---- */
  --gold-500: #F0B429;

  /* ---- Primitives — Error ---- */
  --red-500: #D92B2B;

  /* ---- Primitives — Neutral ---- */
  --neutral-900: #1A1A2E;
  --neutral-600: #555566;
  --neutral-400: #888899;
  --neutral-100: #EEEEF5;
  --neutral-050: #F3F4F6;
  --neutral-000: #FFFFFF;

  /* ---- Semantic — Backgrounds ---- */
  --bg-screen:       var(--lavender-50);
  --bg-card:         var(--lavender-50);
  --bg-card-active:  var(--lavender-100);
  --bg-selected-coral: var(--coral-50);
  --bg-success:      var(--green-50);
  --bg-overlay:      var(--neutral-900);
  --bg-info-banner:  var(--neutral-050);
  --bg-icon-subtle:  rgba(63, 54, 145, 0.15); /* lavender-500 @ 15% */
  --bg-toast-success: var(--green-500);

  /* ---- Semantic — Text ---- */
  --text-wordmark:  var(--coral-200);
  --text-primary:   var(--neutral-900);
  --text-secondary: var(--neutral-600);
  --text-tertiary:  var(--neutral-400);
  --text-on-dark:   var(--neutral-000);
  --text-brand:     var(--lavender-500);
  --text-success:   var(--green-500);
  --text-error:     var(--red-500);
  --icon-gold:      var(--gold-500);
  /* AA-safe alternative to --text-brand for small body-weight text on white
     (e.g. inline links). The app never needs this — its lavender text always
     sits on lavender-tinted surfaces, not pure white, so 4.5:1 isn't a factor
     there. On the marketing site it is. */
  --text-brand-aa:  #5A4A9F;

  /* ---- Semantic — Interactive ---- */
  --cta-primary:  var(--coral-500);
  --cta-hover:    var(--coral-300);
  --accent-brand: var(--lavender-500);

  /* ---- Semantic — Borders ---- */
  --border-default:  var(--neutral-100);
  --border-selected: var(--coral-500);
  --border-brand:    var(--lavender-500);
  --border-success:  var(--green-500);

  /* ---- Spacing scale (4pt base) ---- */
  --space-xxxs: 0.25rem; /* 4 */
  --space-xxs:  0.5rem;  /* 8 */
  --space-xs:   0.75rem; /* 12 */
  --space-sm:   1rem;    /* 16 */
  --space-md:   1.25rem; /* 20 */
  --space-lg:   1.5rem;  /* 24 */
  --space-xl:   2rem;    /* 32 */
  --space-xxl:  2.5rem;  /* 40 */
  --space-xxxl: 3rem;    /* 48 */
  --space-title-body-gap: 0.875rem; /* 14 */

  /* ---- Radius scale ---- */
  --radius-xs:    0.375rem; /* 6 */
  --radius-sm:    0.5rem;   /* 8 */
  --radius-input: 0.625rem; /* 10 */
  --radius-md:    0.75rem;  /* 12 */
  --radius-lg:    1rem;     /* 16 */
  --radius-xl:    1.5rem;   /* 24 */
  --radius-pill:  100rem;

  /* ---- Shadows ---- */
  --shadow-card-default: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-card-active:  0 4px 12px rgba(123, 108, 246, 0.12);
  --shadow-button:       0 4px 12px rgba(232, 93, 63, 0.30);
  --shadow-card-tight:   0 2px 2px rgba(0, 0, 0, 0.10);
  --shadow-image-float:  0 4px 2px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--neutral-000);
}
main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }

a { color: var(--text-brand-aa); text-underline-offset: 3px; }
a:hover { color: var(--text-brand); }
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent-brand);
  outline-offset: 2px;
  border-radius: 4px;
}
/* --accent-brand is the same color as .landing's own background, so the
   default outline is invisible for controls sitting on the hero (the email
   input and CTA button). Swap to white there for real contrast. */
.landing a:focus-visible,
.landing button:focus-visible,
.landing input:focus-visible {
  outline-color: var(--text-on-dark);
}
.landing input[aria-invalid="true"]:focus-visible {
  outline-color: var(--coral-200);
}

.wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-default);
  padding: 1.1rem 0;
}
.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  max-width: 64rem;
}
.wordmark {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--cta-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark span {
  font-style: italic;
  font-weight: 900;
  color: var(--text-brand);
}

/* Document body */
main.legal { padding: 3rem 0 4rem; }
main.legal .wrap { max-width: 64rem; }

h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.4rem;
}
.effective {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 2rem;
}

h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin: 2.4rem 0 0.6rem;
}
h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.6rem 0 0.4rem;
}
p, li { color: var(--text-primary); }
ul { padding-left: 1.3rem; }
li { margin-bottom: 0.45rem; }
li::marker { color: var(--cta-primary); }

/* Signature: the privacy thread */
.thread {
  background: var(--bg-card);
  border-left: 4px solid var(--accent-brand);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 1.1rem 1.3rem;
  margin: 1.8rem 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.4;
  color: var(--text-brand);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-default);
  padding: 1.4rem 0 2.2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  justify-content: space-between;
  max-width: 64rem;
}
.site-footer p { margin: 0; }
.site-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer nav li { margin-bottom: 0; }
.site-footer nav li:not(:first-child)::before {
  content: "·";
  margin: 0 0.6rem;
  color: var(--text-secondary);
}
.site-footer a { color: var(--text-secondary); }
.pawprint { color: var(--cta-primary); }
.pawprint-on-dark { filter: grayscale(1) brightness(0) invert(1); }

/* Landing hero */
.landing {
  position: relative;
  min-height: 760px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--accent-brand);
  padding: 4rem 1.25rem 9rem;
  overflow: hidden;
}
.landing h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  font-size: clamp(2.75rem, 9vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--text-wordmark);
  margin: 0 0 1.75rem;
}
.landing h1 span {
  font-style: italic;
  font-weight: 900;
  color: var(--text-on-dark);
}
/* White on --accent-brand reaches ~9.78:1, clearing AAA (7:1) for
   normal text. */
.landing .tagline {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--text-on-dark);
  margin: 0 0 1rem;
}
.landing .landing-subcopy {
  font-size: 1.1875rem;
  font-weight: 400;
  color: var(--text-on-dark);
  max-width: 35rem;
  margin: 0 auto 2rem;
}
.waitlist-consent {
  font-size: 1rem;
  color: var(--text-on-dark);
  opacity: 0.65;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

/* Waitlist form */
.waitlist-form[hidden] { display: none; }
.waitlist-form {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--space-xxs);
  flex-wrap: wrap;
}
.waitlist-field {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
}
.waitlist-field label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-on-dark);
}
.waitlist-field-error[hidden] { display: none; }
.waitlist-field-error {
  position: absolute;
  top: 100%;
  left: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.375rem;
  font-size: 1.0625rem;
  color: var(--coral-200);
  white-space: nowrap;
}
.waitlist-field input {
  width: 300px;
  max-width: 100%;
  height: 3rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--text-on-dark);
  background: transparent;
  padding: 0 var(--space-sm);
  font-family: "DM Sans", sans-serif;
  font-size: 1rem;
  color: var(--text-on-dark);
  caret-color: var(--text-on-dark);
  -webkit-text-fill-color: var(--text-on-dark);
}
.waitlist-field input:-webkit-autofill,
.waitlist-field input:-webkit-autofill:hover,
.waitlist-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-on-dark);
  -webkit-box-shadow: 0 0 0 1000px var(--accent-brand) inset;
  transition: background-color 9999s ease-in-out 0s;
}
.waitlist-form button {
  height: 3rem;
  width: 140px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--cta-primary);
  color: var(--text-on-dark);
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-button);
}
.waitlist-form button:hover { background: var(--cta-hover); }
.waitlist-fineprint {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0.75rem 0 0;
}

/* Curved seam between the hero and the white page below */
.landing-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 90px;
  line-height: 0;
}
.landing-wave svg { width: 100%; height: 100%; display: block; }
.landing-wave path { fill: var(--neutral-000); }

/* Floating photos overlapping the curved seam */
.floating-photos {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4rem;
  margin-top: -10rem;
  padding: 0 1.25rem;
  position: relative;
  z-index: 2;
}
.floating-photo {
  width: 192px;
  height: 192px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-image-float);
  opacity: 1;
}
.floating-photo.photo-1 {
  --rot: 0deg;
  transform: rotate(var(--rot));
}
.floating-photo.photo-2 {
  --rot: 5deg;
  margin-top: 2.125rem;
  transform: rotate(var(--rot));
}
.floating-photo.photo-3 {
  --rot: -3deg;
  margin-top: 0.75rem;
  transform: rotate(var(--rot));
}
.floating-photo.photo-4 {
  --rot: 5deg;
  margin-top: 2.125rem;
  transform: rotate(var(--rot));
}

/* How it works */
.how-it-works { padding: 5rem 4rem 2rem; }
.how-it-works-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-align: center;
  max-width: 64rem;
  margin: 0 auto 2rem;
}
.how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 64rem;
  margin: 0 auto;
}
.how-it-works-grid > *:first-child { border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.how-it-works-grid > *:last-child { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.step {
  padding: 2rem 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.step-lavender { background: var(--bg-card-active); }
.step-coral { background: var(--bg-selected-coral); }
.step:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-active);
}
.step-number {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  font-size: 2.5rem;
  line-height: 1;
  margin: 0 0 var(--space-sm);
}
.step-lavender .step-number { color: var(--accent-brand); }
.step-coral .step-number { color: var(--cta-primary); }
.step-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-xxxs);
}
.step-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Entrance animation */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px) rotate(var(--rot, 0deg)); }
  to   { opacity: 1; transform: translateY(0) rotate(var(--rot, 0deg)); }
}
.reveal {
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(.2, .8, .2, 1) forwards;
}
.landing h1.reveal { animation-delay: 0.05s; }
.landing .tagline.reveal { animation-delay: 0.2s; }
.landing .landing-subcopy.reveal { animation-delay: 0.35s; }
.waitlist-consent.reveal { animation-delay: 0.42s; }
.waitlist-form.reveal { animation-delay: 0.5s; }
.step.reveal:nth-child(1) { animation-delay: 0.1s; }
.step.reveal:nth-child(2) { animation-delay: 0.22s; }
.step.reveal:nth-child(3) { animation-delay: 0.34s; }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .waitlist-form { flex-direction: column; align-items: stretch; gap: var(--space-sm); }
  .waitlist-field,
  .waitlist-field input,
  .waitlist-form button { width: 100%; }

  .floating-photos {
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    margin-top: -8.125rem;
    padding: 0 1.25rem;
  }
  .floating-photo {
    --rot: 0deg;
    width: 60%;
    height: auto;
    aspect-ratio: 1 / 1;
  }
  .floating-photo.photo-2,
  .floating-photo.photo-3,
  .floating-photo.photo-4 { --rot: 0deg; margin-top: 0; }
  .how-it-works { padding: 3rem 1.25rem 1rem; }
  .how-it-works-grid { grid-template-columns: 1fr; }
  .how-it-works-grid > *:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .how-it-works-grid > *:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
}
