.home-page > .site-header {
  margin-bottom: calc(-1 * (var(--header-height) + 1px));
}

.home-page:not(.is-past-opening) > .site-header {
  background: linear-gradient(180deg, #131c16f5, #131c16b0 77%, #131c1600);
  border-bottom-color: transparent;
}

.home-page .site-header .outline { background: #172018ad; }
.home-page .site-header .outline:hover { background: #263525; }

.opening {
  --story-reveal: 1;
  --story-pull: 1;
  --story-progress: 0;
  --story-focus: 56%;
  --story-lift: 0;
  --film-controls-height: 76px;
  background: #172018;
  color: #fffaf0;
}

.opening .opening-stage {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 100svh;
  height: 100svh;
  gap: 0;
  padding: 0;
  background: #172018;
}

:root:not(.k-on, [data-opening="photo"]) .opening .opening-stage,
.opening:is(.k-static, .k-media-failed) .opening-stage {
  position: relative;
  height: auto;
  grid-template-rows: minmax(min-content, 1fr) auto;
  padding-top: calc(var(--header-height) + 28px);
}

.opening:is(.k-static, .k-media-failed) {
  --story-reveal: 1 !important;
  --story-pull: 1 !important;
}

.opening.k-media-failed { height: auto !important; }

.opening-film, .story-screen, .opening-shade {
  position: absolute;
  inset: 0;
  margin: 0;
  pointer-events: none;
}

.opening-film { z-index: 0; }
.story-screen { overflow: hidden; }

.story-poster, .story-screen video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.story-screen video { opacity: 0; }
.k-media-ready .story-screen video { opacity: 1; }
.opening:is(.k-static, .k-media-failed) .story-screen video { display: none; }

.opening-shade {
  z-index: 1;
  background: linear-gradient(180deg, #10181030, transparent 28%, transparent 63%, #111910ba);
}

.opening-shade::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #101a12e8, #101a12ac 26%, transparent 52%),
    linear-gradient(0deg, #131b13f2 2%, #131b13a6 23%, #131b132e 43%, transparent 66%);
  opacity: var(--story-reveal);
}

.opening-content {
  z-index: 2;
  align-self: end;
  min-width: 0;
  padding-block: 8px clamp(20px, 6vh, 65px);
  pointer-events: none;
}

.opening-copy {
  width: fit-content;
  max-width: 100%;
  opacity: var(--story-reveal);
  transform: translate3d(0, calc(36px * (1 - var(--story-reveal))), 0);
}

.opening-copy:focus-within {
  opacity: 1;
  transform: none;
}

.opening:has(.opening-copy:focus-within) .opening-shade::after { opacity: 1; }
.opening .hero-actions { pointer-events: auto; }
.opening.is-watching:not(.is-revealed, .k-media-failed, .k-static) .opening-copy:not(:focus-within) .hero-actions { pointer-events: none; }

.opening-copy .area { margin-bottom: 16px; color: #eef1e5; }
.opening-copy .area span { background: var(--bright); }

.opening h1 {
  font-size: clamp(54px, 5.65vw, 96px);
  line-height: .88;
  text-shadow: 0 2px 24px #10181057;
}

.opening h1 span, .opening h1 em { display: block; }

.opening h1 em {
  color: var(--bright);
  transform-origin: left center;
  transform: translate3d(calc(38px * (1 - var(--story-pull))), 0, 0) scale(calc(.95 + .05 * var(--story-pull)));
}

.opening-detail {
  color: #f3f3e9;
  max-width: 43ch;
  margin: 19px 0 21px;
  font-size: clamp(16px, 1.45vw, 20px);
}

.opening .solid { color: #25271e; background: var(--bright); padding-inline: 19px; }
.opening .solid:hover { background: #ffdcc9; }
.opening :focus-visible { outline-color: #fff6de; }
.opening .hero-actions .text-link { display: inline-flex; align-items: center; min-height: 44px; }

.story-screen .k-ring { inset: auto 22px calc(var(--film-controls-height) + 15px) auto; color: #fff6df; }
:root:not(.k-on) .story-screen .k-ring,
.opening:is(.k-static, .k-media-failed) :is(.k-ring, .story-scroll, .story-progress) { display: none; }

.story-controls {
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: var(--film-controls-height);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid #f2efdf4f;
  color: #fffaf0;
  font-size: .84rem;
  text-shadow: 0 1px 8px #142015;
}

.story-scroll { display: none; }
.k-on .story-scroll { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.story-scroll span { color: var(--bright); font-size: 1.2rem; }

.story-progress {
  position: relative;
  display: none;
  flex: 1;
  max-width: 116px;
  height: 1px;
  background: #fffaee52;
}

.k-media-ready .story-progress { display: block; }
.story-progress::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bright);
  transform: scaleX(var(--story-progress));
  transform-origin: left;
}

.story-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-left: auto;
  padding: 0 2px 0 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  text-shadow: inherit;
}

.story-play:hover { text-decoration: underline; text-underline-offset: 4px; }
.story-play[hidden] { display: none; }
.play-icon { width: 0; height: 0; border-block: 5px solid transparent; border-left: 8px solid var(--bright); }

@media (max-aspect-ratio: 1 / 1) {
  .story-poster, .story-screen video { object-position: var(--story-focus) center; }
}

@media (max-width: 720px) {
  .opening { --film-controls-height: 59px; }
  .opening-content { padding-bottom: clamp(15px, 4vh, 39px); }
  .opening-copy { transform: translate3d(0, calc(25px * (1 - var(--story-reveal))), 0); }
  .opening-copy .area { font-size: .77rem; margin-bottom: 12px; text-shadow: 0 1px 8px #101810e0; }
  .opening h1 { font-size: clamp(43px, 11vw, 68px); }
  .opening h1 em { transform: translate3d(0, calc(16px * (1 - var(--story-pull))), 0) scale(calc(.97 + .03 * var(--story-pull))); }
  .opening-detail { font-size: .94rem; margin: 13px 0 15px; max-width: 35ch; }
  .opening .hero-actions { gap: 7px 13px; }
  .opening .hero-actions .button { padding-inline: 13px; gap: 8px; }
  .opening .hero-actions .text-link { font-size: .88rem; }
  .opening-shade::after { background: linear-gradient(0deg, #131b13fc 4%, #131b13e8 26%, #131b13ac 37%, #131b1338 54%, transparent 70%); }
  .story-controls { font-size: .79rem; }
}

@media (max-width: 720px) and (orientation: portrait) {
  .story-screen video { transform: translateY(calc(-1 * var(--story-lift) * clamp(0px, 710px - 100svh, 124px))); }
}

@media (max-width: 380px), (max-height: 560px) {
  .opening h1 { font-size: clamp(39px, 8vw, 63px); }
  .opening-copy .area { margin-bottom: 8px; }
  .opening-content { padding-bottom: 13px; }
  .opening-detail { font-size: .88rem; line-height: 1.45; margin: 11px 0; }
  .opening .hero-actions .button { min-height: 44px; padding-inline: 10px; }
  .opening .hero-actions .text-link { font-size: .82rem; }
}

@media (max-height: 450px) and (orientation: landscape) {
  .opening { --film-controls-height: 45px; }
  .opening h1 { font-size: clamp(35px, 7vh, 46px); }
  .opening-content { padding-bottom: 5px; }
  .opening-detail { margin-block: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .opening :is(.opening-copy, h1 em) { transform: none; }
}

[data-opening="photo"] [data-film-only] { display: none; }

[data-opening="photo"] .home-page > .site-header {
  margin-bottom: 0;
  background: #1d271e;
  border-bottom-color: #ffffff24;
}

[data-opening="photo"] .opening {
  color: var(--ink);
  background: #f5efe3;
}

[data-opening="photo"] .opening .opening-stage {
  position: relative;
  width: min(var(--measure), calc(100% - 96px));
  height: auto;
  min-height: 0;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: clamp(28px, 3.8vw, 54px);
  padding-block: clamp(40px, 5vw, 72px) clamp(36px, 4.6vw, 66px);
  background: none;
  isolation: auto;
  overflow: visible;
}

[data-opening="photo"] .opening-content {
  width: 100%;
  padding: 0;
  pointer-events: auto;
}

[data-opening="photo"] .opening-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  align-items: end;
  gap: clamp(24px, 4.5vw, 65px);
  width: 100%;
}

[data-opening="photo"] .opening-copy .area {
  color: #465342;
}

[data-opening="photo"] .opening-copy .area span {
  background: #a64a32;
}

[data-opening="photo"] .opening h1 {
  font-size: clamp(54px, 7.15vw, 103px);
  line-height: .88;
  text-shadow: none;
}

[data-opening="photo"] .opening h1 em { color: #a64a32; }

[data-opening="photo"] .opening-detail {
  max-width: 41ch;
  margin-block: 0 21px;
  color: #435041;
}

[data-opening="photo"] .opening .solid {
  background: #293a2a;
  color: #fffaf2;
}

[data-opening="photo"] .opening .solid:hover { background: #405441; }
[data-opening="photo"] .opening :focus-visible { outline-color: #a64a32; }

.photo-request {
  position: relative;
  min-width: 0;
  margin: 0;
}

.photo-request-hero {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.55;
  object-fit: cover;
  object-position: 50% 47%;
  border-radius: 7px;
  background: #d1c4a4;
}

.photo-request-card {
  position: absolute;
  right: clamp(13px, 3vw, 43px);
  bottom: clamp(13px, 3vw, 43px);
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px 10px 10px;
  color: #27392b;
  background: #fff9ee;
  border: 1px solid #ded5c5;
  border-radius: 6px;
  box-shadow: 0 5px 20px #30251624;
  line-height: 1.2;
}

.photo-request-thumbnail {
  width: 54px;
  height: 44px;
  flex: none;
  border-radius: 3px;
  background: #888d72 url('assets/cabinet-handle-request.webp') 61% 47% / 300% auto no-repeat;
}

.photo-request-card strong, .photo-request-card small { display: block; }
.photo-request-card strong { font-size: .91rem; }
.photo-request-card small { margin-top: 4px; color: #525d4e; font-size: .77rem; }

@media (max-width: 950px) {
  [data-opening="photo"] .opening .opening-stage { width: calc(100% - 56px); }
}

@media (max-width: 800px) {
  [data-opening="photo"] .opening .opening-stage {
    width: calc(100% - 32px);
    gap: 24px;
    padding-block: clamp(31px, 6vw, 46px) 29px;
  }

  [data-opening="photo"] .opening-copy {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
  }

  [data-opening="photo"] .opening h1 { font-size: clamp(49px, 13.3vw, 85px); }
  [data-opening="photo"] .opening-detail { margin-bottom: 16px; }
  .photo-request-hero { aspect-ratio: 1.56; }

  .photo-request-card { right: 8px; bottom: 8px; gap: 7px; padding: 6px 8px 6px 6px; }
  .photo-request-thumbnail { width: 32px; height: 30px; }
  .photo-request-card strong { font-size: .77rem; }
  .photo-request-card small { font-size: .67rem; margin-top: 3px; }
}
