:root {
    --brand: #c8102e;        /* Wienerberger / Porotherm red */
    --brand-dark: #a50d26;
}

:not(:defined) > * { display: none; }

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Helvetica Neue", Arial, system-ui, sans-serif;
    color: #f3f3f5;
    /* soft dark radial gradient — white logos read against it */
    background: radial-gradient(120% 110% at 50% 32%, #43434d 0%, #26262c 55%, #131317 100%);
    overflow: hidden;
}

/* ---------- top bar ---------- */
#topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    padding: 20px 28px;
    pointer-events: none;
}

#brand {
    display: flex;
    align-items: center;
    gap: 14px;
    pointer-events: auto;
    text-decoration: none;
}

#logo-icon { height: 38px; width: auto; display: block; }

#logo-wordmark {
    height: 26px; width: auto; display: block;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.22);
}

/* ---------- viewer ---------- */
model-viewer {
    width: 100%;
    height: 100%;
    --poster-color: transparent;
    background: transparent;
}

/* ---------- custom poster (height-matched to the 3D framing) ---------- */
#poster {
    width: 100%;
    height: 100%;
    background-image: url(poster_v8.webp);
    background-repeat: no-repeat;
    background-position: center center;
    /* contain matches model-viewer's framing (brick = const fraction of the
       smaller viewport dimension), so poster and 3D model are the same size */
    background-size: contain;
}

/* ---------- progress bar ---------- */
.progress-bar {
    display: block;
    width: 33%;
    max-width: 240px;
    height: 4px;
    position: absolute;
    left: 50%; top: 50%;
    transform: translate3d(-50%, -50%, 0);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}
.progress-bar.hide { visibility: hidden; transition: visibility 0.3s; }
.update-bar {
    background: var(--brand);
    width: 0%; height: 100%;
    border-radius: 25px;
    float: left;
    transition: width 0.25s;
}

/* ---------- AR button ---------- */
#ar-button {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
    background: var(--brand);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    height: 44px;
    padding: 0 22px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(200, 16, 46, 0.32);
    transition: background 0.15s, transform 0.1s;
}
#ar-button:hover { background: var(--brand-dark); }
#ar-button:active { transform: translateX(-50%) translateY(1px); }
#ar-button:focus-visible { outline: 2px solid var(--brand-dark); outline-offset: 2px; }

/* hide AR button where AR is unsupported (model-viewer adds this) */
model-viewer:not([ar-status]) #ar-button { /* default visible */ }

/* ---------- AR hand prompt ---------- */
@keyframes circle {
    from { transform: translateX(-50%) rotate(0deg) translateX(50px) rotate(0deg); }
    to   { transform: translateX(-50%) rotate(360deg) translateX(50px) rotate(-360deg); }
}
@keyframes elongate {
    from { transform: translateX(100px); }
    to   { transform: translateX(-100px); }
}
model-viewer > #ar-prompt {
    position: absolute;
    left: 50%;
    bottom: 70px;
    animation: elongate 2s infinite ease-in-out alternate;
    display: none;
}
model-viewer[ar-status="session-started"] > #ar-prompt { display: block; }
model-viewer > #ar-prompt > img { animation: circle 4s linear infinite; }

/* ---------- responsive ---------- */
@media only screen and (max-width: 600px) {
    #topbar { padding: 16px 18px; }
    #logo-icon { height: 30px; }
    #logo-wordmark { height: 20px; padding-left: 10px; }
}
