/*
 * Shared chrome for every internal page: the page hero and the section
 * surface variants.
 */

/* ---------------------------------------------------------------- Surfaces */

.section-pattern--white { --section-surface: var(--color-card-cool); background: var(--section-surface); }
.section-pattern--paper { --section-surface: var(--color-paper); background: var(--section-surface); }
.section-pattern--sage { --section-surface: var(--color-paper-deep); background: var(--section-surface); }
.section-pattern--mist { --section-surface: var(--color-paper-deep); background: var(--section-surface); }

/* A section whose first child sits close under the page hero. */
.section-pattern--overlap { padding-top: clamp(var(--space-xl), 4vw, var(--space-2xl)); }

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

.page-hero {
  position: relative;
  isolation: isolate;
  padding:
    clamp(var(--space-2xl), 5.5vw, var(--space-3xl))
    var(--section-padding-x)
    clamp(var(--space-2xl), 5.5vw, 4.75rem);
  overflow: clip;
  background:
    radial-gradient(ellipse 60% 72% at 6% 0%, var(--color-wash-blush), transparent 62%),
    radial-gradient(ellipse 54% 64% at 96% 4%, var(--color-wash-gold), transparent 64%),
    linear-gradient(166deg, var(--color-blush) 0%, var(--color-cream-deep) 58%, var(--color-cream) 100%);
}

.page-hero__grid {
  display: grid;
  align-items: center;
  gap: clamp(var(--space-2xl), 6vw, var(--space-3xl));
}

.page-hero__content {
  width: min(100%, 46rem);
  margin-inline: auto;
  text-align: center;
}

.page-hero h1 {
  max-width: 20ch;
  margin-inline: auto;
}

.page-hero .eyebrow { margin-bottom: var(--space-m); }

.page-hero__lede {
  max-width: 52ch;
  margin: var(--space-m) auto 0;
  color: var(--color-ink-soft);
  font-size: var(--text-l);
}

/* Hairline ornament that separates the title from the page below. */
.page-hero__ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-l);
}

.page-hero__ornament::before,
.page-hero__ornament::after {
  content: "";
  width: clamp(var(--space-xl), 6vw, 3.25rem);
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-gold-soft));
}

.page-hero__ornament::after { background: linear-gradient(to left, transparent, var(--color-gold-soft)); }

.page-hero__ornament i {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--color-gold-soft);
}

.page-hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs) var(--space-l);
  margin-top: var(--space-m);
  color: var(--color-ink-muted);
  font-size: var(--text-xs);
  line-height: var(--line-height-meta);
}

.page-hero__meta > * { display: inline-flex; align-items: center; gap: var(--space-2xs); }

.page-hero__meta > * + *::before {
  content: "";
  width: 0.25rem;
  height: 0.25rem;
  margin-right: var(--space-s);
  border-radius: 50%;
  background: var(--color-gold-soft);
}

.page-hero__actions { justify-content: center; margin-top: var(--space-l); }

.page-hero__decor {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.page-hero__decor::before {
  content: "";
  position: absolute;
  top: -30%;
  left: 50%;
  width: min(48rem, 90vw);
  aspect-ratio: 2 / 1;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--color-white) 75%, transparent), transparent 68%);
  transform: translateX(-50%);
}

/* Media variant: text keeps the reading rhythm, the portrait sits beside it. */
.page-hero--with-media .page-hero__grid {
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.74fr);
}

.page-hero--with-media .page-hero__content {
  width: 100%;
  margin-inline: 0;
  text-align: start;
}

.page-hero--with-media h1,
.page-hero--with-media .page-hero__lede { margin-inline: 0; }
.page-hero--with-media .page-hero__ornament { justify-content: flex-start; }
.page-hero--with-media .page-hero__ornament::before { display: none; }
.page-hero--with-media .page-hero__meta,
.page-hero--with-media .page-hero__actions { justify-content: flex-start; }
.page-hero--with-media .page-hero__media { min-height: clamp(17rem, 28vw, 26rem); }

/* --------------------------------------------------------- Section heading */

.section-heading--start {
  max-width: 42rem;
  margin-inline: 0;
  text-align: start;
}

.section-heading--start h2 { margin-inline: 0; }
.section-heading--wide h2 { max-width: 26ch; }

/* ---------------------------------------------------------- Reading blocks */

.section-lede {
  max-width: 46rem;
  margin: 0 auto clamp(var(--space-xl), 4vw, var(--space-2xl));
  color: var(--color-ink-soft);
  font-size: var(--text-l);
  text-align: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-gold-deep);
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.back-link span { transition: transform var(--transition-standard); }
.back-link:hover span,
.back-link:focus-visible span { transform: translateX(-0.25rem); }

/* ------------------------------------------------------------- Empty state */

.empty-state {
  width: min(100%, 34rem);
  margin-inline: auto;
  padding: clamp(var(--space-xl), 4vw, var(--space-2xl));
  border: var(--border-width-thin) dashed var(--color-line-medium);
  border-radius: var(--radius-l);
  background: var(--color-card-warm);
  color: var(--color-ink-soft);
  text-align: center;
}

@media (max-width: 55rem) {
  .page-hero--with-media .page-hero__grid { grid-template-columns: 1fr; }
  .page-hero--with-media .page-hero__media { width: min(100%, 30rem); }
}

@media (prefers-reduced-motion: reduce) {
  .back-link span { transition: none; }
}

/* ------------------------------------------------- Section heading portrait */

/*
 * A round photo above a section heading. Text-only bands are the weakest part
 * of the internal pages, and this reuses the homepage quote portrait's ring so
 * the extra colour still reads as the same system.
 */
.section-heading__media {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  margin-bottom: var(--space-m);
}

.section-heading--start .section-heading__media { justify-items: start; }

.section-heading__ring {
  position: absolute;
  z-index: 1;
  width: calc(var(--section-heading-avatar) + 1.4rem);
  height: calc(var(--section-heading-avatar) + 1.4rem);
  border: var(--border-width-thin) solid var(--color-line-medium);
  border-radius: 50%;
  pointer-events: none;
}

.section-heading--start .section-heading__ring { left: -0.7rem; }

.section-heading__image {
  position: relative;
  z-index: 2;
  width: var(--section-heading-avatar);
  height: var(--section-heading-avatar);
  border: 4px solid var(--color-white);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.section-heading__media--pulse::before,
.section-heading__media--pulse::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: calc(var(--section-heading-avatar) + var(--space-l));
  height: calc(var(--section-heading-avatar) + var(--space-l));
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--color-gold-soft) 82%, transparent) 0%,
    color-mix(in srgb, var(--color-gold-soft) 44%, transparent) 54%,
    transparent 72%
  );
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.68);
  transform-origin: center;
  animation: section-portrait-pulse 8s var(--easing-emphasized) infinite;
  pointer-events: none;
  will-change: opacity, transform;
}

.section-heading__media--pulse {
  width: var(--section-heading-avatar);
  margin-inline: auto;
}

.section-heading--start .section-heading__media--pulse { margin-inline: 0; }
.section-heading__media--pulse::after { animation-delay: -4s; }
.has-reveal-motion .reveal:not(.is-visible) .section-heading__media--pulse::before,
.has-reveal-motion .reveal:not(.is-visible) .section-heading__media--pulse::after { animation-play-state: paused; }

@keyframes section-portrait-pulse {
  0% { opacity: 0.42; transform: translate(-50%, -50%) scale(0.68); }
  72% { opacity: 0.16; transform: translate(-50%, -50%) scale(1.4); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.72); }
}

/* Inside a split the heading sits with its copy, so it keeps the flow spacing. */
.section-heading--inline {
  max-width: none;
  margin-bottom: var(--space-m);
}

@media (prefers-reduced-motion: reduce) {
  .section-heading__media--pulse::before,
  .section-heading__media--pulse::after { animation: none; }
}
