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

:root {
    --primary: #2c2c2c;
    --accent: #b8977e;
    --bg: #fafaf8;
    --bg-alt: #f0eeeb;
    --text: #333333;
    --text-light: #777777;
    --white: #ffffff;
    --shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    animation: pageLoad 0.6s ease;
}

@keyframes pageLoad {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-center {
    text-align: center;
}

/* ========== Buttons ========== */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: #444;
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-full {
    width: 100%;
}

/* ========== Navbar ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.9rem;
    color: var(--text-light);
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-links a.active::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

/* ========== Hero ========== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url("https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?w=1600&h=900&fit=crop") center/cover no-repeat;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    background-size: cover;
    background-position: center;
    animation: heroZoom 20s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes heroZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.5) 100%
    );
    z-index: 1;
}

/* ========== Hero Bubbles ========== */
.hero-bubbles {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.15), rgba(255,255,255,0.03));
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(2px);
}

.bubble-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: -10%;
    animation: floatBubble1 12s ease-in-out infinite, fadeInBubble 1.5s ease 0.2s both;
}

.bubble-2 {
    width: 180px;
    height: 180px;
    top: 60%;
    left: 5%;
    animation: floatBubble2 10s ease-in-out infinite, fadeInBubble 1.5s ease 0.5s both;
}

.bubble-3 {
    width: 120px;
    height: 120px;
    top: 20%;
    right: 8%;
    animation: floatBubble3 14s ease-in-out infinite, fadeInBubble 1.5s ease 0.8s both;
}

.bubble-4 {
    width: 220px;
    height: 220px;
    bottom: 15%;
    right: 15%;
    animation: floatBubble4 11s ease-in-out infinite, fadeInBubble 1.5s ease 1.1s both;
}

.bubble-5 {
    width: 90px;
    height: 90px;
    top: 45%;
    left: 20%;
    animation: floatBubble5 13s ease-in-out infinite, fadeInBubble 1.5s ease 1.4s both;
}

@keyframes fadeInBubble {
    from {
        opacity: 0;
        transform: scale(0.3) translateY(100px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes floatBubble1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(80px, -40px) scale(1.05); }
    50% { transform: translate(120px, 30px) scale(0.95); }
    75% { transform: translate(50px, -20px) scale(1.02); }
}

@keyframes floatBubble2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, -50px) scale(1.08); }
    66% { transform: translate(-30px, 20px) scale(0.96); }
}

@keyframes floatBubble3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-40px, 50px) scale(1.04); }
    50% { transform: translate(-80px, -20px) scale(0.97); }
    75% { transform: translate(-20px, 30px) scale(1.02); }
}

@keyframes floatBubble4 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-60px, -40px) scale(1.06); }
}

@keyframes floatBubble5 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -60px) scale(1.1); }
    66% { transform: translate(-20px, -30px) scale(0.94); }
}

/* ========== Hero Content ========== */
.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: var(--white);
    padding: 0 1.5rem;
}

.hero-badge {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 4px;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 0.4rem 1.5rem;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeSlideUp 1s ease 0.5s forwards;
}

.hero-title {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.hero-line {
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 200;
    letter-spacing: 0.3rem;
    display: inline-block;
    opacity: 0;
    animation: bubbleAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.hero-line-1 { animation-delay: 0.8s; }
.hero-line-2 { animation-delay: 1.0s; }
.hero-line-3 { animation-delay: 1.2s; }
.hero-line-4 { animation-delay: 1.4s; }

@keyframes bubbleAppear {
    0% {
        opacity: 0;
        transform: scale(0.2) translateY(80px);
        filter: blur(10px);
    }
    60% {
        transform: scale(1.15) translateY(-10px);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

.hero-divider {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    margin: 0 auto 1.5rem;
    animation: expandWidth 1s ease 1.8s forwards;
}

@keyframes expandWidth {
    to { width: 200px; }
}

.hero-slogan {
    font-size: clamp(0.95rem, 2vw, 1.2rem);
    opacity: 0;
    letter-spacing: 2px;
    font-weight: 300;
    margin-bottom: 2.5rem;
    animation: fadeSlideUp 1s ease 2s forwards;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

.btn-hero {
    display: inline-block;
    padding: 1rem 2.5rem;
    border: 1px solid rgba(255,255,255,0.5);
    color: var(--white);
    font-size: 0.95rem;
    letter-spacing: 2px;
    transition: all 0.4s ease;
    opacity: 0;
    animation: fadeSlideUp 1s ease 2.3s forwards;
    text-decoration: none;
}

.btn-hero:hover {
    background: var(--white);
    color: var(--primary);
    border-color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* ========== Sections ========== */
.section {
    padding: 5rem 0;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 300;
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: 2px;
}

/* ========== Page Header ========== */
.page-header {
    padding: 8rem 1.5rem 4rem;
    text-align: center;
    background: var(--bg-alt);
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 3px;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-light);
    font-weight: 300;
}

/* ========== Intro ========== */
.intro-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.05rem;
    color: var(--text-light);
    line-height: 2;
}

/* ========== Services ========== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}

.service-card {
    padding: 2.5rem 2rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1.2rem;
}

.service-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.service-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ========== Featured Grid ========== */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.featured-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

.featured-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
    animation: kenBurns 12s ease-in-out infinite alternate;
}

.featured-item:nth-child(2) img {
    animation-delay: -4s;
}

.featured-item:nth-child(3) img {
    animation-delay: -8s;
    animation-duration: 14s;
}

.featured-item:hover img {
    animation-play-state: paused;
    transform: scale(1.1);
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: var(--white);
}

.featured-overlay h3 {
    font-size: 1.1rem;
    font-weight: 500;
}

.featured-overlay p {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ========== CTA ========== */
.cta {
    background: var(--primary);
    color: var(--white);
}

.cta h2 {
    font-size: 1.8rem;
    font-weight: 300;
    margin-bottom: 1rem;
}

.cta p {
    opacity: 0.8;
    margin-bottom: 2rem;
}

.cta .btn-primary {
    background: var(--accent);
}

.cta .btn-primary:hover {
    background: #c9a88e;
}

/* ========== Portfolio ========== */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 1px solid #ddd;
    background: transparent;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    font-family: inherit;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

.portfolio-item.hidden {
    display: none;
}

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

.portfolio-item img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-info {
    padding: 1.5rem;
}

.portfolio-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.portfolio-info p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.btn-view {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    transition: var(--transition);
}

.portfolio-item:hover .btn-view {
    letter-spacing: 1px;
}

/* ========== Modal ========== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
}

.modal-content img {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.modal-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

.modal-content p {
    color: var(--text-light);
    line-height: 1.8;
}

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

.modal-close:hover {
    color: var(--primary);
}

/* ========== About ========== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: start;
}

.about-image img {
    border-radius: var(--radius);
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
}

.about-text h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.about-text p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.9;
}

.stats {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 300;
    color: var(--accent);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ========== Timeline ========== */
.timeline {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #ddd;
}

.timeline-item {
    position: relative;
    padding-bottom: 2.5rem;
}

.timeline-dot {
    position: absolute;
    left: -30px;
    top: 4px;
    width: 13px;
    height: 13px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.timeline-year {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
}

.timeline-content h3 {
    font-size: 1.05rem;
    margin: 0.3rem 0 0.5rem;
}

.timeline-content p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ========== Blog ========== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.blog-card {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.blog-card:hover {
    transform: translateY(-5px);
}

.blog-card-image {
    position: relative;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--accent);
    color: var(--white);
    padding: 0.25rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.blog-card-body {
    padding: 1.5rem;
}

.blog-card-body time {
    font-size: 0.85rem;
    color: var(--text-light);
}

.blog-card-body h3 {
    font-size: 1.1rem;
    margin: 0.5rem 0 0.8rem;
    line-height: 1.4;
}

.blog-card-body p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.btn-readmore {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
}

.btn-readmore:hover {
    text-decoration: underline;
}

/* ========== Contact ========== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

.contact-info h2,
.contact-form-wrapper h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

.contact-item {
    margin-bottom: 1.5rem;
}

.contact-item strong {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 0.3rem;
}

.contact-item p {
    font-size: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-link {
    padding: 0.5rem 1.2rem;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group textarea {
    resize: vertical;
}

.form-success {
    text-align: center;
    padding: 2rem;
    background: #f0f9f0;
    border-radius: var(--radius);
    color: #2d7a2d;
    margin-top: 1rem;
}

/* ========== Footer ========== */
.footer {
    background: var(--primary);
    color: rgba(255, 255, 255, 0.7);
    padding: 4rem 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
}

.footer h4 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer p {
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer ul a {
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer ul a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.85rem;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        gap: 1.5rem;
        transform: translateY(-120%);
        transition: var(--transition);
        box-shadow: var(--shadow);
    }

    .nav-links.active {
        transform: translateY(0);
    }

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

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

    .stats {
        gap: 1.5rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

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

/* ========== Project Detail Page ========== */
.project-hero {
    width: 100%;
    height: 70vh;
    min-height: 500px;
    overflow: hidden;
    margin-top: 70px;
}

.project-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: heroZoom 15s ease-in-out infinite alternate;
}

.project-detail {
    padding: 4rem 0 5rem;
}

.project-meta {
    margin-bottom: 3rem;
}

.back-link {
    display: inline-block;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--accent);
}

.project-meta h1 {
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 2rem;
    letter-spacing: 1px;
}

.meta-row {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.meta-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
}

.meta-value {
    font-size: 1rem;
    font-weight: 500;
}

.project-intro {
    max-width: 800px;
    margin-bottom: 4rem;
}

.project-intro h2 {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.project-intro p {
    color: var(--text-light);
    line-height: 2;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.project-gallery {
    margin-bottom: 4rem;
}

.project-gallery h2 {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 2rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.gallery-grid-5 {
    grid-template-columns: repeat(3, 1fr);
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    animation: kenBurns 8s ease-in-out infinite alternate;
}

.gallery-item:nth-child(odd) img {
    animation-delay: -2s;
}

.gallery-item:nth-child(3n) img {
    animation-duration: 10s;
}

@keyframes kenBurns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.08);
    }
}

.gallery-item:hover img {
    animation-play-state: paused;
    transform: scale(1.1);
}

.gallery-large {
    grid-column: span 2;
}

.gallery-wide {
    grid-column: span 3;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.2rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: var(--white);
    font-size: 0.9rem;
}

.gallery-note {
    margin-top: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
    font-style: italic;
}

.project-nav {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

/* ========== Gallery Lightbox ========== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    transition: opacity 0.4s ease, transform 0.5s ease;
}

.lightbox img.zoom-in {
    animation: lightboxZoomIn 0.5s ease forwards;
}

@keyframes lightboxZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    z-index: 3001;
    transition: var(--transition);
}

.lightbox-close:hover {
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-prev {
    left: 1.5rem;
}

.lightbox-next {
    right: 1.5rem;
}

.lightbox-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.lightbox-play {
    position: absolute;
    bottom: 1.5rem;
    right: 2rem;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: var(--transition);
    z-index: 3001;
}

.lightbox-play:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-play.playing {
    background: var(--accent);
    border-color: var(--accent);
}

.lightbox-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--accent);
    transition: width 0.1s linear;
    z-index: 3001;
}

@media (max-width: 768px) {
    .project-hero {
        height: 50vh;
        min-height: 300px;
    }

    .meta-row {
        gap: 1.5rem;
    }

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

    .gallery-large,
    .gallery-wide {
        grid-column: span 1;
    }
}
