/* === FONT === */
@font-face {
    font-family: 'handwriting';
    src: url(../fonts/camron-handwriting-uni-ball-signo207-x167-regular.otf) format('opentype'),
         url(../fonts/camron-handwriting-uni-ball-signo207-x167-regular.ttf) format('truetype');
}

/* === RESET / BASE === */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --wall:   #ede8df;   /* cream matched to the studio wall in the image */
    --card:   #1c1c1e;
    --accent: #f5c842;
    --border: 1px solid rgba(255, 255, 255, 0.12);
}

body {
    margin: 0;
    padding: 0;
    background: var(--wall);
    font-family: 'handwriting', sans-serif;
}

/* === SCENE — full-width square container === */
/*
    width: 100% fills the viewport edge-to-edge.
    aspect-ratio: 1/1 is declared as a CSS hint, but because #scene-img
    uses height: auto, the container's actual height is driven by the
    image's natural proportions — no JS required.

    position: relative is the stacking context for the SVG overlay.
*/
#scene {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
}

/* === STUDIO IMAGE === */
/*
    width: 100% stretches to the full container width.
    height: auto preserves the square aspect ratio and lets the page
    scroll naturally below the fold on most screens.
    display: block removes the default inline gap beneath the image.
    pointer-events: none so clicks fall through to the SVG shapes above.
*/
#scene-img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

/* === SVG HOTSPOT OVERLAY === */
/*
    Covers the scene container exactly.
    pointer-events: none on the SVG element itself so the transparent
    SVG background doesn't intercept clicks on the image.
    Each .hs-shape re-enables pointer-events for its own area.
*/
#hotspot-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ── Hotspot shapes ── */
/*
    fill: transparent (not fill: none) — the interior is painted but
    invisible, so the entire shape area is clickable.
    pointer-events: all — fires even on transparent fill.
*/
.hs-shape {
    fill: transparent;
    stroke: none;
    cursor: pointer;
    pointer-events: all;
    transition: fill 0.14s;
}

.hs-shape:hover {
    fill: rgba(245, 200, 66, 0.14);
}

/* ── Debug labels (SVG text) ── */
/*
    Hidden by default. Shown only when #hotspot-svg has .debug-on.
    paint-order: stroke fill puts the dark outline behind the text
    so it stays readable over any part of the image.
    pointer-events: none so label text doesn't swallow shape clicks.
*/
.hs-label {
    display: none;
    fill: var(--accent);
    font-size: 26px;
    font-family: monospace, sans-serif;
    font-weight: bold;
    pointer-events: none;
    paint-order: stroke fill;
    stroke: #000;
    stroke-width: 6;
    stroke-linejoin: round;
}

/* === DEBUG MODE — activated by JS when ?debug=1 is in the URL === */
#hotspot-svg.debug-on .hs-shape {
    fill: rgba(245, 200, 66, 0.18);
    stroke: rgba(245, 200, 66, 0.82);
    stroke-width: 4;
}

#hotspot-svg.debug-on .hs-shape:hover {
    fill: rgba(245, 200, 66, 0.32);
    stroke: var(--accent);
}

#hotspot-svg.debug-on .hs-label {
    display: block;
}

/* === LEGACY LINK — temporary, unobtrusive === */
#legacy-link {
    position: fixed;
    bottom: 1em;
    right: 1em;
    color: rgba(80, 60, 40, 0.38);
    font-size: 0.72rem;
    font-family: monospace, sans-serif;
    text-decoration: none;
    z-index: 50;
    transition: color 0.15s;
}

#legacy-link:hover {
    color: rgba(80, 60, 40, 0.72);
}

/* === OVERLAY === */
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1em;
    animation: overlay-fade-in 0.15s ease;
}

#overlay[hidden] {
    display: none;
}

@keyframes overlay-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#overlay-card {
    background: var(--card);
    border: var(--border);
    border-radius: 6px;
    padding: 2em 2.2em;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    animation: card-slide-up 0.18s ease;
}

@keyframes card-slide-up {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

#overlay-label-tag {
    font-size: 0.68rem;
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin: 0 0 0.4em;
}

#overlay-title {
    font-family: 'handwriting', sans-serif;
    font-size: 1.6rem;
    color: #eee;
    margin: 0 0 0.6em;
    line-height: 1.1;
}

#overlay-desc {
    font-family: 'handwriting', sans-serif;
    font-size: 1rem;
    color: #bbb;
    line-height: 1.55;
    margin: 0 0 1.4em;
}

#overlay-close {
    font-family: 'handwriting', sans-serif;
    font-size: 0.9rem;
    background: transparent;
    color: #888;
    border: 1px solid #444;
    border-radius: 3px;
    padding: 0.35em 0.9em;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

#overlay-close:hover {
    background: #2a2a2a;
    border-color: #888;
    color: #eee;
}

#overlay-close::after {
    content: ' (Esc)';
    font-size: 0.75em;
    opacity: 0.45;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    #overlay-card { padding: 1.4em 1.2em; }
    #overlay-title { font-size: 1.3rem; }
}
