:root {
    --bg-dark: #02050a;
    /* Ultra dark blue/black */
    --bg-panel: #0a111a;
    --accent: #00f3ff;
    /* Bright Neon Cyan */
    --accent-secondary: #008f99;
    --text-main: #e6f1f5;
    --text-muted: #8b9bb4;
    --font-heading: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --header-height: 80px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Utilities */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.85rem;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent);
    color: #000 !important;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

.btn-primary:hover {
    background: #fff !important;
    color: #000 !important;
    border-color: var(--accent);
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.6);
    transform: translateY(-2px);
}

.btn-outline {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
}

.btn-outline:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
    text-shadow: 0 0 8px var(--accent);
}

.btn-block {
    display: block;
    width: 100%;
}



.section-title {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 4px;
    color: #fff;
}

.section-title .accent {
    color: var(--accent);
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

/* Background Animation */
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at center, #050a14 0%, #000000 100%);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='1' cy='1' r='1' fill='rgba(0, 243, 255, 0.1)'/%3E%3C/svg%3E");
    mask-image: linear-gradient(to bottom, transparent, black);
    z-index: -1;
    opacity: 0.3;
}

/* Header */
.header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(2, 5, 10, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 243, 255, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
}

.logo-img {
    height: 45px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.3));
}

@media (max-width: 768px) {
    .logo-img {
        height: 35px;
    }

    .logo {
        font-size: 1.5rem;
    }
}

.nav {
    display: flex;
    align-items: center;
}

.nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 40px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    transition: all 0.3s;
    position: relative;
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--accent);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: rgba(10, 17, 26, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.4s cubic-bezier(0.77, 0.2, 0.05, 1);
        z-index: 1000;
        gap: 30px;
    }

    .nav.active {
        right: 0;
    }

    .nav a {
        margin: 0;
        font-size: 1.2rem;
    }
}

.nav a:not(.btn):hover {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
}

/* Hero */
.hero {
    min-height: 100vh;
    /* Reduced from 100vh */
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
    position: relative;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    /* Center it */
    text-align: center;
}

.glitch-text {
    font-size: 3.5rem;
    /* Reduced from 5.5rem */
    font-weight: 700;
    /* Slightly thinner */
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
    /* Softer glow */
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-weight: 300;
    letter-spacing: 6px;
    text-transform: uppercase;
    border: none;
    padding-left: 0;
}

@media (max-width: 768px) {
    .glitch-text {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 0.8rem;
        letter-spacing: 3px;
    }
}

.hero-description {
    line-height: 1.8;
    letter-spacing: 0.5px;
    animation: fadeInUp 1s ease-out 0.5s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Noise Texture */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Portfolio - Bento Grid */
.section {
    padding: 80px 0;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 400px;
    gap: 20px;
}

@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .section-title {
        font-size: 1.9rem;
        /* Increased from 1.7rem */
        letter-spacing: 1px;
        margin-bottom: 1.5rem;
    }
}

/* Uniform Grid - Spans removed */

.card {
    background: rgba(10, 17, 26, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Transition is critical for the tilt effect feel - faster for transform */
    transition: transform 0.1s ease-out, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    /* Important for 3D effect */
    transform-style: preserve-3d;
}

.card:hover {
    /* Transform handled by JS for tilt, but we set a default here */
    border-color: var(--accent);
    box-shadow: 0 15px 50px -10px rgba(0, 243, 255, 0.15);
    z-index: 10;
}

/* Subtle Inner Border Glow */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    -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;
}

/* Remove old corner accents */
.card::after {
    display: none;
}

.card-image-placeholder {
    flex: 1;
    background: #0f1926;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.1);
    font-size: 3rem;
    min-height: 150px;
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Inner zoom effect on placeholder/icon */
.card:hover .card-image-placeholder {
    background: #0b141f;
    /* Slightly lighter */
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent);
}

.card-image-placeholder::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 243, 255, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    opacity: 0;
    transition: opacity 0.5s;
}

.card:hover .card-image-placeholder::after {
    opacity: 1;
}

.card-content {
    padding: 30px;
}

.card h3 {
    margin-bottom: 10px;
    font-size: 1.4rem;
    color: #fff;
    font-weight: 700;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}

.tag {
    font-size: 0.7rem;
    background: rgba(0, 243, 255, 0.05);
    color: var(--accent);
    padding: 6px 12px;
    border: 1px solid rgba(0, 243, 255, 0.15);
    text-transform: uppercase;
    font-weight: 600;
}

.link-arrow {
    display: inline-block;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 2px;
    transition: 0.3s;
}

.link-arrow:hover {
    color: var(--accent);
    padding-left: 5px;
}

/* Stretched Link Strategy */
.link-arrow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Skills */
.skills-list {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.skill-item {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 15px;
    background: transparent;
    padding: 15px 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.skill-icon {
    color: var(--accent);
    font-weight: 900;
}

/* Contact Section Enhancements */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    align-items: start;
    margin-top: 40px;
}

.contact-info {
    position: sticky;
    top: 120px;
}

.info-card {
    padding: 0;
}

.info-card h3 {
    font-size: 2.2rem;
    color: #fff;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.contact-item:hover .item-icon {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--accent);
    transform: scale(1.05);
}

.contact-item:hover .item-text p {
    color: var(--accent);
}

.item-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.item-text span {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
}

.item-text p {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 500;
}

.social-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 800;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 8px;
}

.social-icon.social-linkedin {
    border: 2px solid rgba(0, 119, 181, 0.4);
    color: #0077b5;
    background: rgba(0, 119, 181, 0.05);
}

.social-icon.social-twitter {
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.social-icon.social-instagram {
    border: 2px solid rgba(228, 64, 95, 0.4);
    color: #e4405f;
    background: rgba(228, 64, 95, 0.05);
}

.social-icon.social-linkedin:hover {
    border-color: #0077b5;
    background: rgba(0, 119, 181, 0.15);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 119, 181, 0.3);
}

.social-icon.social-twitter:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.social-icon.social-instagram:hover {
    border-color: #e4405f;
    background: rgba(228, 64, 95, 0.15);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(228, 64, 95, 0.3);
}

/* Contact Form - Floating Panel */
.contact-form {
    background: rgba(10, 17, 26, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 35px 40px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
    position: relative;
}

/* Side Glow Effect */
.contact-form::after {
    content: '';
    position: absolute;
    top: 10%;
    right: -20px;
    width: 40px;
    height: 80%;
    background: var(--accent);
    filter: blur(60px);
    opacity: 0.05;
    z-index: -1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 15px 20px;
    font-size: 1rem;
    /* 16px to prevent iOS zoom */
    color: #fff;
    border-radius: 8px;
    transition: all 0.3s;
    font-family: inherit;
}

@media (max-width: 768px) {
    .card-content {
        padding: 20px;
    }
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 243, 255, 0.03);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
}

.checkbox-group {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.checkbox-group input {
    width: auto;
    margin-top: 5px;
}

.checkbox-group label {
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.5;
    font-weight: 400;
}

@media (max-width: 991px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .contact-info {
        position: static;
    }

    .contact-form {
        padding: 40px 30px;
    }
}

/* Features Grid (Hexceos Style) */
.center-text {
    text-align: center;
}

.section-lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 40px auto;
    font-weight: 300;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    text-align: center;
    position: relative;
}

@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

/* Connector lines between features */
@media (min-width: 1025px) {
    .features-grid::before {
        content: '';
        position: absolute;
        top: 25%;
        left: 15%;
        right: 15%;
        height: 1px;
        background: linear-gradient(90deg, transparent, var(--accent), transparent);
        z-index: -1;
        opacity: 0.3;
    }
}

.feature-item {
    background: rgba(255, 255, 255, 0.03);
    /* Fond plus aérien */
    backdrop-filter: blur(25px);
    /* Flou intense */
    -webkit-backdrop-filter: blur(25px);
    padding: 40px 30px;
    border-radius: 12px;
    /* Coins plus fermes */
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* Bordure lumineuse refractive */
.feature-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 40%, transparent 60%, rgba(255, 255, 255, 0.1) 100%);
    -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;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 255, 255, 0.05);
}

/* Effet de balayage lumineux au survol */
.feature-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    transform: translate(0, 0);
    transition: transform 0.8s ease-out;
    pointer-events: none;
    opacity: 0;
}

.feature-item:hover::before {
    transform: translate(25%, 25%);
    opacity: 1;
}

.feature-icon {
    margin-bottom: 25px;
    display: inline-block;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feature-item:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-item h3 {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 15px;
    font-weight: 700;
}

.feature-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .feature-item {
        padding: 30px 20px;
        /* Reduced side padding to give more room to text */
    }

    .feature-item h3 {
        font-size: 1.25rem;
    }
}

/* 7. FOOTER */
.footer {
    padding: 60px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 1px;
}

/* Animations Utility */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 1.5s ease;
}

/* Responsive Overrides cleanup */
@media (max-width: 768px) {
    .hero {
        padding-top: 120px;
        min-height: auto;
        padding-bottom: 60px;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .contact-form {
        padding: 30px 20px;
    }

    .info-card h3 {
        font-size: 1.8rem;
    }

    .section {
        padding: 60px 0;
    }
}