:root {
    --navy: #0a1430;
    --glass: rgba(10, 20, 48, 0.55);
    --line: rgba(255, 255, 255, 0.55);
}

html, body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--navy);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

#pano {
    position: absolute;
    inset: 0;
}

/* Opening animation, drawn over the first scene */
#intro {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    transition: opacity 0.4s ease;
}

#intro.done {
    opacity: 0;
}

/* Logo: the way back to the website */
#logo {
    position: absolute;
    top: max(14px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: block;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

#logo img {
    display: block;
    height: 34px;
    width: auto;
}

/* Top-right controls */
#controls {
    position: absolute;
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
    z-index: 3;
}

#controls button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--glass);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
}

#controls svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Hotspots: sized in tour.js relative to the scene, like the original tour */
.linkHotspot {
    position: relative;
    border: 0;
    padding: 0;
    background: none;
    cursor: pointer;
    touch-action: manipulation;
}

.linkHotspot.floor svg {
    width: 100%;
    height: 100%;
    fill: #fff;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.45));
    transition: transform 0.15s ease;
}

.linkHotspot.floor .glide {
    animation: glide 1.6s ease-in-out infinite;
}

.linkHotspot.floor:hover svg {
    transform: scale(1.08);
}

@keyframes glide {
    0% { opacity: 0; transform: translateY(14px); }
    40% { opacity: 0.9; }
    100% { opacity: 0; transform: translateY(-10px); }
}

.linkHotspot.enter .dot,
.linkHotspot.enter .ring {
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.linkHotspot.enter .dot {
    width: 34%;
    height: 34%;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease;
}

.linkHotspot.enter .ring {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: 4px solid #fff;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.35), inset 0 0 8px rgba(0, 0, 0, 0.2);
    animation: pulse 1.8s ease-out infinite;
}

.linkHotspot.enter:hover .dot {
    transform: translate(-50%, -50%) scale(1.15);
}

@keyframes pulse {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.45); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* Back to the previous room */
#back {
    position: absolute;
    left: 14px;
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px 9px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--glass);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

#back[hidden] {
    display: none;
}

#back svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Brochure covers on the stand screens; tour.js warps each onto its screen */
#screens {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.brochureScreen {
    position: absolute;
    left: 0;
    top: 0;
    padding: 0;
    border: 0;
    background: #000;
    transform-origin: 0 0;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
}

.brochureScreen[hidden] {
    display: none;
}

.brochureScreen img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    transition: filter 0.15s ease;
}

.brochureScreen:hover img {
    filter: brightness(1.15);
}

/* Brochure viewer */
#brochure {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
}

#brochure[hidden] {
    display: none;
}

#brochure .sheet {
    display: flex;
    flex-direction: column;
    width: min(900px, 100%);
    height: min(92vh, 100%);
    overflow: hidden;
    border-radius: 14px;
    background: #1b1f27;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#brochure header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 10px 18px;
    background: #fff;
}

#brochure h2 {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0a1430;
}

#brochure header a,
#brochure header button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #eef1f6;
    color: #0a1430;
    cursor: pointer;
}

#brochure header svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#brochurePages {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
}

#brochurePages canvas {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto 12px;
    background: #fff;
}

/* Loading screen */
#loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    background: #fff;
    transition: opacity 0.5s ease;
}

#loading.done {
    opacity: 0;
    pointer-events: none;
}

#loading img {
    width: min(320px, 70vw);
}

#loading .bar {
    width: min(220px, 50vw);
    height: 3px;
    overflow: hidden;
    border-radius: 3px;
    background: #e3e7ef;
}

#loading .bar span {
    display: block;
    width: 40%;
    height: 100%;
    background: #002a7f;
    animation: slide 1.1s ease-in-out infinite;
}

@keyframes slide {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}

@media (max-width: 600px) {
    #logo img { height: 26px; }
}
