/**
 * KiraHome - Homepage Stylesheet
 * Premium, state-of-the-art dark mode design for kirasoftware.it
 * Focuses on glassmorphism, glowing accents, and smooth transitions.
 */

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

:root {
    --bg-base: #060913;
    --bg-card: rgba(15, 23, 42, 0.6);
    --bg-card-hover: rgba(23, 37, 84, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --color-violet: #7c3aed;
    --color-blue: #3b82f6;
    --color-cyan: #06b6d4;
    
    --grad-primary: linear-gradient(135deg, #7c3aed 0%, #3b82f6 50%, #06b6d4 100%);
    --grad-text: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
    --grad-glow: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, rgba(59, 130, 246, 0.05) 50%, transparent 100%);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(124, 58, 237, 0.3);
    
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --radius-lg: 18px;
    --radius-md: 12px;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden !important;
    max-width: 100% !important;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden !important;
    max-width: 100% !important;
}

body.kh-nav-open {
    overflow: hidden;
}

/* Prevent cookie/consent banners and fixed overlays from causing horizontal scroll on mobile */
[class*="cookie" i],
[class*="complianz" i],
[class*="iubenda" i],
[class*="consent" i],
[id*="cookie" i],
[id*="complianz" i],
[id*="iubenda" i],
[id*="consent" i],
.cc-window,
.cli-bar-container,
#wpadminbar {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.gradient-text {
    background: var(--grad-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline;
}

.glow-text {
    filter: drop-shadow(0 0 15px rgba(124, 58, 237, 0.3));
}

/* ==========================================================================
   Layout & Container
   ========================================================================== */
.kh-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

.kh-section {
    padding: 100px 0;
    position: relative;
}

@media (max-width: 768px) {
    .kh-section {
        padding: 60px 0;
    }
}

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

/* ==========================================================================
   Background Effects
   ========================================================================== */
.ambient-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, rgba(6, 182, 212, 0.04) 50%, transparent 80%);
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.glow-top-right {
    top: -200px;
    right: -100px;
}

.glow-bottom-left {
    bottom: -100px;
    left: -200px;
}

.glow-middle {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center top;
    pointer-events: none;
    z-index: 0;
}

/* ==========================================================================
   Buttons & UI Elements
   ========================================================================== */
.kh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.kh-btn-primary {
    background: var(--grad-primary);
    background-size: 200% auto;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
    border: none;
}

.kh-btn-primary:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.45);
}

.kh-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
}

.kh-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ==========================================================================
   Header Component
   ========================================================================== */
.kh-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 90px;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(6, 9, 19, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    overflow: visible !important;
}

.kh-header.scrolled {
    background: rgba(6, 9, 19, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    height: 72px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4), 
                0 1px 0 0 rgba(255, 255, 255, 0.05) inset;
}

.kh-header .kh-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.kh-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 22px;
    color: #ffffff;
    letter-spacing: -0.02em;
    transition: opacity 0.3s ease;
}

.kh-logo:hover {
    opacity: 0.9;
}

.kh-logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.kh-logo:hover .kh-logo-img {
    transform: rotate(-5deg) scale(1.05);
}

.kh-logo span {
    font-weight: 300;
    background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-violet) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-left: 2px;
}

@media (max-width: 400px) {
    .kh-logo {
        font-size: 18px;
        gap: 8px;
    }
    .kh-logo-img {
        height: 30px;
    }
}

.kh-nav {
    display: flex;
    align-items: center;
    gap: 36px;
}

.kh-header .kh-nav .kh-nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color 0.3s ease;
    position: relative;
    padding: 8px 0;
}

.kh-header .kh-nav .kh-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--grad-primary);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(-50%);
    border-radius: 2px;
}

.kh-header .kh-nav .kh-nav-link:hover {
    color: #ffffff !important;
}

.kh-header .kh-nav .kh-nav-link:hover::after {
    width: 100%;
}

.kh-header .kh-btn {
    padding: 10px 22px;
    font-size: 13px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.2);
}

.kh-header .kh-btn:hover {
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

.kh-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 22px;
    height: 20px;
    position: relative;
    z-index: 1001;
    padding: 0;
    margin-right: 8px;
}

.kh-mobile-toggle .line {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                top 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.3s ease, 
                background-color 0.3s ease;
}

.kh-mobile-toggle .line-1 {
    top: 5px;
}

.kh-mobile-toggle .line-2 {
    top: 13px;
}

.kh-mobile-toggle:hover .line {
    background: var(--color-cyan);
}

.kh-mobile-toggle.active .line-1 {
    transform: rotate(45deg);
    top: 9px;
}

.kh-mobile-toggle.active .line-2 {
    transform: rotate(-45deg);
    top: 11px;
}

@media (max-width: 900px) {
    .kh-header {
        height: 75px;
    }
    
    .kh-header.scrolled {
        height: 65px;
    }
    
    .kh-nav {
        position: fixed;
        top: 75px;
        left: 0;
        right: 0;
        height: calc(100vh - 75px);
        background: rgba(6, 9, 19, 0.98);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 28px;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                    visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 999;
        padding: 60px 40px;
        overflow-y: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .kh-nav.active {
        transform: translateX(0);
        visibility: visible;
    }
    
    .kh-header .kh-nav .kh-nav-link {
        font-size: 20px;
        padding: 10px 0;
    }
    
    .kh-header .kh-nav .kh-nav-link::after {
        bottom: 4px;
    }
    
    .kh-nav .kh-btn {
        width: 100%;
        max-width: 280px;
        margin-top: 20px;
    }
    
    .kh-mobile-toggle {
        display: block;
    }

    .kh-header.scrolled .kh-nav {
        top: 65px;
        height: calc(100vh - 65px);
    }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.kh-hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 120px;
    padding-bottom: 70px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

#kh-hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.65;
}

.kh-hero .kh-container {
    position: relative;
    z-index: 10;
    max-width: 1000px;
    width: 100%;
}

.kh-hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.kh-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: #c084fc;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 30px;
    margin-bottom: 28px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(6px);
}

.kh-hero-badge span {
    width: 6px;
    height: 6px;
    background-color: var(--color-cyan);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--color-cyan);
    animation: pulse-cyan 2s infinite;
}

.kh-hero .kh-hero-title {
    font-size: 38px !important;
    line-height: 1.25 !important;
    margin-bottom: 24px !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
}

.kh-hero-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 36px;
    max-width: 680px;
    line-height: 1.6;
}

.kh-hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

@media (max-width: 900px) {
    .kh-hero {
        min-height: 80vh;
        padding-top: 100px;
        padding-bottom: 60px;
    }
    
    .kh-hero .kh-hero-title {
        font-size: 30px !important;
        line-height: 1.25 !important;
    }
    
    .kh-hero-subtitle {
        font-size: 15px;
        margin-bottom: 30px;
    }
}

@media (max-width: 576px) {
    .kh-hero-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .kh-hero-actions .kh-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .kh-hero .kh-hero-title {
        font-size: 22px !important;
        line-height: 1.3 !important;
    }
    .kh-hero-subtitle {
        font-size: 14px;
    }
}

.kh-header .kh-btn-primary {
    color: #ffffff !important;
}

/* ==========================================================================
   Stats Section
   ========================================================================== */
.kh-stats {
    background: rgba(6, 9, 19, 0.4);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 60px 0;
}

.kh-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.kh-stat-card {
    text-align: center;
}

.kh-stat-number {
    font-size: 48px;
    font-family: var(--font-heading);
    font-weight: 800;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 8px;
}

.kh-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .kh-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .kh-stat-number {
        font-size: 36px;
    }
}

/* ==========================================================================
   Services Section (Glassmorphism & Glow Cards)
   ========================================================================== */
.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 64px auto;
}

.section-tag {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-cyan);
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
}

.section-title {
    font-size: 36px;
    margin-bottom: 16px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 16px;
}

@media (max-width: 768px) {
    .section-header {
        margin-bottom: 40px;
    }
    
    .section-title {
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 26px;
    }
}

.kh-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 24px;
}

.kh-service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

@media (max-width: 480px) {
    .kh-service-card {
        padding: 30px 20px;
    }
}

.kh-service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--grad-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.kh-service-card:hover {
    transform: translateY(-8px);
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    box-shadow: 0 20px 40px rgba(124, 58, 237, 0.15);
}

.kh-service-card:hover::before {
    transform: scaleX(1);
}

.kh-service-icon-wrapper {
    width: 60px;
    height: 60px;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--color-violet);
    transition: all 0.3s ease;
}

.kh-service-card:hover .kh-service-icon-wrapper {
    background: var(--color-violet);
    color: #fff;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
    transform: scale(1.05);
}

.kh-service-card h3 {
    font-size: 20px;
    margin-bottom: 16px;
}

.kh-service-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* ==========================================================================
   Tech Stack Component
   ========================================================================== */
.kh-tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 20px;
}

.kh-tech-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.kh-tech-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.08);
}

.kh-tech-icon {
    font-size: 32px;
}

.kh-tech-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.kh-tech-card:hover .kh-tech-name {
    color: #fff;
}

/* ==========================================================================
   Timeline / Process Section
   ========================================================================== */
.kh-timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.kh-timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--border-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

@media (max-width: 768px) {
    .kh-timeline::after {
        left: 31px;
    }
}

.kh-timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

.kh-timeline-item.left {
    left: 0;
    text-align: right;
}

.kh-timeline-item.right {
    left: 50%;
}

.kh-timeline-badge {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-base);
    border: 4px solid var(--color-violet);
    top: 22px;
    z-index: 10;
    transition: all 0.3s ease;
}

.kh-timeline-item.left .kh-timeline-badge {
    right: -10px;
}

.kh-timeline-item.right .kh-timeline-badge {
    left: -10px;
}

.kh-timeline-item:hover .kh-timeline-badge {
    background: var(--color-cyan);
    border-color: #fff;
    box-shadow: 0 0 12px var(--color-cyan);
}

.kh-timeline-content {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.kh-timeline-item:hover .kh-timeline-content {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: var(--shadow-premium);
}

.kh-timeline-step {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-cyan);
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

.kh-timeline-content h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.kh-timeline-content p {
    font-size: 14px;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .kh-timeline::after {
        left: 31px;
    }
    
    .kh-timeline-item {
        width: 100%;
        padding-left: 60px;
        padding-right: 0;
        text-align: left !important;
    }
    
    .kh-timeline-item.right {
        left: 0;
    }
    
    .kh-timeline-item.left .kh-timeline-badge {
        right: auto;
        left: 21px;
    }
    
    .kh-timeline-item.right .kh-timeline-badge {
        left: 21px;
    }
}

@media (max-width: 480px) {
    .kh-timeline::after {
        left: 21px;
    }
    
    .kh-timeline-item {
        padding-left: 45px;
    }
    
    .kh-timeline-item.left .kh-timeline-badge {
        left: 11px;
    }
    
    .kh-timeline-item.right .kh-timeline-badge {
        left: 11px;
    }
}

/* ==========================================================================
   Advantages / Why Us
   ========================================================================== */
.kh-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    align-items: center;
}

.kh-features-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.kh-feature-item {
    display: flex;
    gap: 16px;
}

.kh-feature-bullet {
    width: 32px;
    height: 32px;
    background: rgba(6, 182, 212, 0.1);
    color: var(--color-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 14px;
}

.kh-feature-item h3 {
    font-size: 18px;
    margin-bottom: 6px;
}

.kh-feature-item p {
    color: var(--text-secondary);
    font-size: 14px;
}

.kh-features-visual {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-color);
}

.kh-features-visual img {
    width: 100%;
    display: block;
}

@media (max-width: 768px) {
    .kh-features-grid {
        grid-template-columns: 1fr;
    }
    
    .kh-features-visual {
        order: -1;
    }
}

/* ==========================================================================
   CTA / Contact Section
   ========================================================================== */
.kh-cta-card {
    background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.15) 0%, rgba(6, 9, 19, 0.8) 100%);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-lg);
    padding: 60px 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

.kh-cta-card::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
    top: -150px;
    left: -150px;
    filter: blur(40px);
}

.kh-cta-card h2 {
    font-size: 40px;
    margin-bottom: 16px;
}

.kh-cta-card p {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto 32px auto;
}

@media (max-width: 600px) {
    .kh-cta-card {
        padding: 40px 24px;
    }
    .kh-cta-card h2 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .kh-cta-card {
        padding: 40px 16px;
    }
    .kh-cta-card h2 {
        font-size: 24px;
    }
    .kh-cta-card .kh-btn {
        width: 100%;
        max-width: 280px;
    }
}

/* ==========================================================================
   Footer Component
   ========================================================================== */
.kh-footer {
    background: #03050a;
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.kh-footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

@media (max-width: 992px) {
    .kh-footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
    .kh-footer-logo-desc {
        grid-column: span 2;
    }
}

.kh-footer-logo-desc {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kh-footer-logo-desc p {
    line-height: 1.6;
}

.kh-footer-links h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kh-footer-links ul {
    list-style: none;
}

.kh-footer-links ul li {
    margin-bottom: 12px;
}

.kh-footer-links ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.kh-footer-links ul li a:hover {
    color: #fff;
}

.kh-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 30px;
}

.kh-footer-bottom p a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    margin-left: 5px;
    margin-right: 5px;
}

.kh-footer-bottom p a:hover {
    color: #ffffff;
}

.kh-footer-socials {
    display: flex;
    gap: 16px;
}

.kh-footer-social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.kh-footer-social-link:hover {
    background: var(--color-violet);
    color: #fff;
    border-color: var(--color-violet);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.3);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .kh-footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .kh-footer-logo-desc {
        grid-column: span 1;
    }
    
    .kh-footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* ==========================================================================
   Animations Keyframes
   ========================================================================== */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse-cyan {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.4);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(6, 182, 212, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0);
    }
}

/* Reveal elements on scroll */
.kh-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.kh-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Contact Page Section
   ========================================================================== */
body.kh-contact-page {
    background: #060913 !important;
    background-color: #060913 !important;
    color: #ffffff !important;
}

.kh-contact-page #kh-hero-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.5;
}

.kh-contact-page .kh-header,
.kh-contact-page .kh-contact-hero,
.kh-contact-page .kh-contact-body,
.kh-contact-page .kh-footer {
    position: relative;
    z-index: 10;
}

.kh-contact-hero {
    padding-top: 90px !important;
    padding-bottom: 10px !important;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.kh-contact-hero .kh-hero-badge {
    margin-bottom: 16px;
}

.kh-contact-body {
    padding-bottom: 100px;
    position: relative;
}

.kh-contact-grid {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 50px;
    align-items: start;
}

.kh-contact-info-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.kh-info-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    gap: 20px;
    align-items: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-premium), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.kh-info-card:hover {
    border-color: var(--border-glow) !important;
    background: var(--bg-card-hover) !important;
    transform: translateY(-4px);
    box-shadow: 0 25px 45px rgba(124, 58, 237, 0.1) !important;
}

.kh-info-icon {
    font-size: 26px;
    width: 56px;
    height: 56px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: #c084fc;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.15);
}

.kh-info-card h3 {
    font-size: 16px;
    margin-bottom: 6px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.kh-info-card p {
    color: var(--text-secondary);
    font-size: 14.5px;
    margin: 0;
    line-height: 1.5;
}

.kh-info-card p a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.kh-info-card p a:hover {
    color: #ffffff;
}

/* Contact Form Card */
.kh-contact-form-col {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg);
    padding: 44px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-premium), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.kh-contact-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.kh-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.kh-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kh-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.kh-form-group input[type="text"],
.kh-form-group input[type="email"],
.kh-form-group textarea {
    background: rgba(3, 5, 10, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px;
    padding: 14px 18px;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 14.5px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
}

.kh-form-group input[type="text"]:focus,
.kh-form-group input[type="email"]:focus,
.kh-form-group textarea:focus {
    border-color: var(--color-cyan) !important;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2) !important;
    background: rgba(3, 5, 10, 0.8) !important;
    transform: translateY(-1px);
}

.kh-checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.kh-checkbox-group input[type="checkbox"] {
    accent-color: var(--color-cyan);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.kh-checkbox-group label {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 400;
    cursor: pointer;
    line-height: 1.5;
}

.kh-form-submit {
    align-self: flex-start;
    padding: 14px 32px;
    font-size: 15px;
}

.kh-form-response {
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.kh-form-response.success p {
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
    padding: 14px 18px;
    border-radius: 8px;
    margin: 0;
    line-height: 1.5;
}

.kh-form-response.error p {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    padding: 14px 18px;
    border-radius: 8px;
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .kh-contact-hero {
        padding-top: 75px !important;
        padding-bottom: 10px !important;
    }
    
    .kh-contact-body {
        padding-bottom: 80px;
    }

    .kh-contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .kh-form-submit {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .kh-form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .kh-contact-form-col {
        padding: 28px 24px;
    }
}

/* ==========================================================================
   Blog Page Section
   ========================================================================== */
body.kh-blog-page {
    background: #060913 !important;
    background-color: #060913 !important;
    color: #ffffff !important;
}

.kh-blog-page #kh-hero-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.5;
}

.kh-blog-page .kh-header,
.kh-blog-page .kh-blog-hero,
.kh-blog-page .kh-blog-body,
.kh-blog-page .kh-footer {
    position: relative;
    z-index: 10;
}

.kh-blog-hero {
    padding-top: 100px !important;
    padding-bottom: 20px !important;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.kh-blog-hero .kh-hero-badge {
    margin-bottom: 16px;
}

.kh-blog-body {
    padding-bottom: 100px;
    position: relative;
}

.kh-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.kh-blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-premium);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.kh-blog-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    transform: translateY(-5px);
    box-shadow: 0 25px 45px rgba(124, 58, 237, 0.1);
}

.kh-blog-card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.kh-blog-card-category {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(124, 58, 237, 0.9);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    backdrop-filter: blur(4px);
}

.kh-blog-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.kh-blog-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
}

.kh-blog-card-title {
    font-size: 20px;
    line-height: 1.4;
    margin-bottom: 12px;
    font-weight: 700;
}

.kh-blog-card-title a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.kh-blog-card-title a:hover {
    color: var(--color-cyan);
}

.kh-blog-card-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.kh-blog-card-link {
    font-size: 14px;
    color: var(--color-cyan);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.kh-blog-card-link:hover {
    color: #ffffff;
}

/* Pagination Styling */
.kh-blog-pagination {
    margin-top: 50px;
    display: flex;
    justify-content: center;
}

.kh-blog-pagination ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
}

.kh-blog-pagination ul li a,
.kh-blog-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.kh-blog-pagination ul li span.current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}

.kh-blog-pagination ul li a:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    color: var(--color-cyan);
}

.kh-blog-empty {
    text-align: center;
    padding: 60px 0;
}

.kh-blog-empty p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .kh-blog-hero {
        padding-top: 85px !important;
        padding-bottom: 15px !important;
    }
}

/* ==========================================================================
   About Section (Chi C'è Dietro)
   ========================================================================== */
.kh-about-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 60px;
    align-items: center;
}

.kh-about-lead {
    font-size: 19px;
    color: #ffffff;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 20px;
}

.kh-about-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.7;
}

.kh-about-cta {
    margin-top: 30px;
}

.kh-about-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.kh-about-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 380px;
    height: 420px;
}

.kh-about-img-single {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-premium);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.kh-about-image-wrapper:hover .kh-about-img-single {
    transform: translateY(-5px) scale(1.02);
}

/* Stats text adjustment */
.kh-stat-card.has-text .kh-stat-number {
    font-size: 26px !important;
    line-height: 1.2;
    padding-bottom: 4px;
}

@media (max-width: 900px) {
    .kh-about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .kh-about-image-wrapper {
        height: 380px;
        max-width: 320px;
        margin: 0 auto;
    }
}

/* CTA Button Text Colors (Black text for CTA buttons, white for header CTA) */
.kh-btn-primary {
    color: #000000 !important;
}

.kh-btn-primary:hover {
    color: #000000 !important;
}

.kh-header .kh-btn-primary {
    color: #ffffff !important;
}

.kh-header .kh-btn-primary:hover {
    color: #ffffff !important;
}

/* ==========================================================================
   Tech Stack Section (Interactive 3D morphing layout)
   ========================================================================== */
.kh-tech-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 60px;
    align-items: center;
    margin-top: 40px;
}

.kh-tech-grid-new {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kh-tech-card-new {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.kh-tech-card-new:hover,
.kh-tech-card-new.active {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.08);
}

.kh-tech-card-new.active {
    transform: translateX(8px);
}

.kh-tech-icon-new {
    font-size: 28px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.kh-tech-card-new.active .kh-tech-icon-new {
    background: rgba(124, 58, 237, 0.15);
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
}

.kh-tech-text-wrapper h3 {
    font-size: 18px;
    color: #ffffff;
    margin-bottom: 6px;
    font-weight: 700;
}

.kh-tech-text-wrapper p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.kh-tech-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.kh-3d-canvas-container {
    position: relative;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.04) 0%, transparent 70%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#kh-tech-canvas {
    width: 300px;
    height: 300px;
}

.kh-canvas-hint {
    position: absolute;
    bottom: -15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
    white-space: nowrap;
}

.kh-canvas-hint .dot {
    width: 6px;
    height: 6px;
    background: #c084fc;
    border-radius: 50%;
    box-shadow: 0 0 8px #c084fc;
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); opacity: 0.4; }
}

@media (max-width: 900px) {
    .kh-tech-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .kh-tech-card-new.active {
        transform: none;
    }
    
    .kh-tech-visual {
        order: -1; /* Place 3D object on top on mobile */
        margin-bottom: 20px;
    }
}

/* Custom CSS override container */
#kh-custom-styles-anchor {
    display: none;
}
