/* -------------------------------------------------------------------------- */
/*                               DESIGN SYSTEM                                */
/* -------------------------------------------------------------------------- */

/*
Theme Name: IVANP Website
Theme URI: https://ivanp.co.uk
Author: Ivan Petruzzelli
Author URI: https://www.linkedin.com/in/ivanpetruzzelli/
Description: A production-ready, installable WordPress Theme for Design Executive & AI Strategist portfolio.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: antigravity-site
*/

:root {
    --primary-text: #1a1a1a;
    --secondary-text: #555555;
    --accent-green: #00cc88;
    --accent-blue: #4a90e2;
    --accent-purple: #9013fe;
    --bg-color: #f9f9f9;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);

    --font-heading: 'DM Serif Display', serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing System */
    --container-width: 1200px;
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 40px;
    --space-xl: 80px;
}

/* ----------------------------------- */
/*              BASE RESET             */
/* ----------------------------------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--primary-text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ----------------------------------- */
/*           TYPOGRAPHY (MOBILE)       */
/* ----------------------------------- */

h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    /* Reduced for mobile */
    line-height: 1.2;
    margin-bottom: var(--space-sm);
}

h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

/* ----------------------------------- */
/*            COMPONENTS               */
/* ----------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    min-height: 48px;
    /* Touch friendly */
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--accent-green);
    color: var(--white);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-text);
    border: 1px solid var(--border-color);
}

.badge {
    background-color: rgba(0, 204, 136, 0.1);
    color: var(--accent-green);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
    display: inline-block;
}

/* Form Styles */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    padding: var(--space-lg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.form-group {
    margin-bottom: var(--space-md);
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--primary-text);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fdfdfd;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(0, 204, 136, 0.1);
    background: var(--white);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* ----------------------------------- */
/*             STRUCTURE (MOBILE)      */
/* ----------------------------------- */

/* Header & Nav */
.site-header {
    background-color: var(--bg-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    position: relative;
    z-index: 1200;
}

.logo a,
a.logo {
    color: var(--primary-text);
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo a:hover,
a.logo:hover {
    background: linear-gradient(90deg, var(--accent-green), var(--accent-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Base Nav (Mobile: hidden by default) */
.main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.75);
    /* Lowered opacity to see content underneath better */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 100px 40px 40px;
    /* Reduced top padding slightly */
    box-shadow: none;
    transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1100;
    overflow-y: auto;
    /* Allow scrolling for long menus */
    -webkit-overflow-scrolling: touch;
}

.main-nav.active {
    right: 0;
}

.main-nav>ul {
    display: flex;
    flex-direction: column;
    list-style: none;
    gap: 12px;
    /* Reduced gap between L1 items */
}

/* Base Nav link styles */
.main-nav a {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    color: var(--primary-text);
    padding: 6px 0;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
}

.has-submenu>a::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin-left: 10px;
    margin-top: -2px;
    /* Pull up for absolute optical center */
    transition: transform 0.3s ease, color 0.3s ease;
}

/* Desktop/Tablet Hover Rotation */
@media (min-width: 768px) {
    .has-submenu:hover>a::after {
        transform: rotate(-135deg) translateY(-2px);
    }
}

.main-nav a:hover {
    color: var(--accent-green);
}

/* Submenu on Mobile - collapsible */
@media (max-width: 767px) {
    .main-nav .submenu {
        display: none;
        padding-left: 15px;
        margin: 5px 0;
        list-style: none;
        width: 100%;
    }

    .main-nav li.has-submenu.open>.submenu {
        display: block;
        visibility: visible;
        opacity: 1;
        margin: 5px 0 15px 0;
    }

    .has-submenu.open>a::after {
        transform: rotate(-135deg) translateY(-2px);
        color: var(--accent-green);
    }
}

.submenu li {
    list-style: none;
    margin-bottom: 5px;
}

.submenu a {
    font-size: 0.9rem;
    text-transform: none;
    color: var(--secondary-text);
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1200;
}

.mobile-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--primary-text);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.mobile-toggle.open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-toggle.open span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Hero Section */
.hero-section {
    padding: var(--space-lg) 0;
}

.hero-content {
    display: flex;
    flex-direction: column;
    /* Stacked on mobile */
    gap: var(--space-lg);
    text-align: center;
}

.hero-text {
    animation: slideUp 1.6s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    opacity: 0;
}

.hero-subtext {
    font-size: 1rem;
    color: var(--secondary-text);
    margin-bottom: var(--space-md);
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hero-image {
    width: 100%;
    margin-top: var(--space-md);
    animation: panZoomStop 2.5s cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s forwards;
    opacity: 0;
    /* Start hidden for smooth fade-in */
}

.image-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 40px auto;
}

.image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

/* Stats */
.stats-section {
    padding: var(--space-lg) 0;
    background-color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* 1 col on small mobile */
    gap: var(--space-md);
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.25rem;
    color: var(--accent-green);
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--secondary-text);
    letter-spacing: 1px;
}

/* Collaboration */
.collaboration-section {
    padding: var(--space-sm) 0;
    text-align: center;
}



.logos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
}

.logo-item {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xs);
}

.logo-item img {
    max-width: 100%;
    max-height: 70%;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

/* Expertise */
.expertise-section {
    padding: var(--space-xl) 0;
}

.expertise-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.expertise-card {
    background: white;
    padding: var(--space-md);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.icon-box {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-sm);
}

/* Case Studies */
.case-studies-section {
    padding: var(--space-lg) 0;
}

.section-header {
    margin-bottom: var(--space-md);
    text-align: center;
}

.slider-controls {
    display: none;
    /* Hide on mobile as requested */
}

.carousel-wrapper {
    position: relative;
    margin: var(--space-md) 0;
}

.case-studies-grid {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    padding: 20px 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: var(--white);
    border-radius: 50%;
    display: none;
    /* Desktop only */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 20;
    color: var(--accent-green);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: none;
}

.slider-btn:hover {
    background: var(--accent-green);
    color: var(--white);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}


.case-study-card {
    flex: 0 0 85%;
    /* Shows bit of next card */
    min-width: 280px;
    border-radius: 16px;
    overflow: hidden;
    background: white;
    box-shadow: var(--card-shadow);
    scroll-snap-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideUp 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) backwards;
}

.case-study-card:nth-child(2) {
    animation-delay: 0.1s;
}

.case-study-card:nth-child(3) {
    animation-delay: 0.2s;
}

.case-study-card:nth-child(4) {
    animation-delay: 0.3s;
}


.card-image {
    height: 240px;
    /* Increased height slightly for better visibility */
    position: relative;
    overflow: hidden;
}

.case-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


.card-content {
    padding: var(--space-md);
    text-align: center;
}

.card-content .btn {
    margin-top: var(--space-sm);
}

.card-logo {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-sm);
    height: 30px;
    align-items: center;
}

.card-logo img {
    max-height: 100%;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.case-study-card:hover .card-logo img {
    filter: grayscale(0%);
    opacity: 1;
}


/* Footer */
footer {
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    text-align: center;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    margin-bottom: var(--space-xs);
}

.copyright {
    color: var(--secondary-text);
    font-size: 0.85rem;
}

.social-links {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-text);
    transition: all 0.3s ease;
}

.social-links img {
    width: 28px;
    /* Increased from 24px */
    height: 28px;
    object-fit: contain;
}

.social-links a:hover {
    color: var(--accent-green);
    transform: translateY(-3px);
}

/* Global Hover States */
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.expertise-card:hover {
    transform: translateY(-10px);
}

.logo-item:hover {
    transform: scale(1.05);
}

.logo-item:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

.case-study-card:hover {
    transform: translateY(-8px);
}

/* ----------------------------------- */
/*           TABLET (768px+)           */
/* ----------------------------------- */

@media (min-width: 768px) {
    .container {
        padding-left: 32px;
        padding-right: 32px;
    }

    .header-container {
        flex-direction: row;
        justify-content: space-between;
        gap: 0;
    }

    .mobile-toggle {
        display: none;
    }

    .main-nav {
        position: static;
        width: auto;
        height: auto;
        background: transparent;
        padding: 0;
        box-shadow: none;
        display: block;
        overflow: visible;
    }

    .main-nav>ul {
        flex-direction: row;
        gap: 30px;
    }

    .main-nav a {
        font-size: 0.8rem;
        padding: 0;
    }



    h1 {
        font-size: 3rem;
    }

    .hero-actions {
        flex-direction: row;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }

    .logos-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2px;
    }

    .expertise-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .case-study-card {
        flex: 0 0 45%;
    }

    .slider-btn {
        display: flex;
    }

    .prev-btn {
        left: -30px;
    }

    .next-btn {
        right: -30px;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding-right: 80px;
        /* Safe zone for back-to-top button */
    }
}

/* ----------------------------------- */
/*          DESKTOP (1025px+)          */
/* ----------------------------------- */

@media (min-width: 1025px) {
    .container {
        max-width: var(--container-width);
    }

    h1 {
        font-size: 3.5rem;
    }

    .logo {
        font-size: 1.75rem;
    }

    .main-nav>ul {
        gap: 32px;
    }

    .hero-content {
        flex-direction: row;
        text-align: left;
        align-items: center;
    }

    .hero-text {
        flex: 1;
    }

    .hero-subtext {
        margin-left: 0;
    }

    .hero-actions {
        justify-content: flex-start;
    }

    .hero-image {
        flex: 1;
        margin-top: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .logos-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .expertise-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .case-study-card {
        flex: 0 0 28%;
    }

    .slider-btn {
        display: flex;
    }

    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
}

/* ----------------------------------- */
/*             ANIMATIONS              */
/* ----------------------------------- */

@keyframes panZoomStop {
    from {
        opacity: 0;
        transform: scale(1.1) translateX(80px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ----------------------------------- */
/*            NAV SUBMENU              */
/* ----------------------------------- */



@media (min-width: 768px) {
    .has-submenu {
        position: relative;
    }

    /* Submenu reset for horizontal nav */
    .main-nav .submenu {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        background: white;
        min-width: 220px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        padding: 0;
        margin: 0;
        z-index: 100;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
        list-style: none;
        pointer-events: none;
        /* Prevent interference when hidden */
    }

    /* Desktop Hover States */
    .has-submenu:hover>.submenu,
    .has-submenu:focus-within>.submenu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    /* Override mobile open state on desktop */
    .main-nav li.has-submenu.open>.submenu {
        margin: 0;
    }

    /* Bridge to prevent hover gap */
    .has-submenu::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: 20px;
        display: none;
    }

    .has-submenu:hover::after {
        display: block;
    }

    .main-nav .submenu li {
        border-bottom: 1px solid #f0f0f0;
    }

    .main-nav .submenu li:last-child {
        border-bottom: none;
    }

    .main-nav .submenu a {
        padding: 12px 20px;
        display: block;
        text-transform: none;
        font-size: 0.85rem;
        letter-spacing: 0.3px;
        color: var(--primary-text);
        transition: background 0.2s, color 0.2s;
        text-align: left;
    }

    .main-nav .submenu a:hover {
        background-color: #f8f8f8;
        color: var(--accent-green);
    }
}

/* Placeholder Utility */
.highlight {
    background: linear-gradient(90deg, #00cc88, #4a90e2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.icon-green {
    background-color: rgba(0, 204, 136, 0.1);
    color: var(--accent-green);
}

.icon-blue {
    background-color: rgba(74, 144, 226, 0.1);
    color: var(--accent-blue);
}

.icon-purple {
    background-color: rgba(144, 19, 254, 0.1);
    color: var(--accent-purple);
}

.placeholder-bg {
    width: 100%;
    height: 100%;
    position: relative;
}

.dark-bg {
    background-color: #2c2c2c;
}

.light-bg {
    background-color: #e6e6e6;
}

.tag {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 10;
    background: var(--accent-green);
    color: white;
}

.tag.light {
    background: white;
    color: var(--primary-text);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--white);
    color: var(--accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: none;
    outline: none;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent-green);
    color: var(--white);
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}