* {
    margin: 0;
    padding: 0;
}

html,
body {
    overflow: hidden;
}

.webgl {
    position: fixed;
    top: 0;
    left: 0;
    outline: none;
}

.jitter {
    animation-duration: 0.3s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards;
    animation-iteration-count: infinite;
    animation-name: jittery;
    z-index: -10;
}

.interface-wrapper {
    width: 100%;
    top: 64px;
    left: 64px;
}

.icon-control-container {
    height: 26.5px;
    width: 26.5px;
}

@media only screen and (max-width: 768px) {
    .interface-wrapper {
        width: 100%;
        top: 24px;
        left: 24px;
    }

    .icon-control-container {
        height: 19.5px;
        width: 19.5px;
    }
}

@keyframes jittery {
    10% {
        transform: translate(-0.1px, -0.15px) scale(1, 1);
    }

    20% {
        transform: translate(0.15px, 0.1px) scale(1, 1);
    }

    30% {
        transform: translate(-0.2px, -0.25px) scale(1, 1);
    }

    40% {
        transform: translate(0.05px, 0.1px) scale(1, 1);
    }

    50% {
        transform: translate(-0.025px, -0.05px) scale(1, 1);
    }

    60% {
        transform: translate(0px, 0.075px) scale(1, 1);
    }

    70% {
        transform: translate(-0.075px, -0.1px) scale(1, 1);
    }

    80% {
        transform: translate(0.075px, 0.125px) scale(1, 1);
    }

    90% {
        transform: translate(-0.125px, -0.075px) scale(1, 1);
    }

    100% {
        transform: translate(0.075px, 0.025px) scale(1, 1);
    }
}

h1,
h2,
h3,
h4,
h5,
p {
    /* font-family: ocr-a-std, monospace; */
    font-family: monospace;
    font-weight: 400;
    font-style: normal;
    color: white;
    /* mobile friendly font size */
    font-size: 16px;
}

/* if on mobile */
@media only screen and (max-width: 768px) {
    h1,
    h2,
    h3,
    h4,
    h5,
    p {
        font-size: 10px;
    }
}

br {
    padding-top: 8px;
    padding-bottom: 8px;
    height: 16px;
}

.loading::after {
    display: inline-block;
    animation: dotty steps(1, end) 1s infinite;
    content: '';
}

@keyframes dotty {
    0% {
        content: '   ';
    }
    25% {
        content: '. ';
    }
    50% {
        content: '.. ';
    }
    75% {
        content: '...';
    }
    100% {
        content: '   ';
    }
}
.blinking-cursor {
    background-color: #fff;
    width: 0.8em;
    height: 0.15em;
    -webkit-animation: 0.65s blink step-end infinite;
    -moz-animation: 0.65s blink step-end infinite;
    -ms-animation: 0.65s blink step-end infinite;
    -o-animation: 0.65s blink step-end infinite;
    animation: 0.65s blink step-end infinite;
}

@keyframes blink {
    from,
    to {
        background-color: transparent;
    }
    50% {
        background-color: white;
    }
}

@-moz-keyframes blink {
    from,
    to {
        background-color: transparent;
    }
    50% {
        background-color: white;
    }
}

@-webkit-keyframes blink {
    from,
    to {
        background-color: transparent;
    }
    50% {
        background-color: white;
    }
}

@-ms-keyframes blink {
    from,
    to {
        background-color: transparent;
    }
    50% {
        background-color: white;
    }
}

@-o-keyframes blink {
    from,
    to {
        background-color: transparent;
    }
    50% {
        background-color: white;
    }
}

.bios-start-button {
    background-color: #000;
    border: 4px solid #fff;
    border-width: 4px 3px 4px 3px;
}

.bios-start-button p {
    box-sizing: border-box;
    padding: 8px;
}

.bios-start-button:hover p {
    background-color: #fff;
    cursor: pointer;
    color: #000;
}

.loading-screen-header {
    padding: 48px;
}

.loading-screen-body {
    padding-left: 48px;
    padding-right: 48px;
}

.loading-screen-footer {
    padding: 48px;
    padding-bottom: 64px;
}

.info-wrapper {
    top: 64px;
    left: 64px;
}

/* if on mobile make all loading screen elements have a padding of 16 */
@media only screen and (max-width: 768px) {
    .loading-screen-header {
        padding: 16px;
    }

    .info-wrapper {
        top: 16px;
        left: 16px;
    }

    .blinking-cursor {
        background-color: #fff;
        width: 0.4em;
        height: 0.08em;
        -webkit-animation: 0.65s blink step-end infinite;
        -moz-animation: 0.65s blink step-end infinite;
        -ms-animation: 0.65s blink step-end infinite;
        -o-animation: 0.65s blink step-end infinite;
        animation: 0.65s blink step-end infinite;
    }
    
    .loading-screen-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .loading-screen-footer {
        padding: 16px;
        padding-bottom: 32px;
    }
}

/* ---------------- boot progress ---------------- */
.bios-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 2px;
}
.bios-progress-track {
    position: relative;
    flex: 1;
    max-width: 460px;
    height: 10px;
    border: 1px solid #00ff41;
    background: rgba(0, 255, 65, 0.06);
    overflow: hidden;
}
.bios-progress-fill {
    position: absolute;
    inset: 0;
    background: #00ff41;
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 320ms cubic-bezier(0.22, 0.75, 0.2, 1);
}
.bios-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    animation: bios-sheen 1.4s ease-in-out infinite;
}
@keyframes bios-sheen { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.bios-progress-pct {
    color: #00ff41;
    font-variant-numeric: tabular-nums;
    min-width: 3.4em;
}

/* Softer, more deliberate boot typography */
.loading-screen-body p { letter-spacing: 0.02em; }
.bios-start-button {
    transition: transform 160ms cubic-bezier(0.22, 0.75, 0.2, 1),
                background-color 160ms ease;
}
.bios-start-button:hover { transform: translateY(-1px); }
.bios-start-button:active { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    .bios-progress-fill::after { animation: none; }
    .bios-progress-fill { transition: none; }
}

/* =====================================================================
   Boot sequence — a terminal log, centred, monochrome, no chrome.
   Lines type in, the progress rule is driven by the real loader, and the
   final line is the start prompt. Nothing is boxed.
   ===================================================================== */
.boot {
    position: absolute;
    inset: 0;
    margin: auto;
    width: min(640px, 88vw);
    height: fit-content;
    display: flex;
    flex-direction: column;
    background: transparent;
    color: #ffffff;
    text-shadow: 0 1px 1px rgba(8, 30, 60, 0.45), 0 0 14px rgba(8, 30, 60, 0.25);
    font-family: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: 13px;
    line-height: 1.7;
    letter-spacing: 0.02em;
    animation: boot-in 260ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
@keyframes boot-in { from { opacity: 0; transform: translateY(4px); } }

.boot-mark { margin-bottom: 28px; }
.boot-mark .dotmatrix { display: block; }

.boot-head {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.boot-log {
    list-style: none;
    margin: 0;
    padding: 0;
    min-height: 12.5em;
}
.boot-log li {
    display: flex;
    align-items: baseline;
    gap: 12px;
    white-space: nowrap;
}
.boot-log .k { color: #ffffff; flex: 0 0 auto; }
.boot-log .v { color: rgba(255, 255, 255, 0.78); flex: 0 0 auto; font-variant-numeric: tabular-nums; min-width: 4.4em; text-align: right; }
.boot-log .dots {
    flex: 1 1 auto;
    min-width: 12px;
    height: 1px;
    background-image: radial-gradient(circle, rgba(255,255,255,0.45) 1px, transparent 1.2px);
    background-size: 6px 1px;
    background-repeat: repeat-x;
    background-position: 0 0;
    align-self: center;
    margin-top: 2px;
}
.boot-ready .k { color: #ffffff; font-weight: 600; animation: ready-breathe 2.4s ease-in-out infinite; }
.boot-ready .v { color: #ffffff; }
@keyframes ready-breathe { 50% { opacity: 0.6; } }

/* Type-in: reveal by clip, cheap and crisp */
.typed {
    animation: type-in 360ms steps(24, end) both;
}
@keyframes type-in {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}

.boot-progress-line { margin-top: 8px; }
.boot-progress-line .bar {
    flex: 1 1 auto;
    position: relative;
    height: 2px;
    background: rgba(255, 255, 255, 0.28);
    align-self: center;
    overflow: hidden;
    border-radius: 1px;
}
.boot-progress-line .bar-fill {
    position: absolute;
    inset: 0;
    background: #ffffff;
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 380ms cubic-bezier(0.22, 0.75, 0.2, 1);
}
.boot-progress-line .pct { color: #ffffff; min-width: 4.4em; text-align: right; font-variant-numeric: tabular-nums; }

/* Start prompt */
.boot-start, .boot-wait {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 22px;
    padding: 0;
    background: none;
    border: 0;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: #ffffff;
    cursor: pointer;
    text-align: left;
    animation: prompt-in 480ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
@keyframes prompt-in { from { opacity: 0; transform: translateX(-6px); } }
.boot-start-label::before { content: '> '; color: rgba(255, 255, 255, 0.6); }
.boot-start:hover .boot-start-label { text-decoration: underline; text-underline-offset: 4px; }
.boot-wait::before { content: '> '; color: rgba(255, 255, 255, 0.6); }
.boot-caret {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: #ffffff;
    animation: caret 1s steps(2, start) infinite;
    transform: translateY(2px);
}
@keyframes caret { to { visibility: hidden; } }

.boot-note {
    margin: 18px 0 0;
    font-size: 11px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
    letter-spacing: 0.04em;
}

@media (max-width: 560px) {
    .boot { font-size: 12px; }
    .boot-log li { white-space: normal; }
    .boot-log .v { flex: 1 1 100%; padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .boot, .typed { animation: none; }
    .boot-caret { animation: none; }
    .boot-progress-line .bar-fill { transition: none; }
}


/* =====================================================================
   In-scene HUD — same system as the boot: mono, monochrome, no boxes.
   ===================================================================== */
#ui-interactive { width: auto !important; }

.interface-wrapper { top: 0 !important; left: 0 !important; padding: 34px 36px !important; }
.hud {
    position: relative;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
    color: #ffffff;
    font-family: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-shadow: 0 1px 1px rgba(8, 30, 60, 0.35);
    pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-name .dotmatrix { display: block; filter: drop-shadow(0 1px 1px rgba(8,30,60,0.35)); }
.hud-title { color: #f2f2f2; display: inline-flex; align-items: center; gap: 6px; }
.hud-row { display: flex; align-items: center; gap: 14px; }
.hud-clock { color: rgba(255,255,255,0.72); font-variant-numeric: tabular-nums; letter-spacing: 0.14em; }
.hud-control { display: inline-flex; opacity: 0; }
.hud-control .icon-control-container {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    opacity: 1;
    transition: opacity 160ms ease, transform 160ms cubic-bezier(0.2, 0.8, 0.25, 1);
}
.hud-control .icon-control-container:hover { opacity: 0.8; transform: translateY(-1px); }
.hud-control .icon-control-container:hover img { filter: invert(1) brightness(1.15) drop-shadow(0 1px 1.5px rgba(0,0,0,0.6)); }
.hud-control img { display: block; width: 15px !important; height: 15px; object-fit: contain; filter: brightness(0) invert(1) drop-shadow(0 1px 1px rgba(8,30,60,0.35)); }

.hud-caret {
    display: inline-block;
    width: 7px;
    height: 12px;
    background: #ffffff;
    animation: caret 1s steps(2, start) infinite;
}

/* "click anywhere to begin" — bottom centre, borderless, breathing caret */
.help-prompt {
    position: absolute;
    bottom: 56px;
    left: 0;
    right: 0;
    width: max-content;
    margin-inline: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 16px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}
.help-prompt-chevron { color: rgba(255, 255, 255, 0.6); }
.help-prompt .hud-caret { background: #ffffff; }
.help-prompt-text { animation: help-breathe 2.6s ease-in-out infinite; }
@keyframes help-breathe { 50% { opacity: 0.55; } }

@media (max-width: 760px) {
    .interface-wrapper { padding: 18px !important; }
    .hud { font-size: 10px; }
    .help-prompt { bottom: 36px; font-size: 11px; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
    .hud-caret, .help-prompt-text { animation: none; }
}


/* =====================================================================
   Boot sky — pixel-art scenery behind the log. Decor sits at the edges,
   clouds drift, and every layer answers the mouse with its own depth.
   ===================================================================== */
.boot-sky {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #3b8fe9 0%, #47a0f3 55%, #5db0f6 100%);
    pointer-events: none;
}
.sky-decor {
    position: absolute;
    image-rendering: pixelated;
    user-select: none;
    will-change: transform;
    animation: decor-in 700ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
@keyframes decor-in { from { opacity: 0; } }

.decor-left  { left: -1vw;  bottom: -1vh; width: 34vw; max-width: 560px; }
.decor-tr    { right: -1vw; top: -1vh;    width: 26vw; max-width: 430px; }
.decor-br    { right: -1vw; bottom: -1vh; width: 30vw; max-width: 500px; animation-delay: 120ms; }
.decor-tr    { animation-delay: 60ms; }
.cloud-a     { animation-delay: 180ms, 0s; }
.cloud-b     { animation-delay: 260ms, 0s; }

.cloud { opacity: 0.95; }
.cloud-a { right: 6vw; top: 30vh; width: 22vw; max-width: 380px; animation: decor-in 700ms both, drift-a 26s ease-in-out infinite alternate; }
.cloud-b { left: 4vw;  top: 36vh; width: 16vw; max-width: 280px; animation: decor-in 700ms both, drift-b 34s ease-in-out infinite alternate; }
@keyframes drift-a { from { margin-left: 0; } to { margin-left: -46px; } }
@keyframes drift-b { from { margin-left: 0; } to { margin-left:  38px; } }

@media (max-width: 760px) {
    .decor-left { width: 58vw; }
    .decor-tr   { width: 44vw; }
    .decor-br   { width: 50vw; }
    .cloud-a    { width: 34vw; top: 22vh; }
    .cloud-b    { width: 26vw; top: 28vh; }
}
@media (prefers-reduced-motion: reduce) {
    .sky-decor, .cloud-a, .cloud-b { animation: none; }
}

.boot-progress-line .bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.0) 40%, rgba(120,190,255,0.9), transparent);
    animation: bar-sheen 1.6s ease-in-out infinite;
}
@keyframes bar-sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
    .boot-progress-line .bar-fill::after, .boot-ready .k, .boot-start { animation: none; }
}


/* Renderer canvases are display-only; pointer events belong to the monitor
   iframe and the document listeners. A canvas over the screen blocked clicks. */
#webgl, #webgl canvas { pointer-events: none !important; }
/* Free camera: the canvas takes the pointer so you can orbit the scene. */
body.free-cam #webgl, body.free-cam #webgl canvas { pointer-events: auto !important; cursor: grab; }
body.free-cam #webgl canvas:active { cursor: grabbing; }

/* label that follows the cursor over clickable desk objects */
.scene-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    pointer-events: none;
    padding: 3px 7px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: #fff;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.35);
    opacity: 0;
    transition: opacity 0.12s;
    white-space: nowrap;
}
.scene-tooltip.visible { opacity: 1; }

/* resume viewer: the paper on the desk lifts into a page in the middle.
   Text follows the HUD: mono, small caps, wide tracking, borderless. */
.paper-viewer {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    color: #ffffff;
    text-shadow: 0 1px 1px rgba(8, 30, 60, 0.35);
}
.paper-viewer.is-open { display: flex; }
.paper-viewer-backdrop {
    position: absolute;
    inset: 0;
    opacity: 0;
    background: radial-gradient(ellipse at center, rgba(8, 12, 14, 0.5), rgba(4, 6, 8, 0.84));
}
.paper-viewer-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.paper-viewer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    margin-bottom: 12px;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.paper-viewer-title .k { color: #ffffff; }
.paper-viewer-meta { color: rgba(255, 255, 255, 0.6); }
.paper-viewer-meta:empty { display: none; }
.paper-viewer-sheet {
    position: relative;
    will-change: transform, opacity;
}
.paper-viewer-card {
    position: absolute;
    inset: 0;
    background: #ffffff;
    border-radius: 1.5px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 48px 100px rgba(0, 0, 0, 0.6),
        0 14px 30px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    will-change: transform;
    backface-visibility: hidden;
}
.paper-viewer-pages {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
}
.paper-viewer-pages::-webkit-scrollbar { display: none; }
.paper-viewer-page { display: block; background: #ffffff; }
.paper-viewer-page + .paper-viewer-page { border-top: 1px solid rgba(0, 0, 0, 0.08); }
.paper-viewer-frame { width: 100%; height: 100%; border: 0; display: block; background: #ffffff; }
.paper-viewer-actions {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-top: 22px;
}
.paper-viewer-btn {
    position: relative;
    font: inherit;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.86);
    text-decoration: none;
    background: none;
    border: 0;
    padding: 6px 0;
    cursor: pointer;
    text-shadow: inherit;
    transition: color 160ms ease, transform 160ms cubic-bezier(0.2, 0.8, 0.25, 1);
}
.paper-viewer-btn::before { content: '> '; opacity: 0; transition: opacity 160ms ease; }
.paper-viewer-btn::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 2px;
    height: 1px;
    background: #ffffff;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.25, 1);
}
.paper-viewer-btn:hover, .paper-viewer-btn:focus-visible {
    color: #ffffff;
    transform: translateY(-1px);
    outline: none;
}
.paper-viewer-btn:hover::before, .paper-viewer-btn:focus-visible::before { opacity: 0.7; }
.paper-viewer-btn:hover::after, .paper-viewer-btn:focus-visible::after { transform: scaleX(1); }
.paper-viewer-hint {
    margin-top: 12px;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.55);
}
@media (max-width: 640px) {
    .paper-viewer-actions { gap: 18px; }
    .paper-viewer-hint { display: none; }
}

