html,
body {
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
}

body {
  display: grid;
  place-items: center;
  background: #8fc4df;
}

.portfolio-intro {
  position: fixed;
  top: clamp(20px, 5vw, 64px);
  left: clamp(20px, 5vw, 72px);
  z-index: 1;
  width: min(460px, calc(100vw - 40px));
  color: #12394c;
  pointer-events: none;
  text-shadow: 1px 1px 0 rgba(239, 252, 255, 0.38);
}
.portfolio-intro__eyebrow,
.portfolio-intro__prompt {
  margin: 0;
  font: 700 11px/1.3 "Courier New", monospace;
  letter-spacing: .13em;
}
.portfolio-intro h1 {
  margin: 10px 0 14px;
  font: 700 clamp(42px, 5.5vw, 72px)/.93 "Courier New", monospace;
  letter-spacing: -.06em;
  text-transform: uppercase;
}
.portfolio-intro h1 span { color: #164b62; }
.portfolio-intro__copy {
  max-width: 30ch;
  margin: 0;
  font: 16px/1.5 Georgia, serif;
}
.portfolio-intro__prompt { margin-top: 17px; color: #285e75; }

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: default;
  touch-action: none;
}

/* Below this layout threshold the intro and room become two separate sections.
 * This prevents the canvas from ever running beneath the copy on phones,
 * portrait windows, and near-square embedded views. */
html.compact-layout,
html.compact-layout body {
  height: auto;
  overflow: auto;
}
html.compact-layout body { display: block; }
html.compact-layout .portfolio-intro {
  position: relative;
  top: auto;
  left: auto;
  width: auto;
  padding: 26px 22px 14px;
}
html.compact-layout .portfolio-intro h1 {
  font-size: clamp(38px, 10vw, 58px);
  letter-spacing: -.03em;
}
html.compact-layout .portfolio-intro__copy {
  max-width: 34ch;
  color: #12394c;
  font-size: 17px;
  line-height: 1.62;
}
html.compact-layout canvas {
  width: 100%;
  height: clamp(360px, 105vw, 650px);
}

.scene-hint {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 2;
  max-width: calc(100vw - 20px);
  padding: 7px 11px;
  border: 1px solid rgba(56, 42, 28, 0.2);
  background: rgba(255, 250, 235, 0.94);
  color: #493522;
  font: 13px/1.2 Georgia, serif;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.scene-hint.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  .scene-hint,
  .overlay,
  .overlay-panel { transition: none; }
}

@media (max-width: 700px) {
  html,
  body { overflow: auto; }
  body { display: block; }
  .portfolio-intro {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    padding: 26px 22px 12px;
  }
  .portfolio-intro h1 {
    font-size: clamp(39px, 11vw, 56px);
    letter-spacing: -.035em;
  }
  .portfolio-intro__copy {
    max-width: 34ch;
    color: #12394c;
    font-size: 17px;
    line-height: 1.62;
  }
  canvas { height: clamp(360px, 105vw, 650px); }
}
