.portrait-story {
  position: relative;
  isolation: isolate;
  overflow: clip;
  margin-top: -82px;
}

.story-camera { position: absolute; inset: 0; pointer-events: none; }
.story-photo { width: 100%; height: 100%; object-fit: contain; }

.has-portrait-camera > .story-camera {
  z-index: 1;
  mask-image: linear-gradient(to bottom, #000 var(--camera-fade-from), transparent var(--camera-fade-to));
}

.has-portrait-camera > .story-camera .story-photo {
  position: absolute;
  inset: 0 auto auto 0;
  width: auto;
  max-width: none;
  height: var(--camera-height);
  transform-origin: top left;
  transform: translate3d(var(--camera-x), var(--camera-y), 0) scale(var(--camera-scale));
}

@media (max-width: 590px) {
  .portrait-story { margin-top: -63px; }
}

.hero {
  --hero-height: clamp(590px, calc(100svh - 120px), 755px);
  position: relative;
  padding-top: 82px;
}
.hero-field, .field-gradient, .hero-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-field { z-index: -3; bottom: -112px; }
.field-gradient {
  background:
    radial-gradient(ellipse at 88% 8%, #ffe8c9 0, transparent 38%),
    radial-gradient(ellipse at 80% 53%, #bdadff 0, transparent 49%),
    radial-gradient(ellipse at 9% 70%, #e1f5ff 0, transparent 46%),
    radial-gradient(ellipse at 68% 93%, #b8d2ff 0, transparent 63%),
    #f8f5ff;
}
.hero-grid {
  background-image: linear-gradient(#6751a916 1px, transparent 1px), linear-gradient(90deg, #6751a916 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 76% 69%, #000 3%, transparent 71%);
}
.hero-orbit {
  position: absolute;
  left: 70%;
  bottom: 14%;
  width: min(800px, 70vw);
  height: 53%;
  transform: translateX(-50%) rotate(-17deg);
  border: 1px solid #6447bf49;
  border-radius: 50%;
}
.orbit-b {
  transform: translateX(-50%) rotate(12deg);
  opacity: .58;
}
.hero-intro {
  position: relative;
  z-index: 4;
  min-height: var(--hero-height);
  padding-top: clamp(37px, 6.4vh, 83px);
  padding-bottom: 185px;
  pointer-events: none;
}
.hero-intro a { pointer-events: auto; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 17px;
  color: #4b368e;
  font-size: .78rem;
  font-weight: 800;
  animation: hero-intro-rise .55s ease-out both;
}
.hero-kicker span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8354ff;
  box-shadow: 0 0 12px #7140ffb0;
}
.hero h1 {
  margin: 0;
  width: fit-content;
  font-size: clamp(3.25rem, 6.15vw, 6.7rem);
  font-weight: 800;
  line-height: .91;
  letter-spacing: -.052em;
  word-spacing: .055em;
  animation: hero-intro-rise .75s cubic-bezier(.22, .69, .2, 1) .06s both;
}
.hero h1 em {
  display: inline-block;
  padding: .02em .1em .12em 0;
  color: #5735cf;
  font: italic 400 .98em / 1 Georgia, 'Times New Roman', serif;
  letter-spacing: -.05em;
  word-spacing: .045em;
  text-shadow: 0 10px 36px #7c55f730;
}
.hero-lede {
  max-width: 36ch;
  margin: 12px 0 23px;
  color: #463e5e;
  font-size: clamp(1rem, 1.33vw, 1.18rem);
  font-weight: 650;
  line-height: 1.52;
  animation: hero-intro-rise .65s ease-out .15s both;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  animation: hero-intro-rise .65s ease-out .23s both;
}
.hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: 0 .4rem;
  border-radius: 999px;
  color: #373151;
  font-size: .88rem;
  font-weight: 800;
  transition: color .2s;
}
.hero-secondary:hover { color: #4d29c1; }

.hero-stage { position: absolute; inset: 82px 0 0; }
.hero-art { position: relative; height: 100%; }
.ribbon-plane {
  position: absolute;
  inset: 1% -3% 0 22%;
  z-index: -2;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, #000 35%);
}
#liquid-ribbon, .ribbon-fallback { position: absolute; }
#liquid-ribbon { inset: 0; display: block; width: 100%; height: 100%; opacity: 0; }
#liquid-ribbon[data-ready="true"] { opacity: .88; }
#liquid-ribbon[data-ready="true"] + .ribbon-fallback { opacity: 0; }
.ribbon-fallback {
  inset: 15% -18% 5% 34%;
  background: url('/assets/ribbon-fallback.webp') center / contain no-repeat;
  mask-image: radial-gradient(ellipse at 72% 50%, #000 25%, transparent 71%);
  opacity: .78;
  filter: drop-shadow(0 25px 32px #6b4dc541);
  animation: fallback-flow 12s ease-in-out infinite alternate;
}
.portrait-set {
  position: absolute;
  inset: 2% auto 5% 70%;
  width: min(57%, 730px);
  transform: translateX(-50%);
  pointer-events: none;
}
.portrait-halo {
  position: absolute;
  top: 7%;
  left: 50%;
  width: min(75%, 460px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border: 1px solid #fffbffbb;
  border-radius: 50%;
  background: radial-gradient(circle at 37% 28%, #fff9f3df, #f1dbff68 64%, transparent 82%);
  box-shadow: 0 0 70px #e9d5ff8c;
}
.portrait-set::after {
  content: '';
  position: absolute;
  inset: 2% 9% 0;
  background: url('/assets/hero-close-detail.webp') center top / contain no-repeat;
  mask-image: linear-gradient(#000 69%, transparent 99%);
}
.has-portrait-camera .portrait-set::after { display: none; }
.profession {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid white;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 22px #21134d29;
  color: #302853;
  font-size: clamp(.69rem, 1vw, .9rem);
  font-weight: 800;
  white-space: nowrap;
  rotate: var(--tilt, 0deg);
  animation: hero-chip 6s ease-in-out var(--delay, 0s) infinite;
}
.profession span { color: #643de2; font-size: 1.2em; line-height: 1; }
.profession-sound { right: 39%; top: 17%; --tilt: -9deg; --delay: -1s; }
.profession-architect { left: 82%; top: 12%; --tilt: 8deg; --delay: -2.1s; }
.profession-bio { right: 42%; top: 35%; --tilt: -4deg; --delay: -3.3s; }
.profession-design { left: 84%; top: 33%; --tilt: -6deg; --delay: -4s; }
.hero-spark {
  position: absolute;
  z-index: 3;
  display: block;
  color: #5734cf;
  font-size: clamp(22px, 3vw, 45px);
  pointer-events: none;
  animation: hero-spark 6s ease-in-out infinite;
}
.spark-blue { left: 47%; top: 61%; }
.spark-orange { right: 10%; top: 69%; color: #a23284; animation-delay: -3s; }
.hero-question {
  position: absolute;
  z-index: 3;
  width: clamp(184px, 19%, 267px);
  margin: 0;
  padding: 14px 16px 16px;
  border: 1px solid #fff;
  border-radius: 19px;
  background: #fcfaffef;
  box-shadow: 0 16px 38px #39237129;
  backdrop-filter: blur(12px);
  rotate: var(--tilt, 0deg);
  animation: hero-chip 8s ease-in-out var(--delay, 0s) infinite;
}
.question-left { left: 27%; bottom: 7%; --tilt: -4deg; --delay: -1s; }
.question-right { right: .3%; top: 59%; --tilt: 5deg; --delay: -4s; }
.hero-question figcaption {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: #593ba8;
  font-size: .72rem;
  font-weight: 800;
}
.hero-question figcaption span { color: #754af0; }
.hero-question blockquote {
  margin: 0;
  font-size: clamp(.8rem, 1.1vw, .96rem);
  font-weight: 750;
  line-height: 1.43;
}

@keyframes hero-intro-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes hero-chip { 50% { translate: 0 -8px; } }
@keyframes hero-spark { 50% { translate: 0 -10px; rotate: 55deg; scale: .8; } }
@keyframes fallback-flow {
  from { translate: -1% 2%; rotate: -1deg; }
  to { translate: 1% -2%; rotate: 1deg; }
}

@media (min-width: 901px) and (max-width: 1140px) {
  .profession-sound { right: 39%; top: 16%; }
  .profession-bio { right: 40%; top: 31%; }
  .profession-design { left: auto; right: 0; }
  .question-left { left: 26%; bottom: 6%; }
}

@media (max-width: 900px) {
  .hero { --art-height: clamp(320px, 62vw, 465px); }
  .hero-intro { min-height: 0; padding: 37px 0 0; text-align: center; }
  .hero h1 { margin-inline: auto; font-size: clamp(3.04rem, 8.85vw, 5.4rem); }
  .hero-lede { margin: 8px auto 15px; }
  .hero-actions { justify-content: center; }
  .hero-stage { position: relative; inset: auto; }
  .hero-art {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    height: auto;
    padding: var(--art-height) 0 25px;
  }
  .portrait-set { inset: 0 auto auto 50%; width: min(82%, 510px); height: var(--art-height); }
  .portrait-halo { width: min(80%, 350px); }
  .hero-orbit { left: 50%; bottom: 16%; height: 40%; width: 96vw; }
  .ribbon-plane { inset: -39px -14% auto; height: calc(var(--art-height) + 68px); mask-image: none; }
  .profession-sound { right: 60%; top: 35px; }
  .profession-architect { left: 65%; top: 46px; }
  .profession-bio { right: 68%; top: 113px; }
  .profession-design { left: 70%; top: 130px; }
  .spark-blue { left: 19%; top: 174px; }
  .spark-orange { right: 15%; top: 203px; }
  .hero-question { position: relative; inset: auto; width: auto; rotate: none; animation: none; }
}

@media (max-width: 590px) {
  .hero { --art-height: clamp(305px, 91vw, 420px); padding-top: 63px; }
  .hero-intro { padding-top: 30px; }
  .hero-kicker { margin-bottom: 12px; font-size: .7rem; }
  .hero h1 { font-size: clamp(2.15rem, 11vw, 4rem); line-height: .96; }
  .hero-lede { margin-inline: auto; font-size: .91rem; }
  .hero-actions { gap: 9px; }
  .hero-actions .button { gap: .48rem; min-height: 44px; padding: .55rem .72rem; font-size: .8rem; }
  .hero-secondary { padding: 0 .15rem; font-size: .76rem; }
  .hero-stage { margin-top: 17px; }
  .hero-art { grid-template-columns: 1fr; gap: 10px; }
  .portrait-set { width: min(92vw, 445px); }
  .profession { gap: 4px; padding: 6px 7px; font-size: .62rem; }
  .profession-sound { right: auto; left: 0; top: 37px; }
  .profession-architect { right: 0; left: auto; top: 48px; }
  .profession-bio { right: auto; left: 0; top: 147px; }
  .profession-design { right: 0; left: auto; top: 155px; }
  .spark-blue { left: 11%; top: 210px; }
  .spark-orange { right: 8%; top: 229px; }
  .hero-question { border-radius: 15px; padding: 10px 13px 12px; }
  .hero-question figcaption { margin-bottom: 4px; }
}

.liquid-stream {
  position: absolute;
  pointer-events: none;
}

.liquid-stream canvas,
.liquid-stream-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.liquid-stream canvas { display: block; opacity: 0; }
.liquid-stream canvas[data-ready="true"] { opacity: 1; }
.liquid-stream canvas[data-ready="true"] + .liquid-stream-fallback { opacity: 0; }

.liquid-stream-fallback {
  background: url('/assets/ribbon-fallback.webp') center / contain no-repeat;
  mask-image: radial-gradient(ellipse at center, #000 24%, transparent 76%);
}

.story-stream {
  z-index: 0;
  inset: auto -8% max(-265px, -19vw);
  height: clamp(510px, 52vw, 765px);
  opacity: .89;
  mask-image: linear-gradient(180deg, transparent, #000 19% 89%, transparent);
}

.story-stream .liquid-stream-fallback { rotate: -14deg; }

.liquid-relay {
  position: relative;
  isolation: isolate;
  overflow: clip;
  background: radial-gradient(ellipse at 96% 81%, #d6c9fc 0%, transparent 56%), var(--paper);
}

.liquid-relay .question-band > .content-width,
.liquid-relay .step-panel {
  position: relative;
  z-index: 2;
}

.relay-junction { position: relative; z-index: 1; }

.relay-stream {
  inset: -158px max(-47px, -4vw) auto auto;
  width: min(39vw, 510px);
  height: 342px;
  opacity: .97;
  mask-image:
    linear-gradient(180deg, transparent, #000 19% 78%, transparent),
    linear-gradient(90deg, transparent, #000 14% 82%, transparent);
  mask-composite: intersect;
}

.relay-stream .liquid-stream-fallback {
  rotate: -71deg;
  scale: .88 1.15;
  translate: 6% -3%;
}

@media (max-width: 919px) {
  .story-stream {
    inset: auto -21% -170px;
    height: clamp(430px, 74vw, 620px);
    opacity: .74;
  }

  .relay-stream {
    width: min(53vw, 475px);
    right: -7%;
    opacity: .89;
  }
}

@media (max-width: 590px) {
  .story-stream {
    inset: auto -29% -179px;
    height: 495px;
    opacity: .64;
    mask-image: linear-gradient(180deg, transparent 2%, #000 24% 83%, transparent);
  }

  .relay-junction {
    height: 170px;
    background: linear-gradient(180deg, #27174d, #e3dafa);
  }

  .relay-stream {
    inset: 0 -2% 0 auto;
    width: min(83vw, 340px);
    height: auto;
  }

  .relay-stream .liquid-stream-fallback { rotate: -7deg; }
}
