/* ============================================================
   David Merilus — Analytics Engineer
   Concept : "le portfolio comme un projet dbt"
   Palette glacier / nuit arctique · Space Grotesk + JetBrains Mono
   ============================================================ */

:root {
    /* Couleurs */
    --night: #071622;        /* fond sombre (hero, cta, footer) */
    --night-2: #0d2435;      /* surfaces sur fond sombre */
    --ice: #f1f6f9;          /* fond clair du site */
    --paper: #ffffff;        /* cartes */
    --ink: #122b3c;          /* texte principal */
    --muted: #58707f;        /* texte secondaire */
    --line: #dbe6ed;         /* bordures claires */
    --line-dark: rgba(154, 203, 230, 0.16);
    --glacial: #3ec7f0;      /* accent cyan (sur sombre) */
    --glacial-deep: #0b7fab; /* accent cyan (sur clair, AA) */
    --signal: #ff8a3d;       /* accent chaud, rare */
    --signal-deep: #e2641a;

    /* Typo */
    --font-display: "Space Grotesk", system-ui, sans-serif;
    --font-body: "Instrument Sans", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;

    /* Rythme */
    --container: 1140px;
    --section-pad: clamp(4rem, 9vw, 7rem);
    --radius: 14px;
    --shadow: 0 10px 30px rgba(13, 43, 64, 0.08);
    --shadow-lift: 0 18px 44px rgba(13, 43, 64, 0.14);
    --nav-h: 68px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--ice);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
ul { list-style: none; }

.container {
    width: min(var(--container), 100% - 2.5rem);
    margin-inline: auto;
}

.mono { font-family: var(--font-mono); }
.centered { text-align: center; }

:focus-visible {
    outline: 2px solid var(--glacial-deep);
    outline-offset: 3px;
    border-radius: 4px;
}
.hero :focus-visible, .cta :focus-visible { outline-color: var(--glacial); }

::selection { background: var(--glacial); color: var(--night); }

/* ---------- Titres & eyebrows ---------- */
.section { padding-block: var(--section-pad); }

.section-eyebrow {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--glacial-deep);
    margin-bottom: 0.75rem;
}
.section-eyebrow::before { content: "-- "; opacity: 0.55; }
.section-eyebrow.on-dark { color: var(--glacial); }

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

/* ---------- Navigation ---------- */
.navbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--nav-h);
    background: rgba(7, 22, 34, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: background 0.3s ease, border-color 0.3s ease;
}
.navbar.scrolled {
    background: rgba(7, 22, 34, 0.92);
    border-bottom-color: var(--line-dark);
}

.nav-container {
    width: min(var(--container), 100% - 2.5rem);
    margin-inline: auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.nav-logo {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: baseline;
}
.logo-cursor {
    color: var(--glacial);
    animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    justify-content: flex-end;
}

.nav-links { display: flex; gap: 1.6rem; }
.nav-links a {
    color: rgba(235, 246, 252, 0.82);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.35rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.nav-links a:hover { color: #fff; border-bottom-color: var(--glacial); }

.nav-extras { display: flex; align-items: center; gap: 1.25rem; }

.nav-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(235, 246, 252, 0.82);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    transition: color 0.2s ease;
}
.nav-phone:hover { color: var(--glacial); }

.language-switcher {
    display: flex;
    border: 1px solid var(--line-dark);
    border-radius: 999px;
    overflow: hidden;
}
.lang-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(235, 246, 252, 0.7);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.45rem 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    min-height: 34px;
}
.lang-btn:hover { color: #fff; }
.lang-btn.active { background: var(--glacial); color: var(--night); }

.nav-toggle {
    display: none;
    appearance: none;
    background: transparent;
    border: 1px solid var(--line-dark);
    border-radius: 10px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    background:
        radial-gradient(1100px 540px at 78% -10%, rgba(62, 199, 240, 0.16), transparent 60%),
        radial-gradient(700px 420px at 8% 110%, rgba(255, 138, 61, 0.08), transparent 60%),
        var(--night);
    color: #eef7fc;
    padding-top: calc(var(--nav-h) + clamp(3rem, 8vw, 5.5rem));
    padding-bottom: clamp(3.5rem, 8vw, 6rem);
    overflow: hidden;
}

.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line-dark) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-dark) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
    opacity: 0.5;
    pointer-events: none;
}

/* Aurora animée */
.hero-aurora {
    position: absolute;
    inset: -20%;
    pointer-events: none;
    background:
        radial-gradient(420px 320px at 20% 30%, rgba(62, 199, 240, 0.13), transparent 70%),
        radial-gradient(480px 360px at 80% 60%, rgba(255, 105, 74, 0.09), transparent 70%),
        radial-gradient(380px 300px at 60% 15%, rgba(66, 133, 244, 0.1), transparent 70%);
    animation: aurora 16s ease-in-out infinite alternate;
    filter: blur(10px);
}
@keyframes aurora {
    0%   { transform: translate(0, 0) rotate(0deg); }
    50%  { transform: translate(3%, -2%) rotate(2deg); }
    100% { transform: translate(-3%, 2%) rotate(-2deg); }
}

/* Bulles techno flottantes */
.hero-float { position: absolute; inset: 0; pointer-events: none; }

.tech-bubble {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: #eaf6fc;
    background: rgba(13, 36, 53, 0.66);
    border: 1px solid var(--bubble-color, var(--glacial));
    border-radius: 999px;
    padding: 0.5rem 0.95rem;
    box-shadow: 0 0 22px -6px var(--bubble-color, var(--glacial));
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    white-space: nowrap;
    will-change: transform;
    animation: bubbleFloat var(--float-dur, 9s) ease-in-out var(--float-delay, 0s) infinite alternate;
    transition: transform 0.18s ease-out;
    opacity: 0.92;
}
.tech-bubble i, .tech-bubble .bubble-mark { color: var(--bubble-color, var(--glacial)); font-size: 1rem; }
.tech-bubble .bubble-mark { font-size: 0.78rem; letter-spacing: 0.02em; }

@keyframes bubbleFloat {
    0%   { margin-top: 0; margin-left: 0; }
    50%  { margin-top: -16px; margin-left: 8px; }
    100% { margin-top: 12px; margin-left: -8px; }
}

.hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: clamp(2.5rem, 6vw, 5rem);
}

.hero-eyebrow {
    color: var(--glacial);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    opacity: 0.9;
}

.hero-greeting {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.1rem, 5.5vw, 3.6rem);
    line-height: 1.08;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}
.hero-greeting > span:first-child {
    display: block;
    font-size: 0.42em;
    font-weight: 500;
    color: rgba(235, 246, 252, 0.65);
    letter-spacing: 0;
    margin-bottom: 0.4rem;
}
.hero-name { color: #fff; }
.type-caret {
    display: inline-block;
    width: 0.14em;
    height: 0.92em;
    margin-left: 0.08em;
    background: var(--glacial);
    vertical-align: -0.08em;
    animation: blink 1s steps(1) infinite;
}

.hero-title {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    color: var(--glacial);
    margin-bottom: 0.9rem;
}

.hero-location {
    font-size: 0.85rem;
    color: rgba(235, 246, 252, 0.6);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2.2rem;
}

.hero-buttons { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.98rem;
    text-decoration: none;
    padding: 0.85rem 1.7rem;
    border-radius: 999px;
    min-height: 48px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--glacial);
    color: var(--night);
    box-shadow: 0 8px 24px rgba(62, 199, 240, 0.28);
}
.btn-primary:hover { background: #63d4f5; }

.btn-ghost {
    color: #eef7fc;
    border: 1px solid rgba(154, 203, 230, 0.35);
}
.btn-ghost:hover { border-color: var(--glacial); color: var(--glacial); }

.btn-signal {
    background: var(--signal);
    color: var(--night);
    box-shadow: 0 8px 24px rgba(255, 138, 61, 0.3);
}
.btn-signal:hover { background: #ffa066; }

.btn-contact {
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.btn-contact:hover { border-color: var(--glacial-deep); color: var(--glacial-deep); box-shadow: var(--shadow-lift); }
.btn-contact i { color: var(--glacial-deep); }

/* ---------- Worksheet SQL (élément signature) ---------- */
.hero-terminal {
    background: rgba(13, 36, 53, 0.85);
    border: 1px solid var(--line-dark);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line-dark);
}
.term-dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }
.terminal-title {
    margin-left: 0.6rem;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    color: rgba(235, 246, 252, 0.45);
}

.terminal-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.6rem 0.9rem 0;
    border-bottom: 1px solid var(--line-dark);
    overflow-x: auto;
}
.term-tab {
    appearance: none;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: rgba(235, 246, 252, 0.55);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease, border-color 0.2s ease;
    min-height: 38px;
}
.term-tab:hover { color: #fff; }
.term-tab.active { color: var(--glacial); border-bottom-color: var(--glacial); }

.terminal-query {
    padding: 1.1rem 1.2rem 0.4rem;
    font-size: 0.86rem;
    line-height: 1.7;
    color: #d7ecf6;
    white-space: pre-wrap;
    min-height: 92px;
}
.terminal-query .sql-kw { color: var(--glacial); font-weight: 700; }
.term-caret {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: var(--glacial);
    vertical-align: -0.15em;
    animation: blink 1s steps(1) infinite;
}

.terminal-results { padding: 0.4rem 1.2rem 0.6rem; min-height: 132px; }
.terminal-results table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}
.terminal-results th {
    text-align: left;
    color: rgba(235, 246, 252, 0.45);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.66rem;
    padding: 0.4rem 0.9rem 0.4rem 0;
    border-bottom: 1px solid var(--line-dark);
}
.terminal-results td {
    color: #eaf6fc;
    padding: 0.5rem 0.9rem 0.5rem 0;
    border-bottom: 1px solid rgba(154, 203, 230, 0.07);
}
.terminal-results td.level-bar { color: var(--glacial); letter-spacing: 0.05em; }
.terminal-results tbody tr {
    opacity: 0;
    transform: translateY(6px);
    animation: rowIn 0.35s ease forwards;
}
@keyframes rowIn { to { opacity: 1; transform: none; } }

.terminal-status {
    padding: 0.55rem 1.2rem 0.95rem;
    font-size: 0.74rem;
    color: #3ddc8e;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.2rem;
}
.terminal-status:empty { visibility: hidden; }
.terminal-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3ddc8e;
    box-shadow: 0 0 10px rgba(61, 220, 142, 0.8);
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 50% { opacity: 0.45; } }

/* ---------- Services ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 1.4rem;
}

.service-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.8rem 1.6rem;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.service-card {
    position: relative;
    overflow: hidden;
}
.service-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--accent, var(--glacial-deep));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.service-card:hover {
    transform: translateY(-9px) scale(1.02);
    box-shadow: 0 22px 50px rgba(13, 43, 64, 0.18);
    border-color: var(--accent, var(--glacial-deep));
}
.service-card:hover::before { transform: scaleX(1); }
.service-card:hover .service-icon {
    transform: scale(1.12) rotate(-6deg);
    background: var(--accent, var(--glacial-deep));
    color: #fff;
}
.service-card .service-icon {
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
    background: color-mix(in srgb, var(--accent, var(--glacial-deep)) 14%, transparent);
    color: var(--accent, var(--glacial-deep));
}
.service-card { cursor: pointer; user-select: none; }
.service-card:active { transform: scale(0.97); }
.service-card.pop { animation: cardPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes cardPop {
    0% { transform: scale(1); }
    35% { transform: scale(0.95); }
    70% { transform: scale(1.03); }
    100% { transform: scale(1); }
}
.service-card.pop .service-icon { animation: iconSpin 0.45s ease; }
@keyframes iconSpin {
    50% { transform: rotate(-8deg) scale(1.15); }
}
.service-card .service-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(62, 199, 240, 0.12);
    color: var(--glacial-deep);
    font-size: 1.2rem;
    margin-bottom: 1.1rem;
}
.service-card h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.55rem;
}
.service-card p { color: var(--muted); font-size: 0.98rem; }

/* ---------- About ---------- */
.about { background: var(--paper); }

.about-content {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: start;
}

.about-image {
    position: relative;
    max-width: 290px;
    justify-self: start;
}
.about-image img {
    border-radius: var(--radius);
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lift);
}
.about-image-frame {
    position: absolute;
    inset: 1.1rem -1.1rem -1.1rem 1.1rem;
    border: 2px solid var(--glacial);
    border-radius: var(--radius);
    opacity: 0.5;
}

.about-text p:not(.section-eyebrow) {
    color: var(--muted);
    margin-bottom: 1.1rem;
}

.social-links { display: flex; gap: 0.8rem; margin-top: 1.6rem; }
.social-link {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    color: var(--glacial-deep);
    font-size: 1.05rem;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.social-link:hover {
    background: var(--glacial-deep);
    color: #fff;
    transform: translateY(-3px);
}

/* ---------- Timeline ---------- */
.timeline {
    position: relative;
    max-width: 820px;
    margin-inline: auto;
    padding-left: 3.4rem;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 19px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(var(--glacial-deep), var(--line));
}

.timeline-item {
    position: relative;
    padding-bottom: 2.4rem;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-icon {
    position: absolute;
    left: -3.4rem;
    top: 2px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--paper);
    border: 2px solid var(--glacial-deep);
    display: grid;
    place-items: center;
    color: var(--glacial-deep);
    font-size: 1rem;
    z-index: 1;
    box-shadow: var(--shadow);
}

.timeline-content {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.6rem;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.timeline-content:hover { transform: translateX(4px); box-shadow: var(--shadow-lift); }

.timeline-content h3 {
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.timeline-content .company {
    color: var(--glacial-deep);
    font-weight: 600;
    margin: 0.15rem 0 0.3rem;
}
.timeline-content .date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.85rem;
}
.timeline-content .description li {
    position: relative;
    padding-left: 1.2rem;
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}
.timeline-content .description li::before {
    content: "›";
    position: absolute;
    left: 0;
    color: var(--glacial-deep);
    font-weight: 700;
}

/* ---------- Projects ---------- */
.projects { background: var(--paper); }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 1.6rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: var(--ice);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lift);
    border-color: rgba(11, 127, 171, 0.4);
}

.project-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--night-2);
}
.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.project-card:hover .project-image img { transform: scale(1.05); }

.project-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.4rem 1.4rem 1.5rem;
}
.project-body h3 {
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.55rem;
}
.project-body p {
    color: var(--muted);
    font-size: 0.93rem;
    margin-bottom: 1rem;
    flex: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1.1rem;
}
.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--glacial-deep);
    background: rgba(62, 199, 240, 0.12);
    border: 1px solid rgba(11, 127, 171, 0.22);
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
}

.project-link {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease, gap 0.2s ease;
}
.project-link:hover { color: var(--glacial-deep); gap: 0.75rem; }

/* ---------- Companies ---------- */
.companies { padding-bottom: var(--section-pad); }
.companies .section-title { margin-bottom: 1rem; }

.companies-slider-wrapper {
    overflow: hidden;
    margin-top: 2rem;
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.companies-slider {
    display: flex;
    align-items: center;
    gap: clamp(2.5rem, 6vw, 5rem);
    width: max-content;
}
@keyframes scrollCompanies {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-100% / 3)); }
}

.company-logo-container {
    height: 72px;
    min-width: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.7rem 1.3rem;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.company-logo-container:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.company-logo-img {
    max-height: 42px;
    max-width: 130px;
    width: auto;
    object-fit: contain;
    filter: grayscale(1) opacity(0.75);
    transition: filter 0.25s ease;
}
.company-logo-container:hover .company-logo-img { filter: grayscale(0) opacity(1); }
.company-logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
}

/* ---------- Skills ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: 1.4rem;
}

.skill-category {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.6rem 1.5rem;
    box-shadow: var(--shadow);
}
.skill-category h3 {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--glacial-deep);
    margin-bottom: 1.1rem;
}
.skill-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.45rem 0;
    color: var(--ink);
    font-weight: 500;
    font-size: 0.96rem;
}
.skill-item i { color: var(--glacial-deep); width: 20px; text-align: center; }

/* ---------- CTA (bande sombre) ---------- */
.cta {
    background:
        radial-gradient(800px 400px at 85% 0%, rgba(255, 138, 61, 0.12), transparent 60%),
        var(--night);
    color: #eef7fc;
}
.cta-content { max-width: 760px; }
.cta-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.6vw, 2.3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.18;
    margin-bottom: 1.1rem;
}
.cta-intro { color: rgba(235, 246, 252, 0.72); margin-bottom: 1.8rem; }
.cta-conclusion {
    font-size: 0.82rem;
    color: var(--signal);
    margin-bottom: 0.9rem;
}
.cta-symptoms { margin-bottom: 2.2rem; }
.cta-symptoms li {
    position: relative;
    padding: 0.55rem 0 0.55rem 2rem;
    color: rgba(235, 246, 252, 0.85);
    border-bottom: 1px solid var(--line-dark);
    font-size: 0.97rem;
}
.cta-symptoms li:last-child { border-bottom: 0; }
.cta-symptoms li::before {
    content: "!";
    position: absolute;
    left: 0;
    top: 0.62rem;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: rgba(255, 138, 61, 0.15);
    color: var(--signal);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.75rem;
    display: grid;
    place-items: center;
}

/* ---------- How I Work ---------- */
.how-i-work { background: var(--paper); }
.how-i-work-subtitle {
    color: var(--muted);
    max-width: 620px;
    margin: -1.2rem 0 2.5rem;
}
.impact-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1.4rem;
    margin-bottom: 2.5rem;
}
.impact-stat {
    background: var(--ice);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.9rem 1.7rem 1.7rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.impact-stat:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lift);
    border-color: var(--stat-color, var(--glacial-deep));
}
.impact-stat .stat-value {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5.5vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--stat-color, var(--glacial-deep));
    margin-bottom: 0.7rem;
}
.impact-stat .stat-label {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}
.impact-stat .stat-context {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--stat-color, var(--glacial-deep));
    margin-top: 0.7rem;
}

.how-i-work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 1.4rem;
}
.work-block {
    background: var(--ice);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.7rem 1.6rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.work-block:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.work-step {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--glacial-deep);
    margin-bottom: 0.8rem;
    display: block;
}
.work-block h3 {
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 700;
    margin-bottom: 0.55rem;
}
.work-block p { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.9rem; }
.work-block .deliverable {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--glacial-deep);
    background: rgba(62, 199, 240, 0.1);
    border-left: 3px solid var(--glacial-deep);
    padding: 0.6rem 0.8rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 0;
}

/* ---------- Contact ---------- */
.contact-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

/* ---------- Footer ---------- */
.footer {
    background: var(--night);
    color: rgba(235, 246, 252, 0.55);
    padding-block: 2.2rem;
    font-size: 0.88rem;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}
.footer .mono { color: var(--glacial); font-size: 0.82rem; }

/* ---------- Reveal au scroll ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1024px) {
    .nav-toggle { display: inline-flex; }

    .nav-menu {
        position: fixed;
        top: var(--nav-h);
        right: 0;
        bottom: 0;
        width: min(330px, 85vw);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        background: rgba(7, 22, 34, 0.97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-left: 1px solid var(--line-dark);
        padding: 1.6rem 1.6rem 2.5rem;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }
    .nav-menu.open { transform: translateX(0); }

    .nav-links { flex-direction: column; gap: 0; }
    .nav-links a {
        display: block;
        padding: 0.95rem 0.25rem;
        font-size: 1.05rem;
        border-bottom: 1px solid var(--line-dark);
    }

    .nav-extras {
        flex-direction: column;
        align-items: stretch;
        gap: 1.2rem;
        margin-top: 1.6rem;
    }
    .nav-phone { justify-content: center; padding: 0.7rem; border: 1px solid var(--line-dark); border-radius: 10px; }
    .language-switcher { justify-content: center; }
    .lang-btn { flex: 1; }

    .hero-inner { grid-template-columns: 1fr; }
    .tech-bubble { font-size: 0.68rem; padding: 0.4rem 0.75rem; opacity: 0.5; }
    .hero-terminal { max-width: 560px; }

    .about-content { grid-template-columns: 1fr; }
    .about-image { max-width: 260px; }
}

@media (max-width: 640px) {
    body { font-size: 1rem; }

    .hero-buttons .btn { flex: 1 1 100%; }
    .contact-buttons { flex-direction: column; }
    .contact-buttons .btn { width: 100%; }

    .timeline { padding-left: 2.9rem; }
    .timeline::before { left: 15px; }
    .timeline-icon { left: -2.9rem; width: 32px; height: 32px; font-size: 0.82rem; border-radius: 10px; }
    .timeline-content { padding: 1.2rem 1.1rem; }

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

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    [data-reveal] { opacity: 1; transform: none; }
    .companies-slider { animation: none !important; flex-wrap: wrap; width: 100%; justify-content: center; }
    .terminal-results tbody tr { animation: none; opacity: 1; transform: none; }
    .term-caret { animation: none; }
    .tech-bubble, .hero-aurora { animation: none; }
    .type-caret { animation: none; }
}
