/* Dock and stage metadata share one responsive width and center line. */
:root { --cloud-rail: min(1480px, calc(100% - clamp(40px, 8vw, 160px))); }
/* A glass navigation object with the Archivist's own character portraits. */
.site-header.cloud-header {
  position: fixed;
  top: 12px;
  left: 0;
  right: 0;
  z-index: 30;
  width: var(--cloud-rail);
  max-width: none;
  height: 96px;
  min-height: 96px;
  margin: 0 auto;
  padding: 8px 20px 8px 12px;
  gap: 36px;
  border: 1px solid #ffffffc9;
  border-radius: 30px;
  background: #f8f7f0;
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 #123f4912, 0 8px 26px #123f4914, 0 1px 3px #123f4910;
}

@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .site-header.cloud-header {
    background: linear-gradient(150deg,#ffffff70,#ffffff24 48%,#d5efed45);
    -webkit-backdrop-filter: blur(24px) saturate(145%);
    backdrop-filter: blur(24px) saturate(145%);
  }
}
.cloud-header .cloud-brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0;
  padding: 0;
  letter-spacing: normal;
}
.brand-character { width: 76px; height: 76px; object-fit: contain; position: relative; z-index: 1; }
.brand-lettering { display: grid; gap: 6px; margin-left: -9px; }
.brand-name { position: relative; font: 400 32px/.95 Anton,'Arial Narrow',sans-serif; letter-spacing: .005em; white-space: nowrap; }
.brand-spark { color: #cc6949; display: inline-block; font: 24px/1 Georgia,serif; margin-left: 7px; vertical-align: top; }
.brand-caption { font: 600 8px/1.3 Arial,sans-serif; letter-spacing: .14em; white-space: nowrap; }
.cloud-header .character-nav { display: flex; align-items: center; gap: 6px; height: 100%; }
.cloud-header .character-nav a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 84px;
  height: 78px;
  padding: 2px 4px 7px;
  border: 1px solid transparent;
  border-radius: 20px;
  text-decoration: none;
}
.character-nav img { width: 55px; height: 55px; object-fit: contain; filter: drop-shadow(0 2px 1px #123f4920); }
.character-nav a > span { font: 600 10px/1.3 Arial,sans-serif; color: #123f49; white-space: nowrap; }
.cloud-header .character-nav a[aria-current="location"] {
  background: #ffffff8c;
  border-color: #ffffffd6;
  box-shadow: inset 0 1px 0 #fff, 0 2px 5px #123f4910;
}
.character-nav a[aria-current="location"]::after { content: ''; position: absolute; bottom: 2px; width: 3px; height: 3px; border-radius: 50%; background: #bd6145; }
.cloud-header .character-nav a:hover { background: #ffffffa6; }
.cloud-header a:focus-visible { outline: 2px solid #ae5034; outline-offset: 3px; }
/* Anchor destinations clear the persistent dock. */
html { scroll-padding-top: 124px; }
#room, #pocket-machine, #expressions, #collectibles, #stories { scroll-margin-top: 0; }
#room { padding-top: 120px; background: #a8d5d9 url('assets/hero/stage.webp') center/100% 100% no-repeat; }
#room .playroom { height: clamp(620px,calc(100svh - 120px),920px); background: transparent; }
@media (max-width: 760px) {
  :root { --cloud-rail: calc(100% - 24px); }
  .site-header.cloud-header { padding: 7px 10px; gap: 8px; height: 88px; min-height: 88px; border-radius: 25px; top: 8px; margin: 0 auto; }
  .brand-character { width: 54px; height: 64px; }
  .brand-name { font-size: 25px; }
  .brand-caption { font-size: 6px; letter-spacing: .08em; }
  .brand-spark { font-size: 18px; margin-left: 4px; }
  .cloud-header .character-nav { gap: 0; }
  .cloud-header .character-nav a { width: 65px; height: 70px; border-radius: 17px; }
  .character-nav img { width: 48px; height: 48px; }
  .character-nav a > span { font-size: 9px; }
  html { scroll-padding-top: 110px; }
  #room { padding-top: 104px; }
}
@media (max-width: 560px) {
  :root { --cloud-rail: min(410px, calc(100% - 24px)); }
  .site-header.cloud-header { flex-direction: column; justify-content: center; gap: 3px; height: 124px; min-height: 124px; padding: 5px 10px 7px; }
  .cloud-header .cloud-brand { height: 40px; }
  .brand-character { width: 45px; height: 44px; }
  .brand-lettering { margin-left: -3px; gap: 3px; }
  .brand-name { font-size: 22px; }
  .brand-caption { font-size: 5.5px; letter-spacing: .1em; }
  .brand-spark { font-size: 16px; }
  .cloud-header .character-nav { width: 100%; justify-content: center; height: 67px; gap: 5px; }
  .cloud-header .character-nav a { width: 23%; max-width: 82px; height: 67px; padding: 0 2px 7px; }
  .character-nav img { width: 45px; height: 45px; }
  .character-nav a > span { font-size: 10px; }
  html { scroll-padding-top: 144px; }
  #room { padding-top: 140px; --stage-height: clamp(620px,calc(100svh - 140px),760px); }
  #room .playroom { height: var(--stage-height); }
}

/* Fit the entire composition to both viewport dimensions, not just its width. */
@media (min-width: 1101px) {
  #room {
    --stage-height: max(520px, calc(100svh - 120px));
    --char-size: min(54vw, calc(var(--stage-height) * .86), 840px);
  }
  #room .playroom { height: var(--stage-height); }
  #room h1 { top: 66px; font-size: min(22.7vw, calc(var(--stage-height) * .37), 420px); }
  #room .stage-intro { left: max(6%, calc((100% - 1580px) / 2)); width: 24%; max-width: 330px; }
  #room .stage-intro p { font-size: clamp(26px, 2.4vw, 40px); }
  #room .speech { left: auto; right: max(6%, calc((100% - 1580px) / 2)); bottom: 55%; width: 19%; max-width: 250px; }
  #room .mood-note { right: max(6%, calc((100% - 1580px) / 2)); bottom: 26%; }
}
@media (min-width: 1600px) {
  .site-header.cloud-header { height: 104px; min-height: 104px; padding-right: 24px; }
  .cloud-header .character-nav { gap: 12px; }
  .cloud-header .character-nav a { width: 98px; height: 86px; }
  .character-nav img { width: 62px; height: 62px; }
  .character-nav a > span { font-size: 11px; }
  #room { padding-top: 128px; --stage-height: max(520px, calc(100svh - 128px)); }
  html { scroll-padding-top: 136px; }
}
@media (min-width: 1101px) and (max-height: 760px) {
  #room .character { bottom: calc(21% - var(--char-size) * .078125); }
  #room .speech { bottom: 62%; }
  #room .mood-note { width: 180px; padding: 14px 18px; }
  #room .mood-note .eyebrow { margin-bottom: 10px; }
  #room .mood-note p:nth-child(2) { font-size: 22px; margin-bottom: 12px; }
  #room .ticket-number { padding-top: 8px; }
}

#room .stage-meta {
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  width: var(--cloud-rail);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 44px;
  z-index: 7;
}
#room .stage-meta .stage-kicker {
  position: static;
  width: auto;
  max-width: none;
  min-width: 0;
  margin: 0;
  text-align: left;
}
#room .stage-meta .room-toolbar {
  position: static;
  flex: 0 0 auto;
  max-width: none;
  flex-wrap: nowrap;
}
@media (max-width: 700px) {
  #room .stage-meta { top: 16px; flex-direction: column; gap: 8px; }
  #room .stage-meta .stage-kicker { text-align: center; }
  #room .stage-meta .room-toolbar { width: 100%; justify-content: center; }
}
