/* The page stays readable without JavaScript and with reduced motion. */
.hero-film,
.hero-finale,
.scroll-invitation,
.reading-progress,
.chapter-indicator,
.feature-counter,
.gallery-position,
.portal-word {
  display: none;
}

.perspective-scroll {
  background: var(--olive-dark);
  color: var(--paper);
}

.perspective-pin {
  padding-block: 110px;
}

.perspective-pin .eyebrow {
  color: #cccbb4;
}

.perspective-statement {
  max-width: 1120px;
  font-size: clamp(46px, 7.4vw, 106px);
  line-height: 1.08;
  letter-spacing: -.045em;
  text-wrap: pretty;
}

.thought-word {
  display: inline-block;
}

.perspective-statement em {
  color: #e3d8ae;
}

@media (max-width: 999px), (max-height: 649px) {
  .motion-toggle {
    position: static !important;
    display: flex;
    width: fit-content;
    margin: 22px auto 0;
  }
}

.perspective-caption {
  margin-top: 38px;
  color: #d2d0be;
  font-size: 12px;
}

.perspective-line {
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 52px;
  background: rgb(237 234 212 / 24%);
  transform-origin: left center;
}

html.motion-enabled .reading-progress {
  position: fixed;
  z-index: 60;
  inset: 0 0 auto;
  display: block;
  height: 2px;
  pointer-events: none;
}

html.motion-enabled .reading-progress > span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
}

.motion-toggle {
  position: fixed;
  z-index: 26;
  left: 24px;
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 17px;
  border: 1px solid rgb(214 211 195 / 85%);
  border-radius: 28px;
  background: rgb(250 249 245 / 96%);
  color: var(--olive-dark);
  box-shadow: 0 3px 16px rgb(35 32 19 / 4%);
  backdrop-filter: blur(12px);
  font-size: 10px;
  line-height: 1.4;
  transition: background .2s ease;
}

.motion-toggle:hover {
  background: var(--paper-deep);
}

body.menu-open .motion-toggle {
  display: none;
}

html.motion-enabled .portal-finale .portal-word {
  position: absolute;
  display: block;
  z-index: 1;
  right: -.045em;
  bottom: -.17em;
  color: transparent;
  font-family: var(--serif);
  font-size: clamp(110px, 25vw, 390px);
  line-height: 1;
  font-weight: 400;
  letter-spacing: -.06em;
  -webkit-text-stroke: 1px rgb(236 233 209 / 80%);
  pointer-events: none;
  user-select: none;
}

@media (min-width: 1000px) and (min-height: 650px) {
  html.motion-enabled {
    --scene-top: 84px;
  }

  html.motion-enabled .hero-scroll {
    position: relative;
    height: 190svh;
  }

  html.motion-enabled .hero {
    position: sticky;
    top: var(--scene-top);
    height: calc(100svh - var(--scene-top));
    min-height: 0;
    padding-block: 28px 62px;
    isolation: isolate;
  }

  html.motion-enabled .hero-copy {
    position: relative;
    z-index: 3;
    padding-block: 8px;
    transform-origin: left center;
  }

  html.motion-enabled .hero h1 {
    font-size: clamp(58px, min(6.2vw, 10.7svh), 88px);
  }

  html.motion-enabled .hero-description {
    margin-top: 24px;
  }

  html.motion-enabled .hero-caption {
    margin-top: 30px;
  }

  html.motion-enabled .hero-visual {
    z-index: 1;
    min-height: 0;
    height: 100%;
    max-height: 790px;
    align-self: center;
    transform-origin: right center;
  }

  html.motion-enabled .hero-film {
    position: absolute;
    z-index: 2;
    inset: 28px 0 62px;
    display: block;
    overflow: hidden;
    border-radius: 8px 8px 70px 8px;
    clip-path: inset(0 0 0 50%);
    opacity: 0;
    background: #d7d0bf;
    pointer-events: none;
  }

  html.motion-enabled .hero-film::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(to top, rgb(29 29 21 / 72%), rgb(29 29 21 / 32%) 43%, rgb(29 29 21 / 5%) 85%);
  }

  html.motion-enabled .hero-film img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 55%;
  }

  html.motion-enabled .hero-film-label {
    position: absolute;
    z-index: 1;
    top: 24px;
    right: 26px;
    color: var(--paper);
    font-size: 9px;
    letter-spacing: .1em;
    text-shadow: 0 1px 9px rgb(0 0 0 / 35%);
  }

  html.motion-enabled .hero-finale {
    position: absolute;
    z-index: 4;
    left: clamp(32px, 4.8vw, 70px);
    bottom: 116px;
    display: flex;
    flex-direction: column;
    color: #fffdf5;
    font-family: var(--serif);
    font-size: clamp(62px, min(7.7vw, 12svh), 110px);
    line-height: 1.02;
    letter-spacing: -.055em;
    text-shadow: 0 3px 35px rgb(25 24 16 / 25%);
    opacity: 0;
    pointer-events: none;
  }

  html.motion-enabled .hero-finale em {
    color: #f5eccd;
    font-weight: 400;
  }

  html.motion-enabled .scroll-invitation {
    position: absolute;
    z-index: 5;
    left: 50%;
    width: max-content;
    transform: translateX(-50%);
    bottom: 21px;
    display: flex;
    align-items: center;
    gap: 22px;
    color: var(--olive);
    font-size: 8px;
    letter-spacing: .18em;
    line-height: 1.5;
    pointer-events: none;
  }

  html.motion-enabled .scroll-invitation > span {
    font-family: var(--serif);
    font-size: 23px;
    line-height: 1;
  }

  html.motion-enabled .perspective-scroll {
    position: relative;
    height: 180svh;
  }

  html.motion-enabled .perspective-pin {
    position: sticky;
    top: var(--scene-top);
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: calc(100svh - var(--scene-top));
    padding-block: 56px;
  }

  html.motion-enabled .perspective-pin .eyebrow {
    margin-bottom: clamp(26px, 6svh, 64px);
  }

  html.motion-enabled .perspective-statement {
    font-size: clamp(68px, min(8.1vw, 12.5svh), 115px);
    line-height: 1.08;
  }

  html.motion-enabled .thought-word {
    opacity: .18;
  }

  html.motion-enabled .perspective-caption {
    margin-top: clamp(26px, 5svh, 50px);
  }

  html.motion-enabled .perspective-line {
    margin-top: clamp(28px, 5svh, 50px);
  }

  html.motion-enabled .scroll-feature {
    grid-template-columns: 1.05fr .85fr;
    align-items: start;
    gap: 60px;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }

  html.motion-enabled .scroll-feature .feature-image {
    position: sticky;
    top: 110px;
    height: calc(100svh - 160px);
    min-height: 450px;
    max-height: 750px;
    overflow: hidden;
    border-radius: 6px 6px 72px 6px;
    isolation: isolate;
    background: var(--paper-deep);
  }

  html.motion-enabled .scroll-feature .feature-image > img {
    transform-origin: 50% 55%;
  }

  html.motion-enabled .scroll-feature .feature-counter {
    position: absolute;
    top: 24px;
    right: 24px;
    display: block;
    padding: 7px 10px;
    border: 1px solid rgb(255 255 255 / 55%);
    border-radius: 3px;
    color: #555342;
    background: rgb(250 249 245 / 91%);
    font-size: 9px;
    line-height: 1.65;
    letter-spacing: .13em;
    font-variant-numeric: tabular-nums;
  }

  html.motion-enabled .scroll-feature .feature-copy {
    padding: 40px 0 0;
  }

  html.motion-enabled .scroll-feature .feature-copy h2 {
    font-size: clamp(40px, 4.4vw, 61px);
  }

  html.motion-enabled .scroll-feature .feature-list {
    gap: 0;
    margin-top: 6svh;
  }

  html.motion-enabled .scroll-feature .feature-list article {
    position: relative;
    align-items: center;
    min-height: 44svh;
    padding-block: 48px;
    gap: 22px;
    border-top: 1px solid var(--line);
    opacity: .5;
    transition: opacity .35s ease;
  }

  html.motion-enabled .scroll-feature .feature-list article.is-active {
    opacity: 1;
  }

  html.motion-enabled .scroll-feature .feature-list article > span {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 25px;
  }

  html.motion-enabled .scroll-feature .feature-list h3 {
    margin-bottom: 12px;
    font-family: var(--serif);
    font-size: clamp(24px, 2.2vw, 31px);
    font-weight: 400;
    line-height: 1.2;
  }

  html.motion-enabled .scroll-feature .feature-list p {
    max-width: 340px;
    color: #666658;
    font-size: 14px;
    line-height: 1.85;
  }

  html.motion-enabled .gallery-scroll {
    position: relative;
    height: 250svh;
    margin-top: 28px;
  }

  html.motion-enabled .gallery-pin {
    position: sticky;
    top: 110px;
    padding-block: 18px 24px;
    overflow: hidden;
  }

  html.motion-enabled .gallery-pin .inspiration-filters {
    margin: 0 0 24px;
  }

  html.motion-enabled .gallery-pin .inspiration-grid {
    display: flex;
    gap: 28px;
    width: 100%;
    align-items: flex-start;
  }

  html.motion-enabled .gallery-pin .inspiration-card {
    flex: 0 0 min(660px, calc((100vw - 160px) / 2));
  }

  html.motion-enabled .gallery-pin .inspiration-card > div {
    width: 100%;
    aspect-ratio: 1.3;
    max-height: min(50svh, calc(100svh - 370px));
    border-radius: 6px;
  }

  html.motion-enabled .gallery-pin .inspiration-card h3 {
    margin-top: 19px;
    font-size: 29px;
  }

  html.motion-enabled .gallery-pin .inspiration-card p {
    font-size: 12px;
  }

  html.motion-enabled .gallery-position {
    display: block;
    width: 140px;
    height: 2px;
    margin-top: 23px;
    overflow: hidden;
    background: #d6d2c2;
  }

  html.motion-enabled .gallery-position > span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--olive);
    transform: scaleX(.1);
    transform-origin: left center;
  }

  html.motion-enabled .gallery-scroll[data-count="3"] {
    height: 180svh;
  }

  html.motion-enabled .gallery-scroll[data-count="1"],
  html.motion-enabled .gallery-scroll[data-count="2"] {
    height: auto;
  }

  html.motion-enabled .gallery-scroll[data-count="1"] .gallery-pin,
  html.motion-enabled .gallery-scroll[data-count="2"] .gallery-pin {
    position: relative;
    top: auto;
  }

  html.motion-enabled .gallery-scroll[data-count="1"] .inspiration-grid,
  html.motion-enabled .gallery-scroll[data-count="2"] .inspiration-grid {
    transform: none !important;
  }

  html.motion-enabled .gallery-scroll[data-count="2"] .inspiration-card {
    flex-basis: calc((100% - 28px) / 2);
  }

  html.motion-enabled .gallery-scroll[data-count="1"] .gallery-position,
  html.motion-enabled .gallery-scroll[data-count="2"] .gallery-position {
    display: none;
  }

  html.motion-enabled .portal-finale {
    display: flex;
    align-items: center;
    min-height: 95svh;
    padding-block: 120px;
  }

  html.motion-enabled .portal-finale h2 {
    font-size: clamp(72px, 7.2vw, 104px);
  }

  html.motion-enabled .portal-finale h2 + p {
    margin-top: 30px;
    font-size: 14px;
  }

  html.motion-enabled .portal-finale .button {
    margin-top: 35px;
    min-height: 55px;
    padding-inline: 25px;
    font-size: 12px;
  }

  html.motion-enabled .portal-finale .arch {
    width: 410px;
    height: 760px;
    bottom: -200px;
    border-radius: 250px 250px 0 0;
    transform-origin: center bottom;
  }

  html.motion-enabled .portal-finale .arch-two {
    width: 480px;
    height: 850px;
    bottom: -240px;
  }

  html.motion-enabled .chapter-indicator {
    position: fixed;
    z-index: 25;
    right: 24px;
    bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 10px 11px;
    border: 1px solid rgb(214 211 195 / 70%);
    border-radius: 40px;
    background: rgb(250 249 245 / 92%);
    box-shadow: 0 3px 16px rgb(35 32 19 / 4%);
    color: var(--olive);
    backdrop-filter: blur(12px);
    pointer-events: none;
  }

  html.motion-enabled .chapter-number {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1px solid #d9d6c5;
    border-radius: 50%;
    font-family: var(--serif);
    font-size: 11px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }

  html.motion-enabled .chapter-name {
    font-size: 9px;
    letter-spacing: .04em;
    line-height: 1.4;
  }
}

@media (min-width: 1000px) and (min-height: 650px) and (max-height: 760px) {
  html.motion-enabled .hero-copy {
    padding-block: 0;
  }

  html.motion-enabled .hero-copy .eyebrow {
    margin-bottom: 14px;
  }

  html.motion-enabled .hero h1 {
    font-size: clamp(54px, 6vw, 66px);
  }

  html.motion-enabled .hero-description {
    margin-top: 18px;
    max-width: 420px;
    font-size: 12px;
    line-height: 1.7;
  }

  html.motion-enabled .hero-buttons {
    margin-top: 18px;
  }

  html.motion-enabled .credit-note {
    margin-top: 14px;
  }

  html.motion-enabled .hero-caption {
    display: none;
  }

  html.motion-enabled .perspective-pin {
    padding-block: 35px;
  }
}

@media (max-width: 999px), (max-height: 649px) {
  html.motion-enabled .perspective-pin {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: min(90svh, 780px);
    padding-block: 80px;
  }

  html.motion-enabled .perspective-statement {
    font-size: clamp(46px, 8vw, 78px);
  }

  html.motion-enabled .thought-word {
    opacity: 1;
  }

  html.motion-enabled .portal-finale h2 {
    font-size: clamp(52px, 7.7vw, 72px);
  }
}

@media (max-width: 680px) {
  .motion-toggle {
    left: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    padding-inline: 13px;
    font-size: 9px;
  }

  .perspective-pin {
    padding-block: 74px;
  }

  .perspective-statement {
    font-size: clamp(44px, 11.7vw, 66px);
  }

  .perspective-caption {
    max-width: 240px;
    margin-top: 30px;
    font-size: 11px;
  }

  .perspective-line {
    margin-top: 36px;
  }

  html.motion-enabled .perspective-statement {
    font-size: clamp(44px, 11.7vw, 66px);
  }

  html.motion-enabled .portal-finale h2 {
    font-size: clamp(52px, 14vw, 66px);
  }
}

/* Preference changes apply immediately, including before JavaScript rebuilds. */
@media (prefers-reduced-motion: reduce) {
  html.motion-enabled .hero-scroll,
  html.motion-enabled .perspective-scroll,
  html.motion-enabled .gallery-scroll {
    height: auto;
  }

  html.motion-enabled .hero,
  html.motion-enabled .perspective-pin,
  html.motion-enabled .scroll-feature .feature-image,
  html.motion-enabled .gallery-pin {
    position: relative;
    top: auto;
  }

  html.motion-enabled .hero {
    height: auto;
    min-height: 630px;
  }

  html.motion-enabled .hero-visual {
    height: min(68svh, 660px);
    min-height: 395px;
  }

  html.motion-enabled .hero-copy,
  html.motion-enabled .hero-visual,
  html.motion-enabled .thought-word,
  html.motion-enabled .scroll-feature .feature-list article {
    opacity: 1 !important;
    transform: none !important;
  }

  html.motion-enabled .perspective-pin {
    height: auto;
    min-height: 0;
    padding-block: 90px;
  }

  html.motion-enabled .scroll-feature .feature-list article {
    min-height: 0;
    padding-block: 25px;
  }

  html.motion-enabled .gallery-pin .inspiration-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    transform: none !important;
  }

  html.motion-enabled .hero-film,
  html.motion-enabled .hero-finale,
  html.motion-enabled .scroll-invitation,
  html.motion-enabled .reading-progress,
  html.motion-enabled .chapter-indicator,
  html.motion-enabled .gallery-position {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) and (max-width: 680px) {
  html.motion-enabled .gallery-pin .inspiration-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  html.motion-enabled .hero-scroll,
  html.motion-enabled .perspective-scroll,
  html.motion-enabled .gallery-scroll {
    height: auto;
  }

  html.motion-enabled .hero,
  html.motion-enabled .perspective-pin,
  html.motion-enabled .scroll-feature .feature-image,
  html.motion-enabled .gallery-pin {
    position: static;
    height: auto;
    min-height: 0;
  }

  html.motion-enabled .hero-copy,
  html.motion-enabled .hero-visual,
  html.motion-enabled .thought-word,
  html.motion-enabled .feature-list article,
  html.motion-enabled .inspiration-grid {
    opacity: 1 !important;
    transform: none !important;
  }

  html.motion-enabled .reading-progress,
  html.motion-enabled .chapter-indicator,
  html.motion-enabled .hero-film,
  html.motion-enabled .hero-finale,
  html.motion-enabled .scroll-invitation,
  html.motion-enabled .portal-word {
    display: none;
  }

  .motion-toggle {
    display: none;
  }
}
