/* ============================================================
   VARIABLES & RESET
   ============================================================ */
:root {
    --primary:    #0a2540;
    --primary-2:  #0d3460;
    --accent:     #00c2ff;
    --bg:         #f5f7fa;
    --text:       #333;
    --text-muted: #666;
    --white:      #ffffff;
    --shadow:     0 4px 28px rgba(10, 37, 64, 0.10);
    --shadow-lg:  0 12px 48px rgba(10, 37, 64, 0.18);
    --radius:     12px;
    --radius-lg:  20px;
    --transition: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

abbr[title] {
    text-decoration: none;
    cursor: help;
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible        { opacity: 1; transform: none; }
.reveal-delay-1        { transition-delay: 0.15s; }
.reveal-delay-2        { transition-delay: 0.30s; }
.reveal-delay-3        { transition-delay: 0.45s; }

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================================
   HEADER
   ============================================================ */
#main-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--primary);
    transition: box-shadow var(--transition);
}
#main-header.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--white);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}
.logo-img {
    height: 34px;
    width: auto;
}

#main-nav a {
    color: rgba(255, 255, 255, 0.82);
    margin-left: 2rem;
    font-size: 0.93rem;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    transition: color var(--transition);
    white-space: nowrap;
}
#main-nav a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transition: width var(--transition);
}
#main-nav a:hover        { color: var(--accent); }
#main-nav a:hover::after { width: 100%; }

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-shrink: 0;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-2), var(--accent), var(--primary));
    background-size: 300% 300%;
    animation: heroGradient 14s ease-in-out infinite;
    color: var(--white);
    padding: 6rem 0 5rem;
    overflow: hidden;
}

@keyframes heroGradient {
    0%   { background-position: 0%   50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0%   50%; }
}

.hero-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    align-items: center;
    gap: 3rem;
}

.hero-text h1 {
    font-size: clamp(1.75rem, 3.5vw, 2.85rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
}
.hero-text p {
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.75;
    margin-bottom: 2.5rem;
}

.hero-portrait {
    width: 100%;
    max-width: 280px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    display: block;
    margin: 0 auto;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-block;
    padding: 0.82rem 2rem;
    border-radius: 50px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-primary {
    background: var(--white);
    color: var(--primary);
}
.btn-primary:hover {
    background: var(--accent);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 194, 255, 0.38);
}
.btn-accent {
    background: var(--accent);
    color: var(--primary);
}
.btn-accent:hover {
    background: var(--white);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 194, 255, 0.35);
}

/* ============================================================
   SECTION TITLE
   ============================================================ */
.section-title {
    text-align: center;
    font-size: clamp(1.55rem, 2.8vw, 2.15rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 3rem;
}
.section-title::after {
    content: '';
    display: block;
    width: 52px;
    height: 4px;
    background: var(--accent);
    margin: 0.7rem auto 0;
    border-radius: 2px;
}
.services .section-title { color: var(--primary); }

/* ============================================================
   SERVICES
   ============================================================ */
.services {
    padding: 5.5rem 0;
    background: var(--white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.5rem;
}

.card {
    position: relative;
    background: var(--bg);
    padding: 2rem 1.6rem;
    border-radius: var(--radius);
    border: 1px solid #e4eaf0;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card-accent {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(to right, var(--accent), var(--primary-2));
    opacity: 0;
    transition: opacity var(--transition);
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.card:hover .card-accent { opacity: 1; }

.card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.6rem;
}
.card p {
    font-size: 0.93rem;
    color: var(--text-muted);
    line-height: 1.65;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.about::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('david-marini-home.jpg');
    background-size: cover;
    background-position: center;
    z-index: 0;
    animation: zoomBg 22s ease-in-out infinite;
}
@keyframes zoomBg {
    0%, 100% { transform: scale(1);    }
    50%       { transform: scale(1.05); }
}

.about-overlay {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(to right, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.45) 55%, rgba(0,0,0,0) 100%);
    display: flex;
    align-items: center;
}

.about-box {
    color: var(--white);
    max-width: 480px;
    margin-left: 3%;
    padding: 2.5rem;
}
.about-box h2 {
    font-size: clamp(1.55rem, 2.8vw, 2.15rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 1.25rem;
}
.about-box h2::after {
    content: '';
    display: block;
    width: 52px;
    height: 4px;
    background: var(--accent);
    margin-top: 0.7rem;
    border-radius: 2px;
}
.about-box p {
    font-size: clamp(0.95rem, 1.4vw, 1.08rem);
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    text-align: justify;
}
.about-box em {
    font-style: normal;
    color: var(--accent);
}

/* ============================================================
   CONTACT SECTION
   ============================================================ */
.contact-section {
    background: var(--primary);
    padding: 5.5rem 0 6rem;
}
.contact-section .section-title {
    color: var(--white);
}
.contact-sub {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.05rem;
    margin-top: -2rem;
    margin-bottom: 2.75rem;
}

/* Feedback banner */
.form-feedback {
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    font-weight: 500;
    text-align: center;
    font-size: 1rem;
    line-height: 1.6;
}
.form-feedback.success {
    background: rgba(0, 200, 120, 0.12);
    border: 1px solid rgba(0, 200, 120, 0.35);
    color: #a8ffd4;
}
.form-feedback.error {
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid rgba(231, 76, 60, 0.35);
    color: #ffb8b8;
}
.form-feedback.error a { color: var(--accent); }

/* Form wrapper */
.contact-form {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-lg);
    padding: 2.5rem 3rem;
    backdrop-filter: blur(8px);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-group {
    margin-bottom: 1.35rem;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 0.45rem;
}
.required { color: var(--accent); font-size: 0.85em; }

.char-counter {
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    transition: color var(--transition);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 0.78rem 1rem;
    color: var(--white);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    outline: none;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
    resize: vertical;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.30);
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.11);
    box-shadow: 0 0 0 3px rgba(0, 194, 255, 0.15);
}
/* Browser autofill override */
.form-group input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 50px #0d3460 inset;
    -webkit-text-fill-color: var(--white);
}

/* Checkbox RGPD */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 2px;
    accent-color: var(--accent);
    cursor: pointer;
}
.form-check label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.62);
    cursor: pointer;
    line-height: 1.5;
}

.form-note {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.38);
    margin-bottom: 1.5rem;
}

/* Honeypot */
.hp-field {
    display: none !important;
    position: absolute;
    left: -9999px;
    visibility: hidden;
}

.form-actions {
    text-align: center;
    margin-top: 0.5rem;
}
.btn-submit {
    padding: 0.9rem 3rem;
    font-size: 1rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    background: #081a2b;
    color: rgba(255, 255, 255, 0.55);
    padding: 1.5rem 0;
    font-size: 0.85rem;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
footer a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity var(--transition);
}
footer a:hover { opacity: 0.8; }

/* ============================================================
   RESPONSIVE — TABLET & MOBILE (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
    /* Header */
    .hamburger  { display: flex; }
    #main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 1rem 5%;
        border-top: 1px solid rgba(255,255,255,0.10);
        gap: 0;
    }
    #main-nav.open { display: flex; }
    #main-nav a {
        margin: 0;
        padding: 0.65rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        font-size: 1rem;
    }
    #main-nav a:last-child { border-bottom: none; }
    #main-nav a::after { display: none; }
    #main-header { position: relative; }

    /* Hero */
    .hero         { padding: 3.5rem 0; }
    .hero-layout  { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
    .hero-visual  { order: -1; }
    .hero-portrait { max-width: 180px; }
    .hero-text p   { margin-bottom: 2rem; }

    /* Services */
    .services-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

    /* About — décalage de la photo vers la droite sur mobile */
    .about::before {
        background-position: 72% center;
    }

    .about-overlay {
        background: linear-gradient(to bottom,
            rgba(0,0,0,0) 0%,
            rgba(0,0,0,0.55) 35%,
            rgba(0,0,0,0.88) 100%);
        align-items: flex-end;
    }
    .about-box {
        margin: 0;
        padding: 2rem;
        max-width: 100%;
        margin-bottom: 2.5rem;
    }

    /* Contact form */
    .contact-form { padding: 1.75rem; }
    .form-row     { grid-template-columns: 1fr; gap: 0; }

    /* Footer */
    .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .contact-form { padding: 1.25rem; }
    .btn-submit   { width: 100%; }
}
