/* GoWaggly landing page: brand tokens from the product design system (tokens.ts) */

:root {
  --primary: #006480;
  --accent: #ffb702;
  --background: #faf9f7;
  --foreground: #1a1c1b;
  --card: #ffffff;
  --muted-fg: #686c73;
  --border: #e2dfd9;
  --surface-tint: rgba(0, 100, 128, 0.04);
  --surface-sunken: #f5f3f0;
  --coral: #ff6f61;
  --success: #40bf6a;
  --radius: 0.75rem;
  --radius-lg: 1.25rem;
  --font-display: 'Baloo 2', 'Nunito Sans', system-ui, sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;
  --shadow-card: 0 1px 2px rgba(26, 28, 27, 0.05), 0 4px 16px rgba(26, 28, 27, 0.06);
  --shadow-btn: 0 2px 8px rgba(255, 183, 2, 0.35);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 0.75rem;
  color: var(--foreground);
}

h1 {
  font-size: clamp(2.125rem, 5.5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.625rem, 4vw, 2.25rem);
  font-weight: 700;
}

h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--primary);
}

::selection {
  background: var(--accent);
  color: var(--foreground);
}

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

.container {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 249, 247, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.6rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  padding-block: 0.3rem;
  margin-block: -0.3rem;
}

/* the mark is wider than tall: size by height, let width follow */
.brand-mark {
  height: 2.4rem;
  width: auto;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--primary);
}

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  background: var(--accent);
  color: var(--foreground);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  padding: 0.8rem 1.7rem;
  border-radius: 999px;
  box-shadow: var(--shadow-btn);
  transition: transform 200ms ease, box-shadow 200ms ease, filter 200ms ease;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
  box-shadow: 0 4px 14px rgba(255, 183, 2, 0.45);
}

.btn--sm {
  padding: 0.5rem 1.15rem;
  font-size: 0.95rem;
}

.btn--full {
  width: 100%;
}

/* text links get an invisible padded tap area (44px+) without shifting layout */
.link-quiet,
.link-arrow,
.contact-alt a,
.footer-inner a {
  display: inline-block;
  padding-block: 0.75rem;
  margin-block: -0.75rem;
}

.link-quiet {
  color: var(--muted-fg);
  text-decoration: none;
}

.link-quiet:hover {
  color: var(--primary);
  text-decoration: underline;
}

.link-arrow {
  font-weight: 700;
  text-decoration: none;
}

.link-arrow:hover {
  text-decoration: underline;
}

/* ---------- Hero ---------- */

.hero {
  padding-block: 3rem 3.5rem;
}

.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--muted-fg);
  max-width: 34rem;
}

/* phones: stacked full-width CTAs; desktop: side by side */
.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.hero-actions .link-quiet {
  text-align: center;
}

.hero-img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ---------- Bands & sections ---------- */

.band {
  padding-block: 3.25rem;
}

.band--card {
  background: var(--card);
  border-block: 1px solid var(--border);
}

.band--tint {
  background: var(--surface-tint);
}

.band--sunken {
  background: var(--surface-sunken);
  border-block: 1px solid var(--border);
}

.section-lead {
  color: var(--muted-fg);
  max-width: 40rem;
  margin-bottom: 2rem;
}

.section-cta {
  margin-top: 2rem;
  text-align: center;
}

/* ---------- Cards ---------- */

.cards {
  display: grid;
  gap: 1rem;
}

.cards--3 {
  margin-top: 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-card);
}

.card p {
  margin: 0;
  color: var(--muted-fg);
  font-size: 0.98rem;
}

/* ---------- Split layouts (cards + photo) ---------- */

.split {
  display: grid;
  gap: 1.75rem;
  align-items: start;
}

.split-img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  /* phones: photo first, so the section leads with a visual instead of five cards of text */
  order: -1;
}

/* ---------- Founding vet perks ---------- */

.founding {
  margin-top: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-card);
}

.founding h3 {
  margin-bottom: 0.75rem;
}

.founding ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.6rem;
}

.founding li {
  color: var(--muted-fg);
}

.founding strong {
  color: var(--foreground);
}

/* ---------- Steps ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3.4rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
}

.steps p {
  margin: 0;
  color: var(--muted-fg);
}

/* ---------- Disclaimer ---------- */

.disclaimer {
  margin-top: 2rem;
  padding: 0.9rem 1.2rem;
  background: var(--surface-sunken);
  border-left: 4px solid var(--coral);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted-fg);
  font-size: 0.95rem;
}

/* ---------- Investor band ---------- */

.investor {
  padding-block: 2.5rem;
}

.investor-inner {
  max-width: 44rem;
  text-align: center;
}

.h-quiet {
  font-size: 1.35rem;
  font-weight: 700;
}

.investor p {
  color: var(--muted-fg);
  font-size: 0.98rem;
}

/* ---------- Contact form ---------- */

.contact-inner {
  max-width: 44rem;
}

.contact-form {
  display: grid;
  gap: 1.1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-weight: 700;
  font-size: 0.95rem;
}

.optional {
  font-weight: 400;
  color: var(--muted-fg);
}

.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 0.6);
  padding: 0.65rem 0.8rem;
  width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

/* inline validation: same AA-safe red as the form error note */
.field-error {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  color: #c0362c;
}

.field input.field--invalid {
  border-color: #c0362c;
}

.field input.field--invalid:focus {
  outline-color: #c0362c;
  border-color: #c0362c;
}

.gotcha {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-privacy {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted-fg);
  text-align: center;
}

.form-note {
  margin: 0.6rem 0 0;
  font-size: 0.95rem;
  color: var(--muted-fg);
  text-align: center;
  min-height: 1.2em;
}

.form-note--error {
  /* darker than --coral: #ff6f61 fails AA contrast on the white card */
  color: #c0362c;
}

.contact-alt {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted-fg);
}

.success-panel:focus {
  outline: none;
}

.success-panel {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 1.75rem;
  box-shadow: var(--shadow-card);
}

.success-check {
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.success-panel p {
  color: var(--muted-fg);
  margin: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding-block: 2.5rem;
}

.footer-inner {
  text-align: center;
}

.footer-mark {
  height: 3rem;
  width: auto;
  margin: 0 auto 0.5rem;
}

.footer-slogan {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.footer-links {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.footer-fine {
  color: var(--muted-fg);
  font-size: 0.85rem;
  margin: 0.35rem 0 0;
}

/* ---------- Mobile sticky CTA bar ---------- */

.mobile-cta {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 30;
  padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
  background: rgba(250, 249, 247, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  transition: transform 200ms ease, opacity 200ms ease;
}

.mobile-cta--hidden {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

/* ---------- Privacy page ---------- */

.prose {
  max-width: 44rem;
}

.prose-date {
  color: var(--muted-fg);
  font-size: 0.9rem;
}

.prose ul {
  padding-left: 1.2rem;
  display: grid;
  gap: 0.7rem;
}

/* ---------- Mobile-only: room for the sticky CTA bar ---------- */

@media (max-width: 767.98px) {
  body {
    padding-bottom: 4.4rem;
  }

  /* phones get exactly one form CTA per scroll position: hero button at the top,
     the sticky bar after it scrolls away */
  .site-header .btn--sm {
    display: none;
  }
}

/* ---------- Desktop ---------- */

@media (min-width: 768px) {
  .container {
    padding-inline: 2rem;
  }

  .mobile-cta {
    display: none;
  }

  .hero-actions {
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
  }

  .hero-actions .btn {
    align-self: auto;
  }

  .hero {
    padding-block: 4.5rem 5rem;
  }

  .hero-grid {
    grid-template-columns: 1.1fr 1fr;
    gap: 3rem;
  }

  .band {
    padding-block: 4.5rem;
  }

  .cards--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .split {
    grid-template-columns: 1.15fr 1fr;
    gap: 2.5rem;
  }

  .split-img {
    order: 0;
    position: sticky;
    top: 5.5rem;
  }

  .split--flip .cards {
    order: 2;
  }

  .split--flip .split-img {
    order: 1;
  }

  .steps {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }

  .steps li {
    padding-left: 0;
    padding-top: 3.2rem;
  }

  .steps li::before {
    top: 0;
  }

  .btn--full {
    width: auto;
    justify-self: center;
    padding-inline: 2.6rem;
  }
}

/* ---------- Motion polish ---------- */

/* Shared entrance keyframe: fade plus a small rise, transform and opacity only */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* Header logo: one dignified wag shortly after load */
.brand-mark {
  transform-origin: 50% 80%;
  animation: logo-wag 900ms ease-in-out 700ms 1;
}

@keyframes logo-wag {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-7deg); }
  60% { transform: rotate(5deg); }
  85% { transform: rotate(-2deg); }
}

/* Hero entrance: eyebrow, then headline, lead, and actions, photo alongside */
.hero-copy > *,
.hero-img {
  animation: rise-in 550ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.hero-copy > :nth-child(2) { animation-delay: 90ms; }
.hero-copy > :nth-child(3) { animation-delay: 180ms; }
.hero-copy > :nth-child(4) { animation-delay: 270ms; }
.hero-img { animation-delay: 250ms; }

/* Scroll reveal: the hidden state exists only when main.js has run (html gets .js),
   so the page stays fully readable with JS disabled */
.js .reveal {
  opacity: 0;
}

.js .reveal.is-visible {
  opacity: 1;
  animation: rise-in 550ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: var(--stagger, 0ms);
}

/* Light stagger inside card grids and the steps row */
.js .cards > .reveal:nth-child(2),
.js .steps > .reveal:nth-child(2) { --stagger: 70ms; }
.js .cards > .reveal:nth-child(3),
.js .steps > .reveal:nth-child(3) { --stagger: 140ms; }
.js .cards > .reveal:nth-child(4),
.js .steps > .reveal:nth-child(4) { --stagger: 210ms; }
.js .cards > .reveal:nth-child(5) { --stagger: 280ms; }

/* Card lift on hover (mouse) and a light press on touch */
.card {
  transition: transform 180ms ease, box-shadow 180ms ease;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 2px 4px rgba(26, 28, 27, 0.06), 0 10px 26px rgba(26, 28, 27, 0.11);
  }
}

@media (hover: none) {
  .card:active {
    transform: scale(0.985);
  }
}

/* One polite nudge on the hero CTA a moment after load */
.hero-actions .btn {
  animation: cta-nudge 900ms ease-in-out 3s 1;
}

@keyframes cta-nudge {
  0%, 100% { transform: none; }
  35% { transform: scale(1.05); }
  65% { transform: scale(0.99); }
}

/* ---------- Toast (Sonner-style, single instance, JS-created) ---------- */

.gw-toast {
  position: fixed;
  z-index: 40; /* above .mobile-cta (30) and header (20) */
  inset-inline: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  pointer-events: none;
  transition: transform 200ms ease;
}

.gw-toast__card {
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: 24rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 0.75rem 1.1rem;
  animation: toast-spring-in 480ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.gw-toast__card--out {
  animation: toast-slide-out 220ms ease-in forwards;
}

.gw-toast__mark {
  height: 2rem;
  width: auto;
  flex: none;
}

.gw-toast__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
}

.gw-toast__msg {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted-fg);
}

/* spring up from below the viewport edge with a slight overshoot, then settle */
@keyframes toast-spring-in {
  0% { opacity: 0; transform: translateY(calc(100% + 1.5rem)); }
  70% { opacity: 1; transform: translateY(-0.4rem); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes toast-slide-out {
  to { opacity: 0; transform: translateY(calc(100% + 1.5rem)); }
}

/* edge case: toast outlives a scroll away from the form and the sticky bar returns */
@media (max-width: 767.98px) {
  .mobile-cta:not(.mobile-cta--hidden) ~ .gw-toast {
    transform: translateY(-3.6rem);
  }
}

@media (min-width: 768px) {
  .gw-toast {
    inset-inline: auto 1.5rem;
    bottom: 1.5rem;
    justify-content: flex-end;
  }
}

/* ---------- Motion preferences ---------- */

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

  .btn {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }

  .brand-mark,
  .hero-copy > *,
  .hero-img,
  .hero-actions .btn,
  .js .reveal.is-visible {
    animation: none;
  }

  .js .reveal {
    opacity: 1;
  }

  .card {
    transition: none;
  }

  .card:hover,
  .card:active {
    transform: none;
    box-shadow: var(--shadow-card);
  }

  .gw-toast {
    transition: none;
  }

  .gw-toast__card,
  .gw-toast__card--out {
    animation: none;
  }
}
