:root {
    --bg: #0b0b0d;
    --text: #e7e3da;
    --text-2: #a8a49b;
    --text-3: #7a766e;
    --gold: #d4a72c;
    --gold-bright: #f5c542;
    --gold-light: #fff3a8;
    --gold-dark: #8a5a12;
    --nav-h: 64px;
    --mine: 0;
    /* font pixel of the 16/24/32px pixel fonts, snapped to whole screen pixels by script.js */
    --fp2: 2px;
    --fp3: 3px;
    --fp4: 4px;
    --font-title: "Press Start 2P", monospace;
    --font-label: "Silkscreen", monospace;
    --font-pixel: "VT323", ui-monospace, monospace;
    --nav-gold: #ffd54a;
    --nav-trim: #d4a72c;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
    margin: 0;
    color: var(--text);
    font-family: var(--font-pixel);
    font-size: 24px;
    line-height: 32px;
    overflow-x: hidden;
    overflow-x: clip;
}

body.locked,
.gate body {
    overflow: hidden;
}

img {
    image-rendering: auto;
}

button {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 4px solid var(--gold-bright);
    outline-offset: 4px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* PIXEL KIT */
.px-panel {
    border: 8px solid transparent;
    border-image: var(--tex-frame) 4 / 8px stretch;
    background: var(--tex-panel) 0 0 / 32px 32px;
    background-clip: padding-box;
    image-rendering: pixelated;
    filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.5));
}

.px-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 12px;
    font-family: var(--font-label);
    font-size: calc(var(--fp2) * 8);
    line-height: 16px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text);
    background: none;
    border: 8px solid transparent;
    border-image: var(--tex-btn) 4 fill / 8px stretch;
    image-rendering: pixelated;
    filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.55));
    cursor: pointer;
}

.px-btn:hover,
.px-btn:focus-visible {
    color: var(--gold-light);
    border-image-source: var(--tex-btn-hover);
    outline: none;
}

.px-btn:active {
    translate: 0 4px;
    border-image-source: var(--tex-btn-press);
    filter: none;
}

.seg-bar {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #08080a;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5);
}

.seg-bar span {
    position: relative;
    width: 16px;
    height: 12px;
    background: #1d1d23;
    box-shadow: inset 0 -4px 0 #151519;
}

.seg-bar span::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gold-bright);
    box-shadow: inset 0 4px 0 var(--gold-light), inset 0 -4px 0 var(--gold);
    opacity: 0;
}

/* WALL */
.wall-fallback,
.wall-3d {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.wall-fallback {
    z-index: -3;
    image-rendering: pixelated;
}

.wall-3d {
    z-index: -2;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.wall-3d.ready {
    opacity: 1;
}

.gate .wall-3d {
    touch-action: none;
}

.gate body {
    touch-action: none;
}

.gate.over-gold body {
    cursor: var(--cursor-pickaxe) 10 24, pointer;
}

.gate.mining body {
    cursor: none;
}

.vignette {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(rgba(5, 5, 7, 0.38), rgba(5, 5, 7, 0.38)), radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.75));
    pointer-events: none;
}

.gate .vignette {
    background: linear-gradient(90deg, rgba(3, 3, 5, 0.7), rgba(3, 3, 5, 0.35) 34%, transparent 56%), radial-gradient(ellipse 80% 90% at 64% 50%, transparent 38%, rgba(0, 0, 0, 0.85));
}

@media (max-aspect-ratio: 6/5) {
    .gate .vignette {
        background: linear-gradient(rgba(3, 3, 5, 0.7), rgba(3, 3, 5, 0.3) 40%, transparent 60%), radial-gradient(ellipse 90% 80% at 50% 62%, transparent 38%, rgba(0, 0, 0, 0.85));
    }
}

/* GATE */
.gate-ui,
.gate-flash,
.pickaxe {
    display: none;
}

.gate body {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.gate .gate-ui {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: block;
    pointer-events: none;
}

.gate-copy {
    position: absolute;
    top: 0;
    bottom: 0;
    left: round(max(32px, 8vw), 4px);
    width: min(620px, 46vw);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.gate-eyebrow {
    margin: 0 0 24px;
    font-family: var(--font-label);
    font-size: calc(var(--fp2) * 8);
    line-height: 16px;
    letter-spacing: calc(var(--fp2) * 2);
    text-transform: uppercase;
    color: var(--gold);
    text-shadow: 4px 4px 0 #000;
}

.gate-lead {
    max-width: 440px;
    margin: 28px 0 0;
    font-size: 26px;
    line-height: 30px;
    color: var(--text);
    text-shadow: 2px 2px 0 #000;
}

.gate-stats {
    display: flex;
    margin: 36px 0 0;
}

.gate-stats div {
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    padding: 0 28px;
    border-left: 2px solid rgba(231, 227, 218, 0.14);
}

.gate-stats div:first-child {
    padding-left: 0;
    border-left: 0;
}

.gate-stats dd {
    margin: 0;
    font-family: var(--font-title);
    font-size: calc(var(--fp3) * 8);
    line-height: 32px;
    color: var(--text);
    text-shadow: var(--fp3) var(--fp3) 0 #000;
}

.gate-stats dt {
    font-family: var(--font-label);
    font-size: calc(var(--fp2) * 8);
    line-height: 16px;
    letter-spacing: var(--fp2);
    text-transform: uppercase;
    color: var(--gold);
    text-shadow: var(--fp2) var(--fp2) 0 #000;
}

@media (max-aspect-ratio: 6/5) {
    .gate-copy {
        bottom: auto;
        top: max(64px, 9vh);
        left: 24px;
        width: calc(100% - 48px);
        align-items: center;
        text-align: center;
    }

    .gate-lead {
        margin-top: 20px;
    }

    .gate-stats {
        margin-top: 24px;
    }
}

@media (max-width: 480px) {
    .gate-eyebrow {
        letter-spacing: var(--fp2);
    }

    .gate-lead {
        font-size: 22px;
        line-height: 26px;
    }

    .gate-stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px 16px;
    }

    .gate-stats div {
        gap: 8px;
        padding: 0;
        border-left: 0;
    }

    .gate-stats dd {
        font-size: calc(var(--fp2) * 8);
        line-height: 24px;
    }

    .gate-stats dt {
        letter-spacing: 0;
    }
}

/* Short phones: tighten the copy so the ore keeps its space */
@media (max-height: 640px) and (max-aspect-ratio: 6/5) {
    .gate-copy {
        top: 56px;
    }

    .gate-eyebrow {
        margin-bottom: 12px;
    }

    .gate-lead {
        margin-top: 12px;
        font-size: 20px;
        line-height: 24px;
    }

    .gate-stats {
        margin-top: 14px;
    }
}

/* The hint under the ore needs the bottom of narrow screens, so skip moves to the top */
@media (max-width: 540px) and (max-aspect-ratio: 6/5) {
    .gate .gate-skip {
        top: 12px;
        right: 12px;
        bottom: auto;
    }
}

@media (max-height: 520px) and (min-aspect-ratio: 6/5) {
    .gate-eyebrow {
        margin-bottom: 12px;
    }

    .gate-lead {
        margin-top: 14px;
        font-size: 20px;
        line-height: 24px;
    }

    .gate-stats {
        margin-top: 16px;
    }

    .gate-stats dd {
        font-size: calc(var(--fp2) * 8);
        line-height: 24px;
    }

    .gate .gate-skip {
        top: 12px;
        bottom: auto;
    }
}

@media (max-height: 420px) and (min-aspect-ratio: 6/5) {
    .gate-stats,
    .hint-keys {
        display: none;
    }
}

.gate-title {
    margin: 0;
}

.gate-logo {
    display: block;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 28px rgba(245, 197, 66, 0.18));
}

.gate-hint {
    position: absolute;
    left: calc(var(--ore-x, 50vw) - 130px);
    width: 260px;
    top: calc(var(--ore-y, 50vh) + var(--ore-px, 200px) / 2 + 32px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.wall-ready .gate-hint {
    opacity: 1;
}

.mine-bar span::after {
    opacity: clamp(0, calc((var(--mine) * 10 - var(--i) + 1) * 100), 1);
}

.hint-main {
    margin: 4px 0 0;
    font-family: var(--font-label);
    font-size: calc(var(--fp2) * 8);
    line-height: 16px;
    letter-spacing: var(--fp2);
    text-transform: uppercase;
    color: var(--text);
    text-shadow: 4px 4px 0 #000;
    animation: blink 1.6s steps(1) infinite;
}

@keyframes blink {
    60% {
        color: var(--gold-bright);
    }
}

.hint-keys {
    margin: 0;
    font-size: 20px;
    line-height: 20px;
    color: var(--text-3);
    text-shadow: 2px 2px 0 #000;
}

.gate-skip {
    position: absolute;
    right: 24px;
    bottom: 24px;
    pointer-events: auto;
}

.gate .gate-flash {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: block;
    background: radial-gradient(circle at 50% 50%, rgba(255, 246, 220, 0.6), rgba(245, 197, 66, 0.2) 40%, transparent 70%);
    opacity: 0;
    pointer-events: none;
}

.gate-flash.flash {
    animation: flash 0.4s ease-out forwards;
}

@keyframes flash {
    10% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.leaving .gate-ui > * {
    opacity: 0 !important;
    transition: opacity 0.16s ease-out;
}

.gate .pickaxe {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 35;
    display: block;
    width: 32px;
    height: 32px;
    background: var(--tex-pickaxe) center / 32px 32px no-repeat;
    image-rendering: pixelated;
    translate: var(--px, -100px) var(--py, -100px);
    transform-origin: 20% 85%;
    opacity: 0;
    pointer-events: none;
    filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.7));
}

.pickaxe.on {
    opacity: 1;
}

.pickaxe.auto {
    width: 64px;
    height: 64px;
    background-size: 64px 64px;
}

.pickaxe.swing {
    animation: swing 0.24s steps(3) infinite alternate;
}

@keyframes swing {
    from {
        rotate: 0deg;
    }
    to {
        rotate: -45deg;
    }
}

.gate .navbar,
.gate main,
.gate footer {
    visibility: hidden;
    opacity: 0;
}

.entered .navbar,
.entered main,
.entered footer {
    animation: appear 0.32s ease-out both;
}

@keyframes appear {
    from {
        opacity: 0;
    }
}

/* NAVBAR (kept as is) */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1.25rem;
    font-family: var(--font-pixel);
    font-size: 1.4rem;
    line-height: 1.35;
    color: #efe8d6;
    background: linear-gradient(rgba(10, 9, 12, 0.82), rgba(10, 9, 12, 0.9)), var(--tex-deepslate) 0 0 / 48px 48px;
    image-rendering: pixelated;
    border-bottom: 3px solid var(--nav-trim);
    box-shadow: 0 3px 0 #000, 0 8px 24px rgba(0, 0, 0, 0.6);
}

.navbar :focus-visible {
    outline: 3px solid var(--nav-gold);
    outline-offset: 3px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text {
    font-family: var(--font-title);
    font-size: calc(var(--fp2) * 8);
    color: var(--nav-gold);
    text-shadow: var(--fp3) var(--fp3) 0 #3d2903;
}

.nav-links {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
}

.nav-links a {
    padding: 0.35rem 0.75rem;
    font-size: 1.5rem;
    color: #fff;
    text-decoration: none;
    text-shadow: 2px 2px 0 #000;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--nav-gold);
}

.toggle-menus {
    display: none;
    margin-left: auto;
    padding: 0.2rem 0.6rem;
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--nav-gold);
    background: transparent;
    border: none;
    text-shadow: 2px 2px 0 #000;
    cursor: pointer;
}

/* CONTENT */
.content {
    padding-top: var(--nav-h);
}

.content section {
    max-width: 1104px;
    margin: 0 auto;
    padding: 96px 32px 0;
}

.content section:last-child {
    padding-bottom: 112px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 32px;
    font-family: var(--font-title);
    font-weight: 400;
    font-size: calc(var(--fp3) * 8);
    line-height: 32px;
    color: var(--text);
    text-shadow: 4px 4px 0 #000;
}

.section-title::before {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    background: var(--gold-bright);
    box-shadow: inset 4px 4px 0 var(--gold-light), inset -4px -4px 0 var(--gold-dark), 4px 4px 0 #000;
}

.section-intro {
    max-width: 640px;
    margin: -12px 0 32px;
    color: var(--text-2);
    text-shadow: 2px 2px 0 #000;
}

/* ABOUT */
.about-layout {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 24px;
    align-items: start;
    padding: 20px 24px;
}

.portrait {
    padding: 4px;
    background: #0e0e11;
    background-clip: padding-box;
    border: 8px solid transparent;
    border-image: var(--tex-frame-gold) 4 / 8px stretch;
    image-rendering: pixelated;
}

.about-img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
}

.about-text {
    margin: 0;
    font-size: 22px;
    line-height: 26px;
    color: #dcd7cc;
    columns: 2;
    column-gap: 32px;
}

.about-text strong {
    font-weight: 400;
    color: var(--gold-bright);
}

.about-text a {
    color: var(--gold-bright);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

/* PROJECTS */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 16px;
}

.world {
    display: grid;
    grid-template-columns: 64px 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 8px 16px;
    padding: 16px;
    color: inherit;
    text-decoration: none;
}

.world:hover,
.world:focus-visible,
.skill:hover,
.skill:focus-visible {
    translate: 0 -4px;
    border-image-source: var(--tex-frame-gold);
    outline: none;
}

.world-icon {
    grid-row: 1 / 4;
    width: 64px;
    height: 64px;
    border: 4px solid #08080a;
    background: #08080a;
}

.project-icon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.world-info {
    display: contents;
}

.project-title {
    font-family: var(--font-title);
    font-size: calc(var(--fp2) * 8);
    line-height: 24px;
    color: var(--text);
    text-shadow: var(--fp2) var(--fp2) 0 #000;
}

.project-description {
    font-size: 22px;
    line-height: 26px;
    color: var(--text-2);
}

.world-btn {
    font-family: var(--font-label);
    font-size: calc(var(--fp2) * 8);
    line-height: 16px;
    text-transform: uppercase;
    color: var(--text-3);
}

.world:hover .world-btn,
.world:focus-visible .world-btn {
    color: var(--gold-bright);
}

/* SKILLS */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px 16px;
}

.skill {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    text-align: left;
    cursor: pointer;
}

.slot {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    background: #0c0c0f;
    box-shadow: inset 4px 4px 0 #050507, inset -4px -4px 0 #2b2b32;
}

.skill-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.tooltip {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
}

.skill-title {
    font-family: var(--font-title);
    font-size: calc(var(--fp2) * 8);
    line-height: 24px;
    color: var(--text);
    text-shadow: var(--fp2) var(--fp2) 0 #000;
}

.skill-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0 8px;
    font-size: 22px;
    line-height: 26px;
    color: var(--text-2);
}

.skill-tools span:not(:last-child)::after {
    content: "\00b7";
    margin-left: 8px;
    color: var(--text-3);
}

.tooltip-hint {
    margin-top: auto;
    padding-top: 8px;
    font-family: var(--font-label);
    font-size: calc(var(--fp2) * 8);
    line-height: 16px;
    text-transform: uppercase;
    color: var(--text-3);
}

.skill:hover .tooltip-hint,
.skill:focus-visible .tooltip-hint {
    color: var(--gold-bright);
}

/* STATISTICS */
.stats-box {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.stat {
    padding: 24px 16px;
    text-align: center;
}

.stat h3 {
    margin: 0;
    font-family: var(--font-title);
    font-weight: 400;
    font-size: calc(var(--fp4) * 8);
    line-height: 40px;
    color: var(--gold-bright);
    text-shadow: 4px 4px 0 #3d2903;
}

.stat h4 {
    margin: 16px 0 0;
    font-family: var(--font-label);
    font-weight: 400;
    font-size: calc(var(--fp2) * 8);
    line-height: 16px;
    text-transform: uppercase;
    color: var(--text-2);
}

/* CONTACT */
.contact-boxs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.contact-box {
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 16px;
    font-family: var(--font-pixel);
    font-size: 24px;
    line-height: 24px;
    text-transform: none;
}

.contact-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: grayscale(1) brightness(1.4);
}

.contact-box:hover .contact-logo,
.contact-box:focus-visible .contact-logo {
    filter: none;
}

/* FOOTER */
.footer {
    padding: 28px 16px;
    text-align: center;
    background: linear-gradient(rgba(5, 5, 7, 0.5), rgba(5, 5, 7, 0.5)), var(--tex-panel) 0 0 / 32px 32px;
    image-rendering: pixelated;
    border-top: 4px solid #08080a;
    box-shadow: inset 0 4px 0 #2b2b32;
}

.footer p {
    margin: 0;
    font-size: 20px;
    line-height: 24px;
    color: var(--text-3);
}

/* TOAST */
.toast {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 32px;
    z-index: 70;
    width: max-content;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    color: var(--text);
    opacity: 0;
    translate: 0 16px;
    transition: opacity 0.2s steps(2), translate 0.2s steps(2);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    translate: 0 0;
}

.toast-gem {
    width: 12px;
    height: 12px;
    background: var(--gold-bright);
    box-shadow: inset 4px 4px 0 var(--gold-light), inset -4px -4px 0 var(--gold-dark);
}

/* WORK GALLERY */
.work {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: linear-gradient(rgba(6, 6, 8, 0.88), rgba(6, 6, 8, 0.92)), var(--tex-panel) 0 0 / 32px 32px;
    image-rendering: pixelated;
}

.work[hidden] {
    display: none;
}

.work-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.work:not(.loading) .work-loading {
    display: none;
}

.loading-title {
    margin: 0;
    font-family: var(--font-label);
    font-size: calc(var(--fp2) * 8);
    line-height: 16px;
    text-transform: uppercase;
    color: var(--text-2);
}

.work.loading .load-bar span::after {
    animation: seg-on 0.05s steps(1) forwards;
    animation-delay: calc(var(--i) * var(--load-ms, 700ms) / 11);
}

@keyframes seg-on {
    to {
        opacity: 1;
    }
}

.work-view {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: 32px 32px 64px;
}

.work.loading .work-view {
    visibility: hidden;
}

.work-head {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1104px;
    margin: 0 auto 32px;
}

.back-btn {
    width: 56px;
    height: 56px;
    padding: 0;
    font-size: calc(var(--fp2) * 8);
}

.chest-title {
    margin: 0;
    font-family: var(--font-title);
    font-weight: 400;
    font-size: calc(var(--fp3) * 8);
    line-height: 32px;
    color: var(--text);
    text-shadow: 4px 4px 0 #000;
}

.chest-tools {
    margin: 4px 0 0;
    font-size: 22px;
    line-height: 26px;
    color: var(--text-2);
}

.chest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(264px, 1fr));
    gap: 24px 16px;
    max-width: 1104px;
    margin: 0 auto;
}

.chest-slot {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    padding: 0;
    overflow: hidden;
    background: #08080a;
    background-clip: padding-box;
    border: 8px solid transparent;
    border-image: var(--tex-frame) 4 / 8px stretch;
    image-rendering: pixelated;
    filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.5));
    cursor: pointer;
}

.chest-slot:hover,
.chest-slot:focus-visible {
    translate: 0 -4px;
    border-image-source: var(--tex-frame-gold);
    outline: none;
}

.chest-slot img,
.chest-slot video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: auto;
}

.slot-tip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 12px;
    font-family: var(--font-label);
    font-size: calc(var(--fp2) * 8);
    line-height: 16px;
    text-align: left;
    text-transform: uppercase;
    color: var(--text);
    background: rgba(5, 5, 7, 0.86);
    box-shadow: 0 -4px 0 #08080a;
    opacity: 0;
    pointer-events: none;
}

.chest-slot:hover .slot-tip,
.chest-slot:focus-visible .slot-tip {
    opacity: 1;
}

.play-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: #08080a;
    box-shadow: inset 0 0 0 4px #2b2b32;
    pointer-events: none;
}

.play-badge::after {
    content: "";
    position: absolute;
    left: 12px;
    top: 8px;
    border-left: 12px solid var(--gold-bright);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.soon-mark {
    display: none;
}

.chest-note {
    max-width: 1104px;
    margin: 32px auto 0;
    font-family: var(--font-label);
    font-size: calc(var(--fp2) * 8);
    line-height: 16px;
    text-transform: uppercase;
    text-align: center;
    color: var(--text-3);
}

.chest-note[hidden] {
    display: none;
}

.lightbox {
    --stage-h: calc(100dvh - 176px);
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(4, 4, 6, 0.97);
}

.lightbox[hidden] {
    display: none;
}

.lb-stage {
    position: absolute;
    inset: 88px 112px 88px;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.lb-stage img,
.lb-stage video,
.lb-stage iframe {
    border: 8px solid transparent;
    border-image: var(--tex-frame) 4 / 8px stretch;
    background: #000;
    background-clip: padding-box;
}

.lb-stage img {
    max-width: 100%;
    max-height: var(--stage-h);
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.3s ease-out;
}

.lb-stage img.zoomed {
    transform: scale(2);
    cursor: zoom-out;
}

.lb-stage video,
.lb-stage iframe {
    width: min(100%, 1280px, calc(var(--stage-h) * 16 / 9));
    height: auto;
    aspect-ratio: 16 / 9;
}

.lb-close,
.lb-prev,
.lb-next {
    position: absolute;
    width: 56px;
    height: 56px;
    padding: 0;
}

.lb-close {
    top: 24px;
    right: 24px;
}

.lb-prev,
.lb-next {
    top: calc(50% - 28px);
}

.lb-prev {
    left: 32px;
}

.lb-next {
    right: 32px;
}

.lb-prev[hidden],
.lb-next[hidden] {
    display: none;
}

.lb-caption {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 32px;
    margin: 0;
    font-size: 22px;
    line-height: 24px;
    text-align: center;
    color: var(--text-2);
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .about-layout {
        grid-template-columns: 88px 1fr;
        gap: 16px;
    }
    .about-text {
        columns: 1;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .contact-boxs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .nav-links {
        display: none;
    }
    .toggle-menus {
        display: block;
    }
    .nav-links.open {
        position: fixed;
        top: var(--nav-h);
        left: 0;
        right: 0;
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0.5rem;
        background: linear-gradient(rgba(10, 9, 12, 0.92), rgba(10, 9, 12, 0.96)), var(--tex-deepslate) 0 0 / 48px 48px;
        border-bottom: 3px solid var(--nav-trim);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
    }
    .nav-links.open a {
        padding: 0.7rem 1rem;
        font-size: 1.6rem;
    }
}

@media (max-width: 640px) {
    .content section {
        padding: 72px 16px 0;
    }
    .section-title {
        font-size: calc(var(--fp2) * 8);
        line-height: 24px;
    }
    .stats-box {
        grid-template-columns: 1fr;
    }
    .stat h3 {
        font-size: calc(var(--fp3) * 8);
        line-height: 32px;
    }
    .gate-skip {
        right: 16px;
        bottom: 16px;
    }
    .lightbox {
        --stage-h: calc(100dvh - 240px);
    }
    .lb-stage {
        inset: 88px 8px 152px;
    }
    .lb-prev,
    .lb-next {
        top: auto;
        bottom: 88px;
    }
    .lb-caption {
        bottom: 16px;
    }
    .work-view {
        padding: 24px 16px 48px;
    }
    .chest-title {
        font-size: calc(var(--fp2) * 8);
        line-height: 24px;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 0.85rem;
    }
    .contact-boxs {
        grid-template-columns: 1fr;
    }
    .about-layout {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    .portrait {
        width: 88px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
