/* ===================================
   Ghray, Inc. — Corporate Website v2
   Black / White / Gray — Clean & Authoritative
   3D Hero + Scroll Experience
   =================================== */

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

:root {
    --black: #0a0a0a;
    --dark: #111111;
    --dark-gray: #1a1a1a;
    --mid-gray: #2a2a2a;
    --gray: #666666;
    --light-gray: #999999;
    --silver: #b0b0b0;
    --off-white: #e8e8e8;
    --white: #f5f5f5;
    --pure-white: #ffffff;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--black);
    color: var(--silver);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--off-white);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--pure-white);
}

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

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* --- Navigation --- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 24px 0;
    transition: all var(--transition);
    background: transparent;
}

#navbar.scrolled {
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-links a {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--light-gray);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    position: relative;
    padding: 4px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--pure-white);
    transition: width var(--transition);
}

.nav-links a:hover {
    color: var(--pure-white);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--off-white);
    transition: all var(--transition);
}

/* ==============================
   HERO — 3D Scroll Experience
   ============================== */

#hero-wrapper {
    position: relative;
    width: 100%;
    /* Height set by GSAP pin (100vh + scroll distance) */
}

#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#hero-text {
    text-align: center;
    pointer-events: auto;
}

.hero-logo {
    width: min(820px, 85vw);
    display: block;
    margin: 0 auto;
}

.hero-divider {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--light-gray), transparent);
    margin: 36px auto;
}

.hero-tagline {
    font-size: clamp(1.1rem, 2vw, 1.7rem);
    font-weight: 300;
    color: var(--off-white);
    letter-spacing: 0.35em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.hero-sub {
    font-size: clamp(1.05rem, 1.6vw, 1.4rem);
    color: var(--silver);
    font-weight: 300;
    max-width: 640px;
    margin: 0 auto;
}

.scroll-hint {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

.scroll-hint span {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gray);
}

.scroll-arrow {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--gray), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 0.8; transform: scaleY(1.3); }
}

/* ==============================
   CONTENT SECTIONS
   ============================== */

section:not(#hero-wrapper) {
    padding: 140px 0;
    position: relative;
}

section:nth-of-type(odd):not(#hero-wrapper) {
    background: var(--dark);
}

.section-header {
    margin-bottom: 80px;
}

.section-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    color: var(--off-white);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 80px;
    align-items: start;
}

.about-text .lead {
    font-size: 1.12rem;
    color: var(--off-white);
    line-height: 1.8;
    margin-bottom: 24px;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--silver);
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding-top: 10px;
}

.stat {
    padding: 24px 0;
    border-top: 1px solid var(--mid-gray);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--off-white);
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Services Section --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border-top: 1px solid var(--mid-gray);
    border-left: 1px solid var(--mid-gray);
}

.service-card {
    padding: 48px 40px;
    border-right: 1px solid var(--mid-gray);
    border-bottom: 1px solid var(--mid-gray);
    transition: background var(--transition);
    position: relative;
}

.service-card:hover {
    background: rgba(255, 255, 255, 0.02);
}

.service-number {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--gray);
    margin-bottom: 24px;
    font-variant-numeric: tabular-nums;
}

.service-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--off-white);
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.service-card p {
    font-size: 0.88rem;
    color: var(--light-gray);
    line-height: 1.75;
}

/* --- Portfolio Section --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.portfolio-card {
    display: flex;
    flex-direction: column;
    padding: 40px 36px;
    background: var(--dark-gray);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    min-height: 280px;
}

.portfolio-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
    background: var(--mid-gray);
}

.portfolio-card:hover .arrow {
    transform: translate(2px, -2px);
}

.portfolio-card-dark {
    background: var(--dark);
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.08);
    cursor: default;
}

.portfolio-card-dark:hover {
    transform: none;
    background: var(--dark);
    border-color: rgba(255, 255, 255, 0.12);
}

.portfolio-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.portfolio-tag {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray);
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 10px;
    border-radius: 2px;
}

.portfolio-year {
    font-size: 0.72rem;
    color: var(--gray);
    letter-spacing: 0.05em;
}

.portfolio-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--off-white);
    margin-bottom: 12px;
}

.portfolio-card h3 sup {
    font-size: 0.6em;
    vertical-align: super;
}

.portfolio-card p {
    font-size: 0.88rem;
    color: var(--light-gray);
    line-height: 1.7;
    flex: 1;
}

.portfolio-link {
    display: block;
    margin-top: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray);
    letter-spacing: 0.05em;
    transition: color var(--transition);
}

.portfolio-card:hover .portfolio-link {
    color: var(--off-white);
}

.arrow {
    display: inline-block;
    transition: transform var(--transition);
}

/* --- Approach Section --- */
.approach-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
}

.approach-item {
    padding: 40px 0;
    border-top: 1px solid var(--mid-gray);
    transition: border-color var(--transition);
}

.approach-item:hover {
    border-color: var(--gray);
}

.approach-number {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--gray);
    letter-spacing: 0.15em;
    margin-bottom: 20px;
}

.approach-item h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--off-white);
    margin-bottom: 14px;
}

.approach-item p {
    font-size: 0.88rem;
    color: var(--light-gray);
    line-height: 1.75;
}

/* --- Markets Section --- */
.markets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.market-item {
    padding: 44px 36px;
    background: var(--dark);
    border: 1px solid var(--mid-gray);
    transition: all var(--transition);
}

.market-item:hover {
    border-color: var(--gray);
}

.market-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--off-white);
    margin-bottom: 12px;
}

.market-item p {
    font-size: 0.88rem;
    color: var(--light-gray);
    line-height: 1.7;
}

/* --- Contact Section --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.contact-block {
    margin-bottom: 40px;
}

.contact-block:last-child {
    margin-bottom: 0;
}

.contact-block h3 {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 12px;
}

.contact-block p {
    font-size: 1rem;
    color: var(--off-white);
    line-height: 1.8;
}

.contact-block a {
    color: var(--off-white);
    border-bottom: 1px solid var(--mid-gray);
    padding-bottom: 2px;
    transition: all var(--transition);
}

.contact-block a:hover {
    color: var(--pure-white);
    border-color: var(--pure-white);
}

.contact-cta .lead {
    font-size: 1.12rem;
    color: var(--silver);
    line-height: 1.8;
    margin-bottom: 36px;
}

.btn {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--black);
    background: var(--off-white);
    padding: 16px 48px;
    transition: all var(--transition);
    border: 1px solid var(--off-white);
}

.btn:hover {
    background: transparent;
    color: var(--off-white);
}

/* --- Footer --- */
footer {
    padding: 80px 0;
    background: var(--black);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 32px;
}

.footer-logo img {
    height: 30px;
    opacity: 0.4;
    transition: opacity var(--transition);
}

.footer-logo:hover img {
    opacity: 0.7;
}

.footer-links {
    display: flex;
    gap: 32px;
}

.footer-links a {
    font-size: 0.78rem;
    color: var(--gray);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--off-white);
}

.footer-legal {
    color: var(--gray);
    font-size: 0.78rem;
}

.footer-legal p {
    margin-bottom: 4px;
}

/* ==============================
   SCROLL ANIMATIONS
   ============================== */

.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==============================
   RESPONSIVE
   ============================== */

@media (max-width: 1024px) {
    .container { padding: 0 32px; }
    section:not(#hero-wrapper) { padding: 100px 0; }

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

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .approach-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 36px;
    }

    .markets-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    .container { padding: 0 24px; }
    section:not(#hero-wrapper) { padding: 80px 0; }
    .section-header { margin-bottom: 48px; }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(10, 10, 10, 0.98);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 32px;
        z-index: 999;
    }

    .nav-links.active { display: flex; }

    .nav-links a { font-size: 1.2rem; }

    .nav-toggle {
        display: flex;
        z-index: 1001;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .nav-toggle.active span:nth-child(2) { opacity: 0; }
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hero-logo { width: min(520px, 85vw); }

    .hero-tagline {
        font-size: 0.85rem;
        letter-spacing: 0.2em;
    }

    .hero-sub {
        font-size: 0.95rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        border-left: none;
        border-top: none;
    }

    .service-card {
        border-left: 1px solid var(--mid-gray);
        padding: 36px 28px;
    }

    .portfolio-grid { grid-template-columns: 1fr; }

    .approach-grid { grid-template-columns: 1fr; }

    .markets-grid { grid-template-columns: 1fr; }

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

    .market-item { padding: 32px 28px; }

    .footer-links {
        gap: 20px;
    }

    .footer-links a {
        font-size: 0.68rem;
        letter-spacing: 0.06em;
    }

    .footer-legal {
        font-size: 0.68rem;
    }
}

@media (max-width: 480px) {
    .container { padding: 0 20px; }
    .nav-container { padding: 0 20px; }

    .hero-logo { width: 90vw; }

    .hero-tagline {
        font-size: 0.75rem;
        letter-spacing: 0.15em;
    }

    .hero-sub {
        font-size: 0.88rem;
    }

    .stat-number { font-size: 2rem; }

    .about-stats { grid-template-columns: 1fr; }

    .footer-links {
        flex-wrap: nowrap;
        justify-content: center;
        gap: 12px;
    }

    .footer-links a {
        font-size: 0.6rem;
        letter-spacing: 0.04em;
    }

    .footer-legal {
        font-size: 0.6rem;
    }
}

/* --- Selection --- */
::selection {
    background: rgba(255, 255, 255, 0.15);
    color: var(--pure-white);
}
