/* ==========================================================================
   Pledge marketing site — shared stylesheet
   Brand tokens mirror Pledge/Colors.swift 1:1 so the web presence matches the
   app. No third-party fonts, scripts or trackers (see the Privacy Policy).
   ========================================================================== */

:root {
  /* Brand palette — from Colors.swift */
  --pledge-dark-blue: #0069c3;
  --pledge-mid-blue: #0096e1;
  --pledge-light-blue: #00c3ff;
  --pledge-brand: #0096e1;               /* light-mode adaptive accent */
  --pledge-brand-wash: rgba(0, 150, 225, 0.12);

  /* Signature gradient — SwiftUI .bottomLeading -> .topTrailing == 135deg */
  --pledge-gradient: linear-gradient(
    135deg,
    var(--pledge-dark-blue),
    var(--pledge-mid-blue),
    var(--pledge-light-blue)
  );

  /* Radii — from PledgeMetrics */
  --pledge-radius: 16px;
  --pledge-radius-button: 26px;

  /* Surfaces / text (light mode) */
  --bg: #ffffff;
  --bg-soft: #f5f8fb;
  --surface: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --text: #1a1d21;
  --text-soft: #5b636c;
  --header-bg: rgba(255, 255, 255, 0.8);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --pledge-brand: #19aaf5;             /* dark-mode adaptive accent */
    --pledge-brand-wash: rgba(25, 170, 245, 0.14);
    --bg: #0d1116;
    --bg-soft: #141a21;
    --surface: #161d25;
    --border: rgba(255, 255, 255, 0.1);
    --text: #f2f5f8;
    --text-soft: #9aa4af;
    --header-bg: rgba(13, 17, 22, 0.8);
  }
}

/* -------------------------------------------------------------------------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

a { color: var(--pledge-brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 1.05rem;
}
.brand:hover { text-decoration: none; }

/* Logo uses the real app icon so the web mark is identical to the app. */
.logo-img { display: block; border-radius: 22.37%; } /* iOS squircle corner */
.brand .logo-img { width: 30px; height: 30px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--pledge-brand); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--pledge-brand); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: var(--text);
}
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 14px 24px;
    font-size: 1.05rem;
    border-top: 1px solid var(--border);
  }
}

/* ------------------------------ Buttons ---------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 30px;
  border-radius: var(--pledge-radius-button);
  font-weight: 600;
  font-size: 1rem;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn-primary {
  background: #fff;
  color: var(--pledge-mid-blue);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.btn-primary:hover { text-decoration: none; transform: scale(1.02); }
.btn-primary:active { transform: scale(0.96); }

.btn-brand {
  background: var(--pledge-brand);
  color: #fff;
}
.btn-brand:hover { text-decoration: none; transform: scale(1.02); }
.btn-brand:active { transform: scale(0.96); }

.btn-disabled {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  cursor: default;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.btn-disabled:hover { text-decoration: none; transform: none; }

.btn-note {
  margin-top: 12px;
  font-size: 0.85rem;
  opacity: 0.8;
}

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

.hero {
  background: var(--pledge-gradient);
  color: #fff;
  text-align: center;
  padding: 96px 24px 108px;
}
.hero .logo-img {
  width: 96px;
  height: 96px;
  margin: 0 auto 28px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.28);
}
.hero .eyebrow {
  font-size: 1.15rem;
  font-weight: 500;
  opacity: 0.92;
  margin: 0;
}
.hero .wordmark {
  font-size: clamp(2.8rem, 9vw, 4rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  margin: 6px 0 0;
  padding-left: 0.22em; /* optically center the tracked text */
}
.hero .tagline {
  font-size: clamp(1.15rem, 3.5vw, 1.5rem);
  opacity: 0.95;
  max-width: 30ch;
  margin: 22px auto 36px;
}

/* ------------------------------ Sections --------------------------------- */

section { padding: 72px 0; }
.section-soft { background: var(--bg-soft); }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
.section-head h2 { font-size: clamp(1.8rem, 5vw, 2.4rem); margin: 0 0 12px; }
.section-head p { color: var(--text-soft); font-size: 1.1rem; margin: 0; }

/* How it works — step cards */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--pledge-radius);
  padding: 28px 24px;
}
.step .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--pledge-brand-wash);
  color: var(--pledge-brand);
  font-weight: 700;
  margin-bottom: 16px;
}
.step h3 { margin: 0 0 8px; font-size: 1.15rem; }
.step p { margin: 0; color: var(--text-soft); }

/* Giving model — split bar + disclosure */
.giving-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--pledge-radius);
  padding: 32px;
  max-width: 760px;
  margin: 0 auto;
}
.split-bar {
  display: flex;
  gap: 4px;
  height: 14px;
  margin: 8px 0 24px;
}
.split-bar span { border-radius: 7px; }
.split-bar .seg-give { flex: 0 0 58%; background: var(--pledge-brand); }
.split-bar .seg-apple { flex: 0 0 14%; background: #98a1ab; }
.split-bar .seg-keep { flex: 1; background: var(--pledge-brand-wash); }
.split-row { display: flex; gap: 14px; align-items: baseline; margin-bottom: 12px; }
.split-row .share {
  flex: 0 0 52px;
  font-weight: 700;
  color: var(--pledge-brand);
  font-size: 1.1rem;
}
.split-row.apple .share { color: #6b7079; }
.split-row .detail { color: var(--text-soft); }

.disclosure {
  margin-top: 28px;
  padding: 20px 22px;
  border-radius: var(--pledge-radius);
  background: var(--pledge-brand-wash);
  border: 1px solid var(--border);
  font-size: 0.95rem;
}
.disclosure strong { color: var(--text); }
.disclosure p { margin: 0 0 10px; }
.disclosure p:last-child { margin-bottom: 0; }

/* Charities */
.charity-group + .charity-group { margin-top: 36px; }
.charity-group h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin: 0 0 16px;
}
.charity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.charity {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--pledge-radius);
  padding: 20px 22px;
}
.charity .name { font-weight: 600; margin: 0 0 4px; }
.charity .tagline { color: var(--text-soft); font-size: 0.92rem; margin: 0; }

.fineprint {
  color: var(--text-soft);
  font-size: 0.88rem;
  max-width: 720px;
  margin: 28px auto 0;
  text-align: center;
}

/* ------------------------------ Legal / content pages -------------------- */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}
.doc h1 { font-size: clamp(1.9rem, 5vw, 2.4rem); margin: 0 0 8px; }
.doc .updated { color: var(--text-soft); margin: 0 0 32px; font-size: 0.95rem; }
.doc h2 { font-size: 1.2rem; margin: 32px 0 6px; }
.doc p { margin: 0 0 16px; color: var(--text); }
.doc .lead { color: var(--text-soft); }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--pledge-radius);
  padding: 4px 22px;
  margin-bottom: 14px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 16px 0;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  float: right;
  color: var(--pledge-brand);
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1;
}
.faq details[open] summary::after { content: "\2013"; }
.faq details p { margin: 0 0 16px; color: var(--text-soft); }

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 40px 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: center;
  justify-content: space-between;
}
.site-footer .foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}
.site-footer .foot-brand .logo-img { width: 24px; height: 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer nav a { color: var(--text-soft); }
.site-footer nav a:hover { color: var(--pledge-brand); }
.site-footer .copyright { width: 100%; opacity: 0.75; margin-top: 4px; }

/* 404 */
.notfound {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
}
.notfound .logo-img { width: 72px; height: 72px; margin-bottom: 20px; }
