html {
  background: var(--jw-cream);
  scroll-padding-top: 7rem;
}

body {
  color: var(--jw-navy);
  background: var(--jw-cream);
}

/* Hero: Josie's cut-out portrait anchored to the bottom-left, the welcome copy
   beside her, and a naturalist iris entering from the right edge. */
.contact-welcome { --veil-rgb: 247 243 235; }
.contact-options__heading { --veil-rgb: 250 237 214; } /* wallpaper centre after the cream wash */

.contact-welcome {
  position: sticky;
  z-index: 0;
  /* contact.js sets --contact-hero-top so a hero taller than the window
     scrolls until its bottom edge is visible, then holds still. */
  top: var(--contact-hero-top, 0px);
  isolation: isolate;
  overflow: hidden;
  --contact-hero-pad: clamp(2.5rem, 5vw, 4.5rem);
  padding-top: var(--contact-hero-pad);
  background:
    radial-gradient(60% 70% at 22% 45%, rgb(255 252 246 / .9), transparent 70%),
    var(--jw-cream);
}

/* Everything after the hero scrolls up over it on an opaque surface. */
#main-content > section:not(.contact-welcome) { position: relative; z-index: 1; }

.contact-welcome__botanical {
  position: absolute;
  z-index: -1;
  right: clamp(-8rem, -5vw, -3rem);
  bottom: clamp(-4rem, -3vw, -1.5rem);
  width: clamp(22rem, 34vw, 36rem);
  opacity: .92;
  transform: rotate(-4deg);
  transform-origin: right bottom;
  pointer-events: none;
}

/* The portrait column is exactly as wide as Josie is at full hero height;
   contact.js measures the hero and sets --contact-portrait-w. */
.contact-welcome__inner {
  display: grid;
  grid-template-columns: var(--contact-portrait-w, minmax(0, .82fr)) minmax(0, 1fr);
  align-items: end;
  gap: clamp(2rem, 4vw, 4rem);
}

/* Josie fills the hero top to bottom: the figure stretches up through the
   hero's top padding to the header, and the photo takes its full height. */
.contact-welcome__portrait {
  position: relative;
  align-self: stretch;
  margin: calc(var(--contact-hero-pad) * -1) 0 0 clamp(-3rem, -2vw, 0rem);
}

.contact-welcome__portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left bottom;
}

/* Set by contact.js when the column is narrower than Josie at full height:
   anchor her to the copy side and let the left edge run off-screen. */
.contact-welcome__portrait.is-bleeding img {
  left: auto;
  right: 0;
  width: auto;
  max-width: none;
  object-fit: fill;
}

/* A tight cream veil behind the heading and each paragraph: artwork passing
   behind the words is blurred and faded, feathering out about 12px past the
   text box and leaving the rest of the illustration sharp. */
.contact-welcome h1,
.contact-welcome__copy > p,
.contact-options__heading h2,
.contact-options__heading p {
  position: relative;
  z-index: 0;
  width: fit-content; /* box hugs the longest line, so the veil does too */
}

.contact-welcome h1::before,
.contact-welcome__copy > p::before,
.contact-options__heading h2::before,
.contact-options__heading p::before {
  --veil-feather: 12px;
  content: "";
  position: absolute;
  z-index: -1;
  inset: calc(var(--veil-feather) * -1);
  background: rgb(var(--veil-rgb) / .32);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  -webkit-mask-image:
    linear-gradient(90deg, transparent, #000 var(--veil-feather), #000 calc(100% - var(--veil-feather)), transparent),
    linear-gradient(180deg, transparent, #000 var(--veil-feather), #000 calc(100% - var(--veil-feather)), transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent, #000 var(--veil-feather), #000 calc(100% - var(--veil-feather)), transparent),
    linear-gradient(180deg, transparent, #000 var(--veil-feather), #000 calc(100% - var(--veil-feather)), transparent);
  mask-composite: intersect;
  pointer-events: none;
}

.contact-welcome__copy {
  container-type: inline-size;
  position: relative;
  z-index: 0;
  align-self: center;
  max-width: 44rem;
  padding-block: clamp(1.5rem, 4vw, 4rem) clamp(3rem, 6vw, 5.5rem);
}

.contact-welcome h1,
.contact-welcome__copy > p,
.contact-options__heading h2,
.contact-options__heading p {
  /* Several tight layers: a dense halo in the section's own background colour
     (--veil-rgb) that stays within ~15px of the letters. */
  text-shadow:
    0 0 2px rgb(var(--veil-rgb)),
    0 0 4px rgb(var(--veil-rgb)),
    0 0 6px rgb(var(--veil-rgb)),
    0 0 9px rgb(var(--veil-rgb)),
    0 0 12px rgb(var(--veil-rgb)),
    0 0 15px rgb(var(--veil-rgb));
}

.contact-welcome h1 {
  max-width: 13ch;
  margin: 0;
  font: 600 var(--jw-type-h1)/.98 var(--jw-font-display);
  letter-spacing: -.035em;
  text-wrap: balance;
}

.contact-welcome__divider {
  display: flex;
  align-items: center;
  gap: .9rem;
  width: min(100%, 27rem);
  margin-block: clamp(1.5rem, 2.6vw, 2.1rem);
  color: rgb(166 112 30);
}

.contact-welcome__divider::before,
.contact-welcome__divider::after {
  content: "";
  flex: 1;
  height: 2px;
  background: currentColor;
  opacity: .8;
}

.contact-welcome__divider svg { width: 2.6rem; flex: none; }

.contact-welcome__copy > p {
  max-width: 34rem;
  margin: 0 0 1.1rem;
  font: 500 clamp(1.25rem, 1.65vw, 1.55rem)/1.38 var(--jw-font-display);
}

.contact-options__heading p,
.contact-next p,
.contact-schedule__copy p {
  max-width: 42rem;
  margin: 0 0 1rem;
}

.contact-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.contact-direct { width: fit-content; max-width: 100%; margin-top: clamp(1.75rem, 3vw, 2.5rem); }

.contact-direct__bar {
  --jw-glass-card-min-height: 0;
  --jw-glass-card-padding: .65rem clamp(1rem, 2vw, 1.6rem);
  --jw-glass-card-radius: 1rem;
  --jw-glass-solid-fallback: var(--jw-cream);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem clamp(1rem, 2vw, 1.5rem);
}

.contact-direct__icon { width: 1.75rem; height: auto; flex: none; color: rgb(166 112 30); }

.contact-direct__email {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: .85rem;
  min-width: 0;
  color: var(--jw-navy);
  font: 600 clamp(1.35rem, 2vw, 1.8rem)/1.1 var(--jw-font-display);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-direct__email:hover span,
.contact-direct__email:focus-visible span { text-decoration: underline; text-decoration-color: rgb(181 125 27 / .7); text-underline-offset: .2em; }

.contact-direct__rule { align-self: stretch; width: 1px; margin-block: .35rem; background: rgb(166 112 30 / .6); }

.contact-direct__copy {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: .6rem;
  padding: .35rem .5rem;
  border: 0;
  border-radius: var(--jw-radius-sm);
  color: rgb(122 80 20);
  background: none;
  font: 600 clamp(1.05rem, 1.3vw, 1.2rem)/1 var(--jw-font-display);
  cursor: pointer;
}

.contact-direct__copy:hover { background: rgb(247 243 235 / .9); }

@container (max-width: 33rem) {
  .contact-direct { width: 100%; }
  .contact-direct__bar { flex-direction: column; align-items: flex-start; gap: .25rem; padding: .6rem 1rem; }
  .contact-direct__rule { align-self: stretch; width: auto; height: 1px; margin: .2rem 0; }
  .contact-direct__copy { padding-inline: 0; }
}
.contact-direct .contact-copy__status { margin: .5rem 0 0 .25rem; }

.contact-copy {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  margin-top: .8rem;
  padding: .55rem .9rem;
  border: 1px solid rgb(23 44 69 / .28);
  border-radius: var(--jw-radius-pill);
  color: var(--jw-navy);
  background: rgb(247 243 235 / .78);
  font-size: .9rem;
  font-weight: 650;
  cursor: pointer;
}

.contact-copy:hover {
  background: var(--jw-white);
}

.contact-copy__status {
  min-height: 1.4em;
  margin: .45rem 0 0;
  font-size: .85rem;
  line-height: 1.4;
}

.contact-options__heading h2,
.contact-next h2,
.contact-schedule h2 {
  margin: 0 0 1.25rem;
  font: 400 var(--jw-type-h2)/var(--jw-leading-h2) var(--jw-font-display);
  letter-spacing: -.035em;
}

/* Connection choices: a featured Speaking card above four quieter cards.
   Each card pairs a gold line icon and short rule with the copy and action. */
.contact-options {
  --contact-card-gold: rgb(166 112 30);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(4rem, 7vw, 7rem);
  background:
    linear-gradient(180deg, var(--jw-cream), rgb(247 243 235 / 0) 7rem),
    linear-gradient(rgb(247 243 235 / .18), rgb(247 243 235 / .18)),
    url("../Branding/04-Illustrations-and-Backgrounds/Wallpaper/Josie-White-Wallpaper-Vintage-Iris-Frame.webp") center / cover no-repeat,
    var(--jw-cream);
  background-attachment: scroll, scroll, fixed;
}

.contact-options__heading {
  max-width: 46rem;
  margin: 0 auto clamp(2.25rem, 4vw, 3.25rem);
  text-align: center;
}

.contact-options__heading h2,
.contact-options__heading p { margin-inline: auto; }

.contact-options__rule {
  display: block;
  width: 5rem;
  height: 2px;
  margin: 0 auto 1.75rem;
  background: var(--contact-card-gold);
}

.contact-options__heading h2 { margin-bottom: .85rem; }
.contact-options__heading p { margin: 0; font-size: clamp(1.02rem, 1.25vw, 1.15rem); }

.contact-options__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.6rem);
}

/* An expanded email template should not stretch the neighbouring card. */
.contact-options__list:has(details[open]) { align-items: start; }

.contact-option {
  --jw-glass-card-min-height: 0;
  --jw-glass-card-radius: 1.15rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "icon copy" "icon actions";
  column-gap: clamp(1.25rem, 2.2vw, 2rem);
  row-gap: 1.15rem;
  align-content: start;
  padding: clamp(1.5rem, 2.6vw, 2.15rem);
  scroll-margin-top: 7rem;
}

.contact-option__icon {
  grid-area: icon;
  align-self: start;
  display: grid;
  place-items: center;
  min-height: 5.75rem;
  padding-right: clamp(1.1rem, 2vw, 1.75rem);
  border-right: 2px solid rgb(181 125 27 / .5);
  color: var(--contact-card-gold);
}

.contact-option__icon svg { width: clamp(3.4rem, 4.6vw, 4.4rem); height: auto; }
.contact-option--featured .contact-option__icon svg { width: clamp(4rem, 5.6vw, 5.4rem); }
.contact-option__copy { grid-area: copy; }

.contact-option h3 {
  margin: 0 0 .45rem;
  color: var(--jw-navy);
  font: 500 clamp(1.85rem, 2.6vw, 2.5rem)/1.02 var(--jw-font-display);
  letter-spacing: -.02em;
}

.contact-option p { margin: 0; line-height: 1.5; }

.contact-option__actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1.25rem;
}

.contact-option--featured {
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "icon copy actions";
  align-items: center;
  padding-block: clamp(1.9rem, 3.4vw, 2.75rem);
  padding-inline: clamp(1.75rem, 4vw, 3.5rem);
}

.contact-option--featured .contact-option__icon { align-self: center; min-height: 7rem; }
.contact-option--featured h3 { color: var(--jw-plum); font-size: clamp(2.3rem, 3.6vw, 3.25rem); }
.contact-option--featured p { font-size: clamp(1.02rem, 1.25vw, 1.15rem); }
.contact-option--featured .contact-option__actions { flex-direction: column; align-items: flex-end; }
/* Email templates: the card's main button (a <summary>) opens an editable
   template; "Open Email" at the end opens the visitor's email app with their edits. */
.contact-template { flex-basis: 100%; }
.contact-template > summary { list-style: none; width: fit-content; }
.contact-template > summary::-webkit-details-marker { display: none; }
.contact-template__chevron { display: inline-block; transition: transform var(--jw-duration) var(--jw-ease); }
.contact-template[open] .contact-template__chevron { transform: rotate(180deg); }

.contact-template__content {
  display: grid;
  justify-items: start;
  gap: .55rem;
  margin-top: 1rem;
  padding: clamp(1rem, 2.4vw, 1.5rem);
  border: 1px solid rgb(181 125 27 / .35);
  border-radius: var(--jw-radius-sm);
  background: rgb(255 252 246 / .88);
}

.contact-template__intro { margin: 0 0 .35rem; color: color-mix(in srgb, var(--jw-navy) 78%, transparent); font-size: .9rem !important; }

.contact-template__label {
  margin-top: .5rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.contact-template__field {
  width: 100%;
  padding: .75rem .85rem;
  border: 1px solid rgb(23 44 69 / .25);
  border-radius: .5rem;
  color: var(--jw-navy);
  background: var(--jw-cream);
  font: 400 .92rem/1.55 var(--jw-font-ui);
}

.contact-template__field--message { min-height: 14rem; resize: vertical; }
.contact-template__field:focus-visible { outline: 3px solid var(--jw-plum); outline-offset: 2px; border-color: var(--jw-plum); }
.contact-template .contact-copy { margin-top: 0; }
.contact-template .contact-copy__status { margin: 0; }
.contact-template__open { margin-top: .75rem; }

/* The wide Speaking card stacks while its template is open, so the template gets the full card width. */
.contact-option--featured:has(.contact-template[open]) { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "icon copy" "actions actions"; }
.contact-option--featured:has(.contact-template[open]) .contact-option__actions { align-items: stretch; }

.contact-next {
  padding-block: clamp(3.5rem, 6vw, 5rem);
  color: var(--jw-cream);
  background:
    linear-gradient(rgb(23 44 69 / .82), rgb(23 44 69 / .82)),
    url("../Branding/04-Illustrations-and-Backgrounds/Wallpaper/Josie-White-Wallpaper-Vintage-Iris-Frame.webp") center / cover no-repeat,
    var(--jw-navy);
  background-attachment: scroll, fixed;
}

.contact-next__inner {
  display: grid;
  grid-template-columns: minmax(16rem, .55fr) minmax(0, 1.45fr);
  gap: clamp(3rem, 8vw, 8rem);
}

.contact-next h2,
.contact-next p {
  margin: 0;
}

.contact-schedule {
  scroll-margin-top: 7rem;
  background: var(--jw-cream);
  padding-block: clamp(4rem, 7vw, 7rem);
}

.contact-schedule__inner {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(25rem, 1.2fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: start;
}

.contact-schedule__pending {
  min-height: 20rem;
  display: grid;
  place-content: center;
  justify-items: start;
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid rgb(23 44 69 / .2);
  border-radius: var(--jw-radius-md);
  background: color-mix(in srgb, var(--jw-champagne) 45%, var(--jw-cream));
  box-shadow: var(--jw-shadow-soft);
}

.contact-schedule__pending h3 {
  margin: 0 0 1rem;
  font: 400 var(--jw-type-h3)/var(--jw-leading-h3) var(--jw-font-display);
}

.contact-schedule__pending p {
  margin: 0 0 1.5rem;
}

/* Live Google Calendar booking page. */
.contact-schedule__booking { min-width: 0; }
.contact-schedule__frame {
  display: block;
  width: 100%;
  height: 720px;
  border: 1px solid rgb(23 44 69 / .2);
  border-radius: var(--jw-radius-md);
  background: #fff;
  box-shadow: var(--jw-shadow-soft);
}
.contact-schedule__fallback { margin: 1rem 0 0; font-size: .95rem; }
.contact-schedule__fallback a { color: var(--jw-plum); font-weight: 650; }
@media (max-width: 56rem) {
  .contact-schedule__frame { height: 900px; }
}

/* Below wide desktop the iris has no clear corner, so it recedes behind the copy. */
@media (max-width: 56rem) {
  .contact-options,
  .contact-next { background-attachment: scroll; }

  .contact-welcome__inner,
  .contact-options__layout,
  .contact-next__inner,
  .contact-schedule__inner {
    grid-template-columns: 1fr;
  }

  .contact-options__list { grid-template-columns: 1fr; }

  .contact-option--featured {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "icon copy" "icon actions";
  }

  .contact-option--featured .contact-option__actions { flex-direction: row; align-items: center; }

  /* Tablet/phone hero: copy first, then the portrait anchored to the section bottom. */
  .contact-welcome__copy { grid-row: 1; padding-bottom: 0; }
  .contact-welcome__inner { grid-template-columns: 1fr; }
  .contact-welcome__portrait { grid-row: 2; justify-self: center; align-self: end; margin: 0; }
  .contact-welcome__portrait img { position: static; width: min(72vw, 24rem); height: auto; }
  .contact-welcome { position: relative; top: auto; }
  .contact-welcome__botanical { width: min(70vw, 24rem); opacity: .5; }
}

@media (max-width: 40rem) {
  .contact-welcome__botanical { right: -7rem; opacity: .35; }

  .contact-direct { width: 100%; }
  .contact-direct__bar { flex-direction: column; align-items: flex-start; gap: .25rem; padding: .6rem 1rem; }
  .contact-direct__rule { align-self: stretch; width: auto; height: 1px; margin: .2rem 0; }
  .contact-direct__copy { padding-inline: 0; }

  .contact-option__actions > .jw-button,
  .contact-schedule__pending .jw-button {
    width: 100%;
  }

  /* Phones: icon on top with a short gold rule, so copy and buttons get the full card width. */
  .contact-option,
  .contact-option--featured {
    grid-template-columns: 1fr;
    grid-template-areas: "icon" "copy" "actions";
    row-gap: 1rem;
    padding: 1.5rem 1.25rem;
  }

  .contact-option__icon,
  .contact-option--featured .contact-option__icon {
    justify-self: start;
    align-self: start;
    min-height: 0;
    padding: 0 .35rem .7rem 0;
    border-right: 0;
    border-bottom: 2px solid rgb(181 125 27 / .5);
  }
  .contact-option__icon svg,
  .contact-option--featured .contact-option__icon svg { width: 2.9rem; }
  /* Phones: anchor the wallpaper left so its iris band shows. */
  .contact-options { background-position: 0 0, 0 0, left top, 0 0; }

  .contact-schedule__pending {
    min-height: 0;
    padding: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .contact-welcome { position: relative; top: auto; }
}
