/* A quiet, touchable introduction to the four details of a small home. */
.interactive-opening {
  --intro-paper: #f7f7f2;
  --intro-ink: #29372e;
  --intro-muted: #747d72;
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-height: 100%;
  padding: 100px 28px 82px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--intro-paper);
  color: var(--intro-ink);
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.interactive-opening[hidden],
.interactive-opening [hidden] {
  display: none !important;
}

.interactive-opening::before,
.interactive-opening::after {
  display: none;
}

.has-opening { overflow: hidden; }

.interactive-opening button {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.interactive-opening button:focus-visible,
.intro-replay:focus-visible {
  outline: 1px solid #6b806a;
  outline-offset: 6px;
}

.intro-signature {
  position: absolute;
  top: max(32px, env(safe-area-inset-top));
  left: clamp(28px, 5vw, 72px);
  margin: 0;
  font-size: 10px;
  line-height: 44px;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.interactive-opening .intro-skip {
  position: absolute;
  top: max(32px, env(safe-area-inset-top));
  right: clamp(28px, 5vw, 72px);
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--intro-muted);
  transition: color .2s ease;
}

.intro-skip:hover { color: var(--intro-ink); }
.intro-skip svg { width: 15px; height: 15px; }

.interactive-opening .intro-sound {
  position: absolute;
  top: max(32px, env(safe-area-inset-top));
  right: calc(clamp(28px, 5vw, 72px) + 104px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--intro-muted);
  font-size: 10px;
  letter-spacing: .04em;
}
.intro-sound svg { width: 18px; height: 18px; }
.intro-sound .sound-muted { display: none; }
.intro-sound[aria-pressed="false"] .sound-waves { display: none; }
.intro-sound[aria-pressed="false"] .sound-muted { display: block; }
.intro-sound:hover { color: var(--intro-ink); }
@media (max-width: 700px) {
  .interactive-opening .intro-sound { top: max(18px, env(safe-area-inset-top)); right: 125px; }
}

.intro-stage {
  width: 100%;
  max-width: 480px;
  margin: auto;
  text-align: center;
}

.intro-eyebrow {
  margin: 0 0 14px;
  color: var(--intro-muted);
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.intro-stage h2 {
  margin: 0;
  font-family: var(--serif, Georgia, "Songti SC", serif);
  font-size: 27px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: .04em;
}

.intro-instruction {
  margin: 13px 0 30px;
  color: var(--intro-muted);
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: .03em;
}

.intro-instruction .hint-touch { display: none; }

.intro-objects {
  display: grid;
  grid-template-columns: repeat(2, 116px);
  justify-content: center;
  gap: 14px 28px;
  margin: 0 auto;
}

.interactive-opening .intro-object {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 116px;
  min-height: 123px;
  padding: 8px 0 15px;
  isolation: isolate;
}

.intro-object::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 6px;
  left: calc(50% - 40px);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #e7ece1;
  opacity: 0;
  transform: scale(.78);
  transition: opacity .45s ease, transform .55s cubic-bezier(.22, 1, .36, 1);
}

.intro-object.is-active::before {
  opacity: .85;
  transform: scale(1);
}

.intro-object svg {
  display: block;
  flex: none;
  width: 76px;
  height: 76px;
  overflow: visible;
}

.intro-object .object-lines {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: 48px 48px;
}

.intro-object.is-idle .object-lines {
  animation: intro-line-breathe 4.8s ease-in-out infinite;
}

.intro-object.is-idle:nth-child(2) .object-lines { animation-delay: -1.2s; }
.intro-object.is-idle:nth-child(3) .object-lines { animation-delay: -2.7s; }
.intro-object.is-idle:nth-child(4) .object-lines { animation-delay: -3.9s; }

.object-name {
  display: block;
  position: relative;
  margin-top: 7px;
  color: #7b8478;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .08em;
  transition: color .3s ease;
}

.object-name::after {
  content: "";
  position: absolute;
  top: calc(100% + 6px);
  left: calc(50% - 1.5px);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #6d8269;
  opacity: 0;
  transform: scale(0);
  transition: opacity .3s ease, transform .3s ease;
}

.is-discovered .object-name { color: var(--intro-ink); }
.is-discovered .object-name::after { opacity: 1; transform: scale(1); }

.intro-response {
  min-height: 38px;
  margin: 25px 0 8px;
  color: var(--intro-muted);
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: .035em;
}

.intro-response p { margin: 0; }

.interactive-opening .intro-enter {
  display: inline-flex;
  min-width: 76px;
  min-height: 80px;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
}

.intro-enter .entry-scene {
  display: block;
  width: 74px;
  height: 58px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.entry-floor { opacity: .4; }
.entry-label { font-size: 10px; line-height: 1.6; letter-spacing: .11em; color: var(--intro-muted); }
.intro-enter:hover .entry-label, .intro-enter:focus-visible .entry-label { color: var(--intro-ink); }
.interactive-opening .intro-enter:focus-visible { outline: none; }
.intro-enter:focus-visible .entry-scene { stroke: #56704d; stroke-width: 2.1; filter: drop-shadow(0 0 3px #c1cfb5); }

.intro-footnote {
  position: absolute;
  right: 24px;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 24px;
  margin: 0;
  color: #7e8679;
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: .12em;
  text-align: center;
}

.interactive-opening.is-leaving {
  pointer-events: none;
  animation: intro-surface-leave .55s cubic-bezier(.4, 0, .2, 1) forwards;
}

.intro-replay {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  line-height: 1.6;
  cursor: pointer;
  text-underline-offset: 5px;
}

.intro-replay:hover { text-decoration: underline; }

@keyframes intro-line-breathe {
  0%, 100% { transform: translateY(1px) rotate(-1deg); }
  50% { transform: translateY(-2px) rotate(1deg); }
}

@keyframes intro-surface-leave {
  to { opacity: 0; transform: translateY(-12px); visibility: hidden; }
}

@media (hover: none) {
  .intro-instruction .hint-pointer { display: none; }
  .intro-instruction .hint-touch { display: inline; }
}

@media (max-width: 700px) {
  .interactive-opening { padding: 88px 24px 72px; }
  .intro-signature { top: max(18px, env(safe-area-inset-top)); left: 24px; font-size: 9px; }
  .interactive-opening .intro-skip { top: max(18px, env(safe-area-inset-top)); right: 24px; }
  .intro-stage h2 { font-size: 24px; }
  .intro-eyebrow { font-size: 8px; margin-bottom: 12px; }
  .intro-instruction { margin-top: 11px; margin-bottom: 22px; }
  .intro-objects { grid-template-columns: repeat(2, 108px); gap: 10px 20px; }
  .interactive-opening .intro-object { width: 108px; min-height: 116px; padding-top: 7px; }
  .intro-object svg { width: 70px; height: 70px; }
  .intro-object::before { left: calc(50% - 37px); width: 74px; height: 74px; }
  .intro-response { margin-top: 20px; }
  .intro-footnote { bottom: max(22px, env(safe-area-inset-bottom)); font-size: 8px; }
}

@media (max-height: 690px) {
  .interactive-opening { padding-top: 76px; padding-bottom: 58px; }
  .intro-instruction { margin-top: 8px; margin-bottom: 12px; }
  .intro-eyebrow { margin-bottom: 8px; }
  .intro-objects { row-gap: 2px; }
  .intro-response { margin-top: 14px; margin-bottom: 0; min-height: 30px; }
  .intro-footnote { bottom: 16px; }
}

@media (max-height: 510px) and (min-width: 560px) {
  .interactive-opening { padding-top: 65px; padding-bottom: 46px; }
  .intro-stage { max-width: 560px; }
  .intro-stage h2 { font-size: 23px; }
  .intro-eyebrow { display: none; }
  .intro-instruction { margin: 5px 0 10px; }
  .intro-objects { grid-template-columns: repeat(4, 108px); gap: 4px; }
  .intro-response { min-height: 20px; margin-top: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .interactive-opening,
  .interactive-opening *,
  .interactive-opening *::before,
  .interactive-opening *::after,
  .intro-replay {
    animation: none !important;
    transition: none !important;
  }
  .interactive-opening.is-leaving { opacity: 0; visibility: hidden; }
  .has-opening { overflow: hidden; }
}
