/* 2026-10-14: the artwork supplies the object; overlays supply its live text. */
#intercom-opener {
    bottom: calc(clamp(0.9rem, 2.5vw, 2rem) + 5.6rem);
}
@media (max-width: 600px) {
    /* Leave the centered Answer / Ignore row clear on a narrow phone. */
    #intercom-opener { bottom: calc(clamp(0.9rem, 2.5vw, 2rem) + 9rem); }
}
#intercom-opener[hidden],
#experience-page:not(.active) #intercom-opener,
body.arrival-showing #intercom-opener,
body:has(#guided-arrival-layer) #intercom-opener { display: none; }

.intercom-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.intercom-dialog {
    box-sizing: border-box;
    width: calc(100vw - 24px); max-width: none;
    height: calc(100dvh - 24px); max-height: none;
    padding: 0; border: 0; margin: auto;
    background: transparent; color: #f4e9ce;
    overflow: hidden;
    font-family: 'EB Garamond', Georgia, serif;
}
.intercom-dialog[open] { display: flex; flex-direction: column; align-items: center; }
.intercom-dialog::backdrop { background: rgb(0 0 0 / 55%); }
.intercom-close, .intercom-wait {
    flex: none; min-height: 36px; padding: 4px 12px;
    border: 0; border-bottom: 1px solid #c5b78d;
    font: inherit; font-size: 16px; color: inherit; background: #17231dd9;
    cursor: pointer;
}
.intercom-close { align-self: flex-end; }
.intercom-body { flex: 1; min-height: 0; width: 100%; overflow: auto; }
.intercom-panel {
    --intercom-room-ink: #29261c;
    --intercom-name-ink: #29261c;
    position: relative;
    width: max(var(--intercom-min-width), min(100%, calc((100dvh - 142px) * var(--intercom-ratio))));
    margin-inline: auto;
    container-type: inline-size;
}
.intercom-art, .intercom-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
/* The PNG/WebP keeps its alpha: no background is painted behind it. */
.intercom-art { object-fit: contain; pointer-events: none; filter: drop-shadow(0 14px 28px rgb(0 0 0 / 55%)); }
.intercom-fallback { background: #243b30; border-radius: 20px; }
.intercom-fallback .intercom-art { visibility: hidden; }
.intercom-fallback::before {
    content: 'INTERCOM / SYSTEM 03'; position: absolute; top: 6%; width: 100%;
    text-align: center; color: #e0d5ad; font-size: 4cqw; letter-spacing: 0.12em;
}
.intercom-box { position: absolute; box-sizing: border-box; }
.intercom-room, .intercom-name { display: flex; align-items: center; justify-content: center; container-type: size; }
/* Ink on the paper and brass plates: dark enough for 4.5:1 on the worn cream. */
/* Text sizes follow the plate (cqh of the plate), so they sit in it at any size. */
.intercom-room { color: var(--intercom-room-ink); overflow: visible; }
.intercom-room span {
    font-family: 'Special Elite', 'Courier Prime', monospace;
    font-size: max(12px, 88cqh); line-height: 1; letter-spacing: 0.06em; white-space: nowrap;
}
.intercom-name { color: var(--intercom-name-ink); overflow: hidden; }
.intercom-name span {
    display: block; max-width: 100%; font-family: 'Patrick Hand', 'Caveat', cursive;
    font-size: max(12px, 54cqh); line-height: 1.05; white-space: nowrap; text-align: center;
}
.intercom-room span, .intercom-name span { mix-blend-mode: multiply; opacity: 0.92; }
.intercom-name .intercom-wrap {
    line-height: 1; white-space: normal; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.intercom-fallback .intercom-room, .intercom-fallback .intercom-name { background: #c9bd90; border-radius: 2px; }
/* An empty window shows the photo's own paper insert. */
.intercom-portrait { overflow: hidden; }
.intercom-portrait:has(img) { background: #1b1712; }
.intercom-portrait img {
    display: block; width: 100%; height: 100%; object-fit: cover;
    filter: sepia(0.22) saturate(0.85) contrast(1.04);
}
/* The brass lip shades the edge of the photograph. */
.intercom-portrait:has(img)::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 2px 5px rgb(0 0 0 / 60%); pointer-events: none; }
.intercom-call { padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.intercom-call::after {
    content: ''; position: absolute; border-radius: 50%;
    inset: calc(-1 * var(--intercom-hit-y, 0px)) calc(-1 * var(--intercom-hit-x, 0px));
}
.intercom-call:not(:disabled):not([data-empty]):hover { box-shadow: 0 0 0 2px rgb(255 232 160 / 75%), 0 0 14px rgb(255 214 120 / 45%); }
.intercom-call:disabled, .intercom-call[data-empty] { cursor: default; }
.intercom-call:not(:disabled):not([data-empty]):active,
.intercom-call[aria-busy="true"] {
    background-image: var(--intercom-pressed); background-repeat: no-repeat;
    background-size: var(--press-size); background-position: var(--press-pos);
}
.intercom-fallback .intercom-call:not(:disabled):not([data-empty]):active,
.intercom-fallback .intercom-call[aria-busy="true"] { background-image: none; }
.intercom-fallback .intercom-call { border: 1px solid #ddcea1; background: #8b3d28; }
.intercom-fallback .intercom-call:disabled, .intercom-fallback .intercom-call[data-empty] { background: #35483d; border-color: #72816b; }
.intercom-call[aria-busy="true"] {
    box-shadow: 0 0 12px rgb(255 220 130 / 50%);
    animation: intercom-ring 1.1s ease-in-out infinite alternate;
}
@keyframes intercom-ring { from { box-shadow: 0 0 4px rgb(255 220 130 / 20%); } }
.intercom-dialog button:focus-visible { outline: 3px solid #fff6c7; outline-offset: 3px; box-shadow: 0 0 0 6px #192820; }
.intercom-call:focus-visible { outline-offset: 2px; }
.intercom-status { flex: none; min-height: 22px; margin: 6px 0; font-size: 16px; text-align: center; }
.intercom-slot-number { display: none; }
.intercom-calibrate .intercom-room { outline: 1px solid #ff877e; }
.intercom-calibrate .intercom-name { outline: 1px solid #ffdf57; }
.intercom-calibrate .intercom-portrait { outline: 1px solid #65e5ff; }
.intercom-calibrate .intercom-call { outline: 1px solid #f491ff; }
.intercom-calibrate .intercom-slot-number { display: block; color: white; background: black; font: 12px monospace; }
@media (prefers-reduced-motion: reduce) {
    .intercom-dialog, #intercom-opener, .intercom-call[aria-busy="true"] { animation: none; transition: none; }
}
