/* 
 * Theme: Morandi / Milk Tea / High-end Minimalist
 * Author: Antigravity
 */

:root {
    /* Morandi Palette */
    --bg-color: #FDFBF7;
    /* Creamy White */
    --text-primary: #5E5048;
    /* Warm Dark Grey/Brown */
    --text-secondary: #8C8279;
    /* Muted Brown */
    --accent-color: #D4C4B7;
    /* Milk Tea */
    --accent-dark: #B09F92;
    /* Darker Milk Tea */
    --highlight: #C6D1C5;
    /* Sage Green (Subtle) */
    --soft-pink: #E8Dddb;
    /* Dusty Pink */

    /* Spacing */
    --container-width: 1200px;
    --section-padding: 100px 0;

    /* Fonts */
    --font-serif: 'Playfair Display', 'Noto Serif TC', serif;
    --font-sans: 'Noto Sans TC', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
    cursor: none;
    /* Custom cursor */
    background-image: radial-gradient(#D4C4B7 1px, transparent 1px);
    background-size: 40px 40px;
    /* Subtle dot pattern */
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--text-primary);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid var(--text-primary);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

body:hover .cursor-outline {
    opacity: 1;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--text-primary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(253, 251, 247, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: padding 0.3s ease;
}

.navbar.scrolled {
    padding: 15px 50px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--text-primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10%;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--soft-pink) 0%, transparent 70%);
    opacity: 0.3;
    z-index: -1;
    filter: blur(50px);
}

.hero-content {
    flex: 1;
    z-index: 2;
}

.subtitle {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.title {
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 10px;
}

.chinese-name {
    font-size: 2.5rem;
    margin-bottom: 30px;
    font-weight: 400;
}

.intro-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 500px;
}

.btn-primary {
    display: inline-block;
    padding: 15px 40px;
    border: 1px solid var(--text-primary);
    border-radius: 30px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--text-primary);
    color: var(--bg-color);
    transform: translateY(-3px);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    position: relative;
}

.image-frame {
    width: 400px;
    height: 550px;
    overflow: visible;
    /* Changed to visible to allow pseudo-elements outside */
    position: relative;
    z-index: 1;
}

.image-frame::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--soft-pink);
    border-radius: 200px 200px 0 0;
    z-index: -1;
    transition: transform 0.5s ease;
}

.image-frame::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 150px;
    height: 150px;
    background-color: var(--highlight);
    border-radius: 50%;
    opacity: 0.5;
    z-index: -2;
    filter: blur(20px);
}

.image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 200px 200px 0 0;
    /* Apply radius to image directly */
    transition: transform 1.5s ease;
    display: block;
}

.hero:hover .image-frame::before {
    transform: translate(10px, 10px);
}

.hero:hover .image-frame img {
    transform: scale(1.05);
}

/* Sections General */
.section {
    padding: var(--section-padding);
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-header.left-align {
    text-align: left;
    margin-bottom: 40px;
}

.section-subtitle {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-dark);
    margin-bottom: 10px;
}

.section-title {
    font-size: 2.5rem;
}

/* About Section */
.about {
    position: relative;
}

.about::after {
    content: '';
    position: absolute;
    bottom: 50px;
    right: -50px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--highlight) 0%, transparent 70%);
    opacity: 0.3;
    z-index: -1;
    filter: blur(40px);
}

.about-content {
    display: flex;
    align-items: center;
    gap: 80px;
}

.about-text {
    flex: 1;
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.about-text p {
    margin-bottom: 20px;
    text-align: justify;
}

.about-image {
    flex: 1;
    position: relative;
}

.about-image img {
    width: 100%;
    border-radius: 20px;
    /* Softer corners */
    box-shadow: 20px 20px 0 var(--soft-pink);
}

/* Skills Section */
.skills {
    background-color: rgba(248, 246, 242, 0.8);
    /* Transparent for texture */
}

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

.skill-card {
    background: #fff;
    padding: 40px;
    border-radius: 30px;
    /* Softer corners */
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.skill-card .icon {
    font-size: 2.5rem;
    color: var(--accent-dark);
    margin-bottom: 20px;
}

.skill-card h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.skill-card ul li {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Works Section */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 60px;
}

.work-item {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease;
}

.work-item:hover {
    transform: translateY(-5px);
}

.work-media {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.work-media iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.work-info {
    padding: 30px;
}

.work-info h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.work-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.tags span {
    display: inline-block;
    font-size: 0.8rem;
    padding: 5px 15px;
    background-color: var(--soft-pink);
    color: var(--text-primary);
    border-radius: 20px;
    margin-right: 10px;
    margin-bottom: 5px;
}

/* Photography Section */
.photography {
    background-color: #fff;
}

.photo-category {
    display: flex;
    gap: 60px;
    margin-bottom: 100px;
    align-items: center;
}

.photo-category.reverse {
    flex-direction: row-reverse;
}

.photo-text {
    flex: 1;
}

.photo-text h3 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.photo-text .sub-title {
    font-size: 1rem;
    color: var(--accent-dark);
    margin-bottom: 20px;
    font-weight: 500;
}

.feature-box {
    margin-top: 30px;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 15px;
    border-left: 3px solid var(--accent-color);
}

.feature-box h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.feature-box p {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.photo-carousel {
    flex: 1.5;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    aspect-ratio: 4/3;
    /* Standard photo aspect ratio */
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    /* For overlay positioning */
    cursor: pointer;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hover Overlay */
.carousel-slide::after {
    content: '點擊查看完整圖片';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    font-family: var(--font-serif);
    opacity: 0;
    transition: opacity 0.3s ease;
    letter-spacing: 2px;
}

.carousel-slide:hover::after {
    opacity: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 10;
    /* Ensure above overlay */
}

.photo-carousel:hover .carousel-btn {
    opacity: 1;
}

.carousel-btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: 20px;
}

.carousel-btn.next {
    right: 20px;
}

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

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.dot.active {
    background: #fff;
    transform: scale(1.2);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 5px;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Experience & Education */
.row {
    display: flex;
    gap: 60px;
}

.col-half {
    flex: 1;
}

.timeline {
    position: relative;
    padding-left: 30px;
    border-left: 1px solid var(--accent-color);
}

.timeline li {
    margin-bottom: 40px;
    position: relative;
}

.timeline li::before {
    content: '';
    position: absolute;
    left: -35px;
    top: 5px;
    width: 10px;
    height: 10px;
    background-color: var(--accent-dark);
    border-radius: 50%;
    border: 3px solid var(--bg-color);
}

.timeline .date {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--accent-dark);
    margin-bottom: 5px;
    font-weight: 500;
}

.timeline h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.timeline p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.timeline .sub-detail {
    font-size: 0.85rem;
    margin-top: 5px;
    color: #999;
}

.job-duties {
    margin-top: 10px;
    list-style: none;
    padding-left: 0;
}

.job-duties li {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background-color: var(--text-primary);
    color: var(--bg-color);
    padding: 80px 0 40px;
    text-align: center;
}

.footer-title {
    font-size: 3rem;
    color: var(--bg-color);
    margin-bottom: 20px;
}

.footer-text {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
}

.contact-info {
    margin-bottom: 40px;
    font-size: 1.2rem;
}

.contact-link {
    color: var(--bg-color);
    margin: 0 10px;
}

.separator {
    color: rgba(255, 255, 255, 0.3);
}

.social-links {
    margin-bottom: 40px;
}

.social-icon {
    font-size: 1.5rem;
    color: var(--bg-color);
    margin: 0 15px;
    transition: transform 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.2);
}

.copyright {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 1s ease, transform 1s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

/* Responsive */
@media (max-width: 992px) {
    .hero {
        flex-direction: column-reverse;
        justify-content: center;
        text-align: center;
        padding-top: 100px;
    }

    .hero-image {
        justify-content: center;
        margin-bottom: 50px;
    }

    .image-frame {
        width: 300px;
        height: 400px;
    }

    .about-content {
        flex-direction: column;
    }

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

    .row {
        flex-direction: column;
    }

    .photo-category {
        flex-direction: column;
    }

    .photo-category.reverse {
        flex-direction: column;
    }

    .photo-carousel {
        width: 100%;
        aspect-ratio: 16/9;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 20px;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: rgba(253, 251, 247, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.05);
        z-index: 999;
    }

    .nav-links.active {
        right: 0;
        display: flex;
    }

    .nav-links li {
        margin: 20px 0;
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.4s ease;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateX(0);
    }

    .hamburger {
        display: block;
        z-index: 1000;
    }

    .hamburger span {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        background-color: var(--text-primary);
        transition: all 0.3s ease-in-out;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .title {
        font-size: 3rem;
    }

    .chinese-name {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .contact-info {
        font-size: 1rem;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .separator {
        display: none;
    }

    /* Photography Mobile Logic Rewrite */
    .photo-category,
    .photo-category.reverse {
        flex-direction: column;
        gap: 30px;
    }

    .photo-carousel {
        aspect-ratio: auto;
        height: auto;
        box-shadow: none;
        overflow: visible;
    }

    .carousel-track {
        flex-direction: column;
        gap: 20px;
        transform: none !important;
        /* Disable JS transform */
        height: auto;
    }

    .carousel-slide {
        width: 100%;
        height: auto;
        aspect-ratio: 4/3;
        border-radius: 15px;
        overflow: hidden;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    }

    .carousel-btn,
    .carousel-dots {
        display: none !important;
    }

    /* Disable Custom Cursor on Mobile */
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }

    body {
        cursor: auto;
    }
}