*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --black: #000000;
    --bg: #fafafa;
    --bg-card: #ffffff;
    --bg-dark: #0a0a0a;
    --border: rgba(0, 0, 0, 0.08);
    --border-dark: rgba(255, 255, 255, 0.08);
    --text: #171717;
    --text-secondary: #525252;
    --text-muted: #737373;
    --text-light: #fafafa;
    --text-light-muted: #a3a3a3;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --radius: 12px;
    --radius-lg: 16px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.hide-mobile {
    display: inline;
}

.overline {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}

.overline-light {
    color: rgba(255, 255, 255, 0.5);
}

/* ===== Header ===== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: all 0.3s var(--ease);
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-light);
    transition: color 0.3s var(--ease);
}

.header.scrolled .logo {
    color: var(--text);
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
}

.logo-text {
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 36px;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s var(--ease);
}

.header.scrolled .nav-links a {
    color: var(--text-muted);
}

.nav-links a:hover {
    color: white;
}

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

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 101;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: white;
    border-radius: 1px;
    transition: all 0.3s var(--ease);
}

.header.scrolled .menu-toggle span {
    background: var(--text);
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* ===== Hero ===== */

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
    padding: 80px 24px 60px;
}

.hero-noise {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    pointer-events: none;
}

.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 640px;
}

.hero-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    padding: 6px 20px;
    margin-bottom: 2.5rem;
    letter-spacing: 0.04em;
    opacity: 0;
    animation: fade-up 0.6s ease forwards 0.1s;
}

.hero-title {
    font-size: clamp(2.2rem, 5.5vw, 3.75rem);
    font-weight: 700;
    color: var(--text-light);
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.04em;
    opacity: 0;
    animation: fade-up 0.6s ease forwards 0.25s;
}

.hero-name {
    background: linear-gradient(135deg, #60a5fa, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.125rem;
    color: var(--text-light-muted);
    line-height: 1.8;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fade-up 0.6s ease forwards 0.4s;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    opacity: 0;
    animation: fade-up 0.6s ease forwards 0.55s;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s var(--ease);
    cursor: pointer;
    border: none;
    font-family: var(--font);
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--text-light);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: #e5e5e5;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    opacity: 0;
    animation: fade-up 0.6s ease forwards 0.8s;
}

.hero-scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
    animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
    0%, 100% { opacity: 1; transform: scaleY(1); }
    50% { opacity: 0.4; transform: scaleY(0.6); }
}

/* ===== Section Common ===== */

section {
    padding: 7rem 0;
}

.section-title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.2;
}

.section-title-light {
    color: var(--text-light);
}

/* ===== About ===== */

.about {
    background: var(--bg);
}

.about-header {
    text-align: center;
    margin-bottom: 2rem;
}

.about-body {
    max-width: 560px;
    margin: 0 auto 4rem;
    text-align: center;
}

.about-body p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.about-body p:last-child {
    margin-bottom: 0;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    transition: all 0.3s var(--ease);
}

.about-card:hover {
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

.about-card-num {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.about-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.about-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===== Work ===== */

.work {
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.work-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.work-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.work-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.work-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--bg-card);
    transition: all 0.2s var(--ease);
    gap: 1rem;
}

.work-item:hover {
    background: #f8f8f8;
}

.work-item:hover .work-item-arrow {
    transform: translateX(4px);
    color: var(--text);
}

.work-item-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.work-item-tag {
    display: inline-block;
    width: fit-content;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.work-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

.work-item p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.work-item-right {
    flex-shrink: 0;
}

.work-item-arrow {
    font-size: 1.25rem;
    color: var(--text-light-muted);
    transition: all 0.2s var(--ease);
}

/* ===== Contact ===== */

.contact {
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.contact-inner {
    text-align: center;
    padding: 2rem 0;
}

.contact-desc {
    font-size: 1.05rem;
    color: var(--text-light-muted);
    margin-top: 0.75rem;
    margin-bottom: 2.5rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s var(--ease);
    cursor: pointer;
}

.contact-link:hover {
    color: white;
}

.contact-link i {
    font-size: 1.1rem;
}

/* ===== Modal ===== */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    z-index: 1;
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    max-width: 340px;
    width: 90%;
    animation: modal-in 0.25s ease;
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-light-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s var(--ease);
    line-height: 1;
    font-family: var(--font);
}

.modal-close:hover {
    color: white;
}

.modal-content h3 {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.modal-qr {
    background: white;
    padding: 12px;
    border-radius: var(--radius);
    display: inline-block;
}

.modal-qr img {
    width: 180px;
    height: auto;
    border-radius: 8px;
}

.modal-id {
    margin-top: 0.75rem;
    color: var(--text-light-muted);
    font-size: 0.85rem;
}

/* ===== Footer ===== */

.footer {
    background: var(--bg-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-light-muted);
    text-align: center;
    padding: 1.25rem 24px;
    font-size: 0.8rem;
}

.icp-link {
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.2s var(--ease);
}

.icp-link:hover {
    color: rgba(255, 255, 255, 0.6);
}

/* ===== Scroll Reveal ===== */

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

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

/* ===== Responsive ===== */

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-card);
        flex-direction: column;
        padding: 80px 32px 32px;
        gap: 24px;
        transition: right 0.3s var(--ease);
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
        z-index: 99;
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links a {
        color: var(--text) !important;
        font-size: 1rem;
    }

    .menu-toggle {
        display: flex;
    }

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

    .about-card {
        padding: 1.5rem;
    }

    .work-item {
        padding: 1.25rem 1.5rem;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
        gap: 1.25rem;
    }

    section {
        padding: 5rem 0;
    }

    .hero-scroll {
        display: none;
    }

    .hide-mobile {
        display: none;
    }

    .hero-badge {
        margin-bottom: 2rem;
    }

    .hero-desc {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 260px;
        margin: 0 auto;
    }

    .btn {
        width: 100%;
    }

    .work-item-right {
        display: none;
    }
}