* { box-sizing: border-box; }

:root {
  font-family: var(--type-body-family);
  font-size: 100%;
  font-weight: var(--type-body-weight);
  font-synthesis: none;
  font-optical-sizing: none;
  font-variation-settings: var(--type-body-variation);
  --page-background: #d2cfc9;
  --light-progress: 0;
  --text-primary: #f1e7d6;
  --text-secondary: #d7cab4;
}

html { background: var(--page-background); }
body {
  margin: 0;
  padding: 8px;
  height: 2000px;
  font-size: var(--type-body-size);
  line-height: var(--type-body-leading);
  letter-spacing: var(--type-body-tracking);
  color: var(--text-primary);
  background: var(--page-background);
  -webkit-font-smoothing: antialiased;
}

.lighting-story {
  height: 100%;
}

.room {
  position: relative;
  display: flex;
  justify-content: flex-end;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
}

.lighting-story.is-scroll-ready .room {
  position: sticky;
  top: 8px;
}

.scene {
  position: relative;
  flex: 0 0 100%;
  min-width: 640px;
  aspect-ratio: 8 / 5;
  isolation: isolate;
  background: var(--page-background);
}

/* Animate the fade's color with the page, keeping its transparency fixed. */
.scene::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  height: 28%;
  pointer-events: none;
  background: var(--page-background);
  --bottom-fade: linear-gradient(
    to bottom,
    rgb(0 0 0 / 0) 0%,
    rgb(0 0 0 / .06) 15%,
    rgb(0 0 0 / .25) 35%,
    rgb(0 0 0 / .6) 60%,
    rgb(0 0 0 / .9) 82%,
    #000 100%
  );
  -webkit-mask-image: var(--bottom-fade);
  mask-image: var(--bottom-fade);
}

.hero-copy {
  position: absolute;
  z-index: 2;
  top: clamp(72px, 9vw, 180px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(0, 352px) 260px;
  align-items: end;
  gap: 64px;
  width: 676px;
  max-width: calc(100% - 48px);
  color: var(--text-primary);
}

.hero-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

h1 {
  margin: 0;
  color: #F3E7D4;
  color: color(display-p3 0.9462 0.9063 0.8387);
  font-family: var(--type-heading-family);
  font-size: var(--type-heading-size);
  font-style: normal;
  font-weight: var(--type-heading-weight);
  line-height: var(--type-heading-leading);
  letter-spacing: var(--type-heading-tracking);
  font-variation-settings: var(--type-heading-variation);
}

.hero-description {
  margin: 0;
  width: 260px;
  max-width: 100%;
  text-wrap: balance;
  color: var(--text-secondary);
  font-family: var(--type-body-family);
  font-size: var(--type-body-size);
  font-weight: var(--type-body-weight);
  line-height: var(--type-body-leading);
  letter-spacing: var(--type-body-tracking);
  font-variation-settings: var(--type-body-variation);
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  min-height: 36px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: #23201a;
  color: var(--text-primary);
  font-family: var(--type-button-family);
  font-size: var(--type-button-size);
  font-style: normal;
  font-weight: var(--type-button-weight);
  line-height: var(--type-button-leading);
  letter-spacing: var(--type-button-tracking);
  font-variation-settings: var(--type-button-variation);
  opacity: 1;
  white-space: nowrap;
  -webkit-text-fill-color: var(--text-primary);
}

.download-button:disabled { cursor: default; }
.download-button:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 4px; }

.scene-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.scene-night {
  position: absolute;
  inset: 0;
  opacity: var(--light-progress);
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 641px) and (max-width: 800px) {
  .hero-copy { top: 64px; grid-template-columns: minmax(0, 320px) 260px; gap: 32px; width: 612px; }
}

@media (max-width: 640px) {
  .hero-copy { top: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 14px; width: 360px; }
  .download-button { margin-top: 14px; }
}
