/* ==========================================================================
   REIL STUDIO REDESIGN
   ========================================================================== */

/* Typography & Defaults */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden; /* Prevent default scrolling on body */
    background-color: #f2f2f2; /* Maintain the classic light-grey background */
    font-family: "Liter", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Link Styles */
a:link, a:visited {
    color: #000;
    text-decoration: none;
    transition: opacity 0.25s ease, color 0.25s ease;
}

a:hover {
    opacity: 0.6;
}

a:active {
    color: #555;
}

/* Main Snap-Scroll Container */
.projects-wrapper {
    height: 100vh;
    width: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    touch-action: pan-y;
}

.projects-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Slide Setup */
.project-slide {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    justify-content: center; /* Centered media block vertically */
    align-items: center;
    box-sizing: border-box;
    position: relative; /* Position relative for absolute children */
    overflow: hidden;
    touch-action: pan-y;
}

/* Fixed Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2.5%;
    box-sizing: border-box;
    z-index: 100;
    background: transparent;
    pointer-events: none; /* Allow scroll wheel and clicks to pass through */
}

.site-header a,
.site-header div {
    pointer-events: auto; /* Re-enable clicks on interactive elements */
}

.header-left {
    width: 35%;
    text-align: left;
}

.header-left a {
    font-family: "Liter", sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 2px;
    color: #000;
}

.header-center {
    width: 30%;
    text-align: center;
    font-family: "Liter", sans-serif;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 1.5px;
    color: #000;
}

.header-center .current-num {
    font-weight: 700;
}

.header-center .total-num {
    color: #999;
}

.header-right {
    width: 35%;
    text-align: right;
}

.header-right a {
    font-family: "Liter", sans-serif;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 2px;
    color: #000;
}

/* Fixed Footer */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 110px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* Align elements to the bottom of the footer area */
    padding: 0 2.5% 30px 2.5%;
    box-sizing: border-box;
    z-index: 100;
    background: transparent;
    pointer-events: none;
}

.site-footer span,
.site-footer div {
    pointer-events: auto;
}

.footer-left {
    width: 45%;
    font-family: "Liter", sans-serif;
    font-weight: 300;
    font-size: 11px;
    line-height: 1.6em;
    color: #000; /* Styled black to match nyc/mmxxvi */
    letter-spacing: 0.5px;
    text-align: left;
}

.footer-right {
    width: 45%;
    text-align: right;
    font-family: "Liter", sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #000;
    letter-spacing: 2px;
    line-height: 1.6em;
}

/* Slide Content Layout */
.project-media-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 2; /* Sit in front of background text */
}

.project-media-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    max-height: 52vh;
    box-sizing: border-box;
    overflow: hidden;
    background-color: transparent;
}

a.project-media-link:hover {
    opacity: 1; /* Prevent double opacity-fade for link tags */
}

.project-media-link img,
.project-media-link video {
    display: block;
    max-width: 100%;
    max-height: 52vh;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.25s ease;
}

/* Hover state triggers smooth scale and opacity fade for all media types */
.project-media-link:hover img,
.project-media-link:hover video {
    transform: scale(1.012);
    opacity: 0.6;
}

/* Project Details (Absolute bottom center of viewport, above footer) */
.project-info-wrapper {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 65vw;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center-align flex children */
    text-align: center; /* Center-align text */
    gap: 3.5px;
    z-index: 2; /* Sit in front of background text */
}

.project-info-wrapper .project-title {
    font-family: "Liter", sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1.5px;
    color: #000;
    text-transform: uppercase;
}

.project-info-wrapper .project-desc {
    font-family: "Liter", sans-serif;
    font-weight: 300;
    font-size: 13px;
    color: #111;
    letter-spacing: 0.5px;
    line-height: 1.4em;
}

.project-info-wrapper .project-tags {
    font-family: "Liter", sans-serif;
    font-weight: 500;
    font-size: 10px;
    color: #3F51B5;
    letter-spacing: 1px;
    margin-top: 1px;
    text-transform: uppercase;
}

/* Oversized Background Text (Solid black watermark) */
.slide-bg-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Impact', 'Helvetica Neue', Arial, sans-serif;
    font-size: 85vh;
    font-weight: 900;
    color: #000;
    text-transform: uppercase;
    line-height: 0.75;
    letter-spacing: -0.05em;
    text-align: center;
    user-select: none;
    white-space: nowrap;
    opacity: 0;
    z-index: 1; /* Sits behind media and content */
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

/* Trigger Background Text on Hover of Media */
.project-slide:has(.project-media-link:hover) .slide-bg-text {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.03);
}

/* Responsive Rules */
@media screen and (max-width: 980px) {
    .site-header {
        height: 70px;
    }
    
    .header-center {
        display: none; /* Hide counter in header on tablet/mobile to avoid crowding */
    }
    
    .site-footer {
        flex-direction: column;
        height: auto;
        padding: 20px 5%;
        gap: 15px;
        background: rgba(242, 242, 242, 0.95);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        pointer-events: auto; /* Capture clicks on overlay footer */
        align-items: center;
    }
    
    .footer-left {
        width: 100%;
        text-align: center;
        order: 1;
    }
    
    .footer-right {
        width: 100%;
        text-align: center;
        order: 2;
    }
    
    .project-slide {
        padding-top: 70px;
        padding-bottom: 240px; /* Extra spacing on mobile for stacked footer and absolute text */
    }
    
    .project-info-wrapper {
        max-width: 90vw;
        bottom: 190px; /* Lift text on mobile to avoid overlapping the stacked mobile footer */
    }
    
    .project-media-link {
        max-height: 45vh;
    }
    
    .project-media-link img,
    .project-media-link video {
        max-height: 45vh;
    }
    
    .slide-bg-text {
        display: none !important;
    }
}

@media screen and (max-height: 600px) {
    .project-media-link {
        max-height: 40vh;
    }
    .project-media-link img,
    .project-media-link video {
        max-height: 40vh;
    }
    .site-footer {
        padding-bottom: 15px;
    }
    .project-info-wrapper {
        bottom: 90px;
    }
}

/* ==========================================================================
   INFO PAGE STYLES (from stylesheet26_pre.css)
   ========================================================================== */

#navbar {
    margin: auto;
    padding-top: 2%;
    z-index: 9;
    width: 100%;
}

#navleft {
    margin: auto;
    float: left;
    text-align: left;
    color: #000;
    font-family: "Liter", sans-serif;
    font-weight: 500;
    font-style: normal;
    font-size: 14px;
    line-height: 1.5em;
    letter-spacing: 2px;
    padding-left: 2.5%;
    z-index: 9;
}

#container {
    margin: auto;
    padding-top: 2%;
    padding-bottom: .5%;
    width: 95%;
}

#containerspace {
    margin: auto;
    padding-bottom: 5%;
}

#myinfo {
    color: #333;
    font-family: "Liter", sans-serif;
    font-weight: 300;
    font-style: normal;
    font-size: 30px;
    line-height: 1.5em;
    text-align: left;
    letter-spacing: .1em;
}

#projectcopy {
    color: #111;
    font-family: "Liter", sans-serif;
    font-weight: 300;
    font-style: normal;
    font-size: 14px;
    line-height: 1.5em;
    letter-spacing: .5px;
    text-align: left;
    padding-top: 1%;
    max-width: 700px;
}

/* Modern CSS Grid Layout for Info Page */
html.info-page-html,
body.info-page {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
}

body.info-page #container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 140px 2.5% 160px 2.5%;
    box-sizing: border-box;
}

.info-bio-section {
    max-width: 900px;
    width: 100%;
}

.info-grid-4col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 3.5%;
    align-items: start;
}

#myinfo {
    color: #000;
    font-family: "Liter", sans-serif;
    font-weight: 300;
    font-size: 30px;
    line-height: 1.55em;
    text-align: left;
    letter-spacing: .02em;
    margin: 0;
}

#projectcopy {
    color: #000;
    font-family: "Liter", sans-serif;
    font-weight: 300;
    font-size: 13.5px;
    line-height: 1.6em;
    letter-spacing: .5px;
    text-align: left;
}

.info-section-title {
    font-family: "Liter", sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1.5px;
    color: #000;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.info-page ul {
    margin: 10px 0 0 0;
    padding-left: 18px;
    list-style-type: none;
}

.info-page li {
    position: relative;
    margin-bottom: 12px;
    font-family: "Liter", sans-serif;
    font-weight: 300;
    font-size: 13px;
    line-height: 1.6em;
    color: #222;
}

/* Minimalist dot indicator for list items */
.info-page li::before {
    content: "•";
    color: #3F51B5; /* Matches project tags color */
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.info-page li .sub-list-text {
    font-size: 11px;
    color: #666;
    display: block;
    line-height: 1.5em;
    margin-top: 4px;
}

.info-divider {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin: 50px 0;
    width: 100%;
}

/* Responsive Overrides */
@media screen and (max-width: 980px) {
    body.info-page #container {
        padding-top: 100px;
        padding-bottom: 220px;
    }
    
    .info-grid-4col {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    #myinfo {
        font-size: 22px;
        line-height: 1.45em;
    }
}

/* ==========================================================================
   PRODUCT PAGE STYLES
   ========================================================================== */

html.product-page-html,
body.product-page {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    background-color: #f2f2f2;
    touch-action: pan-y;
}

body.product-page #container {
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 2.5%;
    padding-right: 2.5%;
    padding-top: 0;
    padding-bottom: 0;
    width: 95%;
    box-sizing: border-box;
}

body.product-page #containerabout {
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 2.5%;
    padding-right: 2.5%;
    padding-top: 50px;
    padding-bottom: 0;
    width: 95%;
    box-sizing: border-box;
}

body.product-page {
    padding-top: 140px;
    padding-bottom: 160px;
    box-sizing: border-box;
}

/* Hero section on product pages (centered like home page) */
body.product-page #container:first-of-type {
    height: 100vh;
    margin-top: -140px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
    touch-action: pan-y;
}

body.product-page #container:first-of-type .section.group {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

body.product-page #container:first-of-type .col {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    max-height: 52vh;
}

body.product-page #container:first-of-type img,
body.product-page #container:first-of-type video {
    max-height: 52vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    touch-action: pan-y;
}

/* Modern Grid System using Flexbox */
.product-page .section.group {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: start;
    width: 100%;
    margin: 0;
    padding: 0;
}

.product-page .col {
    flex: 1;
    box-sizing: border-box;
}

/* Spans using calc to support mixed rows and exact spacing */
.product-page .span_1_of_1,
.product-page .span_3_of_3 {
    width: 100%;
    flex: 0 0 100%;
}

.product-page .span_1_of_2 {
    width: calc(50% - 15px);
    flex: 0 0 calc(50% - 15px);
}

.product-page .span_1_of_3 {
    width: calc(33.333% - 20px);
    flex: 0 0 calc(33.333% - 20px);
}

.product-page .span_1_of_4 {
    width: calc(25% - 22.5px);
    flex: 0 0 calc(25% - 22.5px);
}

.product-page .span_1_of_5 {
    width: calc(20% - 24px);
    flex: 0 0 calc(20% - 24px);
}

.product-page .span_2_of_5 {
    width: calc(40% - 18px);
    flex: 0 0 calc(40% - 18px);
}

.product-page .span_4_of_5 {
    width: calc(80% - 6px);
    flex: 0 0 calc(80% - 6px);
}

/* Spacers */
.product-page #containerspace {
    height: 50px;
    width: 100%;
    clear: both;
}

/* Media styling inside grids */
.product-page img,
.product-page video {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Project Text Elements */
.product-page #projecttitle {
    color: #000;
    font-family: "Liter", sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.5em;
    text-align: left;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.product-page #projectdescription {
    color: #111;
    font-family: "Liter", sans-serif;
    font-weight: 300;
    font-size: 13px;
    line-height: 1.6em;
    text-align: left;
    letter-spacing: 0.5px;
    max-width: 600px;
}

.product-page #projecttags {
    color: #3F51B5;
    font-family: "Liter", sans-serif;
    font-weight: 500;
    font-size: 10px;
    line-height: 1.5em;
    text-align: left;
    margin-top: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    max-width: 650px;
}

.product-page #imagetitle {
    color: #666;
    font-family: "Liter", sans-serif;
    font-weight: 300;
    font-size: 11px;
    margin-top: 8px;
    line-height: 1.5em;
    text-align: left;
    letter-spacing: 0.5px;
}

.product-page hr {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin: 40px 0;
    width: 100%;
}

/* Responsive Overrides */
@media screen and (max-width: 980px) {
    body.product-page {
        padding-top: 100px;
        padding-bottom: 60px;
    }
    
    body.product-page .site-footer {
        display: none;
    }
    
    body.product-page #container:first-of-type {
        height: auto;
        margin-top: 0;
        overflow: hidden;
        touch-action: pan-y;
    }
    
    body.product-page #container:first-of-type .col {
        height: auto;
        max-height: 45vh;
    }
    
    body.product-page #container:first-of-type img,
    body.product-page #container:first-of-type video {
        max-height: 45vh;
    }
    
    .product-page .section.group {
        flex-direction: column;
        gap: 30px;
    }
    
    .product-page .col {
        width: 100% !important;
        flex: 0 0 100% !important;
    }
}

/* ==========================================================================
   ALL PROJECTS PAGE STYLES
   ========================================================================== */

html.all-projects-html,
body.all-projects-page {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    background-color: #f2f2f2;
    touch-action: pan-y;
}

body.all-projects-page #container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 140px 2.5% 160px 2.5%;
    box-sizing: border-box;
}

.all-projects-page .projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px 30px;
    width: 100%;
}

.all-projects-page .project-card {
    display: flex;
    flex-direction: column;
    text-align: left;
    
    /* Animation & Stagger properties */
    opacity: 0;
    --stagger-time: 0.06s;
    animation: fadeInProject 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: calc(var(--sibling-index, 0) * var(--stagger-time));
    animation-delay: calc(sibling-index() * var(--stagger-time));
}

@keyframes fadeInProject {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .all-projects-page .project-card {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

.all-projects-page .project-card-media {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    margin-bottom: 15px;
}

.all-projects-page .project-card-media img,
.all-projects-page .project-card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.25s ease;
}

/* Hover state for project card elements */
.all-projects-page .project-card.is-link:hover .project-card-media img,
.all-projects-page .project-card.is-link:hover .project-card-media video {
    transform: scale(1.02);
    opacity: 0.7;
}

.all-projects-page .project-card-title {
    font-family: "Liter", sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    color: #000;
    text-transform: uppercase;
    margin: 0 0 5px 0;
}

.all-projects-page .project-card-desc {
    font-family: "Liter", sans-serif;
    font-weight: 300;
    font-size: 12px;
    line-height: 1.5em;
    color: #222;
    margin: 0 0 8px 0;
    letter-spacing: 0.3px;
}

.all-projects-page .project-card-tags {
    font-family: "Liter", sans-serif;
    font-weight: 500;
    font-size: 9px;
    color: #3F51B5;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 0;
}

/* Home page counter link style */
.all-projects-link-wrapper {
    margin-top: 4px;
}

.all-projects-link {
    font-family: "Liter", sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1px;
    color: #000;
    text-decoration: none;
    text-transform: uppercase;
    opacity: 0.5;
    transition: opacity 0.25s ease;
}

.all-projects-link:hover {
    opacity: 1 !important;
}

/* Responsive Overrides */
@media screen and (max-width: 980px) {
    body.all-projects-page #container {
        padding-top: 100px;
        padding-bottom: 220px;
    }
    
    .all-projects-page .projects-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* ==========================================================================
   LOADING SCREEN STYLES
   ========================================================================== */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f2f2f2;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: auto;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-counter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Impact', 'Helvetica Neue', Arial, sans-serif;
    font-size: 85vh;
    font-weight: 900;
    color: #000;
    text-transform: uppercase;
    line-height: 0.75;
    letter-spacing: -0.05em;
    text-align: center;
    user-select: none;
    white-space: nowrap;
}

@media screen and (max-width: 980px) {
    .loader-counter {
        font-size: 35vh;
    }
}
