/* css/n64-props.css — the N64 layer
   Props are low-poly 3D objects drawn by js/n64-props.js into [data-prop]
   placeholders; the words beside them use the HUD voice: a chunky display
   face with a hard, unblurred drop shadow, the way a 1997 pause menu was
   lettered. Panels are flat and square-cornered with a double sand-gold
   frame — a dialog box, not a sheet of glass. */

:root {
    --hud-font: 'Lilita One', 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
    --hud-ink: #fff4d8;
    --hud-gold: #ffd36a;
    --hud-shadow: #061220;
    --panel-bg: rgba(3, 12, 24, 0.88);
    --panel-line: #d8b56a;
    --panel-line-dim: rgba(216, 181, 106, 0.38);
}

/* ===== The prop canvas: fixed over the page, transparent, never clickable ===== */
.n64-props {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 250;
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    transition: opacity 0.4s ease;
}

html.nav-arriving .n64-props {
    opacity: 0;
}

/* ===== Bubbles given off by props (collect bursts, the open chest) =====
   Same air as the ambient bubbles: a lens with a bright rim and one glint. */
.prop-bubble {
    position: fixed;
    z-index: 255;
    pointer-events: none;
    border-radius: 50%;
    background: radial-gradient(circle at 42% 36%,
            rgba(255, 255, 255, 0.5) 0%,
            rgba(255, 255, 255, 0.06) 22%,
            rgba(3, 24, 54, 0.05) 55%,
            rgba(150, 210, 255, 0.38) 86%,
            transparent 100%);
    border: 1px solid rgba(190, 230, 255, 0.26);
    animation: propBubbleRise var(--dur, 2s) ease-out forwards;
}

.prop-bubble::before {
    content: '';
    position: absolute;
    top: 18%;
    left: 26%;
    width: 22%;
    height: 13%;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 50%;
}

.prop-bubble--burst {
    animation: propBubbleBurst var(--dur, 0.9s) cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes propBubbleRise {
    0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
    12% { opacity: 0.85; }
    50% { transform: translate(var(--sway, 10px), calc(var(--rise, -120px) * 0.5)) scale(0.95); }
    100% { transform: translate(calc(var(--sway, 10px) * -0.5), var(--rise, -120px)) scale(1); opacity: 0; }
}

@keyframes propBubbleBurst {
    0% { transform: translate(0, 0) scale(0.5); opacity: 0.9; }
    60% { opacity: 0.85; }
    100% { transform: translate(var(--bx, 40px), var(--by, -120px)) scale(1.05); opacity: 0; }
}

/* ===== Placeholders ===== */
.prop-stage {
    display: block;
    width: var(--stage-w, 180px);
    height: var(--stage-h, 180px);
    flex: none;
}

.prop-stage--sm {
    --stage-w: 56px;
    --stage-h: 56px;
    display: inline-block;
    vertical-align: middle;
}

/* ===== HUD voice ===== */
.hud-label {
    font-family: var(--hud-font);
    font-weight: 400;
    font-size: 1.25rem;
    line-height: 1.1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--hud-ink);
    text-shadow:
        2px 2px 0 var(--hud-shadow),
        3px 3px 0 rgba(6, 18, 32, 0.45);
    transition: color 0.2s ease, transform 0.25s ease;
}

.hud-title {
    font-family: var(--hud-font);
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hud-ink);
    text-shadow:
        3px 3px 0 var(--hud-shadow),
        5px 5px 0 rgba(6, 18, 32, 0.35);
}

.hud-sub {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(220, 236, 255, 0.78);
    text-shadow: 1px 1px 0 rgba(6, 18, 32, 0.9);
}

/* ===== Prop links (journey stops, bottom nav, return nav) ===== */
.prop-link,
.dive-prop {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    gap: 0.1rem;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.prop-link:hover .hud-label,
.prop-link:focus-visible .hud-label,
.dive-prop:hover .hud-label,
.dive-prop:focus-visible .hud-label {
    color: var(--hud-gold);
    transform: translateY(-2px);
}

.prop-link:focus-visible,
.dive-prop:focus-visible {
    outline: 2px solid var(--hud-gold);
    outline-offset: 6px;
}

/* collected: the word pops once and is gone with the object */
.dive-prop.nav-collecting .hud-label {
    animation: hudPop 0.5s ease-out forwards;
}

.dive-prop.nav-collecting .prop-peek {
    opacity: 0;
}

@keyframes hudPop {
    0% { transform: scale(1); opacity: 1; }
    35% { transform: scale(1.25) translateY(-6px); opacity: 1; }
    100% { transform: scale(0.6) translateY(-30px); opacity: 0; }
}

/* destination peek under the label (hover/focus) */
.prop-peek {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(220, 236, 255, 0.85);
    text-shadow: 1px 1px 0 rgba(6, 18, 32, 0.95);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease 0.05s, transform 0.25s ease 0.05s;
    white-space: nowrap;
}

.dive-prop:hover .prop-peek,
.dive-prop:focus-visible .prop-peek {
    opacity: 1;
    transform: translateY(0);
}

/* ===== The signpost (contact) ===== */
.signpost {
    position: relative;
    width: min(380px, 94vw);
    height: 470px;
    margin: 0 auto;
}

.signpost .prop-stage {
    --stage-w: 100%;
    --stage-h: 100%;
}

/* each plank is a real link, laid over its projected plank by the stage */
.plank-link {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    display: block;
    color: transparent;
    font-size: 0;
    overflow: hidden;
    cursor: pointer;
    outline-offset: 3px;
}

.plank-link:focus-visible {
    outline: 2px solid var(--hud-gold);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* without WebGL the signpost falls back to plain HUD links */
html.no-props .prop-stage {
    display: none;
}

html.no-props .signpost {
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 0 2rem;
}

html.no-props .plank-link {
    position: static;
    width: auto;
    height: auto;
    font-family: var(--hud-font);
    font-size: 1.3rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--hud-ink);
    text-shadow: 2px 2px 0 var(--hud-shadow);
}

html.no-props .visually-hidden.plank-title {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
}

/* ===== Panels: flat, square, double-framed ===== */
.n64-panel {
    background: var(--panel-bg);
    border: 2px solid var(--panel-line);
    border-radius: 0;
    outline: 1px solid var(--panel-line-dim);
    outline-offset: 4px;
    box-shadow: 6px 6px 0 rgba(2, 8, 16, 0.55);
}

/* chunky 90s push-button: flat fill, hard offset shadow, moves when pressed */
.n64-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--hud-font);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1a1206;
    background: var(--panel-line);
    border: 2px solid #2a1c08;
    border-radius: 0;
    padding: 0.55rem 1.1rem;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--hud-shadow);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
}

.n64-button:hover,
.n64-button:focus-visible {
    background: var(--hud-gold);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--hud-shadow);
}

.n64-button:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--hud-shadow);
}

/* mono tag with a hard edge (tools, dates, status) */
.n64-tag {
    display: inline-block;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--hud-ink);
    background: rgba(8, 24, 44, 0.9);
    border: 1px solid var(--panel-line-dim);
    border-radius: 0;
    padding: 0.28rem 0.7rem;
}

@media (max-width: 640px) {
    .hud-label {
        font-size: 1.05rem;
    }

    .signpost {
        height: 420px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hud-label,
    .prop-peek,
    .n64-button {
        transition: none;
    }

    .dive-prop.nav-collecting .hud-label {
        animation: none;
    }
}
