/* Background Texture */
.texture-bg {
    background-color: #fafafa;
    background-image:
        radial-gradient(at 0% 0%, rgba(0, 0, 0, 0.02) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(0, 0, 0, 0.02) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 0, 0, 0.02) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(0, 0, 0, 0.02) 0px, transparent 50%);
}

.texture-overlay {
    content: '';
    position: absolute;
    top: 60px;
    bottom: 205px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1280px;
    opacity: 0.25;
    z-index: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Container Border Lines */
.page-container {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    z-index: 1;
}

.page-container::before,
.page-container::after {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(0, 0, 0, 0.08);
    z-index: 0;
}

.page-container::before {
    left: calc(50% - 640px);
}

.page-container::after {
    right: calc(50% - 640px);
}

@media (max-width: 1280px) {
    .page-container::before,
    .page-container::after {
        display: none;
    }
}

/* Horizontal Border Lines */
body {
    position: relative;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.horizontal-line-top {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    z-index: 1;
}

.horizontal-line-bottom {
    position: absolute;
    bottom: 205px;
    left: 0;
    right: 0;
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    z-index: 1;
}

/* Clip texture to be between horizontal lines */
.page-container {
    overflow: hidden;
}

/* Floating Glass Nav */
.floating-nav {
    position: relative;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85);
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08),
                0 0 20px rgba(0, 0, 0, 0.02),
                rgba(0, 0, 0, 0.04) 0px 0px 0px 3px;
    transition: all 0.3s ease;
    padding-right: 0.75rem !important;
    overflow: hidden;
}

/* Inner border effect using ::before pseudo-element */
.floating-nav::before {
    content: '';
    position: absolute;
    inset: 3.5px;
    background: transparent;
    border: 0.5px solid rgba(0, 0, 0, 0.03);
    border-radius: 13px;
    pointer-events: none;
    z-index: 1;
}

.floating-nav:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
                0 0 25px rgba(0, 0, 0, 0.03),
                rgba(0, 0, 0, 0.05) 0px 0px 0px 3px;
}

.floating-nav:hover::before {
    border-color: rgba(0, 0, 0, 0.04);
}

/* Enhanced scroll behavior */
.navbar-scrolled .floating-nav {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1),
                0 0 30px rgba(0, 0, 0, 0.03),
                rgba(0, 0, 0, 0.05) 0px 0px 0px 3px;
}

.navbar-scrolled .floating-nav::before {
    border-color: rgba(0, 0, 0, 0.04);
}

.floating-nav a.nav-link {
    position: relative;
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

.floating-nav a.nav-link:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* Section Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

/* CSS Custom Property for Border Animation */
@property --border-angle {
    syntax: "<angle>";
    inherits: true;
    initial-value: 0deg;
}

/* Animated Border for How We Work Section */
.animated-border-container {
    position: relative;
    --border-angle: 0deg;
    --border-width: 2px;
    --border-radius: 1.5rem;
}

.animated-border-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--border-radius);
    padding: var(--border-width);
    background: conic-gradient(
        from var(--border-angle) at 50% 50%,
        rgba(59, 130, 246, 0.9) 0deg,
        rgba(96, 165, 250, 1) 10deg,
        transparent 30deg,
        transparent 330deg,
        rgba(59, 130, 246, 0.9) 360deg
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
    animation: rotateBorder 6s linear infinite;
}

@keyframes rotateBorder {
    0% {
        --border-angle: 0deg;
    }
    100% {
        --border-angle: 360deg;
    }
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Burger Menu Icon */
.burger-icon {
    width: 24px;
    height: 24px;
    position: relative;
    cursor: pointer;
}

.burger-icon span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 1px;
    opacity: 1;
    left: 0;
    transition: 0.3s ease;
}

.burger-icon span:nth-child(1) { top: 4px; }
.burger-icon span:nth-child(2) { top: 11px; }
.burger-icon span:nth-child(3) { top: 18px; }

.burger-icon.open span:nth-child(1) {
    top: 11px;
    transform: rotate(135deg);
}

.burger-icon.open span:nth-child(2) {
    opacity: 0;
    left: -60px;
}

.burger-icon.open span:nth-child(3) {
    top: 11px;
    transform: rotate(-135deg);
}

/* Mobile Menu Animation */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu.open {
    max-height: 500px;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Feature Icon Styles */
.feature-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(96, 165, 250, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Principle Cards - How We Work Section */
.principle-card-large {
    padding: 1.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.principle-card-large:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.principle-card-small {
    padding: 1rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.principle-card-small:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.08);
}

/* Illustration Container Styles */
.illustration-container {
    position: relative;
}

.illustration-container::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0.75rem;
    box-shadow:
        inset 0 0 0 5px rgba(255, 255, 255, 0.6),
        inset 0 0 0 6px rgba(0, 0, 0, 0.1),
        inset 0 1px 2px 0 rgba(255, 255, 255, 0.4);
    pointer-events: none;
    z-index: 10;
}

.illustration-container-square {
    position: relative;
}

.illustration-container-square::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    box-shadow:
        inset 0 0 0 6px rgba(255, 255, 255, 0.7),
        inset 0 0 0 7px rgba(0, 0, 0, 0.12),
        inset 0 1px 3px 0 rgba(255, 255, 255, 0.5);
    pointer-events: none;
    z-index: 10;
}

/* Floating Founder Badge */
.founder-badge {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(255, 255, 255, 0.5) inset;
    transition: all 0.3s ease, opacity 0.4s ease, transform 0.4s ease;
    cursor: default;
}

.founder-badge.minimized {
    cursor: pointer;
}

.founder-badge.minimized:hover {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16), 0 0 0 0.5px rgba(255, 255, 255, 0.6) inset;
    transform: translateY(-2px);
}

/* Badge Content */
.badge-content {
    max-height: 500px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

.founder-badge.minimized .badge-content {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

/* Hide border and adjust spacing when minimized */
.founder-badge.minimized {
    padding: 1rem;
}

.founder-badge.minimized .border-t {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

/* Minimize Button */
.minimize-btn {
    opacity: 0;
    z-index: 10;
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.founder-badge:hover .minimize-btn {
    opacity: 1;
}

.minimize-btn:hover {
    transform: scale(1.1);
}

/* Show minimize button on hover even when minimized (to expand back) */
.founder-badge.minimized:hover .minimize-btn {
    opacity: 1;
    pointer-events: auto;
}

/* Reposition minimize button when minimized */
.founder-badge.minimized .minimize-btn {
    top: -12px;
}

.minimize-btn:hover {
    transform: translateX(-50%) scale(1.1) !important;
}

.minimize-btn i {
    transition: transform 0.3s ease;
}

.founder-badge.minimized .minimize-btn i {
    transform: rotate(180deg);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .founder-badge {
        width: calc(100% - 2rem) !important;
        max-width: none !important;
        right: 1rem;
        bottom: 1rem;
        left: 1rem;
        margin: 0 auto;
    }

    .texture-overlay {
        bottom: 270px;
    }

    .horizontal-line-bottom {
        bottom: 270px;
    }

    /* Start minimized on mobile */
    .founder-badge {
        padding: 1rem;
    }

    .founder-badge .badge-content {
        max-height: 0;
        opacity: 0;
        margin-bottom: 0;
    }

    .founder-badge .border-t {
        border-top: none;
        padding-top: 0;
        margin-top: 0;
    }

    /* Show expand button on mobile */
    .founder-badge .minimize-btn {
        opacity: 1;
        top: -12px;
    }

    .founder-badge .minimize-btn i {
        transform: rotate(180deg);
    }

    /* When expanded on mobile */
    .founder-badge.expanded {
        padding: 1rem;
    }

    .founder-badge.expanded .badge-content {
        max-height: 500px;
        opacity: 1;
        margin-bottom: 0;
    }

    .founder-badge.expanded .border-t {
        border-top: 1px solid rgb(229, 231, 235);
        padding-top: 0.75rem;
        margin-top: 0.75rem;
    }

    .founder-badge.expanded .minimize-btn i {
        transform: rotate(0deg);
    }
}

/* Portfolio Cards Responsive */
.portfolio-card {
    width: calc(50% - 0.375rem) !important;
}

.portfolio-card:nth-child(5) {
    width: 100% !important;
}

@media (min-width: 640px) {
    .portfolio-card {
        width: 150px !important;
    }

    .portfolio-card:nth-child(5) {
        width: 150px !important;
    }
}

/* Staggered Card Entrance Animation */
.portfolio-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.portfolio-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for each card */
.portfolio-card:nth-child(1).animate-in {
    transition-delay: 0.1s;
}

.portfolio-card:nth-child(2).animate-in {
    transition-delay: 0.2s;
}

.portfolio-card:nth-child(3).animate-in {
    transition-delay: 0.3s;
}

.portfolio-card:nth-child(4).animate-in {
    transition-delay: 0.4s;
}

.portfolio-card:nth-child(5).animate-in {
    transition-delay: 0.5s;
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.video-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.video-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    z-index: 1;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.video-modal.active .video-modal-content {
    transform: scale(1);
}

.video-modal-close {
    position: absolute;
    top: -10px;
    right: -20px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.video-modal-close:hover {
    background: white;
    transform: scale(1.1);
}

.video-modal-close i {
    color: #1f2937;
    font-size: 16px;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .video-modal-content {
        width: 95%;
    }

    .video-modal-close {
        top: -50px;
        width: 40px;
        height: 40px;
    }
}

/* Bottom Vignette Fade */
.bottom-vignette {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to top,
        rgba(250, 250, 250, 0.95) 0%,
        rgba(250, 250, 250, 0.7) 20%,
        rgba(250, 250, 250, 0.3) 50%,
        transparent 100%);
    pointer-events: none;
    z-index: 35;
}

/* Adjust for mobile */
@media (max-width: 768px) {
    .bottom-vignette {
        height: 200px;
    }
}
