/* ===================================
   CSS Variables & Custom Properties
   =================================== */
:root {
    /* Colors */
    --color-bg: #FAFAFA;
    --color-bg-pure: #FFFFFF;
    --color-text: #1A1A1A;
    --color-text-muted: #6B6B6B;
    --color-accent: #C4B5A3;
    --color-accent-light: #E8E2DA;
    --color-border: #E5E5E5;
    --color-hover-bg: #F5F3F0;

    /* Typography */
    --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Cormorant Garamond', Georgia, serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;
    --space-2xl: 12rem;

    /* Layout */
    --header-height: 80px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   Reset & Base Styles
   =================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    overflow-x: scroll;
    overflow-y: hidden;
    height: 100%;
    scroll-snap-type: x mandatory;
}

body {
    font-family: var(--font-sans);
    font-weight: 300;
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    overflow-x: scroll;
    overflow-y: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    height: 100%;
    width: fit-content;
    min-width: 100vw;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Hide scrollbar but keep functionality */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    height: 0;
    width: 0;
    display: none;
}

html, body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* ===================================
   Horizontal Scroll Container
   =================================== */
.horizontal-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: fit-content;
    min-width: 100vw;
    height: 100vh;
    min-height: 100vh;
}

/* ===================================
   Panel Base Styles
   =================================== */
.panel {
    flex-shrink: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: var(--space-md);
    box-sizing: border-box;
    scroll-snap-align: start;
}

/* ===================================
   Header / Navigation
   =================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    height: var(--header-height);
    background: transparent;
    transition: var(--transition-base);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

.header.scrolled {
    background: transparent;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.header-logo {
    display: flex;
    align-items: center;
    opacity: 1;
    transition: var(--transition-slow);
}

.header.scrolled .header-logo {
    opacity: 1;
}

.header-logo-img {
    height: 40px;
    width: auto;
}

.menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    gap: 6px;
    z-index: 110;
}

.menu-line {
    display: block;
    width: 24px;
    height: 1px;
    background: var(--color-text);
    transition: var(--transition-base);
}

.menu-btn.active .menu-line:first-child {
    transform: rotate(45deg) translate(2.5px, 2.5px);
}

.menu-btn.active .menu-line:last-child {
    transform: rotate(-45deg) translate(2.5px, -2.5px);
}

/* Navigation Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
    background: var(--color-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-slow);
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.nav-link {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.02em;
    transform: translateY(30px);
    opacity: 0;
    transition: var(--transition-base);
    transition-delay: 0s;
}

.nav-overlay.active .nav-link {
    transform: translateY(0);
    opacity: 1;
}

.nav-overlay.active .nav-link:nth-child(1) { transition-delay: 0.1s; }
.nav-overlay.active .nav-link:nth-child(2) { transition-delay: 0.2s; }
.nav-overlay.active .nav-link:nth-child(3) { transition-delay: 0.3s; }
.nav-overlay.active .nav-link:nth-child(4) { transition-delay: 0.4s; }

.nav-link:hover {
    color: var(--color-accent);
}

/* ===================================
   Hero Section
   =================================== */
.hero {
    background: var(--color-bg-pure);
    justify-content: center;
    align-items: center;
}

.hero-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-construction {
    text-align: center;
    overflow: hidden;
}

.hero-logo {
    max-width: 525px;
    width: 90vw;
    height: auto;
}

video.hero-logo {
    background: var(--color-bg-pure);
    border: none;
    outline: none;
    transform: scale(1.03);
}

/* Scroll Indicator - Horizontal */
.scroll-indicator {
    position: absolute;
    right: var(--space-lg);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
}

.scroll-text {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.scroll-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, var(--color-text-muted), transparent);
    animation: scrollPulseH 2s ease-in-out infinite;
}

@keyframes scrollPulseH {
    0%, 100% {
        opacity: 0.3;
        transform: scaleX(0.5);
        transform-origin: left;
    }
    50% {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* ===================================
   Philosophy Section
   =================================== */
.philosophy {
    background: var(--color-bg);
    justify-content: center;
    align-items: center;
}

.philosophy-content {
    max-width: 700px;
    text-align: center;
}

.philosophy-header {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.philosophy-text {
    font-family: var(--font-serif);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 300;
    font-style: italic;
    line-height: 1.7;
    color: var(--color-text);
}

.philosophy-text em {
    font-style: italic;
    color: var(--color-accent);
}

.philosophy-subtext {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--color-text-muted);
    max-width: 500px;
    margin: 0 auto;
}

/* ===================================
   Projects Intro Section
   =================================== */
.projects-intro {
    background: var(--color-bg-pure);
}

.panel-content {
    text-align: center;
}

.section-title {
    font-family: var(--font-sans);
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 200;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: var(--space-md);
}

.section-subtitle {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-style: italic;
    color: var(--color-text-muted);
}

/* ===================================
   Project Panels
   =================================== */
.project-panel {
    width: 100vw;
    height: 100vh;
    background: var(--color-bg);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    padding: var(--space-lg);
    box-sizing: border-box;
}

.project-panel:nth-child(even) {
    flex-direction: row-reverse;
    background: var(--color-bg-pure);
}

.project-image-wrapper {
    flex: 0 0 55%;
    max-width: 800px;
    overflow: hidden;
    position: relative;
}

.project-image {
    width: 100%;
    height: 65vh;
    max-height: 600px;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

video.project-image {
    display: block;
}

.project-panel:hover .project-image {
    transform: scale(1.03);
}

.project-info {
    flex: 0 0 30%;
    max-width: 400px;
}

.project-number {
    font-family: var(--font-serif);
    font-size: 0.875rem;
    font-style: italic;
    color: var(--color-accent);
    display: block;
    margin-bottom: var(--space-sm);
}

.project-title {
    font-family: var(--font-sans);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
    line-height: 1.2;
}

.project-category {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    font-weight: 300;
    font-style: italic;
    color: var(--color-text-muted);
}

/* ===================================
   Services Section
   =================================== */
.services {
    background: var(--color-bg-pure);
    width: 100vw;
}

.services-header {
    margin-bottom: var(--space-lg);
    text-align: center;
}

.services-header .section-title {
    font-size: clamp(0.75rem, 1vw, 0.875rem);
    letter-spacing: 0.3em;
    color: var(--color-text-muted);
    margin-bottom: 0;
}

.services-list {
    width: 100%;
    max-width: 600px;
    border-top: 1px solid var(--color-border);
}

.service-item {
    display: flex;
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition-base);
    cursor: pointer;
}

.service-item:hover {
    padding-left: var(--space-md);
    background: linear-gradient(to right, var(--color-hover-bg) 0%, transparent 100%);
}

.service-number {
    font-family: var(--font-serif);
    font-size: 0.875rem;
    font-style: italic;
    color: var(--color-text-muted);
    width: 60px;
    flex-shrink: 0;
}

.service-name {
    font-family: var(--font-sans);
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    font-weight: 300;
    letter-spacing: 0.05em;
    flex: 1;
}

.service-arrow {
    font-size: 1.5rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition-base);
    color: var(--color-text-muted);
}

.service-item:hover .service-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ===================================
   Contact Section
   =================================== */
.contact {
    background: var(--color-bg);
    width: 100vw;
}

.contact-content {
    text-align: center;
    max-width: 600px;
}

.contact-intro {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-style: italic;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.contact-link {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 300;
    font-style: italic;
    line-height: 1.2;
    display: inline-block;
    position: relative;
}

.contact-link::after {
    content: '';
    position: absolute;
    bottom: 0.1em;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--color-text);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-base);
}

.contact-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ===================================
   Footer
   =================================== */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    z-index: 50;
    pointer-events: none;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand,
.footer-info,
.footer-social a {
    pointer-events: auto;
}

.footer-tagline {
    font-family: var(--font-serif);
    font-size: 0.875rem;
    font-style: italic;
    color: var(--color-text-muted);
}

.footer-info {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.footer-copyright {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
}

.footer-social {
    display: flex;
    gap: var(--space-md);
}

.social-link {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    transition: var(--transition-fast);
}

.social-link:hover {
    color: var(--color-text);
}

/* ===================================
   Horizontal Progress Indicator
   =================================== */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--color-accent);
    width: 0%;
    z-index: 101;
    transition: width 0.1s linear;
}

/* ===================================
   Reveal Animations
   =================================== */
.reveal {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-delay-1 {
    transition-delay: 0.15s;
}

.reveal-delay-2 {
    transition-delay: 0.3s;
}

.reveal-delay-3 {
    transition-delay: 0.45s;
}

/* Hero animations - always visible on load */
.hero .reveal {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: heroFadeIn 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.3s;
}

@keyframes heroFadeIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 1024px) {
    .project-panel {
        flex-direction: column !important;
        gap: var(--space-md);
        padding: var(--space-md);
    }

    .project-image-wrapper {
        flex: none;
        width: 100%;
        max-width: none;
    }

    .project-image {
        height: 45vh;
        max-height: 450px;
    }

    .project-info {
        flex: none;
        max-width: none;
        text-align: center;
    }
}

@media (max-width: 768px) {
    :root {
        --space-lg: 2rem;
        --space-xl: 3rem;
        --space-md: 1.5rem;
    }

    /* Switch to vertical scrolling on mobile */
    html, body {
        overflow-x: hidden;
        overflow-y: auto;
        height: auto;
        width: 100%;
        scroll-snap-type: none;
    }

    .horizontal-container {
        flex-direction: column;
        width: 100%;
        min-width: 100%;
        height: auto;
        min-height: auto;
    }

    .panel {
        width: 100%;
        min-height: 100vh;
        height: auto;
        padding: var(--space-md);
    }

    /* Header */
    .header {
        padding: var(--space-sm) var(--space-md);
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        background: rgba(250, 250, 250, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .header-logo-img {
        height: 35px;
    }

    /* Hero */
    .hero {
        min-height: 100vh;
        padding-top: 0;
        padding-bottom: var(--space-xl);
    }

    .hero-content {
        margin-top: -10vh;
    }

    .hero-logo {
        max-width: 420px;
        width: 80vw;
    }

    /* Scroll indicator - vertical on mobile */
    .scroll-indicator {
        right: auto;
        bottom: var(--space-lg);
        top: auto;
        transform: translateX(-50%);
        left: 50%;
        flex-direction: column;
    }

    .scroll-text {
        writing-mode: horizontal-tb;
        text-orientation: mixed;
    }

    .scroll-line {
        width: 1px;
        height: 40px;
        background: linear-gradient(to bottom, var(--color-text-muted), transparent);
        animation: scrollPulseV 2s ease-in-out infinite;
    }

    @keyframes scrollPulseV {
        0%, 100% {
            opacity: 0.3;
            transform: scaleY(0.5);
            transform-origin: top;
        }
        50% {
            opacity: 1;
            transform: scaleY(1);
        }
    }

    /* Philosophy */
    .philosophy {
        min-height: auto;
        padding: var(--space-xl) var(--space-md);
    }

    .philosophy-content {
        max-width: 100%;
    }

    .philosophy-header {
        font-size: 0.7rem;
        margin-bottom: var(--space-md);
    }

    .philosophy-text {
        font-size: 1.1rem;
        line-height: 1.6;
    }

    /* Projects intro */
    .projects-intro {
        min-height: 50vh;
    }

    .section-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .section-subtitle {
        font-size: 1rem;
    }

    /* Project panels */
    .project-panel {
        flex-direction: column !important;
        min-height: auto;
        padding: var(--space-lg) var(--space-md);
        gap: var(--space-md);
    }

    .project-image-wrapper {
        width: 100%;
        flex: none;
    }

    .project-image {
        height: 50vw;
        min-height: 200px;
        max-height: 300px;
    }

    .project-info {
        text-align: center;
        flex: none;
        max-width: 100%;
    }

    .project-number {
        font-size: 0.75rem;
    }

    .project-title {
        font-size: 1.25rem;
        letter-spacing: 0.1em;
    }

    .project-category {
        font-size: 0.9rem;
    }

    /* Services */
    .services {
        min-height: auto;
        padding: var(--space-xl) var(--space-md);
    }

    .services-header .section-title {
        font-size: 0.7rem;
    }

    .services-list {
        max-width: 100%;
    }

    .service-item {
        padding: var(--space-sm) 0;
    }

    .service-name {
        font-size: 1.1rem;
    }

    .service-number {
        width: 40px;
        font-size: 0.75rem;
    }

    .service-arrow {
        display: none;
    }

    /* Contact */
    .contact {
        min-height: 60vh;
        padding: var(--space-xl) var(--space-md);
    }

    .contact-intro {
        font-size: 1rem;
    }

    .contact-link {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
    }

    /* Footer */
    .footer {
        position: relative;
        padding: var(--space-md);
        border-top: 1px solid var(--color-border);
        pointer-events: auto;
    }

    .footer-content {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }

    .footer-info {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .footer-social {
        justify-content: center;
    }

    /* Reveal animations - vertical on mobile */
    .reveal {
        transform: translateY(30px);
    }

    .reveal.active {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    :root {
        --space-md: 1rem;
        --space-lg: 1.5rem;
    }

    .header-logo-img {
        height: 30px;
    }

    .hero-logo {
        max-width: 330px;
        width: 75vw;
    }

    .hero-content {
        margin-top: -15vh;
    }

    .philosophy-text {
        font-size: 1rem;
    }

    .section-title {
        font-size: clamp(1.75rem, 10vw, 2.5rem);
    }

    .project-title {
        font-size: 1.1rem;
    }

    .project-image {
        min-height: 180px;
        max-height: 250px;
    }

    .service-name {
        font-size: 1rem;
    }

    .contact-link {
        font-size: clamp(1.25rem, 7vw, 2rem);
    }

    .service-arrow {
        display: none;
    }

    .footer-tagline,
    .footer-copyright,
    .social-link {
        font-size: 0.65rem;
    }
}

/* ===================================
   Reduced Motion
   =================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .horizontal-container {
        scroll-behavior: auto;
    }
}
