/* Homepage scenes after the approved hero. Scoped to .dorina-home. */

.dorina-home {
  position: relative;
  background: var(--paper);
}

.fx-ready [data-reveal] {
  will-change: opacity, transform;
}

.fx-ready [data-reveal="rise"] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
  transition-delay: var(--d, 0ms);
}

.fx-ready [data-reveal="rise"].is-in {
  opacity: 1;
  transform: translateY(0);
}

.fx-ready [data-reveal="aperture"] {
  clip-path: inset(14% 6% 14% 6%);
  opacity: 0.4;
  transition: clip-path var(--dur-scene) var(--ease-io), opacity var(--dur-scene) var(--ease-io);
  transition-delay: var(--d, 0ms);
}

.fx-ready [data-reveal="aperture"].is-in {
  clip-path: inset(0 0 0 0);
  opacity: 1;
}

/* ---------- selected work chapters ---------- */

.story-scene {
  position: relative;
  height: var(--story-room, 700vh);
  height: var(--story-room, 700svh);
  background: var(--ink);
}

html:not(.home-motion) .story-scene {
  height: auto;
}

.story-scene__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--ink);
}

html:not(.home-motion) .story-scene__sticky {
  position: relative;
  height: auto;
  overflow: visible;
}

.story-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

html:not(.home-motion) .story-layer {
  position: relative;
  height: 100svh;
}

.story-layer:nth-child(1) { z-index: 1; }
.story-layer:nth-child(2) { z-index: 2; }
.story-layer:nth-child(3) { z-index: 3; }
.story-layer:nth-child(4) { z-index: 4; }

.home-motion .story-layer:not(:first-child) {
  clip-path: inset(100% 0% 0% 0%);
}

.story-layer__media {
  position: absolute;
  left: -4%;
  right: -4%;
  top: -10%;
  bottom: -10%;
}

.story-layer__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-layer__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(64% 56% at 50% 47%, rgba(11, 10, 8, 0.42) 0%, rgba(11, 10, 8, 0.16) 58%, rgba(11, 10, 8, 0) 80%),
    linear-gradient(180deg, rgba(11, 10, 8, 0.48) 0%, rgba(11, 10, 8, 0) 24%, rgba(11, 10, 8, 0) 66%, rgba(11, 10, 8, 0.4) 100%);
}

.story-layer__content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 22px;
  padding: 0 var(--gutter);
  color: #f6f2e9;
}

.home-motion .story-layer__content {
  opacity: 0;
  visibility: hidden;
}

.story-layer__title {
  font-size: clamp(2.9rem, 6.2vw, 6rem);
  text-wrap: balance;
  text-shadow: 0 2px 60px rgba(10, 9, 7, 0.4);
}

.story-layer__mask,
.closing-scene__mask,
.discovery-link__mask {
  display: block;
  overflow: hidden;
}

.story-layer__title-inner,
.closing-scene__title-inner {
  display: block;
  will-change: transform;
}

.story-layer__mask {
  padding-block: 0.08em;
  margin-block: -0.08em;
}

.story-layer .mono-label {
  color: rgba(246, 242, 233, 0.86);
}

.story-layer__action {
  color: #f6f2e9;
  font-size: 13px;
}

html:not(.home-motion) .story-layer__content {
  opacity: 1;
  visibility: visible;
}

/* ---------- practice editorial ---------- */

.editorial-moment {
  position: relative;
  z-index: 3;
  margin-top: -32svh;
  background: var(--paper);
  padding-block: clamp(90px, 12vw, 170px);
}

.editorial-moment .container {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(36px, 6vw, 110px);
  align-items: center;
}

.editorial-moment__label {
  margin-bottom: 28px;
}

.editorial-moment__statement {
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  line-height: 1.32;
  color: var(--text-paper);
  margin-bottom: 26px;
  max-width: 26ch;
}

.editorial-moment__body p {
  color: var(--text-paper-soft);
  font-weight: 400;
  font-size: 17px;
  max-width: 48ch;
  margin-bottom: 32px;
}

.editorial-moment__links {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}

.editorial-moment__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px 0 0;
  background: var(--paper-3);
}

.editorial-moment__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-parallax {
  overflow: hidden;
}

.img-parallax img {
  transform: translateY(calc(var(--py, 0) * 1px)) scale(var(--pscale, 1.12));
  will-change: transform;
}

/* ---------- discovery ---------- */

.discovery-scene {
  position: relative;
  z-index: 4;
  margin-top: -28svh;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: transparent;
}

.discovery-scene__media {
  position: absolute;
  left: 0;
  right: 0;
  top: -6%;
  bottom: -6%;
  transform: translate3d(0, calc((var(--sp, 0.5) - 0.5) * -12svh), 0);
}

.discovery-layers {
  position: absolute;
  inset: 0;
  background: var(--ink);
}

.discovery-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
}

.discovery-layer[data-media="default"] {
  opacity: 1;
  visibility: visible;
}

.discovery-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discovery-scene__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(62% 58% at 50% 50%, rgba(11, 10, 8, 0.5) 0%, rgba(11, 10, 8, 0.22) 58%, rgba(11, 10, 8, 0) 82%),
    linear-gradient(180deg, rgba(11, 10, 8, 0.48) 0%, rgba(11, 10, 8, 0) 30%, rgba(11, 10, 8, 0) 68%, rgba(11, 10, 8, 0.44) 100%);
}

.discovery-scene__veil::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 10, 8, 0.34) 0%, rgba(11, 10, 8, 0) 26%),
    radial-gradient(58% 52% at 50% 48%, rgba(11, 10, 8, 0.32) 0%, rgba(11, 10, 8, 0.12) 60%, rgba(11, 10, 8, 0) 82%);
  opacity: 0;
  transition: opacity 550ms var(--ease-out);
}

.discovery-scene[data-media-state="studio"] .discovery-scene__veil::after,
.discovery-scene[data-media-state="projects"] .discovery-scene__veil::after {
  opacity: 1;
}

.discovery-scene__content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(56px, 8vw, 140px);
  color: #f6f2e9;
  padding: 0 var(--gutter);
  opacity: clamp(0.001, calc(min(var(--sp, 0.5), calc(1 - var(--sp, 0.5))) * 10), 1);
}

.discovery-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transition: opacity 520ms var(--ease-out);
}

.discovery-link__reveal,
.discovery-link__word {
  display: block;
}

.discovery-link__reveal {
  will-change: transform;
}

.discovery-link__word {
  font-family: var(--font-display), serif;
  font-weight: 500;
  font-size: clamp(2.6rem, 5.6vw, 4.8rem);
  line-height: 1;
  letter-spacing: -0.01em;
  padding-bottom: 10px;
  text-shadow: 0 2px 44px rgba(10, 9, 7, 0.45);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 600ms var(--ease-out), transform 560ms var(--ease-out);
}

.discovery-link:hover .discovery-link__word,
.discovery-link:focus-visible .discovery-link__word {
  background-size: 100% 1px;
}

.discovery-scene[data-media-state="studio"] .discovery-link:not([data-state="studio"]),
.discovery-scene[data-media-state="projects"] .discovery-link:not([data-state="projects"]) {
  opacity: 0.66;
}

.discovery-scene[data-media-state="studio"] .discovery-link[data-state="studio"] .discovery-link__word {
  transform: translateX(14px);
}

.discovery-scene[data-media-state="projects"] .discovery-link[data-state="projects"] .discovery-link__word {
  transform: translateX(-14px);
}

.discovery-scene .mono-label {
  color: rgba(246, 242, 233, 0.86);
  text-shadow: 0 1px 18px rgba(10, 9, 7, 0.5);
}

.discovery-scene__divider {
  width: 1px;
  height: 96px;
  background: rgba(246, 242, 233, 0.32);
}

/* ---------- closing ---------- */

.closing-scene {
  position: relative;
  z-index: 5;
  margin-top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: transparent;
}

.closing-scene__media {
  position: absolute;
  left: 0;
  right: 0;
  top: -6%;
  bottom: -6%;
  transform: translate3d(0, calc((var(--sp, 0.5) - 0.5) * -10svh), 0);
}

.closing-scene__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.closing-scene__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 56% at 50% 50%, rgba(11, 10, 8, 0.52) 0%, rgba(11, 10, 8, 0.24) 60%, rgba(11, 10, 8, 0) 84%),
    linear-gradient(180deg, rgba(11, 10, 8, 0.48) 0%, rgba(11, 10, 8, 0) 32%, rgba(11, 10, 8, 0) 64%, rgba(11, 10, 8, 0.5) 100%);
}

.closing-scene__content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 30px;
  color: #f6f2e9;
  padding: 0 var(--gutter);
  opacity: clamp(0.001, calc(min(var(--sp, 0.5), calc(1 - var(--sp, 0.5))) * 10), 1);
}

.closing-scene__title {
  font-size: clamp(2.3rem, 4.8vw, 4.2rem);
  max-width: 24ch;
  text-wrap: balance;
  text-shadow: 0 2px 60px rgba(10, 9, 7, 0.42);
}

.closing-scene .mono-label {
  color: rgba(246, 242, 233, 0.84);
}

.closing-scene .btn {
  border-color: rgba(246, 242, 233, 0.55);
  color: #f6f2e9;
}

.closing-scene .btn::before {
  background: var(--paper);
}

.closing-scene .btn:hover,
.closing-scene .btn:focus-visible {
  color: var(--ink);
  border-color: var(--paper);
}

body.dorina-home-active {
  background: var(--paper);
}

/* ---------- responsive ---------- */

@media (max-width: 921px) {
  .story-scene {
    height: var(--story-room-mobile, 560svh);
  }

  .editorial-moment {
    margin-top: -18svh;
  }

  .discovery-scene {
    margin-top: -16svh;
  }

  .closing-scene {
    margin-top: 0;
  }

  .story-layer__title {
    font-size: clamp(2.4rem, 10.5vw, 3.4rem);
  }

  .discovery-scene__content {
    flex-direction: column;
    gap: 46px;
  }

  .discovery-scene__divider {
    width: 88px;
    height: 1px;
  }

  .editorial-moment .container {
    grid-template-columns: 1fr;
  }

  .editorial-moment__media {
    max-width: 440px;
  }

  .editorial-moment__statement {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }
}

@media (max-height: 480px) {
  .closing-scene__content {
    gap: 16px;
  }

  .closing-scene__title {
    font-size: clamp(1.9rem, 3.6vw, 2.4rem);
  }

  .discovery-scene__content {
    gap: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-scene__media,
  .story-layer__media,
  .discovery-scene__media,
  .closing-scene__media {
    transform: none !important;
  }

  .story-scene {
    height: auto !important;
  }

  .story-scene__sticky {
    position: relative;
    height: auto;
    overflow: visible;
  }

  .story-layer {
    position: relative;
    height: 100vh;
    height: 100svh;
    clip-path: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .story-layer__content {
    opacity: 1 !important;
    visibility: visible !important;
  }

  .story-layer__title-inner {
    transform: none !important;
  }

  .discovery-scene__content,
  .closing-scene__content {
    opacity: 1 !important;
  }

  .fx-ready [data-reveal],
  .fx-ready [data-reveal].is-in {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
  }

  .img-parallax img {
    transform: none !important;
  }
}
