/* ---
   NYC METRICS - STYLE.CSS (v2.1 - PATCHED & FINAL)
   Theme: Precision, Power, and Discovery
   --- */

/* ------------------- */
/* 0. ROOT & VARIABLES */
/* ------------------- */

:root {
    --color-black: #000000;
    --color-white: #FFFFFF;
    --color-gray-light: #a9a9a9;
    --color-gray-dark: #3a3a3a;
    /* For borders and subtle elements */
    --font-primary: 'Inter', sans-serif;
    --font-secondary: 'Space Mono', monospace;
    --transition-speed-fast: 0.3s;
    --transition-speed-slow: 0.6s;
    --easing-curve: cubic-bezier(0.19, 1, 0.22, 1);
}

/* ------------------- */
/* 1. GLOBAL RESETS & SETUP */
/* ------------------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-black);
    color: var(--color-white);
    font-family: var(--font-primary);
    line-height: 1.6;
    overflow-x: hidden;
    /* Page is invisible by default */
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

body.loaded {
    /* Page becomes visible once loaded */
    opacity: 1;
}

a {
    color: var(--color-white);
    text-decoration: none;
    transition: color var(--transition-speed-fast) ease, transform var(--transition-speed-fast) ease;
}

h1,
h2,
h3 {
    line-height: 1.2;
    font-weight: 900;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem auto;
    color: var(--color-gray-light);
}

/* ------------------- */
/* 2. PRELOADER */
/* ------------------- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--color-black);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s var(--easing-curve), visibility 0.8s var(--easing-curve);
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-line {
    width: 1px;
    /* Start as 1px to be visible */
    height: 2px;
    background: var(--color-white);
    animation: loading-bar 1.5s ease-out forwards;
}

@keyframes loading-bar {
    0% {
        width: 1px;
    }

    100% {
        width: 100%;
    }
}

/* ------------------- */
/* 3. SCENE & BACKGROUND */
/* ------------------- */
#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    perspective: 1200px;
    overflow: hidden;
}

.grid-overlay {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 75px 75px;
    animation: move-grid 60s linear infinite;
}

@keyframes move-grid {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.shape {
    position: absolute;
    border: 1px solid var(--color-gray-dark);
    will-change: transform, opacity;
    transform-style: preserve-3d;
}

.shape-1 {
    width: 250px;
    height: 250px;
    top: 15%;
    left: 10%;
    animation: float-rotate 35s linear infinite alternate;
}

.shape-2 {
    width: 60px;
    height: 60px;
    top: 70%;
    left: 85%;
    border-color: var(--color-white);
    background: rgba(255, 255, 255, 0.1);
    animation: pulse-glow 8s ease-in-out infinite;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 80%;
    left: 40%;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.3);
    animation: float-rotate 55s linear infinite;
}

.shape-4 {
    width: 100px;
    height: 100px;
    top: 5%;
    left: 65%;
    animation: float-rotate 40s linear infinite alternate-reverse;
}

.shape-5 {
    width: 40vw;
    height: 1px;
    top: 90%;
    left: 0%;
    background: var(--color-white);
    border: none;
    animation: scan-line 20s ease-in-out infinite;
}

@keyframes float-rotate {
    from {
        transform: translateZ(-300px) rotateX(0deg) rotateY(0deg);
    }

    to {
        transform: translateZ(100px) rotateX(360deg) rotateY(180deg);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        transform: scale(0.8) translateZ(-100px);
        opacity: 0.5;
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
    }

    50% {
        transform: scale(1.2) translateZ(50px);
        opacity: 1;
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    }
}

@keyframes scan-line {
    0% {
        transform: translateX(-100%) translateY(0vh) rotateZ(10deg);
        opacity: 0;
    }

    20%,
    80% {
        opacity: 1;
    }

    100% {
        transform: translateX(calc(100vw + 100%)) translateY(-60vh) rotateZ(-10deg);
        opacity: 0;
    }
}

/* ------------------- */
/* 4. LAYOUT & HEADER */
/* ------------------- */
.content-wrapper {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
}

.logo a {
    font-family: var(--font-secondary);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.cta-button {
    border: 1px solid var(--color-white);
    padding: 0.75rem 1.5rem;
    transition: all var(--transition-speed-fast) var(--easing-curve);
}

.cta-button:hover {
    background: var(--color-white);
    color: var(--color-black);
    transform: scale(1.05);
}

.cta-button.primary-cta {
    background: var(--color-white);
    color: var(--color-black);
}

.cta-button.primary-cta:hover {
    background: transparent;
    color: var(--color-white);
}

.cta-button.large {
    font-size: 1.1rem;
    padding: 1rem 2rem;
    font-weight: bold;
}

.hamburger-button {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 100;
    padding: 10px;
}

.hamburger-button .line {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--color-white);
    margin: 5px 0;
    transition: all var(--transition-speed-fast) ease-in-out;
}

/* ------------------- */
/* 5. HERO SECTION */
/* ------------------- */
.hero {
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-title {
    font-size: clamp(3rem, 10vw, 6rem);
    letter-spacing: -2px;
}

/* Staggered character animation setup */
.hero-title>span {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
}

/* Trigger animations ONLY AFTER page load */
.loaded .hero-title>span {
    animation: reveal-char 0.8s var(--easing-curve) forwards;
    animation-delay: calc(var(--char-index) * 0.05s);
    /* Staggered delay starts immediately after load */
}

@keyframes reveal-char {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title .highlight {
    position: relative;
    display: inline-block;
}

.hero-title .highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--color-white);
    transform: scaleX(0);
    transform-origin: left;
}

.hero-subtitle,
.hero-cta-container {
    opacity: 0;
    transform: translateY(20px);
}

/* Trigger these animations based on the .loaded class */
.loaded .hero-title .highlight::after {
    animation: draw-line 1s var(--easing-curve) 0.8s forwards;
    /* Delay after characters revealed */
}

.loaded .hero-subtitle,
.loaded .hero-cta-container {
    animation: fade-up 1s var(--easing-curve) 1s forwards;
    /* Delay after underline */
}

@keyframes draw-line {
    to {
        transform: scaleX(1);
    }
}

@keyframes fade-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 600px;
    margin: 2rem 0;
    color: var(--color-gray-light);
}

/* ------------------- */
/* 6. FEATURES SECTION */
/* ------------------- */
.data-features {
    padding: 8rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    border: 1px solid var(--color-gray-dark);
    padding: 2.5rem 2rem;
    transition: all var(--transition-speed-fast) var(--easing-curve);
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-white);
    background: rgba(255, 255, 255, 0.02);
}

.feature-card h3 {
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1.5rem;
}

.feature-card p {
    color: var(--color-gray-light);
}

/* Pure CSS Icons */
.feature-icon {
    width: 40px;
    height: 40px;
    position: relative;
}

.feature-icon[data-icon="real-time"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: var(--color-white);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.feature-icon[data-icon="demographic"]::before,
.feature-icon[data-icon="demographic"]::after {
    content: '';
    position: absolute;
    border: 2px solid var(--color-white);
}

.feature-icon[data-icon="demographic"]::before {
    width: 30px;
    height: 30px;
    top: 0;
    left: 0;
}

.feature-icon[data-icon="demographic"]::after {
    width: 15px;
    height: 15px;
    top: 7px;
    left: 7px;
    background: rgba(255, 255, 255, 0.2);
}

.feature-icon[data-icon="market-trends"] {
    display: flex;
    align-items: flex-end;
    gap: 4px;
}

.feature-icon[data-icon="market-trends"]::before,
.feature-icon[data-icon="market-trends"]::after {
    content: '';
    display: block;
    background: var(--color-white);
    width: 6px;
}

.feature-icon[data-icon="market-trends"]::before {
    height: 20px;
    animation: trend-up 1.5s infinite ease-in-out;
}

.feature-icon[data-icon="market-trends"]::after {
    height: 35px;
    animation: trend-up 1.5s infinite ease-in-out 0.5s;
}

@keyframes trend-up {

    0%,
    100% {
        transform: scaleY(0.3);
    }

    50% {
        transform: scaleY(1);
    }
}

/* ------------------- */
/* 7. INTERACTIVE SECTORS */
/* ------------------- */
.interactive-sectors {
    padding: 6rem 0;
}

.sector-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    margin-top: 3rem;
    min-height: 250px;
}

.sector-list {
    list-style: none;
}

.sector-item {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-light);
    padding: 1rem;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: all var(--transition-speed-fast) var(--easing-curve);
}

.sector-item.active {
    color: var(--color-white);
    border-left-color: var(--color-white);
    transform: translateX(10px);
    background: linear-gradient(to right, rgba(255, 255, 255, 0.05), transparent);
}

.sector-item:not(.active):hover {
    color: var(--color-white);
    transform: translateX(5px);
}

.sector-info-display {
    border: 1px solid var(--color-gray-dark);
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sector-info-display p {
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--color-gray-light);
    transition: opacity var(--transition-speed-fast) ease-in-out;
}

/* ------------------- */
/* 8. FINAL CTA & FOOTER */
/* ------------------- */
.final-cta {
    padding: 8rem 0;
    text-align: center;
}

.final-cta-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
}

.final-cta-subtitle {
    color: var(--color-gray-light);
    margin: 1rem 0 2.5rem 0;
}

.main-footer {
    padding: 2rem 0;
    border-top: 1px solid var(--color-gray-dark);
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--color-gray-light);
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

/* ------------------- */
/* 9. SCROLL ANIMATIONS */
/* ------------------- */
.feature-card,
.section-title,
.section-subtitle,
.sector-container,
.final-cta>* {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--easing-curve), transform 0.8s var(--easing-curve);
}

.feature-card.is-visible,
.section-title.is-visible,
.section-subtitle.is-visible,
.sector-container.is-visible,
.final-cta>*.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:nth-child(2) {
    transition-delay: 0.1s;
}

.feature-card:nth-child(3) {
    transition-delay: 0.2s;
}

/* ------------------- */
/* 10. RESPONSIVE DESIGN */
/* ------------------- */
@media (max-width: 992px) {
    .sector-container {
        grid-template-columns: 1fr;
    }

    .sector-info-display {
        min-height: 150px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.5s var(--easing-curve);
        display: flex;
        z-index: 99;
    }

    .main-nav.active {
        transform: translateX(0);
    }

    .main-nav ul {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .main-nav li {
        font-size: 1.8rem;
        margin: 1rem 0;
        transform: translateY(20px);
        opacity: 0;
        transition: transform 0.5s var(--easing-curve), opacity 0.5s ease;
    }

    .main-nav.active li {
        transform: translateY(0);
        opacity: 1;
    }

    .main-nav.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .main-nav.active li:nth-child(2) {
        transition-delay: 0.2s;
    }

    .main-nav.active li:nth-child(3) {
        transition-delay: 0.3s;
    }

    .nav-cta {
        margin-top: 2rem;
        transform: translateY(20px);
        opacity: 0;
        transition: transform 0.5s var(--easing-curve) 0.4s, opacity 0.5s ease 0.4s;
    }

    .main-nav.active .nav-cta {
        transform: translateY(0);
        opacity: 1;
    }

    .hamburger-button {
        display: block;
    }

    .hamburger-button.active .line:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger-button.active .line:nth-child(2) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .hero {
        text-align: left;
        align-items: flex-start;
    }

    .hero-title .highlight::after {
        height: 4px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}