/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --bg-color: #f3f3e9;
    --text-color: #1a1a1a;
    --font-stack: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --overlay-color: rgba(0, 0, 0, 0.5);
}

html { scroll-behavior: smooth; }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-stack);
    font-size: 14px;
    padding: 40px; 
}

button {
    background: none; border: none; cursor: pointer;
    font: inherit; text-transform: uppercase;
}

/* =========================================
   2. HEADER
   ========================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 50px;
    text-transform: uppercase;
    font-weight: 500;
}

.header-left { display: flex; flex-direction: column; gap: 4px; }
.logo { font-weight: bold; font-size: 1.2rem; }
.subtitle { color: #666; font-size: 0.85rem; }
#hire-me-btn { font-weight: bold; color: #ef95ff; }

/* =========================================
   3. LAYOUT GRID
   ========================================= */
#grid-container {
    display: grid;
    grid-template-columns: 25% 25% 25% 25%;
    gap: 0; 
    width: 100%;
    margin-bottom: 100px;
}

/* =========================================
   4. PROJECT ITEMS
   ========================================= */
.project-item {
    position: relative; 
    overflow: hidden;
    cursor: pointer; 
    width: 100%;
}

.media-wrapper {
    position: relative; 
    width: 100%;
    height: 0;         
    padding-top: 100%; 
}

.project-item.banner { grid-column: 1 / -1; }
.project-item.banner .media-wrapper { padding-top: 42.85%; }

/* =========================================
   5. CAROUSEL ITEMS
   ========================================= */
.carousel-item {
    position: relative; 
    overflow: hidden;
    cursor: pointer; 
}
.carousel-item.double-wide { grid-column: span 2; }
.carousel-item.double-wide .media-wrapper { padding-top: 50%; }

/* =========================================
   6. MEDIA STYLES
   ========================================= */
.media-wrapper img, .media-wrapper video {
    position: absolute; 
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block;
    transition: transform 0.5s ease;
}

/* =========================================
   7. CAROUSEL LOGIC
   ========================================= */
.carousel-slide {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover; opacity: 0;
    z-index: 1; transition: opacity 0.4s ease-in-out;
}
.carousel-slide.active { opacity: 1; z-index: 2; }

.carousel-dots {
    position: absolute; bottom: 20px;
    left: 50%; transform: translateX(-50%);
    display: flex; gap: 8px; z-index: 5; pointer-events: none;
}
.dot {
    width: 6px; height: 6px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%; transition: background-color 0.3s;
}
.dot.active { background-color: #fff; }

/* =========================================
   8. TEXT OVERLAY
   ========================================= */
.project-meta {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    justify-content: flex-end; align-items: center; 
    text-align: center; padding-bottom: 30px; 
    background-color: var(--overlay-color);
    color: #fff;
    text-transform: uppercase; letter-spacing: 1px;
    opacity: 0; transition: opacity 0.3s ease; 
    z-index: 10; pointer-events: none;
}
.title { font-weight: bold; font-size: 1.2rem; margin-bottom: 0.5rem; }
.category { font-size: 0.9rem; opacity: 0.8; }

.project-item:hover .project-meta,
.carousel-item:hover .project-meta,
.split-slider:hover .project-meta { opacity: 1; }


.project-item:hover .media-wrapper img { transform: scale(1.05); }


/* =========================================
   9. TEXT BOX STYLES
   ========================================= */
.text-item {
    background-color: var(--bg-color); 
    color: var(--text-color);
    display: block; 
    position: relative; 
    width: 100%;
    height: 100%; 
}

.text-item .text-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 80%; 
    text-align: center;
}

.text-item .text-content h3 {
    text-transform: uppercase; font-size: 1.4rem;
    margin-bottom: 15px; letter-spacing: 1px; font-weight: 700;
}
.text-item .text-content p {
    font-size: 0.9rem; line-height: 1.5;
    color: #555; 
}

.text-item.double-wide { 
    grid-column: span 2; 
    height: 100%; 
}

/* =========================================
   10. SPLIT SLIDER STYLES (ELEVATOR PHYSICS)
   ========================================= */
.split-slider {
    position: relative; overflow: hidden;
    grid-column: span 2; 
    width: 100%;
    padding-top: 50%; 
    background: var(--bg-color); 
    cursor: pointer;
}

.split-col {
    position: absolute;
    top: 0;
    width: 50%; height: 100%;
    overflow: hidden;
}
.split-col.left { left: 0; }
.split-col.right { right: 0; }

.split-content {
    display: flex; flex-direction: column; width: 100%;
    position: absolute; 
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.split-col.left .split-content { top: 0; }
.split-col.right .split-content { bottom: 0; }

.split-content img {
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
}

/* =========================================
   11. CONTACT FORM SECTION
   ========================================= */
#contact-section {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 50px 0 100px 0;
    text-align: center;
}

.contact-form { display: flex; flex-direction: column; gap: 40px; }
.form-group { display: flex; flex-direction: column; align-items: flex-start; width: 100%; }
.form-group label {
    font-size: 0.85rem; text-transform: uppercase;
    font-weight: 500; margin-bottom: 5px; color: #1a1a1a;
}
.form-group input {
    width: 100%; border: none; border-bottom: 1px solid #1a1a1a;
    background: transparent; padding: 10px 0; font-family: inherit; font-size: 1rem; outline: none; border-radius: 0;
}

.submit-wrapper {
    margin-top: 40px; display: flex; flex-direction: column; align-items: center; gap: 20px; 
}

.shoot-label {
    text-transform: uppercase; font-weight: 700; letter-spacing: 1px;
    cursor: pointer; padding: 10px 20px; transition: transform 0.2s ease, color 0.2s ease;
}
.shoot-label:hover { transform: scale(1.1); color: #0044ff; }

.blue-sphere {
    width: 60px; height: 60px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #00aaff, #0044ff);
    box-shadow: 0 10px 20px rgba(0, 68, 255, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}
.blue-sphere:hover { transform: scale(1.1); box-shadow: 0 15px 30px rgba(0, 68, 255, 0.5); }

.floating-btn-link {
    position: fixed; bottom: 30px; left: 30px; z-index: 10000;
    display: block; width: 350px; overflow: hidden; height: auto; line-height: 0;
    transition: transform 0.3s ease;
}
.floating-btn-link:hover { transform: scale(1.05); }
.floating-btn-img { width: 100%; height: auto; display: block; cursor: pointer; }

/* =========================================
   13. MODAL / POPUP (UPDATED FOR CLEAN LOOK)
   ========================================= */
.overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(244,244,244,0.95); z-index: 9999; display: none; 
    align-items: center; justify-content: center;
}
.overlay.active { display: flex; }

.modal-content {
    /* Auto size to fit content, no max width constraint causing borders */
    width: auto; height: auto;
    max-width: 90vw; max-height: 90vh;
    
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    position: relative;
    
    /* REMOVED BACKGROUND & PADDING FOR CLEAN LOOK */
    background: transparent; 
    padding: 0;
    box-shadow: none;
}

.modal-media {
    display: block; line-height: 0;
    /* Optional shadow just for the image */
    box-shadow: 0 20px 40px rgba(0,0,0,0.1); 
}

.modal-media img, .modal-media video {
    max-width: 90vw; max-height: 75vh; /* slightly reduced height to fit text */
    width: auto; height: auto;
    object-fit: contain; display: block;
}

/* NEW: TEXT STYLING */
.modal-text {
    margin-top: 20px;
    text-align: center;
    color: #1a1a1a;
}
/* Hide text container if empty so it doesn't take space */
.modal-text:empty { display: none; }

.modal-text h2 {
    font-size: 1.5rem; text-transform: uppercase; margin-bottom: 5px; letter-spacing: 1px;
}
.modal-text p {
    font-size: 0.9rem; color: #555; text-transform: uppercase;
}

/* UPDATED: CLOSE BUTTON (FIXED TO TOP RIGHT) */
.close-btn {
    position: fixed; 
    top: 30px; 
    right: 30px; 
    z-index: 10000; 
    color: #1a1a1a; 
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
}
.close-btn:hover { opacity: 0.6; }

/* =========================================
   15. LAYER CAKE ANIMATION
   ========================================= */
.layer-cake-item {
    background-color: #f3f3e9; position: relative; width: 100%;
    overflow: hidden; height: 0; padding-top: 100%; perspective: 1000px;
}
.cake-wrapper {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.6); 
    width: 450px; height: 250px; transform-style: preserve-3d;
}
.cake-rotator {
    position: relative; width: 100%; height: 100%;
    transform-style: preserve-3d; animation: spinCake 6s infinite linear;
}
.cake-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain; transform: translateZ(var(--z));
}
@keyframes spinCake {
    0% { transform: rotateX(-10deg) rotateY(0deg); }
    100% { transform: rotateX(-10deg) rotateY(-360deg); }
}

/* =========================================
   16. STOCKISTS SECTION
   ========================================= */
.stockists-section {
    width: 100%; margin-bottom: 80px;
    border-top: 2px solid #1a1a1a; border-bottom: 2px solid #1a1a1a; padding: 40px 0;
}
.stock-grid {
    display: grid; grid-template-columns: 33.33% 33.33% 33.33%; gap: 20px; width: 100%;
}
.stock-col h3 {
    font-family: 'Times New Roman', Times, serif; font-size: 1.5rem; font-weight: 400; 
    text-transform: uppercase; margin-bottom: 30px; letter-spacing: -0.5px;
}
.stock-item { margin-bottom: 25px; }
.stock-title {
    font-weight: 600; color: #1a1a1a; font-size: 1rem; margin-bottom: 5px; display: block;
}
.stock-item p { font-size: 0.9rem; color: #444; line-height: 1.4; max-width: 90%; }

/* =========================================
   17. ACCOMPLISHMENTS
   ========================================= */
.henry-section { width: 100%; margin-bottom: 100px; margin-top: 60px; }
.henry-header {
    font-family: 'Times New Roman', Times, serif; font-size: 3.5rem; font-weight: 400; 
    margin-bottom: 15px; letter-spacing: -1px; line-height: 1; color: #1a1a1a;
}
.henry-divider-line { width: 100%; height: 1px; background-color: #1a1a1a; margin-bottom: 0; }

.henry-3col-row {
    display: grid; grid-template-columns: 25% 2px 74%; width: 100%;
    border-bottom: 1px solid #1a1a1a; min-height: 250px; align-items: center; 
}
.h-col-image { position: relative; cursor: pointer; overflow: hidden; height: 100%; }
.h-col-image .media-wrapper { padding-top: 0; height: 100%; }
.h-col-image img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.h-col-line { width: 1px; height: 100%; background-color: #1a1a1a; }
.h-col-text {
    padding: 30px; display: flex; flex-direction: column; justify-content: center; background-color: var(--bg-color); 
}
.h-col-text h3 {
    font-family: var(--font-stack); font-size: 1.2rem; font-weight: 700; 
    text-transform: uppercase; margin-bottom: 15px;
}
.h-col-text p { font-size: 1rem; line-height: 1.5; color: #333; margin-bottom: 5px; }

/* =========================================
   18. MOBILE RESPONSIVENESS
   ========================================= */
@media screen and (max-width: 768px) {
    #grid-container { grid-template-columns: 50% 50%; grid-auto-flow: dense; }
    header { flex-direction: column; align-items: center; text-align: center; gap: 20px; margin-bottom: 30px; }
    .header-left { align-items: center; }

    .text-item {
        height: auto !important; padding-top: 0 !important; padding: 40px 20px; 
        display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    }
    .text-item .text-content { position: relative; top: auto; left: auto; transform: none; width: 100%; }
    .text-item .text-content h3 { font-size: 1rem; line-height: 1.2; margin-bottom: 8px; }
    .text-item .text-content p { font-size: 0.8rem; line-height: 1.3; }

    .modal-content { width: 100%; height: 100%; border-radius: 0; }
    .modal-media img, .modal-media video { max-height: 60vh; }
    .project-item.banner .media-wrapper { padding-top: 56.25%; }
    #contact-section { padding-left: 20px; padding-right: 20px; padding-bottom: 120px; }
    .floating-btn-link { width: 140px; left: auto; right: 20px; bottom: 20px; }
    
    .cake-wrapper { transform: translate(-50%, -50%) scale(0.35) !important; }
    .layer-cake-item { padding-top: 100%; }

    .stockists-section { padding: 30px 0; margin-bottom: 50px; }
    .stock-grid { grid-template-columns: 100%; gap: 40px; }
    .stock-col.title-col { border-bottom: 1px solid #ccc; padding-bottom: 10px; margin-bottom: 10px; }

    .henry-header { font-size: 1.8rem; }
    .henry-3col-row { grid-template-columns: 100%; grid-template-rows: 250px 1px auto; min-height: auto; }
    .h-col-image { height: 100%; }
    .h-col-line { width: 100%; height: 1px; }
    .h-col-text { padding: 20px; border-left: none; }
}