/* ==========================================================================
   Project Pawsitive - shared stylesheet
   ========================================================================== */

:root {
  --bg: #d9e8fc;
  --bg-deep: #c9dcf7;
  --card: #ffffff;
  --navy: #45518f;
  --navy-dark: #333f77;
  --navy-soft: #eef4fd;
  --brown: #4a2511;
  --brown-hover: #3a1c0c;
  --text: #3c4568;
  --muted: #6b76a0;
  --error: #b3261e;
  --success: #1f7a4d;
  --border: #c9d7ee;

  --radius-sm: 10px;
  --radius: 20px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(51, 63, 119, 0.08);
  --shadow: 0 10px 30px rgba(51, 63, 119, 0.10);
  --shadow-lg: 0 18px 50px rgba(51, 63, 119, 0.14);

  --header-h: 72px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--navy-dark); }

h1, h2, h3 { line-height: 1.25; }

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--navy-dark);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------------------- header  */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(217, 232, 252, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.is-scrolled {
  border-bottom-color: rgba(69, 81, 143, 0.15);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: inline-flex; align-items: center; }
.brand img { height: 34px; width: auto; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 10px;
  color: var(--navy-dark);
}
.nav-toggle:hover { background: rgba(69, 81, 143, 0.10); }
.nav-toggle .bar {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  margin: 4px 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.site-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--navy-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.site-nav a:hover { background: rgba(69, 81, 143, 0.10); }
.site-nav a[aria-current] { background: rgba(69, 81, 143, 0.14); }
.site-nav .nav-cta {
  background: var(--brown);
  color: #fff;
  padding: 10px 20px;
}
.site-nav .nav-cta:hover { background: var(--brown-hover); }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brown); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brown-hover); box-shadow: var(--shadow); }
.btn-secondary { background: transparent; color: var(--navy-dark); border-color: var(--navy); }
.btn-secondary:hover { background: rgba(69, 81, 143, 0.10); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.65; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------ hero */

.hero {
  text-align: center;
  padding: 48px 0 60px;
}
/* Only the 404 page still shows the wordmark inside the hero. */
.hero-logo {
  max-width: 420px;
  width: 100%;
  margin: 0 auto 34px;
}

.hero h1 {
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  margin: 0 0 14px;
  color: var(--navy-dark);
  letter-spacing: -0.02em;
}
.hero .lede {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  max-width: 520px;
  margin: 0 auto 30px;
  color: var(--navy);
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-note {
  margin: 20px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.hero-note a { color: var(--navy-dark); }

/* The snapshot pair is the hero's centrepiece - two prints dropped on the
   page, tilted opposite ways and just overlapping. Heights match while each
   keeps its own aspect ratio, so they read as photos rather than a grid. */
.hero-photos {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0 40px;
}
.hero-photos img {
  height: clamp(200px, 28vw, 330px);
  width: auto;
  border: 8px solid #fff;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.hero-photos img:first-child { transform: rotate(-3deg) translateY(8px); }
.hero-photos img:last-child {
  transform: rotate(2.5deg) translateY(-6px);
  margin-left: -22px;
}

/* -------------------------------------------------------------- sections */

.section { padding: 64px 0; }
.section-title {
  font-size: clamp(1.5rem, 3.5vw, 1.9rem);
  text-align: center;
  color: var(--navy-dark);
  margin: 0 0 10px;
}
.section-sub {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 34px;
  color: var(--muted);
}
.paw-divider {
  text-align: center;
  font-size: 1.25rem;
  margin: 0 0 26px;
  letter-spacing: 10px;
  line-height: 1;
}

.about .prose {
  max-width: 680px;
  margin: 0 auto;
  text-align: justify;
  hyphens: auto;
}
.about .prose p { margin: 0 0 16px; }

/* how it works */
.how .panel {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  box-shadow: var(--shadow);
}
.how-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  text-align: center;
}
.how-step .num {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto 14px;
}
.how-step h3 { font-size: 1.05rem; margin: 0 0 6px; color: var(--navy-dark); }
.how-step p { font-size: 0.94rem; margin: 0; color: var(--muted); }

/* ----------------------------------------------------------------- forms */

.tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 11px 24px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--navy);
  background: transparent;
  color: var(--navy-dark);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.tab-btn:hover { background: rgba(69, 81, 143, 0.10); }
.tab-btn[aria-selected="true"] { background: var(--navy); color: #fff; }

.form-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 34px;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}
.form-card[hidden] { display: none; }
.form-card h3 { text-align: center; color: var(--navy-dark); margin: 0 0 4px; }
.form-card .sub { text-align: center; font-size: 0.92rem; color: var(--muted); margin: 0 0 24px; }

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy-dark);
}
.field .req { color: var(--brown); }
.field .hint { font-size: 0.78rem; color: var(--muted); }

input, textarea, select {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fbfdff;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(69, 81, 143, 0.18);
}
textarea { resize: vertical; min-height: 96px; }

.field.has-error input,
.field.has-error textarea,
.field.has-error select { border-color: var(--error); background: #fff7f6; }
.error-text {
  font-size: 0.8rem;
  color: var(--error);
  font-weight: 600;
  min-height: 0;
}
.error-text:empty { display: none; }

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

.form-status {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
}
.form-status[hidden] { display: none; }
.form-status.is-error { background: #fdeceb; color: var(--error); }

.form-success {
  text-align: center;
  padding: 16px 4px;
}
.form-success[hidden] { display: none; }
.form-success .emoji { font-size: 2.2rem; line-height: 1; }
.form-success h3 { color: var(--success); margin: 12px 0 8px; }
.form-success p { color: var(--muted); margin: 0 0 18px; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- donate page  */

.page-head {
  text-align: center;
  padding: 56px 0 8px;
}
.page-head h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  color: var(--navy-dark);
  margin: 0 0 12px;
}
.page-head p { max-width: 560px; margin: 0 auto; color: var(--navy); }

.donate-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 40px 34px;
  max-width: 620px;
  margin: 32px auto 0;
  box-shadow: var(--shadow);
}

.toggle-group {
  display: inline-flex;
  padding: 4px;
  background: var(--navy-soft);
  border-radius: var(--radius-pill);
  gap: 4px;
  margin: 0 auto 26px;
}
.toggle-group button {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy-dark);
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.toggle-group button[aria-pressed="true"] {
  background: var(--navy);
  color: #fff;
}
.center { text-align: center; }

.tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 16px;
}
.tier {
  border: 2px solid var(--bg-deep);
  background: var(--navy-soft);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.tier:hover { transform: translateY(-2px); border-color: var(--navy); }
.tier[aria-pressed="true"] {
  border-color: var(--navy);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.tier .amount { display: block; font-weight: 700; color: var(--navy-dark); font-size: 1.2rem; }
.tier .desc { font-size: 0.78rem; color: var(--muted); display: block; margin-top: 4px; }

.fieldset-reset { border: 0; padding: 0; margin: 0; min-width: 0; }

.custom-amount { position: relative; }
.custom-amount .currency {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 700;
  pointer-events: none;
}
.custom-amount input { padding-left: 30px; }

.donate-summary {
  background: var(--navy-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.95rem;
  color: var(--navy-dark);
  font-weight: 600;
  text-align: center;
}
.note {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 16px 0 0;
  text-align: center;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid rgba(69, 81, 143, 0.15);
  margin-top: 24px;
  padding: 40px 0 32px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.footer-links a { color: var(--navy); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.footer-links a:hover { text-decoration: underline; }
/* The email picks up the brown accent rather than the navy the nav links use. */
.footer-links a[href^="mailto:"] { color: var(--brown); }
.footer-legal {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 26px 0 0;
}

/* ------------------------------------------------------------ animations */

/* Scoped to .js so that content is never hidden when scripts don't run. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Set when the page loads in a background tab, where transitions are frozen -
   without this the content would sit at opacity 0 until the tab is focused. */
.no-reveal .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 860px) {
  .how-steps { grid-template-columns: 1fr; gap: 32px; }
  .how .panel { padding: 36px 24px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header-h);
    /* Reads as the header panel continuing downwards, rather than a white card.
       A shade deeper than the page so the panel edge stays legible. */
    background: var(--bg-deep);
    border-bottom: 1px solid rgba(69, 81, 143, 0.22);
    box-shadow: var(--shadow-lg);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 10px 16px 18px;
    display: none;
  }
  .site-nav a:hover { background: rgba(69, 81, 143, 0.14); }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav a { padding: 12px 14px; border-radius: var(--radius-sm); }
  .site-nav .nav-cta { text-align: center; margin-top: 8px; border-radius: var(--radius-pill); }

  .hero { padding: 40px 0 48px; }

  /* The subtitle carries a hand-placed <br>. To keep it to those two lines the
     hero's gutters tighten slightly and the type scales with the viewport -
     with a floor, so below roughly 330px it gives up and re-wraps rather than
     becoming unreadable. */
  .hero .container { padding-left: 16px; padding-right: 16px; }
  .hero .lede {
    max-width: 100%;
    font-size: clamp(0.85rem, 4vw, 1rem);
    margin-bottom: 28px;
  }
  .hero-note { margin-top: 26px; }
  /* "Chip in here." gets its own line rather than trailing the question. */
  .hero-note a { display: block; margin-top: 6px; }

  /* Keep the snapshot pair side by side on phones - smaller, thinner frames. */
  .hero-photos { margin-bottom: 30px; }
  .hero-photos img {
    height: clamp(120px, 34vw, 210px);
    border-width: 5px;
    border-radius: 12px;
  }
  .hero-photos img:last-child { margin-left: -12px; }

  .section { padding: 48px 0; }
  .form-card { padding: 26px 20px; }
  .donate-card { padding: 30px 22px; }
  .tiers { grid-template-columns: 1fr; }
  .footer-inner { justify-content: center; text-align: center; }
}

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