/* ==========================================================================
   CITYTRADES HOME STYLESHEET
   File: css/pages/home.css
   Context: Styles specific to the Home Page
   ========================================================================== */

/* ==========================================================================
   [SECTION 1] HERO: THE PARALLAX CURTAIN & SHUTTLE
   ========================================================================== */
.hero-logo-shuttle {
    position: relative;
    width: 50vw;
    max-width: 800px;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 10px auto;
    z-index: 2000;
    will-change: transform, width, top, left;
}

.hero-logo-shuttle img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 rgba(0, 0, 0, 0.6));
}

/* Navbar Logic (Hide/Show) */
body[data-page="home"] .navbar .logo,
body[data-page="home"] .navbar .hamburger {
    opacity: 0;
}

body[data-page="home"] .navbar .logo.is-visible,
body[data-page="home"] .navbar .hamburger.is-visible {
    opacity: 1;
    transition: opacity 0.5s ease;
}

@media (max-width: 1024px) {
    .hero-logo-shuttle {
        width: 70vw;
        margin-bottom: 10px;
    }
}

/* Hero Section Layout */
.hero-curtain-section {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    z-index: 0;
    overflow: hidden;
    margin-top: calc(var(--header-height) * -1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-bg-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    will-change: transform, filter;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    text-align: center;
}

/* Hero Typography */
.hero-content .hero-title {
    font-size: clamp(1.5rem, 4vw, 3rem);
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0em;
    text-transform: uppercase;
    color: #fff;
    margin: 0;
    opacity: 0.9;
    mix-blend-mode: overlay;
}

.hero-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-word,
.hero-divider {
    display: inline-block;
    will-change: transform, opacity, filter;
    transition: transform 0.1s linear;
    /* JS Driven */
}

.hero-divider {
    margin: 0 15px;
    color: var(--accent);
}

.hero-title .line-2 {
    animation-delay: 0.2s;
}

.hero-text-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
}

/* Vertical Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 120px;
    /* Adjusted: Lowered from 200px */
    left: 40px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 15px;
    transform-origin: left bottom;
    transform: rotate(90deg);
    /* Text reads Top-to-Bottom */
    color: #ffffff;
    font-family: var(--font-header);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.25em;
    opacity: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    /* Shadow for contrast */
}

/* On mobile, we show it but suck it in slightly */
@media (max-width: 768px) {
    .scroll-indicator {
        display: flex;
        left: 20px;
        bottom: 160px;
        /* Lifted to avoid clipping */
        transform: rotate(90deg) scale(0.85);
        /* Slightly smaller presence */
    }
}

.scroll-text {
    /* Ensure text is legible */
    font-weight: 500;
}

.scroll-arrow {
    font-size: 14px;
    /* Container is rotated 90deg (Down). X-axis aligns with Screen Y (Down). */
    /* Icon is 'arrow-down'. Rotated 90deg -> Points Left. */
    /* We want it to point Down (Screen Y+). */
    /* Screen Y+ is Container X+. */
    /* So arrow needs to point Right (Container X+). */
    /* Arrow Down (↓) needs to rotate -90 to become Right (→). */
    transform: rotate(-90deg);
    animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: rotate(-90deg) translateX(0);
    }

    40% {
        transform: rotate(-90deg) translateX(5px);
    }

    60% {
        transform: rotate(-90deg) translateX(3px);
    }
}

/* Adjust legacy prompt if needed */
.hero-scroll-prompt {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    display: block;
    margin-top: 10px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.7);
    animation: pulse 4s infinite;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}


/* ==========================================================================
   [SECTION 2] GLOBAL: SECTION LAYERING
   ========================================================================== */
.z-overlap {
    position: relative;
    z-index: 10;
    background-color: var(--bg-color);
    box-shadow: 0 -50px 100px rgba(0, 0, 0, 0.5);
}

.section-border-top {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 20;
}

.section-border-top::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--accent);
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.z-overlap.is-visible .section-border-top::after {
    width: 100%;
}


/* ==========================================================================
   [SECTION 3] INTRO: THE MANIFESTO
   ========================================================================== */
.intro-manifesto-section {
    padding: 200px 0;
    background: #050505;
    overflow: hidden;
}

.manifesto-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 60px;
}

.manifesto-label {
    width: 200px;
    padding-top: 15px;
    border-top: 2px solid var(--accent);
}

.label-text {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--accent);
    text-transform: uppercase;
    display: block;
    margin-top: 10px;
}

.manifesto-content {
    flex: 1;
}

.read-line {
    font-size: clamp(3rem, 5vw, 5.5rem);
    line-height: 1.1;
    font-weight: 800;
    color: #222;
    margin: 0;
    transition: color 0.5s ease;
    word-wrap: break-word;
}

.read-line.is-visible {
    color: #fff;
}

.highlight {
    color: #222;
    transition: color 0.5s ease;
}

.read-line.is-visible .highlight {
    color: var(--accent);
}

.manifesto-sub {
    margin-top: 60px;
    max-width: 900px;
    font-size: 1.4rem;
    color: #888;
}


/* ==========================================================================
   [SECTION 4] SERVICES SECTION (Sticky Deck)
   ========================================================================== */
.services-pin-section {
    padding: 0;
    background-color: #000;
}

.pin-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    width: 100%;
    max-width: 100%;
}

.pin-visuals {
    width: 50%;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.visual-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 0.8s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.visual-item.is-active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}

.visual-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(50%) contrast(1.1);
}

.visual-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
}

.pin-content {
    width: 50%;
    padding-bottom: 20vh;
    padding-left: 5vw;
    padding-right: 5vw;
    background: #000;
}

.pin-text-block {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0.3;
    transition: opacity 0.5s ease;
}

.pin-text-block.is-active {
    opacity: 1;
}


.pin-text-block h2 {
    font-size: clamp(3rem, 5vw, 5rem);
    line-height: 0.9;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.btn-text {
    color: #fff;
    text-transform: uppercase;
    text-decoration: none;
    font-weight: 700;
    margin-top: 5px;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-text i {
    transition: transform 0.3s ease;
    color: var(--accent);
}

.btn-text:hover i {
    transform: translateX(5px);
}


/* ==========================================================================
   [SECTION 5] PROCESS SECTION: THE DARK AXIS
   ========================================================================== */
.horizon-scroll-section {
    background-color: #0b0b0b;
    color: #fff;
    height: 400vh;
    /* Scroll distance */
    position: relative;
    z-index: 10;
}

.horizon-sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.axis-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    z-index: 1;
}

.axis-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20vw;
    height: 1px;
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
    animation: scanLine 4s infinite linear;
}

@keyframes scanLine {
    0% {
        left: -20vw;
    }

    100% {
        left: 100vw;
    }
}

.horizon-header {
    position: absolute;
    top: 5vh;
    left: 5vw;
    z-index: 10;
    pointer-events: none;
}

.horizon-header h2 {
    color: #fff;
    opacity: 0.2;
}

.horizon-track {
    display: flex;
    padding-left: 15vw;
    height: 60vh;
    align-items: center;
    width: max-content;
    will-change: transform;
    position: relative;
    z-index: 5;
}

.horizon-item {
    width: 35vw;
    flex-shrink: 0;
    padding: 0 40px;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.item-top {
    justify-content: flex-start;
    padding-bottom: 10vh;
}

.item-bottom {
    justify-content: flex-end;
    padding-top: 10vh;
}

.big-num {
    font-family: var(--font-heading);
    font-size: 12rem;
    font-weight: 900;
    line-height: 1;
    position: absolute;
    opacity: 0.1;
    color: transparent;
    -webkit-text-stroke: 2px #fff;
    z-index: -1;
    transition: opacity 0.4s;
}

.item-top .big-num {
    bottom: -2rem;
    left: 20px;
}

.item-bottom .big-num {
    top: -4rem;
    left: 20px;
}

.item-content h3 {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 20px;
    color: #fff;
}

.item-content p {
    font-size: 1rem;
    color: #888;
    max-width: 400px;
    line-height: 1.6;
}

.horizon-item:hover .big-num {
    opacity: 0.4;
    -webkit-text-stroke-color: var(--accent);
}

.horizon-item:hover {
    border-left-color: var(--accent);
}


/* ==========================================================================
   [SECTION 6] THE CURTAIN STACK
   ========================================================================== */
.curtain-section {
    position: relative;
    background-color: #000;
    padding-bottom: 0;
}

.curtain-header-sticky {
    position: sticky;
    top: calc(var(--header-height) + 30px);
    left: 0;
    width: 100%;
    z-index: 500;
    pointer-events: none;
    mix-blend-mode: normal;
    color: #ffffff;
}

.curtain-header-sticky .mono-label {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.mono-label {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 0.1em;
}

.curtain-panel {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    z-index: 10;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
    will-change: transform, filter;
    transform-style: preserve-3d;
}

.curtain-visual {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.curtain-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8);
    transform: scale(1.05);
}

.curtain-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent 60%);
    z-index: 2;
}

.curtain-content {
    position: relative;
    z-index: 10;
    color: #fff;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 var(--gutter-x);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    padding-bottom: 200px;
}

.curtain-num {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 20px;
    display: block;
}

.curtain-title {
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 0.9;
    text-transform: uppercase;
    margin: 0 0 30px 0;
    font-weight: 800;
}

.curtain-desc {
    font-size: 1.2rem;
    color: #ccc;
    max-width: 400px;
    line-height: 1.6;
    margin: 0;
}

.curtain-panel:last-child {
    z-index: 600;
}

@media (max-width: 768px) {
    .curtain-title {
        /* 1. Smaller, Tighter Mobile Typography */
        /* Reduced from 2.5rem start to 2rem to satisfy "smaller" request */
        font-size: clamp(2rem, 10vw, 3.5rem);

        line-height: 1.1;
        /* Slightly increased for legibility on wrap */
        width: 100%;
        margin-bottom: 20px;

        /* 2. The "Dash" Logic (Hyphenation Priority) */
        -webkit-hyphens: auto;
        /* Critical for Safari/iOS */
        -ms-hyphens: auto;
        /* Legacy Edge */
        hyphens: auto;
        /* Standard */

        /* 3. Break Strategy */
        /* 'normal' tells it to use hyphens first. 
           'break-word' is the backup if it simply can't hyphenate. */
        word-break: normal;
        overflow-wrap: break-word;
    }

    .curtain-header-sticky .container-fluid {
        padding-left: 20px !important;
        /* Reduce 40px -> 20px */
        padding-right: 20px !important;
        /* Snap to the right edge */
        width: 100%;
    }

    .curtain-header-sticky .mono-label:nth-child(2) {
        text-align: right;
        /* Ensures multiline text aligns to the edge */
        display: block;
        /* Stability */
    }

    .curtain-header-sticky .mono-label {
        font-size: 0.7rem;
        /* Adjusted from 0.8rem for better fit on iPhone SE/Mini */
    }
}

/* ==========================================================================
   [SECTION 7] MOBILE ADJUSTMENTS (Max-Width 1024px)
   ========================================================================== */
@media (max-width: 1024px) {

    /* --- General --- */
    .hero-title {
        font-size: 1.2rem;
    }

    .intro-manifesto-section {
        padding: 120px 0;
    }

    .intro-manifesto-section .container {
        width: 100%;

        /* CHANGED: Use 100% instead of 100vw to avoid scrollbar-width conflicts */
        max-width: 100%;

        padding-left: 20px;
        padding-right: 20px;

        /* UX FIX: Removed 'overflow-x: hidden'. 
           This property was causing the "inner vertical scroll" behavior.
           We now let the content stack naturally. */
        overflow: visible;

        display: block;
        height: auto;
        /* Forces the box to grow with the text */
    }

    .manifesto-wrapper {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 30px;
    }

    .manifesto-label {
        border-top: none;
        width: 100%;
        border-left: 2px solid var(--accent);
        padding-top: 0;
        padding-left: 20px;
    }

    .manifesto-sub {
        font-size: 1.1rem;
        width: 100%;
        margin-top: 30px;
        padding-right: 0;

        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .manifesto-content {
        width: 100%;
        min-width: 0;
        /* CRITICAL: Allows Flex children to shrink below content size */
    }

    .read-line {
        font-size: clamp(2rem, 8vw, 3rem);
        line-height: 1.1;
        width: 100%;

        /* These lines ensure the text never pushes the width out */
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }

    /* --- Services: Cinematic Backdrop --- */
    .pin-container {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .pin-visuals {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        height: 100vh;
        position: sticky;
        top: 0;
        z-index: 0;
        margin: 0;
        padding: 0;
        align-self: start;
    }

    .visual-item img {
        filter: grayscale(100%) brightness(0.4) contrast(1.1);
    }

    .pin-content {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        z-index: 10;
        padding-bottom: 20vh;
        background: transparent;
        box-sizing: border-box;
        padding-left: 20px;
        padding-right: 20px;
    }

    .pin-text-block {
        min-height: 80vh;
        margin: 0;
        opacity: 0.2;
        transform: translateY(20px);
        width: 100%;
        max-width: 100%;
    }

    .pin-text-block.is-active {
        opacity: 1;
        transform: translateY(0);
        text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    }

    .pin-text-block h2 {
        font-size: 3rem;
        line-height: 1.1;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* --- Process: Horizontal Scroll (Vertical Scrub Restored) --- */
    /* We restore the massive height so scrolling DOWN moves the track LEFT via JS */

    .horizon-scroll-section {
        height: 400vh;
        /* Allow vertical scroll */
        padding: 0;
        background: #0b0b0b;
        position: relative;
    }

    .horizon-sticky-wrapper {
        position: sticky;
        top: 0;
        height: 100vh;
        display: flex;
        align-items: center;
        overflow: hidden;
        /* Hide the scrollbar so users MUST scrub vertically */
    }

    .axis-line {
        display: none;
    }

    .horizon-header {
        position: absolute;
        top: 100px;
        /* Adjusted to sit below the header */
        left: 20px;
        margin: 0;
        padding: 0;
        z-index: 20;
    }

    .horizon-header h2 {
        opacity: 1;
        font-size: 2rem;
    }

    .horizon-track {
        display: flex;
        gap: 0;
        padding-left: 0;
        height: 100vh;
        width: max-content;
        align-items: center;

        /* ENABLE JS CONTROL */
        transform-style: preserve-3d;
        will-change: transform;
    }

    .horizon-item {
        width: 100vw;
        /* Full screen width per item */
        min-width: 100vw;
        height: 100vh;
        flex-shrink: 0;

        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0 40px;
        box-sizing: border-box;

        border-left: 1px solid rgba(255, 255, 255, 0.1);
        background: #0b0b0b;
    }

    .item-content {
        margin-top: 40px;
        /* Space for the header title */
    }

    .big-num {
        font-size: 6rem;
        top: 130px;
        left: 20px;
        bottom: auto;
        opacity: 0.1;
    }
}

@media (max-width: 480px) {
    .pin-text-block h2 {
        font-size: 2.2rem;
    }
}