:root {
    --bg: #d9d9d9;
    --bg-soft: rgba(255, 255, 255, 0.42);
    --panel: rgba(255, 255, 255, 0.62);
    --panel-strong: rgba(255, 255, 255, 0.78);
    --text: #111;
    --muted: #505050;
    --line: rgba(0, 0, 0, 0.16);
    --line-strong: rgba(0, 0, 0, 0.7);
    --accent: #e62a2a;
    --blue: #5a8db8;
    --purple: #b99ae8;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.13);
    --radius: 22px;
    --pixel-shadow: 8px 8px 0 rgba(0, 0, 0, 0.08);
    --maxw: 1450px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Arial Black", "Microsoft YaHei", "PingFang SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.45;
}

img {
    max-width: 100%;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

#bgCanvas,
#modalBurstCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#bgCanvas {
    z-index: 0;
}

.page-noise,
.page-grid,
.cursor-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.page-noise {
    z-index: 1;
    opacity: 0.16;
    background-image:
            radial-gradient(circle at 10% 20%, rgba(0, 0, 0, 0.08) 0, transparent 24%),
            radial-gradient(circle at 80% 10%, rgba(0, 0, 0, 0.05) 0, transparent 20%),
            radial-gradient(circle at 70% 80%, rgba(0, 0, 0, 0.06) 0, transparent 24%),
            repeating-linear-gradient(
                    0deg,
                    rgba(255, 255, 255, 0.04) 0 2px,
                    rgba(0, 0, 0, 0.02) 2px 4px
            );
    mix-blend-mode: multiply;
}

.page-grid {
    z-index: 1;
    opacity: 0.14;
    background-image:
            linear-gradient(rgba(0,0,0,0.08) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0,0,0,0.08) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(circle at center, #000 40%, transparent 95%);
}

.cursor-glow {
    z-index: 3;
    width: 260px;
    height: 260px;
    left: 0;
    top: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.55), transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0.8;
    filter: blur(16px);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(217, 217, 217, 0.72);
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.topbar-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 10px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    width: 72px;
    min-width: 72px;
    transition: transform 0.25s ease;
}

.brand:hover {
    transform: translateY(-2px) rotate(-2deg);
}

.nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.nav a {
    position: relative;
    font-size: clamp(18px, 1.5vw, 24px);
    font-style: italic;
    font-weight: 900;
    padding: 6px 10px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav a span,
.eyebrow span,
.control-left h2 span,
.ending-small span,
.hero-stamp span,
.modal-cover-deco span {
    color: var(--accent);
}

.nav a:hover,
.nav a.active {
    transform: translateY(-2px);
}

main {
    position: relative;
    z-index: 2;
}

.hero,
.control-panel,
.gallery-wrap,
.ending {
    max-width: var(--maxw);
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.hero {
    padding-top: 48px;
    padding-bottom: 46px;
    min-height: calc(100vh - 84px);
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 28px;
    align-items: center;
}

.eyebrow {
    font-size: 15px;
    letter-spacing: 0.22em;
    margin: 0 0 10px;
}

.hero-copy h1 {
    font-size: clamp(32px, 4vw, 68px);
    line-height: 0.98;
    margin: 0 0 18px;
    letter-spacing: -0.03em;
}

.hero-text {
    max-width: 720px;
    font-size: clamp(16px, 1.4vw, 22px);
    color: var(--muted);
    min-height: 82px;
    margin-bottom: 24px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 11px 18px;
    border-radius: 999px;
    border: 2px solid #000;
    font-weight: 900;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    will-change: transform;
}

.btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.btn-black {
    background: #111;
    color: #fff;
}

.btn-ghost {
    background: rgba(255,255,255,0.5);
    color: #111;
}

.hero-mini-panels {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.mini-panel {
    min-width: 168px;
    padding: 14px 16px;
    border: 2px solid #000;
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--pixel-shadow);
}

.mini-label {
    display: block;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 6px;
}

.hero-visual {
    position: relative;
    min-height: 620px;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

.hero-shadow {
    position: absolute;
    width: min(900px, 90%);
    opacity: 0.26;
    z-index: 0;
    filter: grayscale(1);
}

.hero-birds {
    position: relative;
    z-index: 2;
    width: min(780px, 100%);
    image-rendering: pixelated;
    filter: drop-shadow(0 18px 30px rgba(0,0,0,0.16));
}

.hero-stamp {
    position: absolute;
    left: 3%;
    top: 6%;
    z-index: 3;
    font-size: clamp(28px, 2.8vw, 58px);
    line-height: 0.96;
    font-weight: 900;
    transform: rotate(-4deg);
}

.hero-floating-card {
    position: absolute;
    z-index: 3;
    max-width: 240px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 2px solid #000;
    background: rgba(255,255,255,0.62);
    box-shadow: var(--pixel-shadow);
    backdrop-filter: blur(12px);
    font-size: 14px;
    font-weight: 900;
}

.floating-card-a {
    right: 8%;
    top: 10%;
    animation: driftA 5.2s ease-in-out infinite;
}

.floating-card-b {
    left: 6%;
    bottom: 10%;
    animation: driftB 6.2s ease-in-out infinite;
}

@keyframes driftA {
    0%, 100% { transform: translateY(0) rotate(4deg); }
    50% { transform: translateY(-12px) rotate(1deg); }
}

@keyframes driftB {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-14px) rotate(-1deg); }
}

.control-panel {
    padding-top: 10px;
    padding-bottom: 18px;
    display: grid;
    gap: 22px;
    grid-template-columns: 0.9fr 1.1fr;
    align-items: end;
}

.control-left h2 {
    margin: 0 0 10px;
    font-size: clamp(28px, 2.8vw, 56px);
    line-height: 1;
}

.control-left p {
    margin: 0;
    color: var(--muted);
    max-width: 520px;
}

.control-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border: 2px solid #000;
    border-radius: 18px;
    background: rgba(255,255,255,0.72);
    box-shadow: var(--pixel-shadow);
}

.search-box input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    font-weight: 800;
    color: #111;
}

.search-box span {
    font-size: 12px;
    letter-spacing: 0.16em;
    color: var(--muted);
    margin-left: 16px;
}

.tag-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag-chip {
    border: 2px solid #000;
    background: rgba(255,255,255,0.62);
    border-radius: 999px;
    padding: 9px 14px;
    cursor: pointer;
    transition: transform 0.22s ease, background 0.22s ease;
    font-weight: 900;
}

.tag-chip:hover,
.tag-chip.active {
    transform: translateY(-2px);
    background: #111;
    color: #fff;
}

.gallery-wrap {
    padding-top: 10px;
    padding-bottom: 60px;
}

.gallery-grid {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
    position: relative;
    border: 2px solid #000;
    border-radius: 24px;
    padding: 14px;
    background:
            linear-gradient(180deg, rgba(255,255,255,0.92), rgba(245,245,245,0.65)),
            rgba(255,255,255,0.4);
    box-shadow: var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.project-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
            radial-gradient(circle at top right, rgba(230, 42, 42, 0.12), transparent 26%),
            radial-gradient(circle at bottom left, rgba(185, 154, 232, 0.16), transparent 28%);
    pointer-events: none;
}

.project-card::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px dashed rgba(0,0,0,0.14);
    border-radius: 18px;
    pointer-events: none;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 52px rgba(0,0,0,0.16);
}

.project-cover-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 2px solid #000;
    aspect-ratio: 16 / 11;
    background: #cfcfcf;
}

.project-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    transition: transform 0.5s ease, filter 0.35s ease;
}

.project-card:hover .project-cover {
    transform: scale(1.06);
}

.project-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    border: 2px solid #000;
    background: rgba(255,255,255,0.78);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
}

.project-index {
    position: absolute;
    right: 12px;
    bottom: 12px;
    border: 2px solid #000;
    background: #111;
    color: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
}

.project-info {
    position: relative;
    z-index: 2;
    padding: 14px 4px 4px;
}

.project-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.project-title h3 {
    margin: 0;
    font-size: clamp(24px, 1.6vw, 34px);
    line-height: 1;
}

.project-dot {
    color: var(--accent);
    font-size: 26px;
    line-height: 1;
}

.project-subtitle {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
    min-height: 40px;
}

.project-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.project-tags span {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 999px;
    background: rgba(0,0,0,0.08);
    font-weight: 900;
}

.project-hover-line {
    position: relative;
    margin-top: 14px;
    height: 14px;
    overflow: hidden;
}

.project-hover-line::before {
    content: "CLICK TO OPEN • CLICK TO OPEN • CLICK TO OPEN • CLICK TO OPEN";
    position: absolute;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 900;
    color: rgba(0,0,0,0.5);
    animation: marquee 12s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 70px 24px;
    border: 2px solid #000;
    border-radius: 24px;
    background: rgba(255,255,255,0.7);
    box-shadow: var(--shadow);
}

.ending {
    padding-top: 10px;
    padding-bottom: 100px;
}

.ending-box {
    border: 2px solid #000;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.56));
    padding: 30px 24px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.ending-box::before {
    content: "";
    position: absolute;
    inset: auto auto 0 0;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(90,141,184,0.22), transparent 70%);
    transform: translate(-25%, 25%);
}

.ending-small {
    margin: 0 0 8px;
    letter-spacing: 0.18em;
    font-size: 13px;
}

.ending-box h2 {
    margin: 0 0 10px;
    font-size: clamp(32px, 3vw, 58px);
    line-height: 1;
}

.ending-box p {
    margin: 0 0 14px;
    max-width: 800px;
    color: var(--muted);
}

.ending-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-weight: 900;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(0,0,0,0.42);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

#modalBurstCanvas {
    z-index: 0;
}

.modal-panel {
    position: relative;
    z-index: 2;
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: 0.94fr 1.06fr;
    gap: 0;
    border: 2px solid #000;
    border-radius: 28px;
    overflow: hidden;
    background: rgba(245,245,245,0.92);
    box-shadow: 0 34px 90px rgba(0,0,0,0.25);
    transform: translateY(30px) scale(0.92) rotateX(10deg);
    transition: transform 0.34s cubic-bezier(.2,.8,.2,1);
}

.modal-overlay.show .modal-panel {
    transform: translateY(0) scale(1) rotateX(0);
}

.modal-close {
    position: absolute;
    right: 16px;
    top: 16px;
    z-index: 4;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 2px solid #000;
    background: #fff;
    cursor: pointer;
    font-size: 28px;
    font-weight: 900;
}

.modal-cover-wrap {
    position: relative;
    min-height: 100%;
    background:
            radial-gradient(circle at top right, rgba(185,154,232,0.25), transparent 36%),
            radial-gradient(circle at bottom left, rgba(90,141,184,0.28), transparent 36%),
            #cecece;
    border-right: 2px solid #000;
}

.modal-cover {
    width: 100%;
    height: 100%;
    min-height: 520px;
    object-fit: cover;
    image-rendering: pixelated;
}

.modal-cover-deco {
    position: absolute;
    left: 18px;
    bottom: 18px;
    padding: 10px 14px;
    border: 2px solid #000;
    border-radius: 999px;
    background: rgba(255,255,255,0.76);
    font-size: 12px;
    font-weight: 900;
}

.modal-content {
    padding: 64px 34px 34px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-topline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.modal-content h3 {
    margin: 0 0 10px;
    font-size: clamp(32px, 4vw, 64px);
    line-height: 0.94;
}

.modal-subtitle {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 16px;
    font-weight: 900;
}

.modal-desc {
    margin: 0 0 24px;
    font-size: 17px;
    color: #202020;
    max-width: 560px;
}

.modal-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.reveal {
    opacity: 0;
    transform: translateY(34px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.show {
    opacity: 1;
    transform: translateY(0);
}

.magnetic {
    transition: transform 0.18s ease;
}

@media (max-width: 1180px) {
    .hero,
    .control-panel,
    .modal-panel {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }

    .hero-visual {
        min-height: 420px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal-cover {
        min-height: 280px;
        max-height: 360px;
    }

    .modal-cover-wrap {
        border-right: 0;
        border-bottom: 2px solid #000;
    }
}

@media (max-width: 760px) {
    .topbar-inner {
        padding: 10px 14px;
        gap: 10px;
    }

    .nav {
        gap: 8px;
    }

    .nav a {
        font-size: 16px;
        padding: 4px 6px;
    }

    .hero,
    .control-panel,
    .gallery-wrap,
    .ending {
        padding-left: 14px;
        padding-right: 14px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .hero-stamp {
        position: static;
        margin-bottom: 14px;
        transform: rotate(-2deg);
    }

    .hero-floating-card {
        display: none;
    }

    .modal-overlay {
        padding: 12px;
    }

    .modal-content {
        padding: 56px 18px 20px;
    }

    .modal-close {
        right: 10px;
        top: 10px;
    }

    .cursor-glow {
        display: none;
    }
}