/* ==========================================================================
   OCTAMARINE - BRUTALIST EDITORIAL SYSTEM (modern-index.css)
   ========================================================================== */

/* 1. Theme Color Variables */
:root {
    --bg-main: #020202;
    --bg-panel: #050505;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --border-core: #1a1a1a;
}

html.day-mode {
    --bg-main: #f8fafc;
    --bg-panel: #f4f4f8;
    --text-main: #111111;
    --text-muted: #4b5563;
    --border-core: #e5e7eb;
}

/* 2. Document Foundations */
html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background-color: var(--bg-main);
    color: var(--text-main);
    cursor: crosshair;
    transition: background-color 1s ease, color 1s ease;
}

/* Hide all scrollbars */
::-webkit-scrollbar {
    display: none;
}
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-sizing: border-box;
}

/* 3. Seamless Dual Video Background */
.video-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    background-color: var(--bg-main);
}

.bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Dual Video Viewport Rules */
@media (min-width: 769px) {
    #hero-desktop {
        display: block;
        width: 100vw;
        height: 100dvh;
        object-fit: cover;
    }
    #hero-mobile {
        display: none;
    }
}

/* 4. Top-Right Utility (JetBrains Mono, 14px) */
.top-utility {
    position: absolute;
    top: 40px;
    right: 40px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 30px; /* spacing */
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    color: #FFFFFF;
    transition: color 1s ease;
}

html.day-mode .top-utility {
    color: #050505;
}

.utility-phone {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.utility-phone:hover {
    opacity: 0.7;
}

.theme-toggle {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: inherit;
    cursor: crosshair;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.theme-toggle:hover {
    transform: rotate(15deg);
    opacity: 0.7;
}

.theme-toggle svg {
    display: block;
}

/* 5. Hero Typography (Space Grotesk) */
.hero-container {
    position: absolute;
    top: 38%;
    left: 10%;
    z-index: 10;
    pointer-events: none;
}

.hero-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9.5vw;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 3px rgba(255, 255, 255, 0.9);
    padding: 12px 24px;
    margin: 0;
    display: inline-block;
    user-select: none;
    line-height: 0.9;
    text-transform: lowercase;
    transition: color 1s ease, -webkit-text-stroke 1s ease;
}

html.day-mode .hero-brand {
    color: transparent;
    -webkit-text-stroke: 3px rgba(0, 0, 0, 0.8);
}

/* 6. Bottom Navigation (JetBrains Mono, 14px) */
.bottom-nav {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 4vw;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    color: #FFFFFF;
    transition: color 1s ease;
}

html.day-mode .bottom-nav {
    color: #050505;
}

.bottom-nav .nav-link {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.bottom-nav .nav-link:hover {
    opacity: 0.6;
}

/* 7. Services Drawer Overlay */
.services-drawer {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.services-drawer.open {
    opacity: 1;
    pointer-events: auto;
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-left: 15vw;
    padding-top: 15vh;
}

.services-list:hover a {
    opacity: 0.3;
}

.services-list a {
    font-family: 'Space Grotesk', sans-serif;
    color: #ffffff;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 400;
    text-decoration: none;
    text-transform: lowercase;
    transition: transform 0.4s ease, opacity 0.4s ease;
    cursor: crosshair;
    display: flex;
    align-items: baseline;
    margin: 0;
}

.services-list a:hover {
    transform: translateX(15px);
    opacity: 1;
}

.services-list .service-index {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    text-transform: uppercase;
    opacity: 0.5;
    margin-right: 20px;
    font-weight: 500;
}

/* 8. Mobile Responsiveness */
@media (max-width: 768px) {
    /* Task 3: Top Utility Balance */
    .top-utility {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        gap: 2px 15px;
        align-items: center;
        top: 20px;
        left: 20px;
        right: 20px;
    }
    .home-anchor {
        grid-column: 1;
        grid-row: 1 / span 2;
    }
    .theme-toggle {
        grid-column: 3;
        grid-row: 1 / span 2;
    }
    .utility-label {
        display: block !important;
        grid-column: 2;
        grid-row: 1;
        text-align: right;
        font-size: 10px;
        line-height: 1.2;
    }
    .utility-phone {
        grid-column: 2;
        grid-row: 2;
        text-align: right;
        font-size: 14px;
        line-height: 1.2;
        margin: 0;
    }

    /* Task 2: About Page Mobile Reflow */
    .editorial-container {
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
    }
    .editorial-left, .editorial-right {
        height: auto !important;
        overflow-y: visible !important;
    }

    /* Task 1: Footer Collapsing */
    .global-footer {
        display: none !important;
    }

    .hero-container {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .hero-brand {
        font-size: 14vw;
        text-align: center;
        width: 100%;
        padding: 12px 10px;
        box-sizing: border-box;
    }

    .bottom-nav {
        bottom: 25px;
        bottom: calc(20px + env(safe-area-inset-bottom));
        width: 100%;
        justify-content: center;
        gap: 8vw;
        margin-top: 1rem;
    }
    
    .bottom-nav .nav-link {
        font-size: 17px;
    }

    /* Dual Video Viewport Rules (Mobile) */
    #hero-mobile {
        display: block;
        width: 100vw;
        height: 100dvh;
        object-fit: cover;
    }
    #hero-desktop {
        display: none;
    }

    /* Topo Background Mobile Anchoring */
    .topo-bg-fixed {
        background-position: -180px bottom !important;
    }
}

/* 9. Editorial Sub-Pages (e.g. welding.html) */
.topo-bg-fixed {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 0;
    background-image: url('images/night-map.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.4s ease-in-out;
    pointer-events: none;
}

#wind-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    pointer-events: none;
    z-index: 1;
}

html.day-mode .topo-bg-fixed { 
    background-image: url('images/day-map.webp');
}

.home-anchor {
    display: flex;
    align-items: center;
    transition: opacity 0.4s ease;
    opacity: 1;
}

.home-anchor:hover {
    opacity: 0.7;
}

#ghost-logo {
    height: 24px;
    width: auto;
}

.editorial-container {
    position: absolute;
    top: 15vh;
    bottom: 120px; /* Leave space for bottom nav */
    left: 40px;
    right: 40px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    z-index: 10;
    overflow-y: auto;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.editorial-container::-webkit-scrollbar,
.editorial-left::-webkit-scrollbar,
.editorial-right::-webkit-scrollbar {
    display: none;
}

.editorial-left {
    grid-column: 2 / span 5; /* Spans ~5 columns, heavy left margin */
    display: flex;
    flex-direction: column;
}

.editorial-right {
    grid-column: 8 / span 5; /* Spans ~5 columns, right-middle */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.editorial-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(3rem, 6vw, 6rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    color: #F0F0F0;
    margin: 0 0 2rem 0;
    line-height: 1;
    transition: color 1s ease;
}

html.day-mode .editorial-title {
    color: #050505;
}

.editorial-manifesto {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1rem, 1.2vw, 1.5rem);
    font-weight: 400;
    line-height: 1.8;
    color: #A0A0A0;
    margin-bottom: 3rem;
}

html.day-mode .editorial-manifesto {
    color: #4A4A4A;
}

.editorial-manifesto p {
    margin: 0 0 1.5rem 0;
}

.sub-service-block {
    margin-bottom: 2.5rem;
}

.sub-service-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #F0F0F0;
    border-bottom: 1px solid #F0F0F0;
    padding-bottom: 8px;
    margin-bottom: 1rem;
    width: fit-content;
    transition: color 1s ease, border-color 1s ease;
}

html.day-mode .sub-service-title {
    color: #050505;
    border-color: #050505;
}

.sub-service-body {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: #888888;
    line-height: 1.6;
    margin: 0;
}

html.day-mode .sub-service-body {
    color: #666666;
}

.editorial-image-wrapper {
    width: 100%;
    max-width: 600px;
}

.editorial-image {
    width: 100%;
    height: auto;
    opacity: 0.9;
    border-radius: 2rem;
    display: block;
}

.editorial-caption {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: #A0A0A0;
    margin-top: 1rem;
    text-align: left;
    transition: color 1s ease;
}

html.day-mode .editorial-caption {
    color: #4A4A4A;
}

@media (max-width: 1024px) {
    .editorial-container {
        grid-template-columns: 1fr;
        top: 100px;
        left: 20px;
        right: 20px;
        padding-bottom: 80px;
    }
    .editorial-left {
        grid-column: 1 / -1;
    }
    .editorial-right {
        grid-column: 1 / -1;
        align-items: center;
        margin-top: 3rem;
    }
}

/* 10. Contact Page Components */
.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.contact-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: #A0A0A0;
    transition: color 1s ease;
}

html.day-mode .contact-label {
    color: #4A4A4A;
}

.contact-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.5rem, 2vw, 2rem);
    font-weight: 400;
    color: #F0F0F0;
    text-decoration: none;
    transition: color 1s ease, opacity 0.3s ease;
}

html.day-mode .contact-value {
    color: #050505;
}

a.contact-value:hover {
    opacity: 0.6;
}

/* Minimalist Terminal Form */
.terminal-form {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.terminal-form input,
.terminal-form textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    outline: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: #F0F0F0;
    padding: 10px 0;
    transition: border-color 0.3s ease, color 1s ease;
}

html.day-mode .terminal-form input,
html.day-mode .terminal-form textarea {
    color: #050505;
    border-bottom: 1px solid #CCC;
}

.terminal-form input:focus,
.terminal-form textarea:focus {
    border-bottom: 1px solid #F0F0F0;
}

html.day-mode .terminal-form input:focus,
html.day-mode .terminal-form textarea:focus {
    border-bottom: 1px solid #050505;
}

.terminal-form input::placeholder,
.terminal-form textarea::placeholder {
    color: #555;
    opacity: 1; /* Firefox fix */
}

html.day-mode .terminal-form input::placeholder,
html.day-mode .terminal-form textarea::placeholder {
    color: #999;
}

.terminal-form textarea {
    resize: none;
}

.terminal-form input:-webkit-autofill,
.terminal-form input:-webkit-autofill:hover, 
.terminal-form input:-webkit-autofill:focus, 
.terminal-form input:-webkit-autofill:active {
    transition: background-color 5000s ease-in-out 0s;
    -webkit-text-fill-color: #FAFAFA;
}

html.day-mode .terminal-form input:-webkit-autofill,
html.day-mode .terminal-form input:-webkit-autofill:hover, 
html.day-mode .terminal-form input:-webkit-autofill:focus, 
html.day-mode .terminal-form input:-webkit-autofill:active {
    -webkit-text-fill-color: #0A0A0A;
}

.terminal-submit {
    background: transparent;
    border: none;
    outline: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #F0F0F0;
    text-align: left;
    cursor: crosshair;
    padding: 0;
    margin-top: 1rem;
    transition: opacity 0.3s ease, color 1s ease;
}

html.day-mode .terminal-submit {
    color: #050505;
}

.terminal-submit:hover {
    opacity: 0.6;
}

/* 11. About Gallery */
.gallery-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.gallery-feed::-webkit-scrollbar {
    display: none;
}

.gallery-feed img {
    width: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.2);
    opacity: 1;
    transition: all 0.4s ease;
    cursor: crosshair;
}

.gallery-feed img:hover {
    filter: grayscale(0%);
}

/* 12. Copyright Footer */
.copyright-text {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    pointer-events: none;
    transition: color 1s ease;
    z-index: 20;
}

html.day-mode .copyright-text {
    color: rgba(0, 0, 0, 0.4);
}

/* 13. Terms & Agreement UI */
.legal-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.legal-list li {
    position: relative;
    padding-left: 1.5rem;
}

.legal-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #F0F0F0;
    font-size: 1.2rem;
}

html.day-mode .legal-list li::before {
    color: #050505;
}

.legal-copyright {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 4rem;
    padding-bottom: 2rem;
    transition: color 1s ease;
}

html.day-mode .legal-copyright {
    color: rgba(0, 0, 0, 0.4);
}

/* 14. Full Height Visual Gallery */
.gallery-full {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 40px;
    width: 38vw;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    z-index: 10;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 15%);
    mask-image: linear-gradient(to bottom, transparent, black 15%);
}

.gallery-full .gallery-feed {
    padding-top: 15vh;
}

.gallery-full::-webkit-scrollbar {
    display: none;
}

@media (max-width: 1024px) {
    .gallery-full {
        position: relative;
        right: auto;
        width: 100%;
        height: 60vh;
    }
}

/* 16. Global Footer */
.global-footer {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.2);
    z-index: 20;
    pointer-events: auto;
    transition: color 1s ease;
}

html.day-mode .global-footer {
    color: rgba(0, 0, 0, 0.2);
}

.global-footer a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.global-footer a:hover {
    opacity: 0.6;
}

/* 17. 404 Error Page */
.error-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 4vw, 4rem);
    font-weight: 700;
    color: #F0F0F0;
    margin-bottom: 2rem;
    transition: color 1s ease;
}
html.day-mode .error-title {
    color: #050505;
}
.error-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: #888888;
    text-decoration: none;
    transition: color 0.3s ease;
}
.error-link:hover {
    color: #F0F0F0;
}
html.day-mode .error-link {
    color: #666666;
}
html.day-mode .error-link:hover {
    color: #050505;
}
