:root {
  --home-bg: #f4f7fb;
  --home-surface: #ffffff;
  --home-surface-soft: #eef4fb;
  --home-text: #183153;
  --home-muted: #4b6077;
  --home-border: rgba(24, 49, 83, 0.12);
  --home-shadow: 0 20px 48px rgba(20, 39, 63, 0.12);
  --home-radius: 26px;
  --home-max-width: 1040px;
}

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

html {
  scroll-behavior: smooth;
}

body.homeMigrationBody {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(var(--theme-secondary-rgb, 227, 161, 32), 0.12), transparent 26%),
    linear-gradient(180deg, #fbfcfe 0%, var(--home-bg) 100%);
  color: var(--home-text);
}

body.homeMigrationBody img {
  display: block;
  max-width: 100%;
}

body.homeMigrationBody a {
  color: inherit;
  text-decoration: none;
}

.homeMigrationBody .container {
  width: min(calc(100% - 2rem), var(--home-max-width));
  margin: 0 auto;
  overflow: visible;
}

.hero,
.community,
.values,
.events,
.story,
.contact-section {
  scroll-margin-top: calc(var(--header-offset, 120px) + 1rem);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-heading {
  margin: 0 0 2rem 0;
  text-align: center;
}

.section-heading--light .section-title,
.section-heading--light .section-kicker {
  color: #fff;
}

.section-kicker {
  display: inline-block;
  margin: 0 0 0.75rem 0;
  color: var(--theme-secondary, #d49620);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-title {
  margin: 0;
  font-size: clamp(2rem, 3.8vw, 3.4rem);
  line-height: 1.05;
  font-weight: 700;
  color: var(--home-text);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(251, 252, 254, 0.88);
  border-bottom: 1px solid rgba(24, 49, 83, 0.08);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  min-height: 6rem;
  padding: 0.75rem 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-nav--left {
  justify-content: flex-start;
}

.site-nav--right {
  justify-content: flex-end;
}

.nav-link,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.95rem;
  padding: 0.8rem 1.35rem;
  border: 1px solid rgba(var(--theme-primary-rgb, 24, 49, 83), 0.16);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-link {
  background: rgba(255, 255, 255, 0.8);
  color: var(--home-text);
}

.nav-link:hover,
.nav-link:focus-visible {
  transform: translateY(-1px);
  background: var(--home-surface);
  border-color: rgba(var(--theme-primary-rgb, 24, 49, 83), 0.3);
  box-shadow: 0 12px 24px rgba(20, 39, 63, 0.08);
}

.button {
  background: var(--theme-primary, #183153);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 16px 30px rgba(var(--theme-primary-rgb, 24, 49, 83), 0.22);
}

.button:hover,
.button:focus-visible {
  background: var(--theme-primary-hover, #10233d);
  color: #fff;
  transform: translateY(-1px);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: none;
}

.button--ghost:hover,
.button--ghost:focus-visible {
  background: rgba(255, 255, 255, 0.2);
}

.brand {
  justify-self: center;
}

.brand-mark {
  width: auto;
  height: 92px;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 29.5rem;
  display: grid;
  place-items: center;
  padding: 3.5rem 0 2.8rem 0;
  background: #183153;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 25, 43, 0.2), rgba(11, 25, 43, 0.66)),
    linear-gradient(120deg, rgba(var(--theme-secondary-rgb, 227, 161, 32), 0.16), transparent 38%);
}

.hero-media,
.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-media img {
  object-fit: cover;
  object-position: center center;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
}

.hero h1 {
  max-width: 24rem;
  margin: 0 auto 1rem auto;
  font-size: 1.56rem;
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-summary {
  max-width: 56rem;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.9);
  font-size: 2.07rem;
  line-height: 1.5;
  font-weight: 300;
  letter-spacing: 0.02em;
  text-transform: none;
}

.intro-band {
  padding: 2.75rem 0;
  background: var(--theme-primary, #9168A4);
}

.intro-band .container {
  width: min(calc(100% - 2rem), 832px);
  color: #fff;
}

.intro-band-body {
  max-width: 72rem;
  margin: 0 auto;
}

.intro-band-body,
.intro-band-body p,
.intro-band-body li {
  color: #fff;
  font-size: 1.15rem;
  line-height: 1.35;
  text-align: center;
}

.intro-band-body p,
.intro-band-body ul,
.intro-band-body ol {
  margin: 0;
}

.intro-band-body p + p,
.intro-band-body p + ul,
.intro-band-body p + ol,
.intro-band-body ul + p,
.intro-band-body ol + p {
  margin-top: 1rem;
}

.intro-band-body a {
  color: #fff;
  text-decoration: underline;
}

.intro-band-body strong,
.intro-band-body h2,
.intro-band-body h3 {
  color: #fff;
}

.community,
.values,
.events,
.story {
  padding: 5.5rem 0;
}

.community {
  padding: 4.5rem 0;
}

.card-grid,
.events-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.info-card,
.event-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  background: var(--home-surface);
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius);
  box-shadow: var(--home-shadow);
}

.info-card {
  transform: translateZ(0);
  box-shadow: 0 20px 48px rgba(var(--theme-primary-rgb, 145, 104, 164), 0.24);
}

.event-card:hover,
.event-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 24px 52px rgba(20, 39, 63, 0.16);
}

.info-card-media {
  position: relative;
  overflow: hidden;
  min-height: 15rem;
  background-color: #d9e4f1;
}

.info-card-media picture,
.info-card-media img {
  display: block;
  width: 100%;
  height: 100%;
}

.info-card-media img {
  position: absolute;
  inset: 0;
  object-fit: cover;
  object-position: center center;
}

.info-card-body,
.event-card {
  padding: 1.5rem;
}

.info-card h3,
.event-card h3,
.value-item h3,
.story-copy h2 {
  margin: 0 0 0.85rem 0;
  color: var(--home-text);
  font-size: 1.45rem;
  line-height: 1.15;
}

.info-card p,
.event-card p,
.value-item p,
.story-copy p,
.story-richtext,
.story-richtext p {
  margin: 0;
  color: var(--home-muted);
  line-height: 1.7;
}

.info-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  color: var(--theme-primary, #183153);
  font-weight: 700;
}

.info-card-link::after {
  content: "→";
}

.values {
  position: relative;
  overflow: hidden;
  padding: 3.85rem 0;
  background: var(--theme-primary, #9168A4);
}

.values::before {
  content: "";
  position: absolute;
  inset: -18% 5%;
  z-index: 0;
  background: rgba(50, 18, 66, 0.36);
  -webkit-mask: url("/media/static/images/COPE-logo.svg") center center / contain no-repeat;
  mask: url("/media/static/images/COPE-logo.svg") center center / contain no-repeat;
  opacity: 0.8;
  pointer-events: none;
}

.values .container {
  position: relative;
  z-index: 1;
}

.values .section-heading {
  margin: 0 0 2rem 0;
}

.values .section-title,
.values .section-kicker {
  color: #fff;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
  margin: 0;
}

.value-item {
  padding: 1.5rem;
  background: transparent;
  border: 0;
  text-align: center;
}

.value-item h3,
.value-item p {
  color: #fff;
}

.value-item p {
  opacity: 0.92;
}

.events {
  background:
    linear-gradient(rgba(24, 49, 83, 0.82), rgba(24, 49, 83, 0.82)),
    url("/media/static/images/kids-sitting-grass-lg.webp") center center / cover no-repeat;
}

.events-grid {
  align-items: stretch;
}

.event-card {
  background: rgba(255, 255, 255, 0.96);
}

.event-date {
  display: inline-block;
  margin: 0 0 0.85rem 0;
  color: var(--theme-secondary, #d49620);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.story-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}

.story-image {
  overflow: hidden;
  border-radius: calc(var(--home-radius) + 4px);
  box-shadow: var(--home-shadow);
  background: #dce8f4;
  min-height: 24rem;
}

.story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-copy {
  padding: 1rem 0;
}

.story-copy h2 {
  font-size: clamp(2rem, 3.2vw, 3.2rem);
}

.story-richtext {
  margin-bottom: 1.5rem;
}

.story-richtext p + p {
  margin-top: 1rem;
}

.contact-section {
  padding: 5.5rem 0;
  background: #fff;
}

.contact-shell {
  max-width: 920px;
  margin: 0 auto;
}

.contact-section .publicForm {
  width: 100%;
  margin: 0;
}

.contact-section .publicFormFieldset {
  margin: 0;
  padding: 2rem;
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius);
  background: var(--home-surface);
  box-shadow: var(--home-shadow);
}

.contact-section .publicForm legend {
  padding: 0 0.5rem;
  color: var(--theme-primary, #9168A4);
  font-size: 1.35rem;
  line-height: 1.2;
  font-weight: 700;
}

.contact-section .publicFormRequiredNote {
  margin: 0 0 1.25rem 0;
  color: var(--home-muted);
}

.contact-section .statusMessage {
  margin: 0 0 1.25rem 0;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(var(--theme-secondary-rgb, 227, 161, 32), 0.14);
  color: var(--home-text);
  font-weight: 700;
}

.contact-section .publicFormGrid,
.contact-section .publicFormSubgrid {
  display: grid;
  gap: 1rem 1.25rem;
  overflow: visible;
}

.contact-section .publicFormGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-section .publicFormSubgrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-section .span6 {
  float: none;
  width: auto;
  margin-left: 0;
}

.contact-section .publicForm label {
  display: inline-block;
  margin: 0 0 0.4rem 0;
  color: var(--home-text);
  font-size: 0.9rem;
  font-weight: 700;
}

.contact-section .publicForm em {
  color: var(--theme-secondary, #d49620);
  font-style: normal;
}

.contact-section .publicForm input:not([type=submit]):not([type=radio]):not([type=checkbox]),
.contact-section .publicForm textarea,
.contact-section .publicForm select {
  width: 100%;
  margin: 0 0 1rem 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(24, 49, 83, 0.14);
  border-radius: 14px;
  background: #f6f8fb;
  color: var(--home-text);
  font: inherit;
}

.contact-section .publicForm input:not([type=submit]):not([type=radio]):not([type=checkbox]):focus,
.contact-section .publicForm textarea:focus,
.contact-section .publicForm select:focus {
  outline: 2px solid rgba(var(--theme-primary-rgb, 145, 104, 164), 0.28);
  outline-offset: 2px;
  background: #fff;
}

.contact-section .publicForm button {
  width: 100%;
  margin: 0;
  border-radius: 999px;
  background: var(--theme-primary, #9168A4);
  border-color: var(--theme-primary, #9168A4);
}

.contact-section .publicForm button:hover,
.contact-section .publicForm button:focus {
  background: var(--theme-primary-hover, #745185);
  border-color: var(--theme-primary-hover, #745185);
}

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

.site-footer {
  padding: 1.9rem 0;
  background: #10233d;
  color: rgba(255, 255, 255, 0.92);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr auto auto auto;
  gap: 1rem 1.5rem;
  align-items: center;
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.45);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration-color: #fff;
}

@media (max-width: 1080px) {
  .header-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.75rem;
    padding: 1rem 0 1.1rem 0;
  }

  .site-nav,
  .site-nav--left,
  .site-nav--right {
    justify-content: center;
  }

  .card-grid,
  .events-grid,
  .story-layout,
  .values-grid,
  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-inner > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 749px) {
  .homeMigrationBody .container {
    width: min(calc(100% - 1.25rem), var(--home-max-width));
  }

  .brand-mark {
    height: 74px;
  }

  .hero {
    min-height: 24rem;
    padding: 3rem 0 2.4rem 0;
  }

  .hero h1 {
    max-width: 22rem;
  }

  .community,
  .values,
  .events,
  .story,
  .contact-section {
    padding: 4.5rem 0;
  }

  .intro-band .container {
    width: min(calc(100% - 1.25rem), 832px);
  }

  .values {
    padding: 3.15rem 0;
  }

  .card-grid,
  .events-grid,
  .story-layout,
  .values-grid,
  .footer-inner,
  .contact-section .publicFormGrid,
  .contact-section .publicFormSubgrid {
    grid-template-columns: 1fr;
  }

  .contact-section .publicFormFieldset {
    padding: 1.35rem;
  }

  .nav-link {
    width: 100%;
  }

  .site-nav {
    width: 100%;
  }

  .info-card-media {
    min-height: 12rem;
  }
}
