/* The opening is a complete static composition before motion is enabled. */
.hero.hero-motion {
  position: relative;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 28px 55px;
  padding-block: 28px 74px;
  align-items: center;
}

.hero-signature {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 25px;
  position: relative;
  z-index: 1;
  width: fit-content;
  padding-bottom: 20px;
  pointer-events: none;
}

.signature-word {
  display: flex;
  align-items: baseline;
  font-size: clamp(100px, 14.8vw, 182px);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.075em;
  color: var(--purple);
}

.signature-soma,
.signature-origin,
.signature-lina,
.signature-letters {
  display: inline-block;
}

.signature-origin { position: relative; margin-left: -.015em; }
.signature-lina {
  transform-origin: top left;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -.085em;
  white-space: nowrap;
}

.signature-digital {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  color: var(--muted);
}

.hero-motion .hero-copy h1 { font-size: clamp(52px, 4.9vw, 68px); margin-bottom: 27px; }
.hero-motion .hero-copy > p:not(.eyebrow) { max-width: 48ch; font-size: 16px; }
.hero-motion .hero-copy .actions { margin-top: 24px; }

.motion-gallery {
  position: relative;
  z-index: 2;
  height: 510px;
  min-width: 0;
  isolation: isolate;
}

.scene-plane {
  position: absolute;
  inset: 45px 14px 50px 74px;
  background: #e8e1ee;
  transform: rotate(-7deg);
  border-radius: 3px;
}

.scene-layer {
  --layer-y: 0px;
  --layer-turn: 0deg;
  position: absolute;
  margin: 0;
  transform: translate3d(0, var(--layer-y), 0) rotate(calc(var(--layer-rotation) + var(--layer-turn)));
  transform-origin: center;
  box-shadow: 0 18px 40px -24px #30253f55;
}

.scene-portrait {
  --layer-rotation: 4deg;
  z-index: 1;
  width: min(66%, 312px);
  top: 0;
  right: 8px;
  padding: 8px 8px 0;
  background: white;
}
.scene-portrait img { width: 100%; height: auto; aspect-ratio: 1; }
.scene-portrait figcaption { margin: 0; padding: 9px 4px 10px; font-size: 12px; line-height: 1.5; }

.scene-product {
  --layer-rotation: -8deg;
  z-index: 2;
  top: 35px;
  left: -8px;
  width: 39%;
  max-width: 195px;
  padding: 9px 9px 12px;
  background: white;
  text-decoration: none;
}
.scene-product > img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; }
.scene-product-caption {
  display: grid;
  gap: 7px;
  padding-inline: 3px;
  padding-top: 8px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
}
.scene-product-caption img { width: 72px; height: auto; }

.scene-feature {
  --layer-rotation: -3deg;
  z-index: 3;
  bottom: 0;
  left: 0;
  width: 76%;
  max-width: 370px;
  padding: 18px;
  color: var(--ink);
  background: #f1edf5;
  border: 1px solid #ded6e5;
  text-decoration: none;
}
.scene-feature .art-label { margin-bottom: 12px; gap: 12px; flex-wrap: wrap; line-height: 1.5; font-size: 9px; }
.scene-feature > img { width: 100%; height: auto; aspect-ratio: 1600 / 750; object-fit: contain; }
.scene-feature-caption {
  display: block;
  max-width: 25ch;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -.035em;
  margin-top: 14px;
}
.scene-feature-link {
  display: block;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid #cec4d8;
  font-size: 12px;
  line-height: 1.6;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.project-section-links {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}

/* The traveling word passes behind the existing ribbon. */
.home-motion .motion-ticker { position: relative; z-index: 5; }

.signature-dock {
  display: flex;
  align-items: baseline;
  pointer-events: none;
  opacity: 0;
  color: var(--purple);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -.075em;
  line-height: .9;
}
.dock-lina {
  display: inline-block;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -.085em;
  margin-left: -.015em;
}

.home-motion.is-motion-enabled .signature-lina {
  transform: translate3d(var(--lina-x, 0px), var(--lina-y, 0px), 0) rotate(var(--lina-turn, 0deg)) scale(var(--lina-scale, 1));
  will-change: transform;
}
.home-motion.is-motion-enabled .signature-dock { opacity: var(--dock-opacity, 0); }
.home-motion.is-motion-enabled .dock-lina { visibility: hidden; }
.home-motion.is-motion-enabled .motion-reveal { transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.home-motion.is-motion-enabled .motion-reveal.is-pending { opacity: 0; transform: translateY(30px); }
.home-motion.is-motion-enabled .motion-reveal:focus-within { opacity: 1; transform: none; }
.home-motion.motion-arriving .signature-soma { animation: signature-enter .9s cubic-bezier(.2, .8, .2, 1) both; }
.home-motion.motion-arriving .signature-letters { animation: signature-join 1.2s cubic-bezier(.18, .75, .22, 1) both; }
.home-motion.motion-arriving .hero-copy,
.home-motion.motion-arriving .motion-gallery { animation: opening-enter 1s .12s cubic-bezier(.2, .8, .2, 1) both; }
.home-motion .button,
.home-motion .nav-cta { transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease; }

@keyframes signature-enter {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes signature-join {
  from { opacity: 0; transform: translate(28px, -32px) rotate(10deg); }
  to { opacity: 1; transform: translate(0, 0) rotate(0deg); }
}
@keyframes opening-enter {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .home-motion .button:hover,
  .home-motion .nav-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 15px -10px #30253f88; }
  .scene-feature:hover .scene-feature-link { text-decoration-thickness: 2px; }
}

@media (min-width: 721px) and (max-width: 1000px) {
  .hero.hero-motion { width: calc(100% - 60px); max-width: none; grid-template-columns: 1fr 1fr; gap: 30px; }
  .hero-motion .hero-copy h1 { font-size: clamp(40px, 5.5vw, 55px); }
  .hero-motion .hero-copy > p:not(.eyebrow) { font-size: 15px; }
  .motion-gallery { height: 450px; }
  .scene-portrait { width: 76%; }
  .scene-product { width: 44%; top: 40px; left: -5px; }
  .scene-feature { width: 94%; padding: 14px; }
  .scene-feature-caption { font-size: 20px; }
}

@media (max-width: 720px) {
  .hero.hero-motion { grid-template-columns: 1fr; gap: 30px; padding-block: 28px 45px; }
  .hero-signature { gap: 12px; padding-bottom: 0; max-width: 100%; flex-wrap: wrap; row-gap: 10px; }
  .signature-word { font-size: clamp(76px, 18.5vw, 126px); }
  .signature-digital { font-size: 9px; letter-spacing: .16em; }
  .hero-motion .hero-copy h1 { font-size: clamp(44px, 10.8vw, 62px); margin-bottom: 24px; }
  .hero-motion .hero-copy .actions { margin-top: 20px; }
  .hero-motion .hero-copy > p:not(.eyebrow) { font-size: 16px; }
  .motion-gallery { width: min(100%, 460px); height: 465px; margin: 20px auto 8px; }
  .scene-portrait { right: 8px; width: 63%; }
  .scene-product { left: 0; top: 40px; width: 39%; padding: 6px 6px 10px; }
  .scene-product-caption { font-size: 9px; gap: 5px; padding-top: 3px; }
  .scene-product-caption img { width: 62px; }
  .scene-feature { width: 88%; padding: 14px; bottom: 0; }
  .scene-feature .art-label { font-size: 8px; letter-spacing: .8px; gap: 4px 10px; }
  .scene-feature-caption { font-size: 20px; }
  .scene-feature-link { font-size: 12px; padding-block: 9px 2px; }
  .scene-plane { inset: 28px 14px 50px 32px; }
  .home-projects .section-top { align-items: stretch; }
  .project-section-links { width: 100%; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 12px; }
  .hero-motion .hero-copy { position: relative; z-index: 2; background: var(--paper); }
  .signature-dock { font-size: 40px; }
  .project-section-links .text-link { font-size: 12px; }
}

@media (max-width: 380px) {
  .hero-motion .hero-copy h1 { font-size: 43px; }
  .signature-word { font-size: clamp(66px, 20vw, 76px); }
  .signature-digital { font-size: 8px; }
  .motion-gallery { height: 430px; }
  .scene-feature-caption { font-size: 18px; }
  .signature-dock { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-motion .signature-lina,
  .home-motion .signature-soma,
  .home-motion .signature-letters,
  .home-motion .hero-copy,
  .home-motion .motion-gallery,
  .home-motion .motion-reveal {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
    will-change: auto !important;
  }
  .home-motion .scene-layer { transform: rotate(var(--layer-rotation)); }
  .home-motion .signature-dock { opacity: 0 !important; }
  .home-motion .button,
  .home-motion .nav-cta { transition: none; }
}
