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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --black: #0a0a0a;
    --white: #fafafa;
    --gray-100: #f5f5f5;
    --gray-300: #d4d4d4;
    --gray-500: #737373;
    --gray-700: #404040;
    --gray-900: #171717;
    --max-width: 1400px;
    --pad-x: clamp(20px, 4vw, 60px);
    --easing: cubic-bezier(0.65, 0, 0.35, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--white);
    color: var(--black);
    line-height: 1.5;
    overflow-x: hidden;
}

body.preload-active {
    overflow: hidden;
    height: 100vh;
}

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

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

a:focus,
a:focus-visible,
button:focus,
button:focus-visible {
    outline: none;
}

a:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 4px;
}

::selection {
    background: var(--black);
    color: var(--white);
}

/* ----------  PRELOADER  ---------- */
.preloader {
    position: fixed;
    inset: 0;
    background: var(--black);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s var(--easing), visibility 0.8s var(--easing);
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-inner {
    display: flex;
    align-items: baseline;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    letter-spacing: -0.04em;
    font-size: clamp(48px, 10vw, 120px);
    line-height: 1;
}

.preloader-text {
    display: inline-block;
    white-space: pre;
}

.preloader-cursor {
    display: inline-block;
    margin-left: 4px;
    color: var(--white);
    animation: blink 0.8s steps(2, start) infinite;
    font-weight: 200;
}

@keyframes blink {
    to { visibility: hidden; }
}

/* ----------  NAV  ---------- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 24px var(--pad-x);
    mix-blend-mode: difference;
    color: var(--white);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max-width);
    margin: 0 auto;
}

.nav-logo {
    font-weight: 600;
    font-size: 18px;
    letter-spacing: -0.02em;
}

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

.nav-links a {
    font-size: 14px;
    font-weight: 400;
    position: relative;
    transition: opacity 0.3s var(--easing);
}

.nav-links a:hover {
    opacity: 0.6;
}

/* ----------  HERO  ---------- */
.hero {
    min-height: 100vh;
    padding: 140px var(--pad-x) 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 100px);
    align-items: center;
    flex: 1;
}

.hero-left {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.hero-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-eyebrow::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--gray-500);
}

.hero-name {
    font-size: clamp(56px, 9vw, 128px);
    font-weight: 500;
    line-height: 0.9;
    letter-spacing: -0.04em;
}

.hero-bio {
    font-size: clamp(15px, 1.2vw, 17px);
    line-height: 1.6;
    color: var(--gray-700);
    max-width: 480px;
}

.hero-meta {
    border-top: 1px solid var(--gray-300);
    border-bottom: 1px solid var(--gray-300);
    padding: 16px 0;
}

.hero-services {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    color: var(--gray-700);
    letter-spacing: 0.04em;
}

.hero-stats {
    display: flex;
    gap: clamp(24px, 4vw, 56px);
    padding: 4px 0;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-num {
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--black);
}

.stat-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-500);
}

.hero-cta {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    background: var(--black);
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid var(--black);
    transition: all 0.3s var(--easing);
}

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

.btn-ghost {
    background: transparent;
    color: var(--black);
}

.btn-ghost:hover {
    background: var(--black);
    color: var(--white);
}

/* Hero photo */
.hero-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.hero-photo {
    width: 100%;
    max-width: 520px;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--gray-100);
    position: relative;
}

.hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 30% center;
    filter: grayscale(100%) contrast(1.05);
    transition: transform 1.2s var(--easing);
}

.hero-photo:hover img {
    transform: scale(1.04);
}

.hero-photo.photo-placeholder::after {
    content: 'Photo';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--gray-500);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px dashed var(--gray-300);
}

.hero-tagline {
    margin-top: 60px;
    border-top: 1px solid var(--gray-300);
    padding-top: 24px;
    display: flex;
    justify-content: flex-end;
}

.hero-tagline p {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: right;
    max-width: 600px;
}

/* ----------  WORK  ---------- */
.work {
    width: 100%;
    padding-top: 80px;
}

.work-header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--pad-x) 60px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}

.work-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gray-500);
}

.work-heading {
    font-size: clamp(36px, 5vw, 72px);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1;
}

.work-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 0;
}

.work-item {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--black);
    cursor: pointer;
    display: block;
}

.work-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: grayscale(100%) contrast(1.05) brightness(0.35);
    transition: transform 0.9s var(--easing), filter 0.6s var(--easing);
    will-change: transform;
}

.work-item:hover .work-bg {
    transform: scale(1.06);
    filter: grayscale(100%) contrast(1.1) brightness(0.5);
}

.work-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: clamp(24px, 4vw, 48px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--white);
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.55) 50%, rgba(0,0,0,0.55) 100%);
}

.work-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.08em;
    align-self: flex-start;
    opacity: 0.85;
}

.work-title {
    font-size: clamp(28px, 3.5vw, 56px);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-top: auto;
    transform: translateY(8px);
    transition: transform 0.5s var(--easing);
}

.work-item:hover .work-title {
    transform: translateY(0);
}

.work-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 8px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s var(--easing), transform 0.5s var(--easing);
}

.work-item:hover .work-meta {
    opacity: 1;
    transform: translateY(0);
}

.work-arrow {
    position: absolute;
    top: clamp(24px, 4vw, 48px);
    right: clamp(24px, 4vw, 48px);
    font-size: 28px;
    transform: rotate(-45deg) translateX(-12px);
    opacity: 0;
    transition: opacity 0.5s var(--easing), transform 0.5s var(--easing);
}

.work-item:hover .work-arrow {
    opacity: 1;
    transform: rotate(-45deg) translateX(0);
}

/* Empty-state styling for missing project images */
.work-bg[style*="project-1.jpg"],
.work-bg[style*="project-2.jpg"],
.work-bg[style*="project-3.jpg"],
.work-bg[style*="project-4.jpg"] {
    background-color: var(--gray-900);
}

/* ----------  FOOTER  ---------- */
.footer {
    background: var(--black);
    color: var(--white);
    padding: clamp(80px, 12vw, 160px) var(--pad-x) 40px;
    margin-top: 0;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.footer-heading {
    font-size: clamp(48px, 8vw, 120px);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 0.95;
}

.footer-email {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(18px, 2vw, 24px);
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--gray-700);
    padding-bottom: 8px;
    align-self: flex-start;
    transition: border-color 0.3s var(--easing), opacity 0.3s var(--easing);
}

.footer-email:hover {
    border-color: var(--white);
    opacity: 0.8;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 32px;
    border-top: 1px solid var(--gray-700);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ----------  REVEAL ANIMATIONS  ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s var(--easing), transform 0.9s var(--easing);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }

/* ----------  RESPONSIVE  ---------- */
@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .hero-right {
        justify-content: center;
        order: -1;
    }

    .hero-photo {
        max-width: 360px;
    }

    .hero-tagline {
        justify-content: flex-start;
    }

    .hero-tagline p {
        text-align: left;
    }

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

    .nav-links {
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .hero {
        padding-top: 100px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .nav-links a {
        font-size: 13px;
    }

    .footer-bottom {
        flex-direction: column;
    }
}
