/* Pentecostals of Wilmington: components. Direction "Sunday Paper":
   editorial type on warm paper, navy anchor bands, brand blue as the voice.
   Structure comes from scale, rules and space, not from boxes inside boxes. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  scrollbar-color: var(--color-brand) var(--color-paper);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  font-size: var(--fs-18);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--color-brand);
}
body.is-locked { overflow: hidden; }
::selection { background: var(--color-brand); color: var(--color-on-dark); }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; border-radius: 6px; }
.band--navy :focus-visible, .menu :focus-visible { outline-color: var(--color-on-dark); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -60px; z-index: 60;
  background: var(--color-ink); color: var(--color-on-dark);
  padding: var(--space-10) var(--space-20); border-radius: var(--radius-sm); font-weight: var(--fw-bold);
}
.skip-link:focus { top: var(--gutter); }
.page { position: relative; overflow-x: clip; }

/* ---------- Bands ---------- */
.band {
  --pad-x: max(var(--gutter), calc((100% - var(--content-max)) / 2));
  padding: var(--section-y) var(--pad-x);
}
.band--navy { background: var(--color-navy); color: var(--color-on-dark); }
.band--paper2 { background: var(--color-paper-2); }

/* ---------- Type ---------- */
.h-display { font-size: var(--fs-44); font-weight: var(--fw-bold); line-height: 1; letter-spacing: -0.035em; }
.h-section { font-size: var(--fs-34); font-weight: var(--fw-bold); line-height: 1.05; letter-spacing: -0.025em; }
.lead { font-size: var(--fs-24); font-weight: var(--fw-medium); line-height: 1.35; max-width: 32ch; }
.lead p + p { margin-top: 0.9em; }

/* ---------- Top bar (Figma 49:11): solid, always present ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; padding: 10px 12px 10px var(--gutter);
  background: var(--color-paper); border-bottom: 1px solid var(--color-rule);
}
.topbar__logo img { width: 115px; height: 40px; object-fit: contain; }
.topbar__right { display: flex; align-items: center; gap: 12px; }
.topbar__times { font-size: 14px; font-weight: var(--fw-semibold); color: var(--color-ink-soft); font-variant-numeric: tabular-nums; }

/* ---------- Menu button (Figma 53:10) ---------- */
.menu-btn {
  position: relative; display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: var(--color-paper-2); cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}
.menu-btn:hover { background: var(--color-ink); }
.menu-btn:hover .menu-btn__bars, .menu-btn:hover .menu-btn__bars::before, .menu-btn:hover .menu-btn__bars::after { background: var(--color-on-dark); }
.menu-btn:active { transform: scale(.94); }
.menu-btn__bars, .menu-btn__bars::before, .menu-btn__bars::after {
  display: block; width: 18px; height: 2px; border-radius: 1px; background: var(--color-ink);
  transition: background-color var(--dur-base) var(--ease-out);
}
.menu-btn__bars { position: relative; }
.menu-btn__bars::before, .menu-btn__bars::after { content: ""; position: absolute; left: 0; }
.menu-btn__bars::before { top: -6px; }
.menu-btn__bars::after { top: 6px; }
.menu-btn--close { background: var(--color-paper); }
.menu-btn--close .menu-btn__bars, .menu-btn--close:hover .menu-btn__bars { background: transparent; }
.menu-btn--close .menu-btn__bars::before { top: 0; rotate: 45deg; width: 20px; left: -1px; }
.menu-btn--close .menu-btn__bars::after { top: 0; rotate: -45deg; width: 20px; left: -1px; }

/* ---------- Menu (Figma 53:297) ---------- */
.menu {
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--color-navy); color: var(--color-on-dark);
  overflow-y: auto;
}
.menu::backdrop { background: transparent; }
.menu__inner {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-40);
  min-height: 100%; max-width: var(--content-max); margin-inline: auto;
}
.menu__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px var(--gutter); min-height: 64px; }
.menu__head img { width: 115px; height: 40px; object-fit: contain; }
.menu__nav { display: flex; flex-direction: column; gap: var(--space-40); padding: var(--space-24) var(--gutter) 0; }
.menu__main { display: flex; flex-direction: column; gap: var(--space-8); }
.menu__main a { font-size: var(--fs-34); font-weight: var(--fw-bold); line-height: 1.1; letter-spacing: -0.025em; }
.menu__group { padding-top: var(--space-20); border-top: 1px solid var(--color-rule-on-dark); }
.menu__group-title { font-size: var(--fs-18); font-weight: var(--fw-semibold); margin-bottom: var(--space-10); }
.menu__sub { display: flex; flex-direction: column; gap: var(--space-10); }
.menu__sub a { font-size: var(--fs-24); font-weight: var(--fw-medium); }
.menu a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.menu__main a, .menu__sub a { display: inline-block; transition: translate var(--dur-base) var(--ease-out); }
.menu__main a:hover, .menu__sub a:hover { translate: 6px 0; }
.menu__foot { display: flex; flex-direction: column; gap: var(--space-14); padding: 0 var(--gutter) 32px; }
.menu__times { font-size: 22px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.menu__legal { display: flex; gap: 20px; font-size: 14px; font-weight: var(--fw-semibold); padding-top: 4px; }
.menu .btn--pill { background: var(--color-on-dark); color: var(--color-navy); }
.menu[open] { animation: menu-in var(--dur-base) var(--ease-out); }
.menu[open] .menu__nav li, .menu[open] .menu__group-title { animation: menu-item 420ms var(--ease-out) both; animation-delay: calc(80ms + var(--i, 0) * 35ms); }
@keyframes menu-in { from { opacity: 0; translate: 0 -24px; } }
@keyframes menu-item { from { opacity: 0; translate: 0 10px; } }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 28px; border: 0; border-radius: var(--radius-lg); cursor: pointer;
  font-size: var(--fs-18); font-weight: var(--fw-bold); line-height: 1.2; white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--color-brand); color: var(--color-on-dark); }
.btn--primary:hover { background: var(--color-brand-deep); }
.btn--light { background: var(--color-on-dark); color: var(--color-navy); }
.btn--light:hover { background: #fff; }
.btn--pill, .btn--block { width: 100%; }

.link-cta {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font-size: var(--fs-18); font-weight: var(--fw-bold); color: var(--color-ink);
  transition: color var(--dur-base) var(--ease-out);
}
.link-cta::after, .link-list a::after, .ministry__more::after {
  content: ""; flex: none; width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: -45deg;
  transition: translate var(--dur-base) var(--ease-out);
}
.link-cta:hover::after, .link-list a:hover::after, .ministry:hover .ministry__more::after { translate: 4px 0; }
.link-cta:hover { color: var(--color-brand); }

/* ---------- Hero ---------- */
.hero {
  --pad-x: max(var(--gutter), calc((100% - var(--content-max)) / 2));
  display: grid; gap: 28px;
  padding: clamp(32px, 6vw, 72px) var(--pad-x) 48px;
}
.hero__title {
  font-size: var(--fs-mega); font-weight: var(--fw-bold); line-height: .98; letter-spacing: -0.045em;
  max-width: 13ch;
  animation: rise 900ms var(--ease-out) 120ms backwards;
}
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; animation: rise 900ms var(--ease-out) 260ms backwards; }
/* Hero photo: rounded inset card at the photo's own proportions (Figma 64:605), then the next gathering */
.hero__figure { display: grid; gap: var(--space-20); }
.hero__photo {
  width: 100%; height: auto; aspect-ratio: 671 / 749;
  border-radius: var(--radius-lg); object-fit: cover; object-position: 50% 100%;
  animation: hero-focus 1.4s var(--ease-out) backwards;
}
.hero__next { display: grid; gap: 2px; }
.hero__next-label { font-size: var(--fs-16); }
.hero__next-title { font-size: var(--fs-24); font-weight: var(--fw-semibold); line-height: 1.2; letter-spacing: -0.015em; }
.hero__next-when { font-size: var(--fs-18); font-variant-numeric: tabular-nums; }
.hero__next-when strong { font-weight: var(--fw-bold); }
@keyframes rise { from { opacity: 0; translate: 0 16px; } }
@keyframes hero-focus { from { opacity: .4; filter: blur(10px); } }

/* ---------- New Here (navy): values light up in place as they scroll through ---------- */
.new-here { display: grid; gap: var(--space-40); }
.values__stage { display: grid; gap: 28px; }
.values__statement { display: grid; gap: 6px; }
.values__intro { font-size: var(--fs-18); font-weight: var(--fw-medium); color: var(--color-on-dark-soft); margin-bottom: 6px; }
.values__line {
  display: block; color: var(--color-sky);
  font-size: clamp(2rem, 1.1rem + 3.8vw, 4.75rem); font-weight: var(--fw-bold); line-height: 1.04; letter-spacing: -0.035em;
}
/* Scroll reveal: only when the script is running and motion is welcome. No pinning, no extra space. */
.values.is-live .values__line {
  opacity: calc(.16 + .84 * var(--t, 0));
  translate: 0 calc((1 - var(--t, 0)) * .35em);
}
.new-here__body { display: grid; gap: 16px; max-width: 40rem; }
.values.is-live + .new-here__body { opacity: var(--f, 1); translate: 0 calc((1 - var(--f, 1)) * 16px); }
.new-here__text { font-size: 20px; line-height: 1.5; color: var(--color-on-dark-soft); }
.new-here__invite { font-size: 22px; font-weight: var(--fw-semibold); line-height: 1.3; }
.new-here__body .link-list { margin-top: 24px; }
.link-list { display: flex; flex-direction: column; border-top: 1px solid var(--color-rule-on-dark); }
.link-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; border-bottom: 1px solid var(--color-rule-on-dark);
  font-size: var(--fs-24); font-weight: var(--fw-bold); letter-spacing: -0.01em;
  transition: color var(--dur-base) var(--ease-out);
}
.link-list a:hover { color: #fff; }

/* ---------- Ministries ---------- */
.ministries { display: grid; gap: var(--space-40); }
.ministries__grid { display: grid; gap: var(--space-40); }
.ministries__photo { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3; }
.ministries__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.ministry-list { border-top: 1px solid var(--color-rule-strong); }
.ministry { display: grid; gap: 6px; padding: 22px 0; border-bottom: 1px solid var(--color-rule-strong); }
.ministry__name { font-size: var(--fs-34); font-weight: var(--fw-bold); line-height: 1.05; letter-spacing: -0.025em; transition: color var(--dur-base) var(--ease-out); }
.ministry__text { color: var(--color-ink-soft); max-width: 44ch; }
.ministry__more { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; font-weight: var(--fw-bold); color: var(--color-brand); }
.ministry:hover .ministry__name { color: var(--color-brand); }

/* ---------- Upcoming dates ---------- */
.dates { display: grid; gap: var(--space-24); }
.schedule { border-top: 1px solid var(--color-rule-strong); }
.schedule__row {
  display: grid; grid-template-columns: 84px 1fr; align-items: baseline; gap: 16px;
  padding: 18px 0; border-bottom: 1px solid var(--color-rule-strong);
}
.schedule__date { display: flex; flex-direction: column; line-height: 1; }
.schedule__month { font-size: 14px; font-weight: var(--fw-semibold); color: var(--color-brand); }
.schedule__day { font-size: var(--fs-28); font-weight: var(--fw-bold); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.schedule__title { font-size: var(--fs-24); font-weight: var(--fw-semibold); letter-spacing: -0.015em; line-height: 1.2; }
.schedule__time { color: var(--color-ink-soft); font-variant-numeric: tabular-nums; }
.dates__note { color: var(--color-ink-soft); font-size: var(--fs-16); }

/* ---------- Get connected + FAQ ---------- */
.connect { display: grid; gap: var(--section-y); }
.connect .h-section { margin-bottom: var(--space-24); }
.form { display: flex; flex-direction: column; gap: var(--space-18); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: var(--fs-16); font-weight: var(--fw-semibold); }
.field__input {
  width: 100%; min-height: 52px; padding: 12px 16px;
  background: transparent; border: 1.5px solid var(--color-rule-strong); border-radius: var(--radius-sm);
  font-size: var(--fs-18); color: var(--color-ink);
  transition: border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.field__input:hover { border-color: var(--color-ink); }
.field__input:focus { outline: none; border-color: var(--color-brand); background: #fff; box-shadow: 0 0 0 3px rgb(61 102 146 / .18); }
textarea.field__input { min-height: 120px; resize: vertical; }
.form__status { font-size: var(--fs-16); font-weight: var(--fw-semibold); min-height: 1.2em; }

.faq { border-top: 1px solid var(--color-rule-strong); }
.faq__item { border-bottom: 1px solid var(--color-rule-strong); }
.faq__q {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-20);
  min-height: 64px; padding: 14px 0; cursor: pointer; list-style: none;
  font-size: var(--fs-18); font-weight: var(--fw-semibold); line-height: 1.3;
  transition: color var(--dur-base) var(--ease-out);
}
.faq__q:hover { color: var(--color-brand); }
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-top: -5px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg;
  transition: rotate var(--dur-base) var(--ease-out), margin var(--dur-base) var(--ease-out);
}
.faq__item[open] .faq__q::after { rotate: 225deg; margin-top: 5px; }
.faq__a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-base) var(--ease-out); }
.faq__a > div { overflow: hidden; }
.faq__a p { padding: 0 0 20px; color: var(--color-ink-soft); max-width: 60ch; }
.faq__item[open] .faq__a { grid-template-rows: 1fr; }

/* ---------- Visit (navy) ---------- */
.visit { display: grid; gap: var(--space-40); }
.visit__copy { display: grid; gap: var(--space-18); justify-items: start; }
.visit__time { font-size: var(--fs-24); font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; }
.visit__map { border-radius: var(--radius-lg); overflow: hidden; background: var(--color-paper-2); }
.visit__map iframe { display: block; width: 100%; height: 320px; border: 0; }

/* ---------- Footer ---------- */
.site-footer { display: grid; gap: var(--space-40); }
.footer-nav { display: grid; gap: var(--space-24); }
.footer-nav__title { font-size: 14px; font-weight: var(--fw-semibold); color: var(--color-ink-soft); padding-bottom: var(--space-8); border-bottom: 1px solid var(--color-rule-strong); margin-bottom: var(--space-10); }
.footer-nav__links { display: flex; flex-direction: column; gap: var(--space-8); }
.footer-nav a {
  font-size: var(--fs-18);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.footer-nav a:hover { background-size: 100% 1px; color: var(--color-brand); }
.footer-nav a[aria-current="page"] { color: var(--color-brand); font-weight: var(--fw-bold); }
.footer-logo img { width: 160px; height: 56px; object-fit: contain; }

/* ---------- Scroll-linked heading wipe (where supported; visible otherwise) ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .t-wipe { animation: wipe linear both; animation-timeline: view(); animation-range: entry 5% cover 28%; }
    @keyframes wipe { from { clip-path: inset(0 0 100% 0); translate: 0 .3em; } to { clip-path: inset(0 0 -12% 0); translate: 0 0; } }
  }
}

/* ---------- Tablet and up ---------- */
@media (min-width: 768px) {
  .hero { grid-template-columns: 1fr 1fr; align-items: end; gap: 48px; }
  .hero { align-items: center; gap: 48px; }
  .hero__photo { max-height: 72vh; }
  .ministries__grid { grid-template-columns: 1fr 1.15fr; align-items: start; gap: 48px; }
  .ministries__photo { aspect-ratio: 4 / 5; }
  .connect { grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
  .visit { grid-template-columns: 1fr 1.4fr; align-items: center; gap: 64px; }
  .visit__map iframe { height: 420px; }
  .site-footer { grid-template-columns: 3fr 1fr; align-items: end; }
  .footer-nav { grid-template-columns: repeat(3, 1fr); }
  .footer-logo { justify-self: end; }
}

@media (min-width: 1100px) {
  .dates { grid-template-columns: 1fr 2fr; column-gap: 64px; align-items: start; }
  .dates__note { grid-column: 2; }
  .schedule__row { grid-template-columns: 120px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__title, .hero__actions, .hero__photo { animation: none; }
  .menu[open], .menu[open] .menu__nav li, .menu[open] .menu__group-title { animation-name: fade; }
  .menu__main a:hover, .menu__sub a:hover { translate: none; }
  .values .values__line { opacity: 1; translate: none; }
  @keyframes fade { from { opacity: 0; } }
}
