/* ========================================================================= */
/* AMMONITE STUDIO | SHARED DESIGN SYSTEM                                    */
/* ========================================================================= */

/* --- SYSTEM VARIABLES --- */
:root {
    /* DEFAULT (LANDING / WHITE MODE) */
    --bg: #FFFFFF;
    --ammonite-blue: #0000FF;
    --ink: #000000;
    --ink-rgb: 0, 0, 0;
    --line: rgba(var(--ink-rgb), 0.2);

    --font-main: 'Inter', sans-serif;
    --font-code: 'Space Mono', monospace;

    --fs-mono: 15px;
    --fs-inter: 15px;

    --border: 1px solid var(--ink);
    --pad-x: 25px;
    --pad: 30px;

    --logo-size: 15px;
}

/* ARCHITECTURE MODE (BLACK / DATA-SHEET) */
body.arch-mode {
    --bg: #000000;
    --ink: #FFFFFF;
    --ink-rgb: 255, 255, 255;
    --line: rgba(var(--ink-rgb), 0.2);
    --border: 1px solid #FFFFFF;
    /* The active color remains blue, as per requirements */
}

/* DESIGN MODE (RED / PHOTO) */
body.design-mode {
    --bg: #CC0000;
    --ink: #000000;
    --ink-rgb: 0, 0, 0;
    --line: rgba(var(--ink-rgb), 0.2);
    --border: 1px solid #000000;
}

/* --- GLOBAL RESET --- */
* {
    box-sizing: border-box;
    cursor: none;
    /* Custom cursor everywhere */
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--font-code);
    font-size: var(--fs-mono);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    /* Smooth transition for background color shifts (used in archive page) */
    transition: background-color 0.8s ease, color 0.3s ease;
}

/* Use different body styles for the landing vs other pages */
body.immersive {
    overflow: hidden;
    background-color: #000000;
}

body.scrollable {
    padding-bottom: 60px;
    /* Space for footer */
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s;
}

a:hover {
    opacity: 0.6;
}

button {
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
    color: inherit;
    text-transform: uppercase;
    outline: none;
}

::selection {
    background: var(--ink);
    color: var(--bg);
}

/* --- CUSTOM CURSOR (BLUEPRINT STYLE) --- */
#cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.05s ease-out;
    mix-blend-mode: difference;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cursor-tool {
    width: 20px;
    height: 20px;
    position: relative;
}

.cursor-tool::before,
.cursor-tool::after {
    content: '';
    position: absolute;
    background-color: #FFFFFF;
}

/* Horizontal Line */
.cursor-tool::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    transform: translateY(-50%);
}

/* Vertical Line */
.cursor-tool::after {
    left: 50%;
    top: 0;
    height: 100%;
    width: 1px;
    transform: translateX(-50%);
}

/* Hover Interaction: Spin */
body:hover #cursor.hovered .cursor-tool {
    transform: rotate(45deg);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- TYPOGRAPHY --- */
.inter {
    font-family: var(--font-main);
    font-size: var(--fs-inter) !important;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.mono {
    font-family: var(--font-code);
    font-size: var(--fs-mono) !important;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.bold {
    font-weight: 700;
}

/* Active states now just rely on ink/bolding rather than blue */
.text-active {
    color: var(--ink) !important;
}

/* --- 4-CORNER NAVIGATION --- */
.nav-corner {
    position: fixed;
    z-index: 100;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-code);
    font-size: var(--fs-mono);
    line-height: 20px;
    font-weight: 400;
    pointer-events: auto;
    mix-blend-mode: difference;
    color: #FFFFFF !important;
    padding: 15px;
    margin: -15px;
}

.nav-corner::before,
.nav-corner::after {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.nav-corner::before {
    content: '[';
    transform: translateX(calc(-100% - 4px));
}

.nav-corner::after {
    content: ']';
    transform: translateX(4px);
}

.nav-corner:hover::before,
.nav-corner.text-active::before,
.nav-corner:hover::after,
.nav-corner.text-active::after {
    opacity: 1;
}

.nav-corner.logo {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: var(--logo-size) !important;
    line-height: 20px;
    /* Match standard line box */
    letter-spacing: -0.04em;
}

.nav-corner.logo:hover::before,
.nav-corner.logo:hover::after,
.nav-corner.logo.text-active::before,
.nav-corner.logo.text-active::after {
    content: none;
}

body.design-mode .nav-corner {
    mix-blend-mode: normal !important;
    color: var(--ink) !important;
}

/* Corner Positions */
.nav-tl {
    top: var(--pad-x);
    left: var(--pad-x);
}

.nav-tr {
    top: var(--pad-x);
    right: var(--pad-x);
}

.nav-bl {
    bottom: var(--pad-x);
    left: var(--pad-x);
}

.nav-br {
    bottom: var(--pad-x);
    right: var(--pad-x);
}



/* ========================================================================= */
/* PAGE SPECIFIC STYLES                                                      */
/* ========================================================================= */

/* --- 1. LANDING PAGE (.immersive) --- */
#viewport {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    background-color: transparent; /* Lets body dots show through */
}


.contact-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 900px;
    pointer-events: none;
    mix-blend-mode: difference;
    color: #FFFFFF !important;
}

.contact-block {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    pointer-events: auto;
}

.contact-entry {
    font-size: var(--fs-mono);
    font-weight: 400;
    text-transform: uppercase;
    line-height: 1.1;
    letter-spacing: 0.05em;
}

.email-link {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.location-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 15px;
    opacity: 0.7;
}

/* --- 2. MULTI-PAGE LAYOUTS (.scrollable) --- */
main {
    margin-top: calc(var(--logo-size) + var(--pad) * 2.5);
    position: relative;
    z-index: 10;
}

.manifesto-section {
    padding: 40px var(--pad-x);
    border-bottom: var(--border);
    width: 100%;
}

.manifesto-text {
    font-size: var(--fs-inter);
    line-height: 1.1;
    margin: 0;
    font-weight: 400;
}

/* --- 3. ARCHIVE PAGE --- */
#mode-switcher {
    display: none !important;
}

.project-list {
    width: 100%;
    padding-top: 0;
}

#mobile-swiper-container {
    height: 100vh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 5;
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}

/* Revert to normal mode blending */
body.design-mode #mobile-swiper-container {
    mix-blend-mode: normal;
}

/* Match nav-corner behavior in design mode (red background) */
body.design-mode #mobile-swiper-container {
    mix-blend-mode: normal;
}

/* Swiper Content Rows */
.project-row-container {
    border-bottom: none;
    cursor: none;
    transition: opacity 0.3s ease;
}

.row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    height: 20vh;
    gap: 4px;
    padding: var(--pad);
    position: relative;
    z-index: 10;
    transition: background 0.1s;
    
    /* Default color follows the mode's ink color */
    color: var(--ink) !important;
}

/* In design mode (red), titles should be white */
body.design-mode .project-row-container .row {
    color: #FFFFFF !important;
}

.header-row {
    display: none !important;
}

.project-row-container:hover .row {
    opacity: 1;
}

/* Info Row Layout */
.info-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.hide-mobile {
    display: inline-block;
}

/* Columns */
.col-id,
.col-meta {
    font-family: var(--font-code) !important;
    font-weight: 400 !important;
    font-size: var(--fs-mono);
    text-transform: uppercase;
    display: inline-block;
    margin: 0;
}

.col-name {
    font-family: var(--font-code) !important;
    font-weight: 700 !important;
    font-size: var(--fs-mono) !important;
    text-transform: uppercase;
    display: block;
    margin: 0;
}

/* Filter display logic */
.category-arch,
.category-design,
.category-photo {
    display: block;
}

body.arch-mode .category-design,
body.arch-mode .category-photo {
    display: none;
}

body.design-mode .category-arch {
    display: none;
}

/* Swiper active states */
.swiper-slide {
    height: auto !important;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.swiper-slide-active {
    opacity: 1;
}

/* Shared Preview Container */
#shared-preview {
    opacity: 1; /* Always visible */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    background-color: var(--bg);
    border: none;
    pointer-events: none;
}

.bg-slide {
    width: 100vw !important;
    height: 100vh !important;
    background-size: cover;
    background-position: center;
    opacity: 1 !important;
}

/* Opaline Glass Effect */
#shared-preview::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: transparent;
    transition: background 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
}

body.arch-mode #shared-preview::after {
    backdrop-filter: blur(8px) saturate(110%);
    -webkit-backdrop-filter: blur(8px) saturate(110%);
    background: rgba(0, 0, 0, 0.2);
}

body.design-mode #shared-preview::after {
    backdrop-filter: blur(8px) saturate(110%);
    -webkit-backdrop-filter: blur(8px) saturate(110%);
    background: rgba(204, 0, 0, 0.2);
}

body.arch-mode #shared-preview {
    filter: grayscale(100%);
}

body.design-mode #shared-preview {
    filter: grayscale(100%);
    mix-blend-mode: multiply;
}

/* --- 4. ABOUT PAGE --- */
.about-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 0;
}

.about-content-overlay {
    margin-top: 70vh !important;
    position: relative;
    z-index: 10;
    width: 100%;
    background-color: var(--bg);
    padding: calc(var(--logo-size) + var(--pad) * 3) var(--pad-x) 40px var(--pad-x);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.about-text-container {
    width: 100%;
    line-height: 1.4;
}

/* Dynamic Lists */
.dynamic-list-container {
    margin-bottom: 60px;
}

.list-section-title {
    opacity: 0.5;
    margin-bottom: 20px;
}

.list-grid-row {
    display: grid;
    grid-template-columns: 60px 1fr 1fr;
    gap: 15px;
    margin-bottom: 8px;
    font-family: var(--font-code);
    font-size: var(--fs-mono);
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
    transition: opacity 0.3s ease;
}

.list-grid-row:hover {
    opacity: 0.6;
}

.list-title {
    font-weight: 700;
}

/* --- 5. PROJECT DETAIL PAGE --- */
.project-detail-content {
    padding: 40px var(--pad-x);
}

.project-meta-container {
    margin-bottom: 40px;
}

.data-row {
    grid-template-columns: 100px 1fr !important;
}

.project-detail-content img, .project-detail-content video {
    max-width: 100%;
    display: block;
    margin-bottom: 20px;
}

.project-description {
    font-size: var(--fs-inter);
    line-height: 1.3;
}

@media (max-width: 768px) {
    :root {
        --fs-mono: 13px;
        --fs-inter: 13px;
        --logo-size: 13px;
    }

    .location-row {
        flex-direction: column;
        gap: 15px;
    }

    .contact-container {
        width: 90%;
    }

    /* Nav corners */
    .nav-tl { top: 15px; left: 15px; }
    .nav-tr { top: 15px; right: 15px; }
    .nav-bl { bottom: 15px; left: 15px; }
    .nav-br { bottom: 15px; right: 15px; }

    .logo.nav-tl,
    .logo.nav-tr {
        font-size: var(--logo-size) !important;
        min-width: auto;
    }

    /* About */
    .about-content-overlay {
        padding-top: calc(var(--logo-size) + var(--pad) * 3);
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .list-grid-row {
        grid-template-columns: 50px 1fr;
    }

    .data-row {
        grid-template-columns: 80px 1fr !important;
    }

    .list-loc {
        display: none;
    }

    /* Archive overrides for mobile */
    #cursor {
        display: none !important;
    }

    #mode-switcher {
        display: none !important;
    }

    main {
        margin-top: 0;
    }

    .hide-mobile {
        display: none !important;
    }

    /* Restore default cursor on mobile */
    * {
        cursor: auto;
    }
}

/* ========================================================================= */
/* VIEW TRANSITIONS & SEAMLESS LOADING                                       */
/* ========================================================================= */

@view-transition {
    navigation: auto;
}

#shared-preview .swiper-slide-active {
    view-transition-name: project-hero;
}

#p-hero-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    view-transition-name: project-hero;
    background-color: var(--bg);
}

#p-hero-container img, #p-hero-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-content-layer {
    margin-top: 70vh !important;
    background-color: var(--bg);
    position: relative;
    z-index: 10;
    padding-top: 60px; /* Space before content starts */
}

/* --- TITLE TRANSITION --- */
#projects-container .swiper-slide-active .col-name {
    view-transition-name: project-title;
}

#p-hero-title-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 100;
    animation: fadeOutTitle 1.5s forwards cubic-bezier(0.25, 1, 0.5, 1);
    animation-delay: 0.5s;
}

#p-hero-title-vt {
    text-transform: uppercase;
    color: var(--ink); /* Can be white or ink depending on bg */
    view-transition-name: project-title;
    margin: 0;
    padding: 0;
}

@keyframes fadeOutTitle {
    to { opacity: 0; visibility: hidden; }
}

/* --- COMING SOON ANIMATIONS & STYLES --- */
.coming-soon-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    pointer-events: auto;
    font-family: var(--font-code);
    text-transform: uppercase;
}

.contact-block,
.coming-soon-block {
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}