/* ========================================
   CSS Variables
======================================== */
:root {
    --red:     #CC0000;
    --gray:    #AAAAAA;
    --light:   #CCCCCC;
    --dark:    #1A1A1A;
    --mid:     #555555;
    --bg:      #FFFFFF;
    --bg-soft: #F8F8F8;
    --border:  #EBEBEB;

    --sans:    'DM Sans', 'Noto Sans SC', system-ui, sans-serif;
    --serif:   'DM Serif Display', 'Noto Serif SC', Georgia, serif;
    --serif-cn:'Noto Serif SC', serif;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================
   Reset & Base
======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--bg);
    color: var(--dark);
    font-family: var(--sans);
    font-weight: 300;
    line-height: 1.7;
    overflow-x: hidden;
    cursor: none;
}

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

/* ========================================
   Custom Cursor
======================================== */
.cursor {
    position: fixed;
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--dark);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.15s var(--ease-out), opacity 0.3s, border-color 0.3s;
    will-change: transform;
}

.cursor-dot {
    position: fixed;
    width: 5px;
    height: 5px;
    background: var(--red);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.05s;
}

.cursor.hover {
    transform: translate(-50%, -50%) scale(1.6);
    border-color: var(--red);
}

/* ========================================
   Navigation
======================================== */
.nav {
    position: fixed;
    top: 36px;
    left: 44px;
    z-index: 100;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
}

.nav-logo {
    display: block;
    opacity: 0.85;
    transition: opacity 0.3s;
    flex-shrink: 0;
}

.nav-logo:hover { opacity: 1; }


.nav-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 4px;
}

.nav-row {
    display: flex;
    gap: 20px;
}

.nav-link {
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--gray);
    letter-spacing: 0.02em;
    transition: color 0.25s;
    position: relative;
}

.nav-link sup {
    font-size: 0.6em;
    vertical-align: super;
    margin-right: 1px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--dark);
    transition: width 0.3s var(--ease-out);
}

.nav-link:hover { color: var(--dark); }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--dark); }

/* ========================================
   Hero Section
======================================== */
.hero {
    height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    padding: 120px 0 0 44px;
    max-width: 1300px;
    margin: 0 auto;
    gap: 0;
    overflow: hidden;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.greeting,
.intro {
    font-family: var(--serif);
    font-weight: 400;
    font-style: italic;
    color: var(--light);
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.greeting { font-size: clamp(3rem, 6vw, 5.5rem); }
.intro    { font-size: clamp(2.6rem, 5.5vw, 5rem); margin-bottom: 0.05em; }

.name {
    font-family: var(--serif-cn);
    font-weight: 900;
    font-size: clamp(3.4rem, 6.5vw, 6rem);
    color: var(--red);
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin-bottom: 0.6em;
}

.x-mark {
    font-family: var(--sans);
    font-weight: 300;
    font-size: 0.75em;
    color: var(--red);
    opacity: 0.7;
    margin: 0 0.05em;
}

.period { color: var(--red); }

.tagline {
    font-family: var(--sans);
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--mid);
    line-height: 1.75;
    max-width: 380px;
}

.tagline em {
    font-style: italic;
    color: var(--dark);
    font-weight: 400;
}

.hero-meta {
    margin-top: 1.6em;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 300;
    color: var(--gray);
    letter-spacing: 0.02em;
}

.meta-sep {
    color: var(--light);
}

.tagline-cn {
    margin-top: 0.6em;
    font-family: var(--serif-cn);
    font-size: 0.85rem;
    color: var(--gray);
    font-weight: 300;
}

/* Hero illustration */
.hero-illustration {
    overflow: hidden;
    display: block;
    height: 100%;
}

.character-svg {
    width: 100%;
    height: 120%;
    object-fit: cover;
    object-position: center top;
    display: block;
    opacity: 0;
    animation: fadeUp 1.2s 0.4s var(--ease-out) forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========================================
   Rita Nails 卡片 — 左文右图
======================================== */
.portfolio-card.rita-card {
    display: grid !important;
    flex-direction: unset !important;
    grid-template-columns: 1fr 1fr;
    grid-column: 1 / -1;
    gap: 60px;
    align-items: center;
    padding: 48px;
}

.rita-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rita-right {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

/* ========================================
   Carousel
======================================== */
.carousel {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background: transparent;
    width: 240px;
    cursor: default;
    box-shadow: 0 24px 60px rgba(0,0,0,0.2);
}

.carousel-track {
    display: flex;
    align-items: flex-start;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel-track img {
    /* width set by JS */
    height: auto;
    display: block;
    pointer-events: none;
}

.carousel-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--border);
    color: var(--gray);
    font-size: 1.4rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s;
    line-height: 1;
    padding-bottom: 2px;
}

.carousel-btn:hover { border-color: var(--dark); color: var(--dark); }

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transition: background 0.3s;
}

.dot.active { background: #fff; }

/* MacBook 显示屏样式轮播 */
.carousel.carousel-mac {
    width: 460px;
    border-radius: 10px;
    background: #000;
    border: 12px solid #1d1d1f;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 28px 60px rgba(0,0,0,0.3);
}

.carousel.carousel-mac .carousel-track img {
    height: 288px;
    object-fit: contain;
    background: #000;
}

/* ========================================
   Scroll Reveal
======================================== */
[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Sections (shared)
======================================== */
.section {
    padding: 100px 44px;
    border-top: 1px solid var(--border);
}

.section-inner {
    max-width: 1080px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 60px;
}

.section-num {
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--light);
    letter-spacing: 0.1em;
}

.section-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.4rem, 4vw, 3.5rem);
    color: var(--dark);
    letter-spacing: -0.02em;
    line-height: 1;
}

.red-dot { color: var(--red); }

/* ========================================
   About Section
======================================== */
.about-layout {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 80px;
    align-items: start;
}

.about-block {
    margin-bottom: 48px;
}

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

.about-block h3 {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 16px;
}

.slash { color: var(--light); }

.about-block p {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--mid);
    margin-bottom: 0.6em;
}

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

.about-block strong {
    font-weight: 500;
    color: var(--dark);
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 32px;
}

.skill-item {
    font-size: 0.9rem;
    color: var(--mid);
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-bullet {
    color: var(--red);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Decorative ring */
.about-deco {
    width: 240px;
    height: 240px;
    flex-shrink: 0;
    position: relative;
}

.deco-ring {
    width: 100%;
    height: 100%;
    border: 1.5px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: spin 30s linear infinite;
}

.deco-ring::before {
    content: '';
    position: absolute;
    inset: 20px;
    border: 1.5px dashed var(--border);
    border-radius: 50%;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.deco-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    animation: spinReverse 30s linear infinite;
}

@keyframes spinReverse {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}

.deco-label {
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--gray);
    letter-spacing: 0.1em;
}

.deco-cross {
    font-size: 0.6rem;
    color: var(--red);
}

/* ========================================
   Portfolio Section
======================================== */
.portfolio-section { background: var(--bg-soft); }

.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.portfolio-card {
    background: var(--bg);
    padding: 40px 36px;
    border: 1px solid var(--border);
    cursor: none;
    transition: background 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.portfolio-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--red);
    transition: width 0.4s var(--ease-out);
}

.portfolio-card:hover::before { width: 100%; }
.portfolio-card:hover { background: var(--bg); border-color: #ddd; }

.portfolio-card.featured {
    background: var(--dark);
}

.portfolio-card.featured .card-num,
.portfolio-card.featured .card-title,
.portfolio-card.featured .card-year {
    color: rgba(255,255,255,0.9);
}

.portfolio-card.featured .card-tag {
    background: var(--red);
    color: white;
    border-color: var(--red);
}

.portfolio-card.featured .card-desc { color: rgba(255,255,255,0.5); }
.portfolio-card.featured .card-arrow { color: rgba(255,255,255,0.7); }
.portfolio-card.featured::before { background: white; }

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-num {
    font-family: var(--sans);
    font-size: 0.72rem;
    color: var(--light);
    letter-spacing: 0.1em;
    font-weight: 300;
}

.card-tag {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 20px;
}

.card-title {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--dark);
    line-height: 1.2;
    letter-spacing: -0.01em;
    flex: 1;
}

.card-desc {
    font-size: 0.875rem;
    color: var(--gray);
    line-height: 1.75;
    flex: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.card-year {
    font-size: 0.75rem;
    color: var(--light);
}

.card-arrow {
    font-size: 1rem;
    color: var(--gray);
    transition: transform 0.3s, color 0.3s;
}

.portfolio-card:hover .card-arrow {
    transform: translate(4px, -4px);
    color: var(--red);
}

/* ========================================
   Contact Section
======================================== */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.contact-intro p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--mid);
    margin-bottom: 0.8em;
}

.contact-intro .cn {
    font-family: var(--serif-cn);
    font-size: 0.9rem;
    color: var(--gray);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    transition: padding-left 0.3s var(--ease-out);
}

.contact-item:first-child { border-top: 1px solid var(--border); }

.contact-item:hover { padding-left: 12px; }

.contact-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--light);
}

.contact-value {
    font-size: 0.95rem;
    color: var(--dark);
    transition: color 0.25s;
}

.contact-item:hover .contact-value { color: var(--red); }

.link-arrow {
    display: inline-block;
    font-size: 0.8em;
    transition: transform 0.25s;
}

.contact-item:hover .link-arrow { transform: translate(3px, -3px); }

/* ========================================
   Footer
======================================== */
.footer {
    padding: 40px 44px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    font-size: 0.78rem;
    color: var(--light);
    font-weight: 300;
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 900px) {
    .nav { top: 24px; left: 24px; }

    .hero {
        grid-template-columns: 1fr;
        padding: 100px 24px 60px;
        min-height: auto;
        gap: 40px;
    }

    .hero-illustration {
        height: 50vw;
        max-height: 380px;
        justify-content: center;
        order: -1;
    }

    .section { padding: 70px 24px; }

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

    .about-deco { display: none; }

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

    .portfolio-card.rita-card {
        grid-template-columns: 1fr !important;
        padding: 32px 24px;
        gap: 24px;
        overflow: hidden;
    }

    .rita-left {
        min-width: 0;
        width: 100%;
    }

    .rita-left .card-desc {
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: normal;
    }

    .rita-right {
        justify-content: center;
        width: 100%;
    }

    .carousel {
        width: 200px;
    }

    .carousel.carousel-mac {
        width: calc(100vw - 120px);
        max-width: 320px;
    }

    .carousel.carousel-mac .carousel-track img {
        height: 180px;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 32px 24px;
    }
}

@media (max-width: 600px) {
    .nav { gap: 14px; }
    .greeting { font-size: 2.6rem; }
    .intro    { font-size: 2.3rem; }
    .name     { font-size: 3rem; }

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