.opening {
  display: none;
  --opening-draft-time: 2250ms;

  position: fixed;
  inset: 0;
  z-index: 110;
  padding: clamp(8px, 1.5vw, 24px);
  background: #f6f6f6;
  color: #252525;
  pointer-events: auto;
}

.home-is-loading {
  overflow: hidden;
}

.home-is-loading .opening {
  display: block;
}

.opening.is-leaving {
  animation: shutter-close var(--shutter-close) var(--shutter-close-ease) both;
}

@media (prefers-reduced-motion: no-preference) {
  html.home-is-arriving .home-film__inner,
  html.home-is-arriving .site-header__inner {
    animation: home-arrive var(--shutter-close) var(--shutter-open-ease) backwards;
  }

  @keyframes home-arrive {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

.opening-sheet {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  border: 1px solid #b2b2b2;
  background-image:
    linear-gradient(rgb(0 0 0 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(0 0 0 / 4%) 1px, transparent 1px);
  background-size: 27px 27px;
}

.opening-head,
.opening-foot {
  display: flex;
  justify-content: space-between;
  gap: 13px;
  padding: clamp(12px, 2.5vw, 31px);
  font: 11px/1.5 'Cascadia Mono', Consolas, monospace;
  letter-spacing: .1em;
}

.opening-head { border-bottom: 1px solid #b2b2b2; }
.opening-foot { border-top: 1px solid #b2b2b2; }
.opening-head span:last-child, .opening-foot span:last-child { white-space: nowrap; }

.opening-drawing {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  container-type: size;
}

.opening-plate {
  position: relative;
  width: min(100%, 1080px);
  width: min(100cqw, 1080px, calc(100cqh * 1.625));
  aspect-ratio: 1040 / 640;
  isolation: isolate;
}

.opening-art {
  position: absolute;
  top: 10%;
  left: 11.057692%;
  width: 82.692308%;
  height: auto;
  mix-blend-mode: multiply;
  filter: grayscale(1);
  animation: opening-sketch-in 480ms cubic-bezier(.22, .7, .35, 1) var(--opening-draft-time) both;
}

.opening-linework {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.opening-linework path {
  fill: none;
  stroke: currentColor;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  stroke-linecap: square;
  stroke-linejoin: round;
  animation: opening-trace var(--trace-time, 500ms) ease-out var(--trace-start, 60ms) both;
}

.opening-guides {
  color: #b3b3b3;
  stroke-width: 1;
}

.opening-bay-guides { --trace-start: 270ms; --trace-time: 950ms; }

.opening-structure {
  color: #555;
  stroke-width: 1.15;
  animation: opening-linework-settle 480ms ease-out var(--opening-draft-time) both;
}

.opening-foundation { --trace-start: 150ms; }
.opening-left-frame { --trace-start: 340ms; --trace-time: 580ms; }
.opening-staging { --trace-start: 510ms; --trace-time: 750ms; }
.opening-roofline { --trace-start: 800ms; --trace-time: 720ms; }
.opening-slab { --trace-start: 1000ms; --trace-time: 630ms; }
.opening-formwork { --trace-start: 1210ms; --trace-time: 640ms; }
.opening-right-frame { --trace-start: 1390ms; --trace-time: 670ms; }
.opening-masonry { --trace-start: 1470ms; --trace-time: 690ms; }
.opening-extension { --trace-start: 1380ms; color: #777; stroke-width: 1; }
.opening-dimension-rule { --trace-start: 1600ms; color: #555; stroke-width: 1.2; }
.opening-dimension-ticks { --trace-start: 1910ms; --trace-time: 280ms; stroke-width: 1.6; }

.opening-dimension-labels {
  fill: #303030;
  font: 16px 'Cascadia Mono', Consolas, monospace;
  letter-spacing: .05em;
  animation: opening-labels 220ms ease-out 1980ms both;
}

.opening-progress {
  --opening-progress: 0;
  display: grid;
  justify-self: center;
  width: min(13rem, 60%);
  margin-block: clamp(8px, 1.4vh, 14px) clamp(12px, 2.5vh, 24px);
  gap: clamp(5px, 1vh, 10px);
  background: linear-gradient(#b2b2b2, #b2b2b2) bottom / 100% 1px no-repeat;
  color: #252525;
  text-align: center;
}

.opening-progress__value {
  font: 600 clamp(26px, 4vw, 48px)/1 'Cascadia Mono', Consolas, monospace;
}

.opening-progress::after {
  height: 1px;
  background: currentColor;
  content: '';
  transform: scaleX(var(--opening-progress));
  transform-origin: left;
}

@keyframes opening-trace {
  to { stroke-dashoffset: 0; }
}

@keyframes opening-linework-settle {
  to { opacity: .06; }
}

@keyframes opening-sketch-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes opening-labels {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 580px) {
  .opening-head, .opening-foot { font-size: 9px; letter-spacing: .045em; }
  .opening-dimension-labels { font-size: 26px; }
  .opening-dimensions path { stroke-width: 1.7; }
}

@media (prefers-reduced-motion: reduce) {
  .opening * { animation: none !important; }
  .opening-linework, .opening-progress { display: none; }
}
