/* Opening audience choice — isolated from the legacy page styles. */
.audience-gateway {
  min-height: 0;
  padding-top: 80px;
  display: block;
  overflow: hidden;
  background: #f5f2e9;
}

.audience-gateway-inner {
  width: min(calc(100% - 48px), 1440px);
  min-height: max(720px, calc(100svh - 80px));
  margin: 0 auto;
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  background: #e6eef0;
}

.audience-gateway-copy {
  width: min(59%, 790px);
  min-height: inherit;
  padding: clamp(52px, 6vh, 76px) clamp(32px, 4vw, 58px) 48px clamp(44px, 5vw, 76px);
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.audience-mobile-intro {
  display: contents;
}

.audience-gateway-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  /* Reserve the image as the dominant visual: the copy mask occupies only
     the left third of the section, then clears before the photo's centre. */
  inset: 0 0 0 0;
  pointer-events: none;
  background: linear-gradient(90deg,
      #fbf8ef 0%,
      rgba(251, 248, 239, .98) 48%,
      rgba(251, 248, 239, .75) 61%,
      rgba(251, 248, 239, .3) 76%,
      rgba(251, 248, 239, 0) 90%);
}

.audience-gateway .eyebrow {
  margin: 0 0 18px;
  color: var(--blue);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .14em;
}

.audience-gateway h1 {
  max-width: 680px;
  margin: 0 0 19px;
  color: var(--deep);
  font-family: var(--font-heading);
  font-size: clamp(40px, 3.7vw, 57px);
  font-weight: 700;
  line-height: 1.43;
  letter-spacing: 0;
}

.audience-gateway h1 em {
  position: relative;
  color: var(--navy);
  font-style: normal;
}

.audience-gateway h1 em::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -4px;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--blue);
  transform: rotate(-1deg);
}

.audience-lead {
  max-width: 590px;
  margin: 0 0 22px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.9;
}

.audience-credentials {
  width: min(100%, 590px);
  margin: -8px 0 22px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.audience-credentials li {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, .82);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
}

.audience-options {
  width: min(100%, 700px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

button.audience-option {
  width: 100%;
  min-height: 154px;
  padding: 18px 18px 15px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-content: start;
  gap: 0 14px;
  border: 1px solid rgba(6, 74, 127, .17);
  border-radius: 17px;
  color: inherit;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 24px rgba(5, 56, 95, .07);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}

button.audience-option:hover,
button.audience-option:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 14px 30px rgba(5, 56, 95, .13);
  transform: translateY(-2px);
}

button.audience-option:focus-visible {
  outline: 3px solid rgba(18, 132, 189, .23);
  outline-offset: 3px;
}

button.audience-option.is-selected {
  border: 2px solid var(--blue);
  box-shadow: 0 12px 26px rgba(5, 56, 95, .11);
}

.audience-option-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--navy);
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

.audience-option-family .audience-option-icon {
  background: var(--blue);
}

.audience-option-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.audience-option-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.audience-option-copy strong {
  color: var(--deep);
  font-family: var(--font-heading);
  font-size: 18px;
  line-height: 1.5;
}

.audience-option-copy em {
  margin-top: 7px;
  padding-right: 24px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.55;
}

.audience-option-arrow {
  grid-column: 2;
  justify-self: end;
  align-self: end;
  margin-top: -19px;
  color: var(--blue);
  font-size: 20px;
  line-height: 1;
}

.audience-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.audience-next {
  min-height: 52px;
  margin-top: 14px;
  padding: 9px 19px;
  display: inline-flex;
  align-items: center;
  gap: 15px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  box-shadow: 0 11px 24px rgba(6, 74, 127, .2);
  font-size: 15px;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease;
  animation: audience-next-in .35s ease both;
}

.audience-next:hover {
  box-shadow: 0 14px 28px rgba(6, 74, 127, .27);
  transform: translateY(-2px);
}

.audience-next[hidden] {
  display: none;
}

.audience-gateway-visual,
.audience-gateway-photo,
.audience-gateway-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.audience-gateway-visual {
  z-index: 0;
  padding: 0;
  overflow: hidden;
}

.audience-gateway-photo {
  overflow: hidden;
  border-radius: 0;
  background: #dbe7e8;
}

.audience-gateway-photo img {
  object-fit: cover;
  object-position: center center;
  transition: opacity .52s ease;
}

/* Keep the complete composition visible in the stacked layouts. */
.audience-gateway-photo img[data-focus="self"] {
  object-position: right center;
}

.audience-gateway-photo img[data-focus="family"] {
  object-position: right center;
}

/* On the overlay desktop layout, centring the wide source image keeps the
   person clear of the copy instead of cropping heavily from the left. */
@media (min-width: 1101px) {

  .audience-gateway-photo img[data-focus="self"],
  .audience-gateway-photo img[data-focus="family"] {
    object-position: center center;
  }
}

/* Keep the elder handwriting in the open foliage between the copy and the
   face on every desktop width; the capped values preserve the same placement
   used at the desktop/tablet handoff even on wider screens. */
@media (min-width: 1101px) {
  body[data-hero-visual="self"] .audience-handwriting {
    top: clamp(34px, 4vw, 50px);
    right: auto;
    left: clamp(540px, 50vw, 620px);
    width: clamp(184px, 17vw, 210px);
  }
}

/* Use one continuous focal curve across tablet and phone widths instead of
   introducing another device breakpoint around the source image's crop. */
@media (max-width: 1100px) {
  .audience-gateway-photo img[data-focus="self"] {
    object-position: clamp(72%, calc(56% + 6vw), 100%) center;
  }
}

.audience-photo-current {
  opacity: 1;
}

.audience-photo-current.is-dimming {
  opacity: 0;
}

.audience-photo-next {
  opacity: 0;
}

.audience-photo-next.is-active {
  opacity: 1;
}

.audience-handwriting {
  position: absolute;
  z-index: 2;
  top: clamp(40px, 5vw, 92px);
  right: clamp(40px, 7vw, 120px);
  width: clamp(240px, 19vw, 340px);
  aspect-ratio: 900 / 401;
  pointer-events: none;
}

.audience-handwriting img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: top right;
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, .18));
  transition: opacity .52s ease;
}

.audience-handwriting-current {
  opacity: 1;
}

.audience-handwriting-current.is-dimming,
.audience-handwriting-next {
  opacity: 0;
}

.audience-handwriting-next.is-active {
  opacity: 1;
}

.audience-gateway-visual>p {
  position: absolute;
  z-index: 2;
  right: 24px;
  bottom: 24px;
  left: auto;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 12px;
  color: var(--deep);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 28px rgba(3, 40, 65, .13);
  backdrop-filter: blur(8px);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: .05em;
}

@keyframes audience-next-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {

  .audience-gateway-photo img,
  .audience-handwriting img,
  .audience-next,
  button.audience-option {
    transition: none;
    animation: none;
  }
}

@media (max-width: 680px) {
  .audience-gateway {
    padding-top: 68px;
  }

  .audience-gateway-inner {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
    background: #fbf8ef;
  }

  .audience-gateway-copy {
    width: 100%;
    min-height: 0;
    position: relative;
    z-index: 2;
    padding: 56px 24px 66px;
    background: #fbf8ef;
  }

  .audience-mobile-intro {
    display: contents;
  }

  .audience-gateway .eyebrow {
    margin-bottom: 14px;
    font-size: 13px;
    letter-spacing: .12em;
  }

  .audience-gateway h1 {
    max-width: 610px;
    margin: 0 0 18px;
    font-size: clamp(24px, 7.1vw, 32px);
    line-height: 1.48;
  }

  .audience-lead {
    margin: 0 0 24px;
    font-size: 16px;
    line-height: 1.85;
  }

  .audience-options {
    width: auto;
    position: absolute;
    z-index: 3;
    top: -48px;
    right: 16px;
    left: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
  }

  button.audience-option {
    min-height: 68px;
    padding: 9px 10px;
    grid-template-columns: 30px minmax(0, 1fr);
    align-content: center;
    gap: 0 7px;
    border-color: rgba(255, 255, 255, .82);
    border-radius: 15px;
    background: rgba(255, 255, 255, .91);
    box-shadow: 0 10px 24px rgba(5, 56, 95, .16);
    backdrop-filter: blur(12px);
  }

  .audience-option-icon {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .audience-option-copy {
    gap: 1px;
  }

  .audience-option-copy small,
  .audience-option-copy strong,
  .audience-option-copy em,
  .audience-option-arrow {
    display: none;
  }

  .audience-option-copy::after {
    display: block;
    align-self: center;
    color: var(--deep);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
  }

  .audience-option-self .audience-option-copy::after {
    content: "自分の相談";
  }

  .audience-option-family .audience-option-copy::after {
    content: "親・家族の相談";
  }

  .audience-gateway-visual {
    width: 100%;
    height: clamp(380px, 56svh, 500px);
    flex: 0 0 clamp(380px, 56svh, 500px);
    display: block;
    position: relative;
    inset: auto;
    z-index: 0;
    order: -1;
    padding: 0;
  }

  .audience-gateway-visual::after {
    content: "";
    position: absolute;
    z-index: 1;
    right: 0;
    bottom: 0;
    left: 0;
    height: 96px;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, #fbf8ef);
  }

  .audience-gateway-photo {
    border-radius: 0;
  }

  .audience-gateway-photo img[data-focus="family"] {
    object-position: 94% center;
  }

  .audience-handwriting {
    top: clamp(18px, 5vw, 30px);
    right: auto;
    left: clamp(16px, 4vw, 28px);
    width: clamp(140px, 38vw, 190px);
  }

  .audience-gateway-visual>p {
    display: none;
  }
}

/* Tablet switches deliberately to photo-first; desktop stays a single overlay. */
@media (min-width: 681px) and (max-width: 1100px) {
  .audience-gateway-inner {
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
    background: #fbf8ef;
  }

  .audience-gateway-visual {
    width: 100%;
    height: clamp(430px, 52vw, 560px);
    flex: 0 0 clamp(430px, 52vw, 560px);
    position: relative;
    inset: auto;
    order: -1;
    padding: 0;
  }

  .audience-gateway-photo {
    border-radius: 0;
  }

  .audience-gateway-photo img[data-focus="family"] {
    object-position: right center;
  }

  .audience-handwriting {
    top: clamp(26px, 4vw, 52px);
    right: clamp(24px, 6vw, 70px);
    left: auto;
    width: clamp(210px, 30vw, 320px);
  }

  body[data-hero-visual="self"] .audience-handwriting {
    right: auto;
    left: clamp(24px, 6vw, 70px);
  }

  .audience-gateway-visual>p {
    display: none;
  }

  .audience-gateway-copy {
    width: 100%;
    min-height: 0;
    padding: 68px clamp(34px, 8vw, 76px) 76px;
    position: relative;
    z-index: 2;
    background: #fbf8ef;
  }

  .audience-gateway-copy::before {
    display: none;
  }

  .audience-gateway h1 {
    max-width: 760px;
    font-size: clamp(39px, 5vw, 52px);
  }

  .audience-lead {
    max-width: 720px;
  }

  .audience-options {
    width: auto;
    position: absolute;
    z-index: 3;
    top: -46px;
    right: clamp(24px, 6vw, 64px);
    left: clamp(24px, 6vw, 64px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
  }

  button.audience-option {
    min-height: 86px;
    padding: 13px 16px;
    grid-template-columns: 36px minmax(0, 1fr);
    align-content: center;
    gap: 0 9px;
    border-color: rgba(255, 255, 255, .88);
    border-radius: 16px;
    background: rgba(255, 255, 255, .93);
    box-shadow: 0 12px 28px rgba(5, 56, 95, .16);
    backdrop-filter: blur(12px);
  }

  .audience-option-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .audience-option-copy small,
  .audience-option-copy strong,
  .audience-option-copy em,
  .audience-option-arrow {
    display: none;
  }

  .audience-option-copy::after {
    display: block;
    align-self: center;
    color: var(--deep);
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
  }

  .audience-option-self .audience-option-copy::after {
    content: "自分の相談";
  }

  .audience-option-family .audience-option-copy::after {
    content: "親・家族の相談";
  }
}
