/* --- Base Setup & Variables --- */
@font-face {
    font-family: 'FK Grotesk';
    src: url('fonts/FKGrotesk-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'FK Grotesk';
    src: url('fonts/FKGrotesk-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'FK Grotesk';
    src: url('fonts/FKGrotesk-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'Ivy Ora Display';
    src: url('fonts/IvyOraDisplay-RegularItalic.woff2') format('woff2');
    font-weight: normal;
    font-style: italic;
}

:root {
    --bg-color: #FFFFFF;
    --text-black: #000000;
    --text-grey: #808080;
    --pill-bg: #b0a198;
    --link-tx-style: underline;
    --margin-base: 20px;

    --font-sans: 'FK Grotesk', 'Manrope', sans-serif;
    --font-serif: 'Ivy Ora Display', 'Instrument Serif', serif;

    --detail-tx: 1rem;
    --copy-tx: 1rem;
    --menu-main-tx: 3.5rem;
    --serif-tx: 1.2rem;
    --hero-tx: 3rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-color);
    color: var(--text-black);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-black); border-radius: 0; border: none; }
html { scrollbar-width: thin; scrollbar-color: var(--text-black) transparent; }

a { color: inherit; text-decoration: none; }

/* --- Utilities & Grid System --- */
.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 20px;
    padding: 0 var(--margin-base);
    width: 100%;
}
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-5 { grid-column: span 5; }
.col-span-9 { grid-column: span 9; }
.col-span-12 { grid-column: span 12; }

.right-align { text-align: right; justify-self: end; }
.grey-text { color: var(--text-grey); }
.serif-italic { font-family: var(--font-serif); font-style: italic; }
.underline { text-decoration: underline; }
.pointer { cursor: pointer; }
.flex-row { display: flex; align-items: center; }
.ml-20 { margin-left: 20px; }
.h-100 { height: 100%; }
.hidden { display: none !important; }

/* Typography */
.menu-text-small, .footer-section div, .footer-copy, .footer-links-mobile {  font-family: var(--font-sans);font-size: var(--detail-tx); }
.menu-text-large {  font-family: var(--font-sans);font-size: var(--menu-main-tx); letter-spacing: -1px; }
.menu-r2-tagline, .proj-industry { font-family: var(--font-serif); font-size: var(--serif-tx); }
p, .proj-title, .proj-intro, .desc-text { font-family: var(--font-sans); font-size: var(--copy-tx); line-height: 1.4; }
.footer-net-list, .footer-bill-info, .footer-about-desc{line-height: 1.4;}

/* --- Header & Menu --- */
#main-header {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    background-color: var(--bg-color);
    color: var(--text-black);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.4s ease, color 0.4s ease;
}

/* Header Drawer Open State (Inverts colors smoothly) */
#main-header.drawer-open {
    background-color: var(--text-black);
    color: var(--bg-color);
}
#main-header.drawer-open #header-logo-img { filter: invert(1); }
#main-header.drawer-open .burger-line { background-color: var(--bg-color); }

.header-hide-all { transform: translateY(-100%); }
.header-show-menu-only { transform: translateY(calc(-10vw - 10px)); }

@media (max-width: 1920px) { .header-show-menu-only { transform: translateY(-12%); } }

.logo-container {
    width: 100%; padding: 0; margin: 0; margin-bottom: 20px; line-height: 0; display: block;
}
.logo-container img { width: 100%; height: auto; display: block; transition: filter 0.4s ease; }

.menu-container { padding-bottom: 20px; }

/* Desktop Grid Mapping for Menu */
.menu-r1-loc { grid-column: 1 / span 3; }
.menu-r1-brand { grid-column: 4 / span 4; }
.menu-r1-socials { grid-column: 8 / span 4; display: flex; gap: 50px; }
.menu-r1-email { grid-column: 12; }

.menu-r2-proj { grid-column: 1 / span 3; margin-top: 20px; }
.menu-r2-about { grid-column: 4 / span 4; margin-top: 20px; }
.menu-r2-lorem { grid-column: 8 / span 4; margin: 20px 0px 12px 0px; line-height: 1.2; display: flex; flex-direction: column; justify-content: flex-end;  gap: 10px; }
.menu-r2-tagline { grid-column: 12; margin-top: 20px; align-self: end; white-space: nowrap; }

.hide-desktop { display: none; }

/* --- Hero Section --- */
.hero-section { margin-top: 24vw; margin-bottom: 8vw; }
.hero-text { font-size: var(--hero-tx); line-height: 1.1; text-transform: uppercase; font-weight: 500; letter-spacing: -1px; }

/* --- Projects Section --- */
.projects-wrapper { margin-bottom: 300px; }
.project-block { margin-bottom: 150px; }
.project-info { margin-bottom: 20px; align-items: center; }

.proj-client-intro { grid-column: 1 / span 3; white-space: nowrap; }
.proj-industry { grid-column: 4 / span 4; }
/* Mediums left aligned */
.proj-mediums { grid-column: 8 / span 5; display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }

.proj-plus {
    display: inline-flex; justify-content: center; align-items: center;
    width: 24px; height: 24px; border: none; position: relative;
}
.proj-plus::before { content: ''; position: absolute; width: 20px; height: 1.5px; background: var(--text-black); }
.proj-plus::after { content: ''; position: absolute; width: 1.5px; height: 20px; background: var(--text-black); }

.pill {
    background-color: var(--pill-bg); color: var(--bg-color);
    padding: 2px 6px 4px 6px; border-radius: 20px; font-size: var(--detail-tx); white-space: nowrap;
}

/* Project Visuals & Carousel */
.project-visuals { position: relative; width: 100%; overflow: hidden; }
.carousel-track { display: flex; gap: 6px; height: 400px; width: max-content; }
.carousel-img { height: 100%; width: 25vw; object-fit: cover; background-color: #eee; cursor: zoom-in; }

@keyframes scrollLeft { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes scrollRight { 0% { transform: translateX(-50%); } 100% { transform: translateX(0); } }
.scroll-left { animation: scrollLeft 30s linear infinite; }
.scroll-right { animation: scrollRight 30s linear infinite; }

.proj-desc-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 0; 
    background-color: var(--bg-color); z-index: 10; overflow: hidden;
    transition: height 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.proj-desc-overlay.active { height: 50%; }
.proj-desc-overlay .grid { padding-top: 20px; padding-bottom: 20px; }


/* --- Footer --- */
.footer-section { padding-bottom: 0; row-gap: 50px; }
.footer-section a { text-decoration: var(--link-tx-style); }
.footer-about-title { grid-column: 1; grid-row: 1; }
.footer-about-desc  { grid-column: 2 / span 4; grid-row: 1; }

.footer-net-title   { grid-column: 7; grid-row: 1; }
.footer-net-list    { grid-column: 8 / span 2; grid-row: 1; }

.footer-bill-title  { grid-column: 10; grid-row: 1; }
.footer-bill-info   { grid-column: 11 / span 2; grid-row: 1; }

.footer-inq-title   { grid-column: 1; grid-row: 2; }
.footer-inq-email   { grid-column: 2 / span 4; grid-row: 2; }

.footer-off-title   { grid-column: 7; grid-row: 2; }
.footer-off-info    { grid-column: 8 / span 5; grid-row: 2; }

.footer-logo { 
    grid-column: 1 / span 3; grid-row: 3;align-self: flex-end; 
    line-height: 0; margin: 0 0 0 -20px; padding: 0; width: calc(100% + 20px); 
}
.footer-logo img { width: 100%; height: auto; display: block; margin: 0; }
.footer-copy { grid-column: 5 / span 3; align-self: flex-end; margin-bottom: 20px; }

/* Wrap links together for desktop/tablet/mobile handling */
.footer-links-mobile { grid-column: 9 / span 3; display: flex; justify-content: space-between; align-self: flex-end; margin-bottom: 20px; width: 100%; }

/* --- Lightbox & Toast --- */
#lightbox {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(255, 255, 255, 0.95); z-index: 9999;
    display: flex; justify-content: center; align-items: center; cursor: zoom-out;
}
#lightbox-img { max-width: 90vw; max-height: 90vh; box-shadow: 0 10px 40px rgba(0,0,0,0.1); cursor: pointer; }
.lightbox-close { position: absolute; top: 30px; right: 40px; font-size: 40px; font-weight: 300; cursor: pointer; }

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.blink-colon { animation: blink 1s infinite; display: inline-block; }

#copy-toast {
    position: fixed; bottom: -50px; left: 50%; transform: translateX(-50%);
    background: var(--text-black); color: var(--bg-color); padding: 10px 20px;
    border-radius: 5px; font-size: 14px; z-index: 9999; transition: bottom 0.3s ease;
}
#copy-toast.show { bottom: 30px; }


/* =========================================
   MEDIA QUERIES
   ========================================= */

/* --- TABLET (max-width: 1024px) --- */
@media (max-width: 1024px) {
    .grid { grid-template-columns: repeat(6, 1fr); }
    
    .hide-tablet { display: none; }
    .hide-desktop { display: block; }
    
    /* Header Tablet Row 1 */
    .menu-r1-brand { grid-column: 1 / span 2; }
    .menu-r1-socials { grid-column: 3 / span 2; justify-content: center; }
    .menu-r1-email { display: block; grid-column: 5 / span 2; justify-self: flex-end; }
    
    /* Header Tablet Drawer */
    .drawer-wrapper { 
        grid-column: 1 / -1; 
        max-height: 0; overflow: hidden; opacity: 0; 
        transition: max-height 0.5s ease, opacity 0.4s ease, padding 0.5s ease;
    }
    .drawer-wrapper.active { max-height: 500px; opacity: 1; padding-top: 30px; padding-bottom: 10px; }
    
    .drawer-inner-grid { padding: 0; } /* Inherit outer bounds */
    .drawer-proj { grid-column: 1 / span 3; }
    .drawer-email { grid-column: 4 / span 3; }
    .drawer-about { grid-column: 1 / span 6; margin-top: 15px; }
    .drawer-sub { grid-column: 1 / span 6; margin-top: 15px; display: flex; flex-direction: column; gap: 4px; }

    /* 100% Hamburger line pushed down */
    .menu-burger { 
        grid-column: 1 / -1; 
        display: flex; flex-direction: column; gap: 8px;
        padding-top: 20px; cursor: pointer;
    }
    .burger-line { width: 100%; height: 1.5px; background-color: var(--text-black); transition: background-color 0.4s ease; }

    .hero-text { font-size: 3rem; grid-column: 1 / span 6; }

    /* Projects Tablet */
    .proj-client-intro { grid-column: 1 / span 3; }
    .proj-industry { grid-column: 4 / span 3; justify-self: flex-end; text-align: right; }
    .proj-mediums { grid-column: 1 / span 6; justify-content: flex-start; margin-top: 15px; }
    .carousel-img { width: 45vw; }

    /* Footer Tablet */
    .footer-about-title { grid-column: 1; grid-row: 1; }
    .footer-about-desc { grid-column: 2 / span 6; grid-row: 1;}
    .footer-net-title { grid-column: 1; grid-row: 2; }
    .footer-net-list { grid-column: 2 / span 2; grid-row: 2; }
    .footer-inq-title { grid-column: 4; grid-row: 2; }
    .footer-inq-email { grid-column: 5 / span 2; grid-row: 2; }
    .footer-bill-title { grid-column: 4; grid-row: 3; }
    .footer-bill-info { grid-column: 5 / span 2; grid-row: 3; }
    .footer-off-title { grid-column: 1; grid-row: 3; }
    .footer-off-info { grid-column: 2 / span 1; grid-row: 3;}

    .footer-logo { grid-column: 1 / span 3;grid-row: 4; }
    .footer-copy { display: none; } 
    .footer-links-mobile { grid-column: 4 / span 3; justify-content: flex-end; gap: 20px; }
}

/* --- MOBILE (max-width: 768px) --- */
@media (max-width: 768px) {
    .grid { grid-template-columns: repeat(2, 1fr); row-gap: 15px; }
    .header-show-menu-only { transform: translateY(-15vh); }
    
    /* Header Mobile Row 1 */
    .menu-r1-brand { grid-column: 1; }
    .menu-r1-socials { grid-column: 2; justify-content: flex-end; gap: 15px; }
    .menu-r1-email { display: none; } /* Kept only in drawer for mobile */
    
    /* Drawer Mobile Layout */
    .drawer-proj { grid-column: 1; }
    .drawer-email { grid-column: 2; }
    .drawer-about { grid-column: 1 / span 2; }
    .drawer-sub { grid-column: 1 / span 2; }

    .hero-text { font-size: 2rem; grid-column: 1 / span 2; margin-top: 35vw; }

    /* Projects Mobile */
    .project-info { row-gap: 6px; }
    .proj-client-intro { grid-column: 1 / span 2; white-space: normal; flex-wrap: wrap; }
    .proj-industry { grid-column: 1 / span 2; justify-self: flex-start; text-align: left; }
    .proj-mediums { grid-column: 1 / span 2; justify-content: flex-start; }
    
    .hide-mobile { display: none; }
    .carousel-img { width: 80vw; }
    .desc-text { grid-column: 1 / span 2; }

    /* Footer Mobile Hard Grid Alignment */
    .footer-section { 
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        row-gap: 0; /* Reset row gap to control exactly via explicit rows */
    }
    
    .footer-about-title { grid-column: 1 / span 2; grid-row: 1; margin-bottom: 5px; }
    .footer-about-desc { grid-column: 1 / span 2; grid-row: 2; margin-bottom: 30px; }
    
    /* Force network and inquiries onto same row aligned tops */
    .footer-net-title { grid-column: 1; grid-row: 3; margin-bottom: 5px; }
    .footer-inq-title { grid-column: 2; grid-row: 3; margin-bottom: 5px; }
    
    .footer-net-list { grid-column: 1; grid-row: 4; margin-bottom: 30px; }
    .footer-inq-email { grid-column: 2; grid-row: 4; align-self: flex-start; margin-bottom: 30px;}
    
    .footer-bill-title { grid-column: 1 / span 2; grid-row: 5; margin-bottom: 5px; }
    .footer-bill-info { grid-column: 1 / span 2; grid-row: 6; margin-bottom: 30px; }
    
    .footer-off-title { grid-column: 1 / span 2; grid-row: 7; margin-bottom: 5px; }
    .footer-off-info { grid-column: 1 / span 2; grid-row: 8; margin-bottom: 50px; }

    /* SVG logo absolute bottom */
    .footer-logo { grid-column: 1; grid-row: 9; margin: 0 0 0 -20px; align-self: end; }
    
    /* Links 20px padding bottom */
    .footer-links-mobile { 
        grid-column: 2; grid-row: 9; 
        display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; 
        gap: 10px; padding-bottom: 20px; margin-bottom: 0;
    }
}