@layer components {

  /* UI chrome — override WP global link underline if it reappears */
  .nav a,
  .footer__row a,
  .btn,
  .primary-cta__ticket,
  .access-card-wrap .card,
  .cta-cards__card,
  .nav__logo {
    text-decoration: none;
  }

  /*
   * Fixed nav overlays #main. Hero sections clear it themselves; every other page
   * gets a generous top band before the first block. Section shells (.canvas,
   * Conxious blocks) pull up into that band so we do not double their padding.
   */
  body:not(.starts-with-hero) #main > .entry-content {
    padding-top: var(--content-below-header);
  }

  body:not(.starts-with-hero) #main > .entry-content > :first-child:is(
    section.canvas,
    section[class*="wp-block-conxious-"]
  ) {
    margin-block-start: calc(-1 * var(--content-below-header));
    padding-block-start: max(
      var(--content-below-header),
      clamp(96px, 12vw, 180px)
    );
  }

  body:not(.starts-with-hero) #main > .entry-content > :first-child.canvas--slide {
    padding-block-start: max(var(--content-below-header), var(--section-v-slide));
  }

  nav,
  .btn,
  .nav__link,
  .nav__hamburger,
  .scroll-cue,
  .card__label,
  .people__card-name,
  .footer__row,
  .masthead {
    font-family: var(--sans);
  }

  /*
   * Conxious sections that remain direct children of `.is-layout-constrained` (no pinned-hero curtain).
   * Exclude `.hero` — pinned hero canvases overlap the fixed gallery; vw margin breakout breaks that setup.
   * When `.page-curtain.alignfull` is present it carries full-bleed; inner sections fill that shell (no vw hack).
   */
  .is-layout-constrained > section[class*="wp-block-conxious-"].alignfull:not(.hero) {
    box-sizing: border-box;
    max-width: none;
    width: 100%;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }

  /* Non-block curtain wrapper — still needs breakout past WP constrained layout on its direct parent. */
  .is-layout-constrained > .page-curtain.alignfull {
    box-sizing: border-box;
    max-width: none !important;
    width: 100%;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }

  /*
   * Pinned hero (waterdrop canvas / video): one curtain wraps all post-hero blocks
   * (see inc/hero-curtain.php). Solid canvas fill covers gaps between sections and
   * core blocks without their own background.
   */
  body.has-pinned-hero #main {
    display: flex;
    flex-direction: column;
  }

  .page-curtain {
    position: relative;
    margin-block-start: 0 !important;
    z-index: 1;
    flex: 1 0 auto;
    display: flow-root;
    isolation: isolate;
    background-color: var(--canvas);
    /* At least one viewport of opaque cover over the pinned hero (e.g. lone core blocks). */
    min-height: 100vh;
    min-height: 100svh;
  }

  /* Bare core blocks (no section shell): full-width canvas slab over pinned media. */
  .page-curtain > :where(
    :not(section):not(.alignfull):not([class*="wp-block-conxious"])
  ) {
    box-sizing: border-box;
    width: 100%;
    margin-block: 0;
    padding-inline: var(--pad-x);
    padding-block: clamp(16px, 2.5vh, 32px);
    background-color: var(--canvas);
  }

  .page-curtain > :where(
    :not(section):not(.alignfull):not([class*="wp-block-conxious"])
  )
    + :where(:not(section):not(.alignfull):not([class*="wp-block-conxious"])) {
    padding-block-start: 0;
  }

  /*
   * Cover pinned hero only once prelude is stuck (see footer.js). An always-on
   * upward spread shadow painted over #main (z-index 1) and clipped the last
   * sections (e.g. picnic #entry) sitting just above the prelude in the flow.
   */
  body.has-pinned-hero .footer-prelude.footer-prelude--stuck {
    /* box-shadow: 0 -100dvh 0 100dvh var(--canvas); */
  }

  /* ─── canvas (section frame) ───────────────────────────── */
  .canvas {
    position: relative;
    width: 100%;
    padding: clamp(96px, 12vw, 180px) var(--pad-x);
  }
  .canvas--slide {
    min-height: 100vh;
    min-height: 100svh;
    padding: var(--section-v-slide) var(--pad-x);
    display: flex;
    flex-direction: column;
  }
  /* Full-bleed section panels — no gutters (high specificity in @layer components beats .canvas--slide). */
  section#entry.primary-cta--ticket.canvas.canvas--slide,
  section#how-to-enter.primary-cta.primary-cta--button.canvas {
    padding: 0;
    margin-bottom: 0;
  }

  /*
   * Hero: .canvas--slide adds 12vh vertical padding that stacks on .hero rules in @layer blocks
   * (block styles load after theme CSS). Shell padding lives here so bottom-anchored copy
   * actually controls the gap above the viewport edge.
   */
  section.hero.canvas.canvas--slide {
    padding-top: 0;
    padding-inline: var(--pad-x);
    padding-bottom: max(40px, env(safe-area-inset-bottom, 0px), 7vh);
  }

  @media (max-width: 900px) {
    section.hero.canvas.canvas--slide {
      padding-bottom: max(24px, env(safe-area-inset-bottom, 0px), clamp(20px, 3.5svh, 36px));
    }
  }

  /* Side-photo primary CTAs: inner is 100vw full-bleed, so it carries the horizontal gutter that .canvas / .canvas--slide padding would otherwise provide.
     Mobile keeps per-element padding on copy/action (primary-cta__inner is not 100vw there). */
  @media (min-width: 901px) {
    section#entry .primary-cta__inner,
    section#how-to-enter .primary-cta__inner {
      padding-inline: var(--pad-x);
    }
  }

  /* Full-bleed photo flush to section top (must live in components — beats @layer blocks) */
  .canvas.canvas--slide.primary-cta.primary-cta--large-photo {
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: var(--primary-cta-tail);
  }
  .canvas.two-columns-big-image {
    padding-top: 0;
  }
  body:not(.starts-with-hero) #main > .entry-content > :first-child.canvas.two-columns-big-image {
    padding-block-start: 0;
  }
  /* No section gutters — center panel on WP wide-size rail (theme.json wideSize) */
  .canvas.canvas--slide.primary-cta.primary-cta--large-photo .primary-cta__inner.layout-shell {
    align-self: center;
    width: min(
      calc(100% - 2 * var(--pad-x)),
      var(--wp--style--global--wide-size, var(--layout-max-main))
    );
    max-width: min(
      calc(100% - 2 * var(--pad-x)),
      var(--wp--style--global--wide-size, var(--layout-max-main))
    );
  }
  .canvas--narrow > * {
    max-width: var(--layout-max-main);
    margin-inline: auto;
    width: 100%;
  }
  .canvas [aria-hidden="true"][class*="__bg"] {
    overflow: hidden;
  }

  .layout-shell {
    width: 100%;
    box-sizing: border-box;
    max-width: var(--layout-max-main);
    margin-inline: auto;
    min-width: 0;
  }
  .layout-shell--wide {
    width: min(100%, var(--layout-max-wide));
    max-width: var(--layout-max-wide);
  }
  /* Centered wide rail inside flex .canvas--slide (matches hero intro/bottom). */
  .canvas--slide > .layout-shell.layout-shell--wide {
    align-self: center;
  }
  .layout-shell--measure {
    max-width: min(var(--layout-max-measure), 100%);
  }
  .layout-shell--lede {
    max-width: min(var(--layout-max-lede), 100%);
  }

  /* Shared two-column grid — matches index .why__inner / .access__head */
  .layout-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8vh;
    align-items: start;
    width: 100%;
  }

  .layout-split__title {
    position: relative;
    top: 0;
  }

  .layout-split__prose {
    max-width: none;
    padding-top: 0;
  }

  @media (min-width: 901px) {
    .layout-split {
      grid-template-columns: 1fr 1fr;
      gap: var(--layout-gap-split);
    }

    .layout-split__title {
      position: sticky;
      top: 14vh;
    }

    .layout-split__prose {
      max-width: var(--layout-max-prose);
      padding-top: 8vh;
    }
  }

  @media (max-width: 900px) {
    .layout-split--section-head {
      margin-bottom: 8vh;
    }
  }

  /* ─── button ───────────────────────────────────────────── */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-ui);
    font-weight: 500;
    letter-spacing: -0.005em;
    white-space: nowrap;
    border: 1px solid transparent;
    transition:
      background-color var(--motion-standard),
      border-color var(--motion-standard),
      color var(--motion-standard),
      transform var(--motion-snappy);
    will-change: transform;
  }
  .btn:active {
    transform: scale(0.98);
  }
  .btn svg.lucide {
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
    transition: transform var(--motion-standard), color var(--motion-standard);
  }
  .btn svg.btn-arrow {
    width: 1.75em;
    height: auto;
    flex-shrink: 0;
    color: currentColor;
    transition: transform var(--motion-standard), color var(--motion-standard);
  }

  .btn--dark {
    background: var(--accent-strong);
    color: #fff;
  }
  .btn:focus svg.btn-arrow--left {
    transform: translateX(-3px);
  }
  @media (hover: hover) {
    .btn--dark:hover {
      background: var(--accent);
      color: #fff;
      transform: translateY(-2px);
    }
    .btn--dark:hover svg {
      transform: translateX(3px);
    }

    .btn--cta:hover {
      background: var(--accent-strong);
      color: #fff;
      transform: translateY(-2px);
    }
    .btn--cta:hover svg {
      transform: translateX(3px);
    }

    .btn--light:hover {
      background: #f1e6d6;
      transform: translateY(-2px);
    }
    .btn--light:hover svg {
      transform: translateX(3px);
    }

    .btn--ghost-dark:hover {
      background: transparent;
      border-color: transparent;
      color: var(--accent);
      transform: translateY(-2px);
      box-shadow: none;
    }
    .btn--ghost-dark:hover svg {
      transform: translateX(3px);
    }

    .btn:hover svg.btn-arrow--left {
      transform: translateX(-3px);
    }
  }

  .btn--cta {
    background: var(--accent);
    color: #fff;
  }

  .btn--light {
    background: var(--sand);
    color: var(--brand-ink);
  }

  .btn--ghost-dark {
    background: transparent;
    border-color: transparent;
    color: var(--accent-strong);
    padding-inline-start: 0;
  }

  /* ─── masthead ─────────────────────────────────────────── */
  .masthead {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: var(--fs-masthead);
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-eyebrow);
  }
  /* Icon + label: one line box (15px) so Lucide aligns with cap height */
  .masthead:has(.masthead__icon) {
    line-height: 15px;
  }
  .masthead__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
    color: color-mix(in srgb, var(--accent-eyebrow) 58%, var(--accent-light) 42%);
  }
  .masthead__icon svg.lucide {
    display: block;
    width: 15px;
    height: 15px;
    stroke-width: 1.2;
  }
  .masthead__dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-eyebrow);
  }

  .people__grid {
    display: grid;
    gap: clamp(40px, 5vw, 72px) clamp(28px, 4vw, 56px);
  }
  .people__grid--quotes {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  @media (max-width: 1100px) {
    .people__grid--quotes {
      grid-template-columns: 1fr 1fr;
    }
  }
  @media (max-width: 560px) {
    .people__grid--quotes {
      grid-template-columns: 1fr;
    }
  }

  /* Utility row only — do not use .footer__row on the WP menu list */
  .footer__utility.footer__row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    font-size: 13px;
    color: var(--ink-muted);
    flex-wrap: wrap;
    letter-spacing: -0.005em;
  }
  @media (hover: hover) {
    .footer__row a:hover {
      color: var(--accent-bright);
    }
  }

  /* reveal base — IO adds .in in reveal.js */
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--motion-reveal), transform var(--motion-reveal);
  }
  .reveal.in {
    opacity: 1;
    transform: translateY(0);
  }
  .reveal--delay-1 {
    transition-delay: 0.1s;
  }
  .reveal--delay-2 {
    transition-delay: 0.2s;
  }
  .reveal--delay-3 {
    transition-delay: 0.3s;
  }
  .reveal--delay-4 {
    transition-delay: 0.4s;
  }

  /* Cascaded fade-up — finer motion + nth-child stagger (reveal.js adds .in) */
  .reveal-seq {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
    transition:
      opacity 0.68s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.68s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-seq-delay, 0ms);
  }
  .reveal-seq.in {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  .two-column-sticky__prose > .reveal-seq:nth-child(1),
  .two-column__prose > .reveal-seq:nth-child(1),
  .layout-split__prose > .reveal-seq:nth-child(1),
  .two-columns-big-image__prose > .reveal-seq:nth-child(1),
  .primary-cta__prose > .reveal-seq:nth-child(1),
  .primary-cta__prose > .reveal-seq:nth-child(1),
  .two-column-sticky__prose > .reveal-seq:nth-child(1) {
    --reveal-seq-delay: 0ms;
  }
  .two-column-sticky__prose > .reveal-seq:nth-child(2),
  .two-column__prose > .reveal-seq:nth-child(2),
  .cta-cards__prose > .reveal-seq:nth-child(2),
  .two-columns-big-image__prose > .reveal-seq:nth-child(2),
  .primary-cta__prose > .reveal-seq:nth-child(2),
  .primary-cta__prose > .reveal-seq:nth-child(2),
  .two-column-sticky__prose > .reveal-seq:nth-child(2) {
    --reveal-seq-delay: 42ms;
  }
  .two-column-sticky__prose > .reveal-seq:nth-child(3),
  .two-column__prose > .reveal-seq:nth-child(3),
  .cta-cards__prose > .reveal-seq:nth-child(3),
  .two-columns-big-image__prose > .reveal-seq:nth-child(3),
  .primary-cta__prose > .reveal-seq:nth-child(3),
  .primary-cta__prose > .reveal-seq:nth-child(3),
  .two-column-sticky__prose > .reveal-seq:nth-child(3) {
    --reveal-seq-delay: 84ms;
  }
  .two-column-sticky__prose > .reveal-seq:nth-child(4),
  .two-column__prose > .reveal-seq:nth-child(4),
  .cta-cards__prose > .reveal-seq:nth-child(4),
  .two-columns-big-image__prose > .reveal-seq:nth-child(4),
  .primary-cta__prose > .reveal-seq:nth-child(4),
  .primary-cta__prose > .reveal-seq:nth-child(4),
  .two-column-sticky__prose > .reveal-seq:nth-child(4) {
    --reveal-seq-delay: 126ms;
  }
  .two-column-sticky__prose > .reveal-seq:nth-child(5),
  .two-column__prose > .reveal-seq:nth-child(5),
  .two-columns-big-image__prose > .reveal-seq:nth-child(5),
  .primary-cta__prose > .reveal-seq:nth-child(5),
  .primary-cta__prose > .reveal-seq:nth-child(5),
  .two-column-sticky__prose > .reveal-seq:nth-child(5) {
    --reveal-seq-delay: 168ms;
  }
  .two-column-sticky__prose > .reveal-seq:nth-child(6),
  .two-column__prose > .reveal-seq:nth-child(6),
  .primary-cta__prose > .reveal-seq:nth-child(6),
  .primary-cta__prose > .reveal-seq:nth-child(6),
  .two-column-sticky__prose > .reveal-seq:nth-child(6) {
    --reveal-seq-delay: 210ms;
  }
  .two-column-sticky__prose > .reveal-seq:nth-child(7),
  .two-column__prose > .reveal-seq:nth-child(7),
  .primary-cta__prose > .reveal-seq:nth-child(7),
  .two-column-sticky__prose > .reveal-seq:nth-child(7) {
    --reveal-seq-delay: 252ms;
  }
  .two-column-sticky__title > .reveal-seq,
  .layout-split__title > .reveal-seq {
    --reveal-seq-delay: 0ms;
  }
  .rich-list__inner > .reveal-seq:nth-child(1) {
    --reveal-seq-delay: 0ms;
  }
  .rich-list__inner > .reveal-seq:nth-child(2) {
    --reveal-seq-delay: 42ms;
  }
  .rich-list__inner > .reveal-seq:nth-child(3) {
    --reveal-seq-delay: 84ms;
  }
  .rich-list__inner > .reveal-seq:nth-child(4) {
    --reveal-seq-delay: 126ms;
  }
  .rich-list__inner > .reveal-seq:nth-child(5) {
    --reveal-seq-delay: 168ms;
  }
  .rich-list__list > .reveal-seq:nth-child(1) {
    --reveal-seq-delay: 0ms;
  }
  .rich-list__list > .reveal-seq:nth-child(2) {
    --reveal-seq-delay: 48ms;
  }
  .rich-list__list > .reveal-seq:nth-child(3) {
    --reveal-seq-delay: 96ms;
  }
  .rich-list__list > .reveal-seq:nth-child(4) {
    --reveal-seq-delay: 144ms;
  }
  .rich-list__list > .reveal-seq:nth-child(5) {
    --reveal-seq-delay: 192ms;
  }
  .cta-cards__grid > .cta-cards__item:nth-child(1).reveal-seq {
    --reveal-seq-delay: 0ms;
  }
  .cta-cards__grid > .cta-cards__item:nth-child(2).reveal-seq {
    --reveal-seq-delay: 120ms;
  }
  .rich-list__points > .rich-list__point:nth-child(1).reveal-seq {
    --reveal-seq-delay: 0ms;
  }
  .rich-list__points > .rich-list__point:nth-child(2).reveal-seq {
    --reveal-seq-delay: 48ms;
  }
  .rich-list__points > .rich-list__point:nth-child(3).reveal-seq {
    --reveal-seq-delay: 96ms;
  }
  .rich-list__points > .rich-list__point:nth-child(4).reveal-seq {
    --reveal-seq-delay: 144ms;
  }
  .rich-list__points > .rich-list__point:nth-child(5).reveal-seq {
    --reveal-seq-delay: 192ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  @layer components {
    .reveal,
    .reveal-seq {
      opacity: 1;
      transform: none;
      transition: none;
    }
  }
}
