/* =========================================================
   VARIABLES & BASE STYLES
========================================================= */

:root {
    --grid-rows: 8px;
    --grid-row-gutter: 8px;
    --grid-columns: 15;
    --grid-margin: 80px;
    --grid-col-gutter: 32px;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #F9F9F9;
}

body.scrollable-page {
    overflow-y: auto;
    overflow-x: hidden;
    background: #F9F9F9;
    color: #040707;
    font-family: "Montserrat", sans-serif;
}

::selection {
    color: #F9F9F9;
    background: #676767;
}

/* =========================================================
   GLOBAL MEDIA FADE-IN
========================================================= */

img, video {
    opacity: 0; 
    animation: imageFadeIn 0.6s ease-out forwards;
}

.standalone-logo, 
.mobile-logo, 
.search-icon, 
.close-btn svg, 
.mobile-menu-icon svg {
    opacity: 1;
    animation: none !important;
}

@keyframes imageFadeIn {
    0% { 
        opacity: 0; 
    }
    100% { 
        opacity: 1; 
    }
}

/* =========================================================
   GLOBAL TYPOGRAPHY
========================================================= */

.title-text {
    font-family: "Montserrat", sans-serif !important;
    font-weight: 900; 
    font-size: 144pt;
    line-height: 1;
    margin: 0; 
    text-transform: uppercase;
    color: #040707;
}

.section-title {
    font-family: "Montserrat", sans-serif !important;
    font-weight: 300; 
    font-size: 60pt; 
    line-height: 1;
    margin: 0 0 calc(var(--grid-rows) * 4) 0;
    color: #040707; 
    text-transform: uppercase;
    text-align: right;
}

.body-text, .list-date, .list-desc {
    font-family: "Montserrat", sans-serif !important;
    font-weight: 400; 
    font-size: 12pt;
    line-height: 1.5;
    color: #040707; 
    margin: 0;
}

.download-link {
    font-family: "Montserrat", sans-serif !important;
    font-weight: 600; 
    color: #040707; 
    text-decoration: underline;
    transition: opacity 0.3s ease;
}

/* =========================================================
   LAYOUT UTILITIES & GRID SYSTEM
========================================================= */

.page-grid-container {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    column-gap: var(--grid-col-gutter);
    padding: calc(var(--grid-rows) * 7 + var(--grid-row-gutter)) var(--grid-margin) calc(var(--grid-margin) * 4);
}

/*1*/
.col-1-1  { grid-column: 1 / 2; }
.col-1-2  { grid-column: 1 / 3; }
.col-1-3  { grid-column: 1 / 4; }
.col-1-4  { grid-column: 1 / 5; }
.col-1-5  { grid-column: 1 / 6; }
.col-1-6  { grid-column: 1 / 7; }
.col-1-7  { grid-column: 1 / 8; }
.col-1-8  { grid-column: 1 / 9; }
.col-1-9  { grid-column: 1 / 10; }
.col-1-10 { grid-column: 1 / 11; }
.col-1-11 { grid-column: 1 / 12; }
.col-1-12 { grid-column: 1 / 13; }
.col-1-13 { grid-column: 1 / 14; }
.col-1-14 { grid-column: 1 / 15; }
.col-1-15 { grid-column: 1 / -1; }

/*2*/
.col-2-2  { grid-column: 2 / 3; }
.col-2-3  { grid-column: 2 / 4; }
.col-2-4  { grid-column: 2 / 5; }
.col-2-5  { grid-column: 2 / 6; }
.col-2-6  { grid-column: 2 / 7; }
.col-2-7  { grid-column: 2 / 8; }
.col-2-8  { grid-column: 2 / 9; }
.col-2-9  { grid-column: 2 / 10; }
.col-2-10 { grid-column: 2 / 11; }
.col-2-11 { grid-column: 2 / 12; }
.col-2-12 { grid-column: 2 / 13; }
.col-2-13 { grid-column: 2 / 14; }
.col-2-14 { grid-column: 2 / 15; }
.col-2-15 { grid-column: 2 / -1; }

/*3*/
.col-3-3  { grid-column: 3 / 4; }
.col-3-4  { grid-column: 3 / 5; }
.col-3-5  { grid-column: 3 / 6; }
.col-3-6  { grid-column: 3 / 7; }
.col-3-7  { grid-column: 3 / 8; }
.col-3-8  { grid-column: 3 / 9; }
.col-3-9  { grid-column: 3 / 10; }
.col-3-10 { grid-column: 3 / 11; }
.col-3-11 { grid-column: 3 / 12; }
.col-3-12 { grid-column: 3 / 13; }
.col-3-13 { grid-column: 3 / 14; }
.col-3-14 { grid-column: 3 / 15; }
.col-3-15 { grid-column: 3 / -1; }

/*4*/
.col-4-4  { grid-column: 4 / 5; }
.col-4-5  { grid-column: 4 / 6; }
.col-4-6  { grid-column: 4 / 7; }
.col-4-7  { grid-column: 4 / 8; }
.col-4-8  { grid-column: 4 / 9; }
.col-4-9  { grid-column: 4 / 10; }
.col-4-10 { grid-column: 4 / 11; }
.col-4-11 { grid-column: 4 / 12; }
.col-4-12 { grid-column: 4 / 13; }
.col-4-13 { grid-column: 4 / 14; }
.col-4-14 { grid-column: 4 / 15; }
.col-4-15 { grid-column: 4 / -1; }

/*5*/
.col-5-5  { grid-column: 5 / 6; }
.col-5-6  { grid-column: 5 / 7; }
.col-5-7  { grid-column: 5 / 8; }
.col-5-8  { grid-column: 5 / 9; }
.col-5-9  { grid-column: 5 / 10; }
.col-5-10 { grid-column: 5 / 11; }
.col-5-11 { grid-column: 5 / 12; }
.col-5-12 { grid-column: 5 / 13; }
.col-5-13 { grid-column: 5 / 14; }
.col-5-14 { grid-column: 5 / 15; }
.col-5-15 { grid-column: 5 / -1; }

/*6*/
.col-6-6  { grid-column: 6 / 7; }
.col-6-7  { grid-column: 6 / 8; }
.col-6-8  { grid-column: 6 / 9; }
.col-6-9  { grid-column: 6 / 10; }
.col-6-10 { grid-column: 6 / 11; }
.col-6-11 { grid-column: 6 / 12; }
.col-6-12 { grid-column: 6 / 13; }
.col-6-13 { grid-column: 6 / 14; }
.col-6-14 { grid-column: 6 / 15; }
.col-6-15 { grid-column: 6 / -1; }

/*7*/
.col-7-7  { grid-column: 7 / 8; }
.col-7-8  { grid-column: 7 / 9; }
.col-7-9  { grid-column: 7 / 10; }
.col-7-10 { grid-column: 7 / 11; }
.col-7-11 { grid-column: 7 / 12; }
.col-7-12 { grid-column: 7 / 13; }
.col-7-13 { grid-column: 7 / 14; }
.col-7-14 { grid-column: 7 / 15; }
.col-7-15 { grid-column: 7 / -1; }

/*8*/
.col-8-8  { grid-column: 8 / 9; }
.col-8-9  { grid-column: 8 / 10; }
.col-8-10 { grid-column: 8 / 11; }
.col-8-11 { grid-column: 8 / 12; }
.col-8-12 { grid-column: 8 / 13; }
.col-8-13 { grid-column: 8 / 14; }
.col-8-14 { grid-column: 8 / 15; }
.col-8-15 { grid-column: 8 / -1; }

/*9*/
.col-9-9  { grid-column: 9 / 10; }
.col-9-10 { grid-column: 9 / 11; }
.col-9-11 { grid-column: 9 / 12; }
.col-9-12 { grid-column: 9 / 13; }
.col-9-13 { grid-column: 9 / 14; }
.col-9-14 { grid-column: 9 / 15; }
.col-9-15 { grid-column: 9 / -1; }

/*10*/
.col-10-10 { grid-column: 10 / 11; }
.col-10-11 { grid-column: 10 / 12; }
.col-10-12 { grid-column: 10 / 13; }
.col-10-13 { grid-column: 10 / 14; }
.col-10-14 { grid-column: 10 / 15; }
.col-10-15 { grid-column: 10 / -1; }

/*11*/
.col-11-11 { grid-column: 11 / 12; }
.col-11-12 { grid-column: 11 / 13; }
.col-11-13 { grid-column: 11 / 14; }
.col-11-14 { grid-column: 11 / 15; }
.col-11-15 { grid-column: 11 / -1; }

/*12*/
.col-12-12 { grid-column: 12 / 13; }
.col-12-13 { grid-column: 12 / 14; }
.col-12-14 { grid-column: 12 / 15; }
.col-12-15 { grid-column: 12 / -1; }

/*13*/
.col-13-13 { grid-column: 13 / 14; }
.col-13-14 { grid-column: 13 / 15; }
.col-13-15 { grid-column: 13 / -1; }

/*14*/
.col-14-14 { grid-column: 14 / 15; }
.col-14-15 { grid-column: 14 / -1; }

/*15*/
.col-15-15 { grid-column: 15 / -1; }


/* Image Aspect Ratios */
.locked-ratio {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.locked-ratio-vert {
    width: auto;
    height: auto;
    aspect-ratio: 3 / 4; 
    object-fit: cover;
}

/* New 16:9 Widescreen Ratio */
.locked-ratio-16-9 {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.locked-ratio-1-1 {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* =========================================================
   UTILITY CLASSES (SPACING & ALIGNMENT)
========================================================= */
/* Margins */
.mb-0   { margin-bottom: 0 !important; }
.mb-24  { margin-bottom: 24px !important; }
.mb-48  { margin-bottom: 48px !important; }
.mb-80  { margin-bottom: 80px !important; }
.mb-120 { margin-bottom: 120px !important; }
.mb-160 { margin-bottom: 160px !important; }

.mt-24 { margin-top: 24px !important; }

/* Padding */
.pt-0   { padding-top: 0 !important; }
.pt-80  { padding-top: 80px !important; }
.pt-120 { padding-top: 120px !important; }

.pb-0   { padding-bottom: 0 !important; }
.pb-120 { padding-bottom: 120px !important; }

/* Structural */
.align-center { align-self: center !important; }
.text-center { text-align: center !important; }
.text-right  { text-align: right !important; }
.text-left   { text-align: left !important; }
.spacer-120 { height: 120px; width: 100%; }


/* =========================================================
   BACK TO TOP BUTTON
========================================================= */

.back-to-top {
    position: fixed;
    bottom: 48px; 
    left: var(--grid-margin); 
    z-index: 999; 
    
    /* 1. Match the exact dimensions of your Logo and Hamburger */
    width: 60px;  
    height: 60px; 
    
    /* 2. Flexbox centers the arrow perfectly inside the 60px container */
    display: flex;
    justify-content: center;
    align-items: center;
    
    background: transparent; 
    color: #040707; 
    border: none;
    cursor: pointer;
    padding: 0;
    
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s ease, color 0.3s ease;
    
    opacity: 0;
    visibility: hidden;
    pointer-events: none; 
}

/* SHOWN STATE */
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; 
}

/* HOVER STATE */
.back-to-top:hover {
    color: #676767; 
    transform: translateY(-5px); 
}

/* 3. Keep the visual size of the arrow at 32px */
.back-to-top svg {
    width: 32px; 
    height: 32px;
    display: block;
}

/* =========================================================
   GALLERY (FIXED & ANIMATED)
========================================================= */

/* 1. 补全缺失的栅格定义，确保按钮能找到自己的列 */
.col-3 { grid-column: 3 / 4; }
.col-13 { grid-column: 13 / 14; }

/* 2. 画廊主容器：保持你原本的 col-4-12，但强制锁定高度比例 */
.gallery-view-port {
    grid-column: 4 / 13; 
    position: relative; /* 必须为 relative，让绝对定位的图片锁定在这里 */
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* 核心修复：撑开高度。16/10 是你原本的比例，没有它，容器高度会变0 */
    aspect-ratio: 16 / 10; 
    overflow: hidden;
}

/* 3. 图片基础样式：改为绝对定位，允许重叠 */
.slider-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    
    opacity: 0;
    display: block !important; 
    pointer-events: none;
    
    /* Saisei 风格的 Premium 贝塞尔曲线 */
    transition: transform 0.9s cubic-bezier(0.7, 0, 0.3, 1), 
                opacity 0.9s ease;
    z-index: 1;
}

/* 4. 激活状态（当前看到的图） */
.slider-img.active {
    opacity: 1;
    transform: translateX(0) scale(1);
    z-index: 10;
    pointer-events: auto;
}

/* 5. 后退状态 (The "Push Back" effect) */
.slider-img.exit {
    opacity: 0;
    transform: scale(0.85); /* 产生向后退的视觉深度 */
    z-index: 5;
}

/* 6. 进场预备位置 */
.slider-img.slide-right { transform: translateX(100%); }
.slider-img.slide-left  { transform: translateX(-100%); }

/* 7. 按钮样式：确保它们浮在图片上方 */
.slider-nav-petal {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #F9F9F9;
    border: 1px solid #CCCCCC;
    color: #040707;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    
    /* 核心修复：确保按钮不被图片挡住 */
    position: relative;
    z-index: 50; 
}

.slider-nav-petal:hover {
    background: #040707;
    color: #F9F9F9;
    border-color: #040707;
}

.slider-nav-petal svg {
    width: 32px;
    height: 32px;
    position: relative;
    top: 1px;
}

#prevBtn svg { left: -1px; }
#nextBtn svg { right: -1px; }

/* 8. 计数器：保持居中 */
#galleryCounter {
    grid-column: 4 / 13;
    text-align: center;
    margin-top: 24px;
    position: relative;
    z-index: 50;
}

/* =========================================================
   NAVIGATION & HEADER
========================================================= */

.standalone-logo {
    position: fixed;
    top: calc(var(--grid-rows) * 7 + var(--grid-row-gutter)); 
    left: var(--grid-margin); 
    width: 60px; 
    height: 60px;
    object-fit: contain;
    z-index: 301;
}

/* Desktop & Tablet Navigation */
.top-nav {
    position: fixed; 
    top: calc(var(--grid-rows) * 27 + var(--grid-row-gutter));    
    left: var(--grid-margin); 
    z-index: 300;    
    display: flex;
    flex-direction: column; 
    gap: calc(var(--grid-rows) * 2);
    mix-blend-mode: difference;
}

.top-nav a {
    text-decoration: none;
    color: white;    
    font-family: "Montserrat", sans-serif;
    font-weight: 200;
    font-size: 22pt; 
    transition: opacity 0.3s ease;
    width: max-content;
}

.top-nav a:hover {
    color: #676767;    
}

/* Search Bar */
.search-container {
    display: flex;
    align-items: center;
    border: 1px solid white;
    border-radius: 20px;
    padding: 2px 8px;
    margin-top: calc(var(--grid-rows));
    width: 140px; 
    justify-content: space-between;
}

.search-container input {
    font-family: "Montserrat", sans-serif; /* Add this line! */
    background: transparent;
    border: none;
    color: white;
    outline: none;
    width: 80%;
    font-size: 1rem;
}

.search-container .search-icon {
    width: 14px;
    height: 14px;
    stroke: white;
}

/* Mobile Navigation */
.mobile-menu-icon {
    display: none; 
    position: fixed;
    top: calc(var(--grid-rows) * 7 + var(--grid-row-gutter) + 60px + var(--grid-rows) * 6); 
    left: var(--grid-margin);
    width: 60px; 
    height: 38px;
    z-index: 300;
    cursor: pointer;
    mix-blend-mode: difference;
}

.mobile-nav-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #040707;
    z-index: 1000;
    display: none; 
    padding: calc(var(--grid-rows) * 7 + var(--grid-row-gutter)) var(--grid-margin);
}

.mobile-nav-overlay.open {
    display: block; 
}

.mobile-nav-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    column-gap: var(--grid-col-gutter);
    row-gap: calc(var(--grid-rows) * 4); 
    align-content: start;
}

.mobile-logo-wrapper {
    grid-column: 1 / -1;
    grid-row: 1;
    margin-bottom: calc(var(--grid-rows) * 2);
    display: flex;
    justify-content: flex-start;
}

.mobile-logo {
    width: 60px; 
    height: 60px;
    object-fit: contain;
}

.close-btn {
    grid-column: 1 / 2;
    grid-row: 2;
    width: 60px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-search-wrapper {
    grid-column: 2 / -1; 
    grid-row: 2;
    background-color: #F9F9F9; 
    border-radius: 20px;
    padding: 0 12px;
    height: 38px; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.mobile-search-wrapper input {
    border: none;
    background: transparent;
    outline: none;
    width: 80%;
    font-family: "Montserrat", sans-serif;
    font-size: 1rem;
    color: #040707;
}

.mobile-links-container {
    grid-column: 2 / -1; 
    grid-row: 3;
    display: flex;
    flex-direction: column;
    gap: calc(var(--grid-rows) * 4);
    margin-top: calc(var(--grid-rows) * 3);
}

.mobile-links-container a {
    color: #F9F9F9;
    font-family: "Montserrat", sans-serif;
    font-weight: 300;
    font-size: 24pt !important; 
    text-decoration: none;
    letter-spacing: 1px;
    line-height: 1.1;
}

/* =========================================================
   HOMEPAGE
========================================================= */

.image-container {
    height: 100vh;
    width: 100vw;  
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.video-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out; 
    z-index: 1; 
}

.video-link.previous {
    opacity: 1;
    visibility: visible;
    z-index: 2; 
    transition: none; 
}

.video-link.active {
    opacity: 1;
    visibility: visible;
    z-index: 3; 
}

.video-link video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay-graphic {
    position: absolute;
    bottom: 10%;      
    right: 40px;      
    width: 600px;
    height: auto;
    z-index: 10;
    pointer-events: none;
    mix-blend-mode: difference;
}

/* =========================================================
   ABOUT PAGE
========================================================= */

.about-header {
    grid-column: 4 / -1; 
    margin-top: 0;
}

.about-image-block {
    grid-column: 4 / 7;
    margin-top: calc(var(--grid-rows) * 8);
    margin-bottom: calc(var(--grid-rows) * 10);
    height: 480px;      
    overflow: hidden;   
}

.about-image {
    width: 100%;
    height: 100%;       
    display: block;
    object-fit: cover;  
    object-position: top; 
}

.about-content-block {
    grid-column: 8 / -1; 
    margin-top: calc(var(--grid-rows) * 8);
    display: flex;
    flex-direction: column;
    gap: calc(var(--grid-rows) * 10); 
}

.list-row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: calc(var(--grid-rows) * 2);
    align-items: baseline; 
}

.list-date {
    width: 280px; 
    flex-shrink: 0;
    text-align: left; 
    font-weight: 600;
}

.list-desc {
    flex-grow: 1;
    text-align: right;
}

/* =========================================================
   UNIFIED INTERACTIVE BUTTONS
========================================================= */

/* 1. Shared Base Logic for all About Actions */
.about-actions .download-btn,
.about-actions .download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-sizing: border-box;
}

/* 2. Primary Black Buttons (Resume/Portfolio) */
.about-actions .download-btn:hover {
    background-color: #676767 !important;
    border-color: #676767 !important;
    /* This line is the key—it overrides the global movement */
    transform: none !important; 
}

/* Interaction: Fades to gray—No movement */
.about-actions .download-btn:hover {
    background-color: #676767 !important;
    border-color: #676767 !important;
    /* transform: translateY removed to keep button static */
}

/* 3. Secondary Outline Chips (Socials) */
.about-actions .download-link:hover {
    /* Changed from #040707 to match the black button hover color */
    background-color: #676767 !important; 
    border-color: #676767 !important;
    color: #F9F9F9 !important;
    transform: none !important; /* Remains stationary */
}

/* Interaction: Inverts colors to fill—No movement */
.about-actions .download-link:hover {
    background-color: #676767 !important;
    color: #F9F9F9 !important;
    /* transform: translateY removed to keep button static */
}

/* =========================================================
   PROJECTS HUB PAGE
========================================================= */

.projects-container {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    column-gap: var(--grid-col-gutter);
    padding: calc(var(--grid-rows) * 7 + var(--grid-row-gutter)) var(--grid-margin) 56px;
}

.projects-header {
    grid-column: 4 / -1; 
    margin-bottom: 56px; 
}

.projects-grid-wrapper {
    grid-column: 4 / -1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--grid-col-gutter);
    row-gap: 56px; 
}

.project-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    cursor: pointer;
    text-decoration: none;
    background-color: #CCCCCC; 
}

.project-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(4, 7, 7, 0.66);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
}

.project-item:hover .project-overlay {
    opacity: 1;
}

.project-overlay h3 {
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    font-size: 24pt;
    color: #F9F9F9;
    margin: 0 0 8px 0;
    text-transform: uppercase;
}

.project-overlay p {
    font-family: "Montserrat", sans-serif;
    font-weight: 300;
    font-size: 12pt;
    color: #F9F9F9;
    margin: 0;
}

/* =========================================================
   PROJECT DETAIL PAGE
========================================================= */

.hero-section {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.hero-media {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    object-fit: cover;
    z-index: 1; 
}

.hero-grid-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2; 
    background: transparent;
    pointer-events: none; 
    mix-blend-mode: difference; 
}

.hero-grid-overlay .about-header {
    grid-column: 4 / -1; 
}

.hero-grid-overlay .title-text {
    color: #FFFFFF !important; 
    mix-blend-mode: normal;
}

.project-content-grid {
    padding-top: calc(var(--grid-rows) * 12);
    padding-bottom: 120px;
    row-gap: 56px;
    align-items: start;
}

.proj-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    margin-bottom: 56px;
}

.proj-text-box {
    display: flex;
    flex-direction: column;
    margin-bottom: 56px;
}

.proj-h2 {
    font-family: "Montserrat", sans-serif;
    font-weight: 900;
    font-size: 24pt;
    margin: 0 0 16px 0;
    color: #040707;
    line-height: 1.2;
}

.proj-h3 {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 18pt;
    margin: 0 0 24px 0;
    color: #040707;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.proj-p {
    font-family: "Montserrat", sans-serif;
    font-weight: 400;
    font-size: 12pt;
    margin: 0;
    color: #040707;
    line-height: 1.6;
}

.proj-headline {
    font-family: "Montserrat", sans-serif;
    font-weight: 300;
    font-size: 40pt;
    line-height: 1.1;
    color: #040707;
    margin: 0;
}

.proj-image-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 56px;
}

.proj-image-group .proj-img {
    margin-bottom: 16px;
}

.proj-caption {
    font-family: "Montserrat", sans-serif;
    font-weight: 500;
    font-size: 12pt;
    color: #676767;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: right;
}

/* Photo Gallery Grid */
.gallery-grid {
    grid-column: 1 / -1; 
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr); 
    column-gap: var(--grid-col-gutter);
    row-gap: var(--grid-col-gutter); 
}

.gallery-grid .proj-img {
    margin-bottom: 0; 
}

/* =========================================================
   FULL-SCREEN IMAGE SECTION
========================================================= */

.full-screen-section {
    width: 100vw;
    height: 100vh;
    margin-left: calc(-50vw + 50%); /* 强制跳出父级网格容器的边距限制 */
    margin-right: calc(-50vw + 50%);
    position: relative;
    overflow: hidden;
    background: #F9F9F9;
}

.full-screen-section img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 确保图片像背景一样覆盖整个屏幕，不留白边 */
    display: block;
}

/* =========================================================
   ANALYSIS TABLE WITH BARS
========================================================= */
.analysis-table {
    width: 100%;
    border-collapse: collapse;
    font-family: "Montserrat", sans-serif;
    color: #040707;
}

.analysis-table th {
    text-align: left;
    padding: 16px 0;
    border-bottom: 2px solid #040707;
    font-weight: 700;
    font-size: 14pt;
    text-transform: uppercase;
}

.analysis-table td {
    padding: 24px 0;
    border-bottom: 1px solid #CCCCCC;
    font-size: 12pt;
}

/* The Bar Container: Set left padding to 0 for text alignment */
.bar-cell {
    padding-right: 40px !important;
    padding-left: 0 !important; 
}

.score-bar {
    height: 18px;
    background-color: #676767;
    border-radius: 2px;
    transition: width 1s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Highlight the winner */
tr:has(.text-bold) .score-bar {
    background-color: #040707; /* Gray to differentiate the winner */
}

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

/* ========================================================= 
   FULLSCREEN PROJECT GALLERY
========================================================= */

.final-renders-hero-section {
    height: 100vh;
    width: 100vw;
    
    /* 1. 核心修改：将 padding 改为 48px 覆盖上下左右四个方向 */
    /* 这能保证无论屏幕多小，文字离顶部永远至少有 48px 的距离 */
    padding: 48px var(--grid-margin) 48px var(--grid-margin) !important;
    
    box-sizing: border-box; 
    display: grid;
    
    /* 2. 维持 1fr auto 1fr 逻辑，照片依然会在除去 padding 后的空间内居中 */
    grid-template-rows: 1fr auto 1fr; 
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    column-gap: var(--grid-col-gutter);
    overflow: hidden; 
}

.final-renders-hero-section .proj-headline {
    grid-row: 1;
    /* 3. 保持 align-self: end，让标题相对于照片定位 */
    align-self: end; 
    
    /* 文字与照片的距离 */
    margin-bottom: 48px !important; 
    margin-top: 0 !important;
    
    /* 确保标题对齐到页面左侧内容的起始线 (第4列) */
    grid-column: 4 / -1; 
}

.final-renders-hero-section .gallery-view-port,
.final-renders-hero-section .col-3,
.final-renders-hero-section .col-13 {
    grid-row: 2;
    align-self: center; /* 确保照片在中间行内垂直居中 */
}

.final-renders-hero-section #galleryCounter {
    grid-row: 3;
    align-self: start;
    /* 1/4 计数器与照片的距离 */
    margin-top: 24px !important; 
}

/* ========================================================= 
   SCROLL-TO-PLAY IMAGE SEQUENCE
========================================================= */

.scroll-sequence-container {
    position: relative;
    width: 100%;
}

.sticky-wrapper {
    position: sticky;
    top: 0;
    width: 100vw;
    height: 100vh; /* 占据全屏 */
    overflow: hidden;
    /* 设置为 1，确保它位于 z-index 为 300+ 的导航栏和 Logo 下方 */
    z-index: 1; 
}

#scroll-video-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.canvas-text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    column-gap: var(--grid-col-gutter);
    padding: 0 var(--grid-margin);
    
    /* Change from 'center' to 'flex-start' to move to the top */
    align-items: flex-start; 
    
    /* Add top padding so it aligns with your project headers */
    padding-top: 80px; 
    
    pointer-events: none;
}

.scroll-trigger {
    height: 300vh; /* 滚动 3 屏的距离来完成 20 帧的播放 */
}

/* =========================================================
   MEDIA QUERIES
========================================================= */

/* --- TABLET SPECIFIC (Below 1024px) --- */
@media (max-width: 1024px) {
    :root {
        --grid-columns: 10;
        --grid-margin: 32px;
        --grid-col-gutter: 16px;
    }
    
    .overlay-graphic {
        right: var(--grid-margin); 
    }
}

/* --- MOBILE SPECIFIC (Phone - Below 768px) --- */
@media (max-width: 767px) {
    :root {
        --grid-columns: 5;
        --grid-margin: 16px;
        --grid-col-gutter: 16px;
    }

    .desktop-nav {
        display: none !important;
    }
    
    .mobile-menu-icon {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .overlay-graphic {
        width: 70vw;    
        right: var(--grid-margin);    
        bottom: 5%;
    }
}

/* =========================================================
   CONTACT PAGE
========================================================= */

.contact-wrapper {
    grid-column: 4 / -1; /* Aligns perfectly with your master grid */
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: calc(var(--grid-rows) * 8);
}

.contact-link {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    text-decoration: none;
    border-bottom: 2px solid #CCCCCC;
    padding-bottom: 24px;
    padding-top: 24px;
    transition: border-color 0.3s ease;
}

/* Hover Effects */
.contact-link:hover {
    border-color: #040707; /* Underline turns black */
}
.contact-link:hover .contact-label {
    color: #040707;
}
.contact-link:hover .contact-value {
    color: #676767;
}

.contact-label {
    font-family: "Montserrat", sans-serif;
    font-weight: 300;
    font-size: 24pt;
    color: #676767;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.contact-value {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 24pt;
    color: #040707;
    text-align: right;
    transition: color 0.3s ease;
}

/* Mobile Fix for Contact Links */
@media (max-width: 767px) {
    .contact-link {
        flex-direction: column;
        gap: 8px;
        padding-bottom: 16px;
        padding-top: 16px;
    }
    .contact-label {
        font-size: 14pt;
    }
    .contact-value {
        font-size: 20pt;
        text-align: left; /* Aligns to left on small screens */
    }

    .resume-actions {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    .download-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

/* Additional Styles for Resume Section */
.resume-section {
    cursor: default; /* Not a link itself */
    border-color: #040707; /* Highlighted by default */
}

.resume-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.download-btn {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 12pt;
    color: #F9F9F9;
    background-color: #040707;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.download-btn:hover {
    background-color: #676767;
    transform: translateY(-2px);
}


/* =========================================================
   404 ERROR PAGE
========================================================= */

.error-project-link {
    grid-column: 1 / -1; /* Stretches across the 12-column wrapper */
    display: grid;
    grid-template-columns: repeat(12, 1fr); /* Inherits the 12 columns */
    column-gap: var(--grid-col-gutter); /* Inherits your exact gutter */
    text-decoration: none;
    align-items: center; 
}

.error-image-col {
    grid-column: 1 / 7; /* Exactly 6 columns, just like projects */
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10; /* Forces the exact same ratio as project cards */
    background-color: #CCCCCC;
}

/* This makes the image perfectly fill the 16:10 container without distorting */
.error-image-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.error-text-col {
    grid-column: 7 / -1; /* Starts exactly where the image ends, taking up the remaining 6 columns */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 0; /* We don't need padding because the grid's column-gap does the spacing! */
}

.continue-text {
    font-family: "Montserrat", sans-serif;
    font-weight: 300;
    font-size: 18pt;
    color: #676767;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.error-project-title {
    font-family: "Montserrat", sans-serif;
    font-weight: 900;
    font-size: 48pt;
    color: #040707;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    line-height: 1;
    transition: color 0.3s ease;
}

.error-project-desc {
    font-family: "Montserrat", sans-serif;
    font-weight: 400;
    font-size: 18pt;
    color: #040707;
    margin: 0;
    line-height: 1.5;
}

/* Hover effects */
.error-project-link:hover .error-project-title {
    color: #676767;
}
.error-project-link:hover .error-image-col img {
    opacity: 0.85;
}

/* =========================================================
   PETAL SUB-SITE GLOBAL
========================================================= */

/* Landing Page (No Scroll) */
.petal-landing-body {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    background-color: transparent; /* Strips away the solid background */
}
/* Background Video */
.bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1; /* Changed from -1 to 0 so it sits above the background color */
}

/* Petal Sub-Navigation (Right Side) */
.petal-sub-nav {
    position: fixed;
    top: calc(var(--grid-rows) * 24 + var(--grid-row-gutter));
    right: var(--grid-margin);
    
    /* 1. FORCES THE CONTAINER TO BE A UNIFORM WIDE BOX */
    width: 280px; 
    
    display: flex;
    flex-direction: column;
    align-items: stretch; 
    gap: 0px;
    z-index: 500;
}

.petal-nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-end; 
    gap: 16px; 
    text-decoration: none;
    transition: opacity 0.3s ease;
    
    position: relative;
    z-index: 10;
    
    padding: 16px 0 16px 60px; 
    
    /* 2. FORCES EVERY LINK TO FILL THAT EXACT 280px BOX */
    width: 100%; 
    box-sizing: border-box; 
}

.petal-nav-text {
    font-family: "Montserrat", sans-serif;
    font-weight: 400;
    font-size: 18pt;
    text-transform: uppercase;
    
    /* ADD THESE TWO LINES */
    white-space: nowrap; /* Forces "Final Design" to stay on exactly one line */
    text-align: right;   /* Keeps the text glued to the right side next to the icons */
}

.mta-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Active vs Inactive Nav States */
.nav-active .petal-nav-text { color: #040707; } /* Removed the bold weight */
.nav-inactive .petal-nav-text { color: #676767; }
.nav-inactive .mta-icon { filter: grayscale(100%) contrast(200%); }

/* Logo behavior for sub-pages */
.logo-scrollable {
    position: absolute; /* Moves with the scroll */
    top: calc(var(--grid-rows) * 7 + var(--grid-row-gutter));
    left: var(--grid-margin);
    width: 60px;
    z-index: 301;
}

/* Clickable Area for Petal Landing Page */
.landing-click-area {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    text-decoration: none;
    z-index: 10; /* Sits above the video (0), but below logo (301) and nav (500) */
    cursor: pointer;
}

/* Prevents the default blue hyperlink color */
.landing-click-area .title-text {
    color: #040707;
}

/* Concept Page Gray Banner */
.gray-banner {
    width: 100vw;
    background-color: #CCCCCC; 
    
    /* Changed from 120px to 240px to make the banner massively taller */
    padding: 260px 0; 
    
    margin: 40px 0;
}

/* =========================================================
   PETAL FLOATING ACTION PILL (Petal Pages Only)
========================================================= */
.floating-action-pill {
    position: fixed;
    bottom: 48px; 
    right: var(--grid-margin); 
    z-index: 999; 
    height: 60px;
    width: 60px; 
    /* Changed from transparent to a pure invisible charcoal to prevent muddy color shifts */
    background-color: rgba(4, 7, 7, 0); 
    border-radius: 30px;
    overflow: hidden; 
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    
    opacity: 1;
    visibility: visible;
    pointer-events: auto; 
}

/* Expand the pill on hover IF we are scrolled down */
.floating-action-pill.scrolled:hover {
    width: 120px; 
    background-color: #040707;
}

/* The Left Button (Home) */
.pill-prev-btn {
    position: absolute;
    right: 60px; 
    top: 0;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2; /* Keeps icon above the sliding background */
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.floating-action-pill.scrolled .pill-prev-btn {
    visibility: visible;
    opacity: 1;
}

.pill-prev-btn img {
    width: 28px; 
    height: 28px;
    object-fit: contain;
    
    /* Added position and right property to optically nudge it left */
    position: relative;
    right: 2px; 
    
    transform: rotate(180deg); 
    filter: brightness(0) invert(1); 
}

/* The Right Dynamic Morphing Button */
.pill-dynamic-btn {
    position: absolute;
    right: 0; 
    top: 0;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2; /* Keeps icon above the sliding background */
}

.pill-dynamic-btn img {
    width: 32px; 
    height: 32px;
    display: block;
    
    /* Added position and bottom property to optically nudge it upwards */
    position: relative;
    bottom: 1px; 
    
    transform: rotate(180deg);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1); 
}

/* Scrolled State: Swivel clockwise to point Up */
.floating-action-pill.scrolled .pill-dynamic-btn img {
    transform: rotate(270deg); 
}

/* Hover when Scrolled: Arrow turns pure white and stays white */
.floating-action-pill.scrolled:hover .pill-dynamic-btn img {
    filter: brightness(0) invert(1);
}

/* ==========================================
   THE SLIDING HOVER CIRCLE
========================================== */
.pill-hover-bg {
    position: absolute;
    top: 4px;   /* Pushed down 4px to create the top border */
    right: 4px; /* Pushed in 4px to create the right border */
    
    width: 52px;  /* Shrunk from 60px */
    height: 52px; /* Shrunk from 60px */
    
    background-color: #676767; 
    border-radius: 50%;
    z-index: 1; 
    
    opacity: 0; 
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
}

/* 1. Show the background when the expanded pill is hovered */
.floating-action-pill.scrolled:hover .pill-hover-bg {
    opacity: 1;
}

/* 2. Sibling trick: If left button is hovered, slide the background left! */
.pill-prev-btn:hover ~ .pill-hover-bg {
    transform: translateX(-60px);
}

/* =========================================================
   TEXT UTILITIES & INLINE STYLES
========================================================= */
.text-italic  { font-style: italic; }
.text-bold    { font-weight: 700; }
.text-regular { font-weight: 400; }

.text-white { color: #F9F9F9; }
.text-gray  { color: #676767; }
.text-black { color: #040707; }

/* Petal specific list padding */
ul.petal-body { padding-left: 20px; }

/* Hero Text Overlay Container */
.hero-text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    box-sizing: border-box;
    align-items: flex-end;
    padding-bottom: calc(var(--grid-rows) * 7 + var(--grid-row-gutter));
    z-index: 2;
    pointer-events: none;
}

/* Action Link (Continue Reading) */
.petal-action-link {
    text-decoration: none;
    font-size: 14pt;
    display: flex;
    align-items: center;
    gap: 12px;
}

.petal-action-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* =========================================================
   PETAL SPECIFIC TYPOGRAPHY
========================================================= */

.petal-title-text {
    font-family: "Montserrat", sans-serif !important;
    font-weight: 900; 
    font-size: 120pt;
    line-height: 1;
    margin: 0; 
    text-transform: uppercase;
}

/* Petal specific text container */
.petal-text-box {
    display: flex;
    flex-direction: column;
    margin-bottom: 80px; 
}

/* Primary Headings */
.petal-h2 {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 24pt;
    margin: 0 0 0 0;
    color: #040707;
    line-height: 1.2;
}

/* Standard Body Text & Lists */
.petal-body {
    font-family: "Montserrat", sans-serif;
    font-weight: 400;
    font-size: 12pt;
    margin: 0;
    color: #040707;
    line-height: 1.6;
}

/* Highlighted/Bold Body Text */
.petal-body-bold {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 12pt;
    margin: 0;
    color: #040707;
    line-height: 1.6;
}

/* =========================================================
   PETAL SPECIFIC IMAGERY
========================================================= */

/* Base image style */
.petal-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    margin-bottom: 80px; 
}

/* 16:10 Landscape Ratio (Perfect for the subway photos) */
.petal-ratio-landscape {
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

/* 16:9 Landscape Ratio (Perfect for the subway photos) */
.petal-ratio-longlandscape {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* 3:4 Portrait Ratio (If you have vertical CAD shots later) */
.petal-ratio-portrait {
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

/* 1:1 Square Ratio (Just in case you need it!) */
.petal-ratio-wide {
    aspect-ratio: 2.2 / 1;
    object-fit: cover;
}

/* Simple Overlay Credit - Bottom Right */
.credit-label {
    position: absolute;
    bottom: 16px;
    right: 20px; /* Swapped from left to right */
    color: rgba(249, 249, 249, 0.7); 
    font-family: "Montserrat", sans-serif;
    font-size: 8pt;
    font-weight: 400;
    pointer-events: none; 
    z-index: 5;
    text-align: right; /* Ensures text stays flush right if it wraps */
}

/* =========================================================
   IMAGE ANNOTATIONS
========================================================= */

/* The wrapper that holds the image and the notes */
.annotation-wrapper {
    position: relative;
    width: 100%;
}

/* The floating text notes */
.sketch-annotation {
    position: absolute;
    max-width: 220px; /* Keeps the text wrapping neatly */
    z-index: 10;
}

/* Styling for the annotation titles */
.sketch-annotation .petal-body-bold {
    color: #040707;
    margin-bottom: 4px;
}

/* Styling for the annotation descriptions */
.sketch-annotation .petal-body {
    color: #676767;
    font-size: 12pt;
}

/* Makes the notes responsive on mobile so they don't overlap the shrinking image */
@media (max-width: 767px) {
    .sketch-annotation {
        position: relative;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        text-align: left !important;
        margin-top: 24px;
        max-width: 100%;
    }
}

/* =========================================================
   DYNAMIC SLIDING SPOTLIGHT EFFECT
========================================================= */

/* 1. Ensure nav items sit above the shadow so you can click them */
.petal-nav-item {
    position: relative;
    z-index: 10;
}

/* 2. Turn text white when hovered */
.petal-nav-item:hover .petal-nav-text {
    color: #FFFFFF !important;
}

/* 3. The shared sliding spotlight (Controlled by Javascript) */
.nav-spotlight {
    position: absolute;
    
    /* Starts massive and invisible (lens opened) */
    width: 2000px;
    height: 2000px;
    right: -984px; /* Math perfectly aligns the center to your icons */
    
    top: 50%; /* Default vertical center */
    transform: translateY(-50%);
    border-radius: 50%;
    
    box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0); 
    z-index: -1; 
    pointer-events: none; 
    
    /* Animates the sliding speed and the lens closing speed */
    transition: top 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                width 0.6s cubic-bezier(0.25, 1, 0.2, 1), 
                height 0.6s cubic-bezier(0.25, 1, 0.2, 1), 
                right 0.6s cubic-bezier(0.25, 1, 0.2, 1),
                box-shadow 0.6s cubic-bezier(0.25, 1, 0.2, 1);
}

/* 4. When the overall nav is hovered, the lens closes in */
.petal-sub-nav.is-hovered .nav-spotlight {
    width: 50px;
    height: 50px;
    right: -9px; /* Re-centers the new 50px circle over the icons */
    box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.85); 
}

/* 5. Bring the icon's full color back when hovered */
.petal-nav-item:hover .mta-icon {
    filter: none !important; 
}

/* 6. Make sure the color fades in smoothly */
.mta-icon {
    transition: filter 0.3s ease;
}