* {
    box-sizing: border-box;
}

:root {
    --primary: #7c5cff;
    --bg: #0b1020;
    --bg-soft: #11182e;
    --text: #f7f8ff;
    --muted: #a8b0c8;
    --card: rgba(255, 255, 255, .08);
    --border: rgba(255, 255, 255, .18);
    --shadow: 0 30px 80px rgba(0, 0, 0, .35);
}

body.light {
    --bg: #eef3ff;
    --bg-soft: #ffffff;
    --text: #172033;
    --muted: #5d6a85;
    --card: rgba(255, 255, 255, .62);
    --border: rgba(80, 100, 160, .16);
    --shadow: 0 30px 80px rgba(80, 100, 160, .18);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 20% 10%, rgba(124, 92, 255, .32), transparent 32%),
        radial-gradient(circle at 80% 20%, rgba(0, 224, 255, .18), transparent 28%),
        linear-gradient(135deg, var(--bg), var(--bg-soft));
    color: var(--text);
    overflow-x: hidden;
}

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

button,
input,
textarea {
    font: inherit;
}

button,
.button-link,
.hero-actions a,
.project-card a {
    border: none;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #00d4ff);
    padding: 12px 18px;
    border-radius: 999px;
    box-shadow: 0 14px 35px rgba(124, 92, 255, .35);
    transition: .25s ease;
    display: inline-block;
}

button:hover,
.button-link:hover,
.hero-actions a:hover,
.project-card a:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    color: var(--text);
    background: rgba(255, 255, 255, .06);
    border-radius: 18px;
    padding: 14px 16px;
    outline: none;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 92, 255, .15);
}

.glass {
    background: var(--card);
    border: 1px solid var(--border);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    box-shadow: var(--shadow);
}

.bg-orb {
    position: fixed;
    width: 360px;
    height: 360px;
    border-radius: 999px;
    filter: blur(30px);
    opacity: .4;
    z-index: -1;
    animation: float 8s ease-in-out infinite;
}

.orb-a {
    top: 10%;
    left: -120px;
    background: var(--primary);
}

.orb-b {
    right: -100px;
    top: 30%;
    background: #00e0ff;
    animation-delay: -2s;
}

.orb-c {
    left: 40%;
    bottom: -160px;
    background: #ff4ecd;
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(24px, -32px, 0);
    }
}

.nav {
    position: sticky;
    top: 18px;
    z-index: 20;
    width: min(1180px, calc(100% - 32px));
    margin: 18px auto;
    padding: 14px 18px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 25px var(--primary);
}

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

.nav nav a {
    color: var(--muted);
}

.nav nav a:hover {
    color: var(--text);
}

.nav button {
    padding: 9px 14px;
}

.hero {
    width: min(1180px, calc(100% - 32px));
    margin: 80px auto 40px;
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 28px;
    align-items: stretch;
}

.hero-content,
.profile-card {
    border-radius: 36px;
    padding: 48px;
}

.eyebrow {
    color: var(--primary);
    letter-spacing: .16em;
    font-size: 13px;
    text-transform: uppercase;
}

.hero h1 {
    margin: 10px 0;
    font-size: clamp(42px, 7vw, 86px);
    line-height: 1;
    letter-spacing: -0.06em;
}

.hero-desc {
    max-width: 720px;
    font-size: 18px;
    color: var(--muted);
    line-height: 1.9;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 32px;
}

.hero-actions .ghost {
    background: rgba(255, 255, 255, .1);
    color: var(--text);
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.profile-card img,
.avatar-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 36px;
    object-fit: cover;
    margin-bottom: 22px;
}

.avatar-placeholder {
    background: linear-gradient(135deg, var(--primary), #00d4ff);
    display: grid;
    place-items: center;
    font-size: 64px;
    color: #fff;
    font-weight: 900;
}

.profile-card p {
    color: var(--muted);
}

.section {
    width: min(1180px, calc(100% - 32px));
    margin: 100px auto;
}

.section-title {
    margin-bottom: 24px;
}

.section-title p {
    color: var(--primary);
    letter-spacing: .2em;
    font-size: 12px;
}

.section-title h2 {
    margin: 0;
    font-size: clamp(30px, 5vw, 52px);
    letter-spacing: -0.04em;
}

.content-card {
    border-radius: 32px;
    padding: 32px;
    line-height: 2;
    color: var(--muted);
    font-size: 17px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.project-card {
    border-radius: 32px;
    padding: 18px;
    overflow: hidden;
    transition: .3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
}

.project-card img,
.project-cover {
    width: 100%;
    height: 220px;
    border-radius: 24px;
    object-fit: cover;
    margin-bottom: 18px;
}

.project-cover {
    background:
        linear-gradient(135deg, rgba(124, 92, 255, .85), rgba(0, 212, 255, .65)),
        repeating-linear-gradient(45deg, transparent 0 10px, rgba(255, 255, 255, .08) 10px 11px);
    display: grid;
    place-items: center;
    color: #fff;
    letter-spacing: .3em;
}

.project-card h3 {
    font-size: 24px;
    margin: 10px 0;
}

.project-card p {
    color: var(--muted);
    line-height: 1.8;
}

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

.contact-card {
    border-radius: 28px;
    padding: 28px;
}

.contact-card span {
    color: var(--muted);
    display: block;
    margin-bottom: 10px;
}

.contact-card strong {
    word-break: break-all;
}

.message-layout {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 24px;
}

.message-form,
.message-item {
    border-radius: 28px;
    padding: 24px;
}

.message-form {
    display: grid;
    gap: 14px;
}

.message-list {
    display: grid;
    gap: 16px;
}

.message-item p {
    color: var(--muted);
    line-height: 1.8;
}

.message-item small {
    color: var(--muted);
}

.hidden-field {
    display: none;
}

footer {
    width: min(1180px, calc(100% - 32px));
    margin: 80px auto 40px;
    text-align: center;
    color: var(--muted);
}

footer a {
    color: var(--primary);
}

.cursor-dot,
.cursor-ring {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
}

.cursor-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--primary);
}

.cursor-ring {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--primary);
    transition: width .2s, height .2s, opacity .2s;
    opacity: .7;
}

.context-menu {
    position: fixed;
    z-index: 9998;
    display: none;
    min-width: 170px;
    padding: 10px;
    border-radius: 18px;
}

.context-menu button {
    width: 100%;
    margin: 4px 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    box-shadow: none;
    color: var(--text);
    text-align: left;
}

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: .8s cubic-bezier(.2, .8, .2, 1);
}

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

/* Admin */
.admin-body {
    padding: 24px;
}

.login-card {
    width: min(420px, calc(100% - 32px));
    margin: 10vh auto;
    padding: 32px;
    border-radius: 32px;
}

.login-card form {
    display: grid;
    gap: 14px;
}

.alert {
    background: rgba(255, 76, 110, .15);
    color: #ff8fa3;
    padding: 12px;
    border-radius: 14px;
    margin: 14px 0;
}

.back-link {
    color: var(--muted);
    display: inline-block;
    margin-top: 18px;
}

.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
}

.admin-sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
    border-radius: 28px;
    padding: 24px;
    display: grid;
    gap: 12px;
}

.admin-sidebar a {
    color: var(--muted);
    padding: 10px 12px;
    border-radius: 14px;
}

.admin-sidebar a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .08);
}

.admin-main {
    display: grid;
    gap: 24px;
}

.panel {
    border-radius: 28px;
    padding: 28px;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.grid-form label span {
    color: var(--muted);
    display: block;
    margin-bottom: 8px;
}

.grid-form textarea,
.grid-form button {
    grid-column: 1 / -1;
}

.admin-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.admin-item {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    background: rgba(255, 255, 255, .05);
}

.admin-item span,
.admin-item small {
    color: var(--muted);
    display: block;
    margin: 6px 0;
}

.admin-item a {
    color: var(--primary);
    margin-right: 12px;
}

@media (max-width: 860px) {
    .nav {
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }

    .nav nav {
        flex-wrap: wrap;
    }

    .hero,
    .project-grid,
    .contact-grid,
    .message-layout,
    .admin-layout,
    .grid-form {
        grid-template-columns: 1fr;
    }

    .hero-content,
    .profile-card {
        padding: 32px;
    }

    .admin-sidebar {
        position: static;
    }
}
