/* ============================================================
   Bay Area DPC Association — styles
   Warm pastel palette · Fraunces + Source Sans 3
   ============================================================ */

:root {
  /* Warm pastels */
  --cream:       #faf4ec;
  --cream-deep:  #f3e9da;
  --peach:       #f0c5a8;
  --peach-soft:  #f7ddc9;
  --sage:        #9fb89a;
  --sage-soft:   #d9e4d3;
  --dusty-blue:  #9bb3c4;
  --blue-soft:   #dde6ec;

  /* Ink */
  --ink:         #3b352f;
  --ink-soft:    #6b6258;
  --ink-faint:   #978c7e;

  /* Roles */
  --bg:          var(--cream);
  --accent:      #c97b54;     /* warm terracotta for buttons/links */
  --accent-dark: #b3683f;

  --radius:      18px;
  --radius-lg:   28px;
  --shadow:      0 10px 30px rgba(90, 70, 50, 0.08);
  --shadow-soft: 0 4px 16px rgba(90, 70, 50, 0.06);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container.narrow { max-width: 720px; }

.section { padding: 5rem 0; }
.section-tint { background: var(--cream-deep); }
.section-mission { padding-top: 4.5rem; }

.center { text-align: center; }

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  letter-spacing: -0.01em;
}
h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 0.8em;
}
h3 {
  font-size: 1.35rem;
  margin-bottom: 0.4em;
}

p { margin: 0 0 1.1rem; }
.lead {
  font-size: 1.25rem;
  color: var(--ink-soft);
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

/* ---------- Section kicker (small accent label above headings) ---------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 1rem;
}
.kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--accent);
  opacity: 0.55;
}
.kicker.center {
  display: flex;
  justify-content: center;
}
.kicker.center::after {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--accent);
  opacity: 0.55;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 5.5rem 0 7rem;
  background:
    radial-gradient(120% 120% at 15% 0%, var(--peach-soft) 0%, transparent 55%),
    radial-gradient(120% 120% at 90% 10%, var(--blue-soft) 0%, transparent 50%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-deep) 100%);
  overflow: hidden;
}
.hero-grid {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}
.hero .subhead { margin-left: auto; margin-right: auto; }
/* Keep the headline on one line once there's room; it still wraps on small screens. */
@media (min-width: 760px) {
  .hero h1 { white-space: nowrap; }
}
.hero .eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.2rem;
}
.hero h1 { margin-bottom: 0.3em; }
.hero .subhead {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  color: var(--ink-soft);
  max-width: 34ch;
  margin: 0 auto 2rem;
}
.hero-photo {
  position: relative;
  isolation: isolate;
}
.hero-photo img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 4px solid #fff;
}
/* offset pastel panel behind the photo */
.hero-photo::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 22px -20px -20px 22px;
  background: var(--sage-soft);
  border-radius: var(--radius-lg);
}

/* ---------- Split (image + copy) sections ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
}
.split-media {
  position: relative;
  isolation: isolate;
}
.split-media img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 4px solid #fff;
}
.split-media::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 22px 22px -20px -20px;
  background: var(--peach-soft);
  border-radius: var(--radius-lg);
}
.split-copy h2 { margin-bottom: 0.5em; }
.split-copy .lead { margin-bottom: 0; }

/* Soft wave at the bottom of the hero */
.hero-wave {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 60px;
  background: var(--cream);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60' preserveAspectRatio='none'%3E%3Cpath d='M0,30 C360,70 720,0 1080,20 C1260,30 1380,40 1440,30 L1440,60 L0,60 Z'/%3E%3C/svg%3E") bottom/100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60' preserveAspectRatio='none'%3E%3Cpath d='M0,30 C360,70 720,0 1080,20 C1260,30 1380,40 1440,30 L1440,60 L0,60 Z'/%3E%3C/svg%3E") bottom/100% 100% no-repeat;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.85rem 2rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover {
  background: var(--accent-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}
.btn-block { width: 100%; margin-top: 0.5rem; }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(150, 130, 110, 0.12);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.75rem 2rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}
/* accent bar across the top of each card */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--accent);
}
.card-num {
  position: absolute;
  top: 1.1rem;
  right: 1.4rem;
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  opacity: 0.12;
}
.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  font-size: 1.7rem;
  line-height: 1;
  border-radius: 50%;
  background: var(--peach-soft);
  margin-bottom: 1.1rem;
}
.card h3 { margin-bottom: 0.35em; }
.card p { margin: 0; color: var(--ink-soft); font-size: 1.02rem; }

/* Per-card pastel accents */
.card:nth-child(1)::before { background: var(--peach); }
.card:nth-child(1) .card-icon { background: var(--peach-soft); }
.card:nth-child(2)::before { background: var(--sage); }
.card:nth-child(2) .card-icon { background: var(--sage-soft); }
.card:nth-child(3)::before { background: var(--dusty-blue); }
.card:nth-child(3) .card-icon { background: var(--blue-soft); }

/* ---------- Signup form ---------- */
#signup { position: relative; overflow: hidden; }
#signup::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  top: -110px;
  left: -120px;
  background: radial-gradient(circle, var(--peach-soft) 0%, transparent 70%);
  opacity: 0.75;
}
#signup::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  bottom: -120px;
  right: -110px;
  background: radial-gradient(circle, var(--blue-soft) 0%, transparent 70%);
  opacity: 0.7;
}
#signup .container { position: relative; z-index: 1; }

.signup-intro {
  color: var(--ink-soft);
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2.5rem;
}
.signup-form {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(150, 130, 110, 0.1);
}
.field { margin-bottom: 1.35rem; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 0.4rem;
  color: var(--ink);
}
.req { color: var(--accent); }
.optional { color: var(--ink-faint); font-weight: 400; font-size: 0.9rem; }

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 1.05rem;
  color: var(--ink);
  padding: 0.75rem 0.9rem;
  background: var(--cream);
  border: 1.5px solid rgba(150, 130, 110, 0.22);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.field textarea { resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-soft);
}
.field select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b6258' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.6rem;
}

.form-message {
  margin: 1.25rem 0 0;
  text-align: center;
  font-weight: 600;
  border-radius: var(--radius);
  padding: 0;
  min-height: 0;
}
.form-message.show { padding: 0.9rem 1rem; }
.form-message.success { background: var(--sage-soft); color: #41613b; }
.form-message.error { background: var(--peach-soft); color: var(--accent-dark); }

/* ---------- Resources ---------- */
/* Resources as a subsection of "What is DPC?" */
.subsection {
  margin-top: 2.75rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(150, 130, 110, 0.2);
}
.subsection-title {
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
}

.resources {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
.resources a {
  display: block;
  position: relative;
  overflow: hidden;
  height: 100%;
  background: var(--cream-deep);
  border: 1px solid rgba(150, 130, 110, 0.14);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem 1.5rem 1.9rem;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
/* accent stripe down the left edge */
.resources a::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  background: var(--accent);
  opacity: 0.85;
}
.resources li:nth-child(2) a::before { background: var(--dusty-blue); }
.resources a:hover {
  transform: translateY(-3px);
  background: #fff;
  box-shadow: var(--shadow);
}
.res-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--accent-dark);
  margin-bottom: 0.25rem;
}
.res-arrow {
  display: inline-block;
  transition: transform 0.16s ease;
}
.resources a:hover .res-arrow { transform: translateX(5px); }
.res-desc { display: block; color: var(--ink-soft); font-size: 1rem; }

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: var(--cream);
  padding: 3.5rem 0;
}
.footer-contact {
  padding-bottom: 2.25rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid rgba(250, 244, 236, 0.15);
}
.footer-heading {
  font-size: clamp(1.6rem, 3vw, 2rem);
  color: var(--cream);
  margin-bottom: 0.5rem;
}
.footer-contact p { margin: 0; color: var(--cream); opacity: 0.9; }
.footer-contact a { color: var(--peach); text-decoration: underline; text-underline-offset: 2px; }
.footer-contact a:hover { color: #fff; }

.footer-ps {
  max-width: 60ch;
  margin: 0 auto;
  text-align: left;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--cream);
  opacity: 0.88;
}
.ps-label {
  font-family: var(--serif);
  font-weight: 600;
  font-style: italic;
  color: var(--peach);
  margin-right: 0.3rem;
}
.footer-ps a { color: var(--peach); text-decoration: underline; text-underline-offset: 2px; }
.footer-ps a:hover { color: #fff; }
.footer-fine { font-size: 0.9rem; color: var(--ink-faint); margin: 0; }

/* ---------- Responsive ---------- */

/* Tablet: ease the 3-up cards into 2 columns, tighten gaps */
@media (max-width: 960px) {
  .hero-grid { gap: 2.25rem; }
  .split { gap: 2.25rem; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile: stack everything to a single column */
@media (max-width: 760px) {
  body { font-size: 1.06rem; }
  .section { padding: 3.5rem 0; }
  .section-mission { padding-top: 3.5rem; }

  .hero { padding: 3.5rem 0 5rem; }
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  .hero .subhead { margin-left: auto; margin-right: auto; }
  .hero-photo { order: -1; }            /* photo above the copy on mobile */
  .hero-photo img { aspect-ratio: 16 / 10; }

  .split {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .split-media { order: -1; }           /* photo above the text on mobile */

  .cards { grid-template-columns: 1fr; gap: 1.1rem; }
  .signup-form { padding: 1.75rem 1.4rem; }

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

  /* tuck the offset panel back in so it sits behind, not beside, the photo */
  .hero-photo::before { inset: 16px -12px -14px 16px; }
  .split-media::before { inset: 16px 16px -14px -12px; }
}

/* Small phones */
@media (max-width: 420px) {
  .container { padding: 0 1.15rem; }
  .signup-form { padding: 1.4rem 1.1rem; }
  .btn { padding: 0.8rem 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
