/* ═══════════════════════════════════════════════════════════ */
/* BASE & RESETS                                              */
/* ═══════════════════════════════════════════════════════════ */

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

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

body {
    overflow-x: hidden;
}

/* Inline/prose links — restores browser defaults stripped by Tailwind preflight */
a:not([class]) {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 3px;
}

a:not([class]):hover {
    color: #1d4ed8;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d6d3d1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a29e;
}

/* ═══════════════════════════════════════════════════════════ */
/* NAVIGATION                                                 */
/* ═══════════════════════════════════════════════════════════ */

#main-nav {
    background: rgba(250, 250, 249, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

#main-nav.scrolled {
    background: rgba(250, 250, 249, 0.95);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

#main-nav.hidden-nav {
    transform: translateY(-100%);
}

/* Hamburger animation */
#mobile-menu-btn.active .hamburger-line:first-child {
    transform: rotate(45deg) translate(2px, 2px);
}

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

#mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

/* ═══════════════════════════════════════════════════════════ */
/* SCROLL ANIMATIONS                                          */
/* ═══════════════════════════════════════════════════════════ */

.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
    transition-delay: var(--delay, 0ms);
}

/* Scroll line pulse */
.scroll-line {
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; height: 48px; }
    50% { opacity: 1; height: 64px; }
}

/* ═══════════════════════════════════════════════════════════ */
/* PARALLAX                                                   */
/* ═══════════════════════════════════════════════════════════ */

.parallax-bg {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* ═══════════════════════════════════════════════════════════ */
/* CASE STUDY CARDS                                           */
/* ═══════════════════════════════════════════════════════════ */

.case-card {
    text-decoration: none;
    color: inherit;
}

/* Slide up from bottom on scroll */
.slide-up-card {
    opacity: 0;
    transform: translateY(80px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-up-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition-delay: var(--delay, 0ms);
}

/* Elevated hover — lifts card with layered shadow */
.case-card-inner {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.case-card:hover .case-card-inner {
    transform: translateY(-12px);
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.02),
        0 12px 24px rgba(0, 0, 0, 0.06),
        0 32px 64px rgba(0, 0, 0, 0.08);
}

/* 5th card spans full width */
.case-card:nth-child(5) {
    grid-column: 1 / -1;
}

.case-card:nth-child(5) article {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 767px) {
    .case-card:nth-child(5) article {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════ */
/* CURSOR (desktop only)                                      */
/* ═══════════════════════════════════════════════════════════ */

.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 1.5px solid #2563eb;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s,
                background 0.3s;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

.custom-cursor.hovering {
    width: 48px;
    height: 48px;
    background: rgba(37, 99, 235, 0.1);
}

@media (max-width: 1024px) {
    .custom-cursor { display: none; }
}

/* ═══════════════════════════════════════════════════════════ */
/* SMOOTH PAGE TRANSITIONS                                    */
/* ═══════════════════════════════════════════════════════════ */

.page-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #0a0a0a;
    transform: scaleY(0);
    transform-origin: bottom;
    pointer-events: none;
}

.page-transition-overlay.entering {
    animation: pageEnter 0.6s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.page-transition-overlay.leaving {
    animation: pageLeave 0.6s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes pageEnter {
    0% { transform: scaleY(0); transform-origin: bottom; }
    100% { transform: scaleY(1); transform-origin: bottom; }
}

@keyframes pageLeave {
    0% { transform: scaleY(1); transform-origin: top; }
    100% { transform: scaleY(0); transform-origin: top; }
}

/* ═══════════════════════════════════════════════════════════ */
/* UTILITIES                                                  */
/* ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════ */
/* SCROLL TO TOP                                              */
/* ═══════════════════════════════════════════════════════════ */

#scroll-top {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

#scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

#scroll-top:hover {
    background: #2563eb;
    box-shadow: 0 4px 24px rgba(37, 99, 235, 0.3);
}

#scroll-top:active {
    transform: scale(0.92);
}

.scroll-top-ring circle {
    transition: stroke-dashoffset 0.15s linear;
}

/* ═══════════════════════════════════════════════════════════ */
/* LIGHTBOX                                                   */
/* ═══════════════════════════════════════════════════════════ */

#lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#lightbox.open {
    opacity: 1;
    pointer-events: all;
}

#lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.12);
    transform: scale(0.96);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#lightbox.open #lightbox-img {
    transform: scale(1);
}

#lightbox-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #0a0a0a;
    color: #fafaf9;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    z-index: 201;
}

#lightbox-close:hover {
    background: #2563eb;
    box-shadow: 0 4px 24px rgba(37, 99, 235, 0.3);
}

#lightbox-close:active {
    transform: scale(0.92);
}

[data-lightbox] {
    cursor: zoom-in;
}

#lightbox-zoom-btn {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    height: 3rem;
    border-radius: 9999px;
    background: #0a0a0a;
    color: #fafaf9;
    border: none;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    z-index: 201;
}

#lightbox-zoom-btn:hover {
    background: #2563eb;
    box-shadow: 0 4px 24px rgba(37, 99, 235, 0.3);
    transform: translateX(-50%) translateY(-1px);
}

#lightbox-zoom-btn:active {
    transform: translateX(-50%) scale(0.96);
}

/* Lightbox body — transparent wrapper in fit mode */
#lightbox-body {
    display: contents;
}

/* Full-size mode — only the body scrolls; #lightbox itself never scrolls */
#lightbox.full-size #lightbox-body {
    display: flex;
    position: absolute;
    inset: 0;
    overflow: auto;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 5rem 2rem 6rem;
}

#lightbox.full-size #lightbox-img {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    transform: none;
    cursor: default;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════ */
/* MISC                                              */
/* ═══════════════════════════════════════════════════════════ */
.flex.align-center {
    align-items: center;
}

@media (min-width: 1024px) {
    .lg\:text-8xl {
        line-height: 1.1 !important;
    }
}
.leading-\[0\.95\] {
    line-height: 1.1 !important;
}
