/*
 * rguina.com — jetons repris du design system Devosoft
 * (lms/resources/css/app.css). Le sombre est la marque ; le clair est
 * la variante déjà définie dans la plateforme, conservée à l'identique.
 */

/* ── Polices auto-hébergées (aucune requête tierce) ───────────────── */
@font-face {
    font-family: 'Inter Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212,
        U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
        U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Space Grotesk Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 300 700;
    src: url('../fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212,
        U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Space Grotesk Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 300 700;
    src: url('../fonts/space-grotesk-latin-ext-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
        U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Jetons ───────────────────────────────────────────────────────── */
:root {
    --bg: #000444;
    --surface-2: #050a4a;
    --fg: #ffffff;
    --fg-muted: rgba(255, 255, 255, 0.58);
    --fg-soft: rgba(255, 255, 255, 0.78);
    --primary: #2ea7e0;
    --primary-deep: #1685bc;
    --primary-ink: #00112a;
    --success: #2ddc9a;
    --glass: rgba(46, 167, 224, 0.08);
    --glass-hover: rgba(46, 167, 224, 0.14);
    --border: rgba(46, 167, 224, 0.18);
    --border-strong: rgba(46, 167, 224, 0.34);
    --nav-bg: rgba(0, 4, 68, 0.72);
    --footer-bg: #000333;
    --grid-line: rgba(46, 167, 224, 0.07);
    --halo: rgba(46, 167, 224, 0.34);

    --font-sans: 'Inter Variable', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk Variable', 'Space Grotesk', var(--font-sans);

    --measure: 62ch;
    --shell: 1180px;
    --gutter: clamp(1.25rem, 5vw, 4rem);
    --rule: 1px solid var(--border);
}

:root[data-theme='light'] {
    --bg: #f4f7ff;
    --surface-2: #ffffff;
    --fg: #00112a;
    --fg-muted: rgba(0, 17, 42, 0.62);
    --fg-soft: rgba(0, 17, 42, 0.82);
    --primary: #11719f;
    --primary-deep: #0d5c82;
    --primary-ink: #ffffff;
    --success: #0e9f6e;
    --glass: rgba(255, 255, 255, 0.72);
    --glass-hover: rgba(255, 255, 255, 0.95);
    --border: rgba(22, 133, 188, 0.24);
    --border-strong: rgba(22, 133, 188, 0.42);
    --nav-bg: rgba(244, 247, 255, 0.84);
    --footer-bg: rgba(255, 255, 255, 0.86);
    --grid-line: rgba(22, 133, 188, 0.09);
    --halo: rgba(22, 133, 188, 0.22);
}

/* ── Base ─────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition:
        background-color 200ms ease,
        color 200ms ease;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.022em;
    line-height: 1.08;
    margin: 0;
    text-wrap: balance;
}

p {
    margin: 0 0 1.1em;
    max-width: var(--measure);
}

a {
    color: inherit;
}

::selection {
    background: var(--primary);
    color: var(--primary-ink);
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 3px;
}

img,
svg {
    max-width: 100%;
}

.shell {
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--primary);
    color: var(--primary-ink);
    padding: 0.6rem 1rem;
    z-index: 100;
    border-radius: 0 0 8px 0;
}
.skip:focus {
    left: 0;
}

/* ── Barre de navigation ──────────────────────────────────────────── */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: var(--rule);
}

.nav__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 4.25rem;
}

.nav__brand {
    display: inline-flex;
    align-items: center;
    color: var(--fg);
    text-decoration: none;
    margin-inline-end: auto;
}

.nav__brand svg {
    height: 28px;
    width: auto;
    display: block;
}

.nav__links {
    display: flex;
    gap: 1.75rem;
    font-size: 0.9375rem;
}

.nav__links a {
    color: var(--fg-muted);
    text-decoration: none;
    padding-block: 0.35rem;
    border-bottom: 1px solid transparent;
    transition:
        color 140ms ease,
        border-color 140ms ease;
}

.nav__links a:hover,
.nav__links a:focus-visible {
    color: var(--fg);
    border-bottom-color: var(--primary);
}

.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--fg-soft);
    cursor: pointer;
    padding: 0;
    transition:
        background-color 140ms ease,
        color 140ms ease;
}

.theme-toggle:hover {
    background: var(--glass-hover);
    color: var(--fg);
}

.theme-toggle svg {
    width: 17px;
    height: 17px;
}
:root:not([data-theme='light']) .theme-toggle .icon-sun {
    display: none;
}
:root[data-theme='light'] .theme-toggle .icon-moon {
    display: none;
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
    position: relative;
    padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 7vw, 5.5rem);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 68px 68px;
    mask-image: radial-gradient(120% 90% at 30% 0%, #000 10%, transparent 72%);
    -webkit-mask-image: radial-gradient(120% 90% at 30% 0%, #000 10%, transparent 72%);
    pointer-events: none;
}

.hero__inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(240px, 30vw, 360px);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}

.hero__name {
    font-size: clamp(3.1rem, 11.5vw, 8.25rem);
    line-height: 0.86;
    letter-spacing: -0.045em;
    margin-bottom: 1.5rem;
}

.hero__name span {
    display: block;
}

.hero__name .is-cyan {
    color: var(--primary);
}

.hero__role {
    font-family: var(--font-display);
    font-size: clamp(1.0625rem, 2.2vw, 1.375rem);
    font-weight: 500;
    line-height: 1.35;
    color: var(--fg);
    max-width: 30ch;
    margin: 0 0 1.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-strong);
}

.hero__lede {
    color: var(--fg-soft);
    max-width: 46ch;
    margin-bottom: 1.9rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.7rem 1.15rem;
    border-radius: 10px;
    border: 1px solid transparent;
    transition:
        background-color 150ms ease,
        border-color 150ms ease,
        transform 150ms ease;
}

.btn svg {
    width: 17px;
    height: 17px;
    flex: none;
}

.btn--primary {
    background: var(--primary);
    color: var(--primary-ink);
}

.btn--primary:hover {
    background: var(--primary-deep);
    color: #fff;
}

.btn--ghost {
    border-color: var(--border-strong);
    color: var(--fg-soft);
    background: var(--glass);
}

.btn--ghost:hover {
    background: var(--glass-hover);
    color: var(--fg);
}

/* Portrait : plaque carrée, halo cyan, léger débord du cadre */
.hero__portrait {
    position: relative;
    aspect-ratio: 1;
    border-radius: 18px;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(46, 167, 224, 0.12), 0 30px 70px -30px rgba(0, 0, 0, 0.75);
}

.hero__portrait::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 90% at 50% 120%, var(--halo), transparent 62%);
    mix-blend-mode: screen;
    pointer-events: none;
}

.hero__portrait img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Bande de faits ───────────────────────────────────────────────── */
.facts {
    border-block: var(--rule);
}

/* Le nombre de colonnes suit le nombre de chiffres laissés visibles. */
.facts__list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
}

.facts__list[data-colonnes='1'] {
    grid-template-columns: minmax(0, 1fr);
}
.facts__list[data-colonnes='2'] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.facts__list[data-colonnes='3'] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.facts__list[data-colonnes='5'] {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
.facts__list[data-colonnes='6'] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.facts__item {
    padding: 1.6rem 0 1.5rem;
    padding-inline-end: 1.25rem;
}

.facts__item + .facts__item {
    border-inline-start: var(--rule);
    padding-inline-start: 1.5rem;
}

.facts__value {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--primary);
    margin-bottom: 0.45rem;
}

.facts__label {
    display: block;
    font-size: 0.875rem;
    color: var(--fg-muted);
    line-height: 1.4;
    margin: 0;
}

/* ── Sections ─────────────────────────────────────────────────────── */
.section {
    padding-block: clamp(3.5rem, 8vw, 6rem);
    border-bottom: var(--rule);
}

/* Les listes de travaux et la table de spécifications posent déjà leur propre
   règle de fin : celle de la section ferait doublon. */
.section:has(.works),
.section:has(.spec) {
    border-bottom: 0;
}

.section__head {
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section__title {
    font-size: clamp(1.75rem, 4vw, 2.6rem);
    margin-bottom: 0.9rem;
}

.section__intro {
    color: var(--fg-muted);
    max-width: var(--measure);
    margin: 0;
}

/* Deux colonnes de texte pour le récit */
.prose-cols {
    columns: 2;
    column-gap: clamp(2rem, 5vw, 4rem);
    max-width: 68rem;
}

.prose-cols p {
    max-width: none;
    break-inside: avoid;
    color: var(--fg-soft);
}

.prose-cols p:last-child {
    margin-bottom: 0;
}

.prose-cols strong {
    color: var(--fg);
    font-weight: 600;
}

/* ── Travaux : entrées de liste, pas de cartes ────────────────────── */
.works {
    display: grid;
    gap: 0;
}

.work {
    display: grid;
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    gap: clamp(1rem, 4vw, 3rem);
    padding-block: clamp(1.75rem, 3.5vw, 2.5rem);
    border-top: var(--rule);
}

.work:last-child {
    border-bottom: var(--rule);
}

.work__name {
    font-size: clamp(1.3rem, 2.6vw, 1.75rem);
    margin-bottom: 0.5rem;
}

.work__kind {
    font-size: 0.9375rem;
    color: var(--primary);
    margin: 0;
}

.work__desc {
    color: var(--fg-soft);
    margin-bottom: 1.15rem;
}

.work__stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1.15rem;
}

.work__stack li {
    font-size: 0.8125rem;
    line-height: 1.3;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--fg-soft);
}

/* Les chiffres sont le sujet : ils tiennent la ligne de pied */
.work__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.6rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
    color: var(--fg-muted);
}

.work__metrics b {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--fg);
    font-size: 0.9375rem;
}

/* Statut du code d'un projet : l'information la plus regardée après le nom,
   posée sous le titre plutôt que noyée dans la description. */
.work__acces {
    margin: 0.9rem 0 0;
    max-width: none;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    line-height: 1.3;
    padding: 0.32rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--glass);
    color: var(--fg-soft);
    text-decoration: none;
}

.tag--code::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    flex: none;
}

a.tag:hover {
    background: var(--glass-hover);
    color: var(--fg);
}

/* Lien vers le déploiement réel, quand il y en a un. */
.work__demo {
    margin: 1.15rem 0 0;
    max-width: none;
}

.work__demo a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
    transition: border-color 140ms ease;
}

.work__demo a:hover {
    border-bottom-color: var(--primary);
}

.work__demo svg {
    width: 16px;
    height: 16px;
    flex: none;
}

/* Encart d'accès : pourquoi le code n'est pas en ligne, et quoi faire à la place. */
.note {
    border-inline-start: 2px solid var(--primary);
    background: var(--glass);
    border-radius: 0 12px 12px 0;
    padding: 1.4rem clamp(1.1rem, 3vw, 1.75rem);
    margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.note p {
    color: var(--fg-soft);
    max-width: 68ch;
}

.note p:last-child {
    margin-bottom: 0;
}

.note__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.1rem;
}

/* ── Technologies ─────────────────────────────────────────────────── */
.stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem) clamp(2rem, 4vw, 3.5rem);
}

.stack__titre {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 0.9rem;
    padding-bottom: 0.6rem;
    border-bottom: var(--rule);
}

.stack__liste {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.stack__liste li {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 0.875rem;
    line-height: 1.3;
    padding: 0.35rem 0.65rem;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--fg-soft);
}

.stack__annees {
    font-size: 0.75rem;
    color: var(--primary);
}

/* ── Compétences : table de spécifications ────────────────────────── */
.spec {
    border-top: var(--rule);
}

.spec__row {
    display: grid;
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
    gap: clamp(0.5rem, 3vw, 3rem);
    padding-block: 1.4rem;
    border-bottom: var(--rule);
    align-items: baseline;
}

.spec__domain {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0;
    color: var(--fg);
}

.spec__items {
    margin: 0;
    color: var(--fg-soft);
    max-width: none;
    line-height: 1.75;
}

.spec__items em {
    font-style: normal;
    color: var(--fg-muted);
}

/* ── Méthode ──────────────────────────────────────────────────────── */
.method {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

.method__item h3 {
    font-size: 1.125rem;
    margin-bottom: 0.6rem;
    padding-top: 1rem;
    border-top: 2px solid var(--primary);
}

.method__item p {
    color: var(--fg-muted);
    font-size: 0.9375rem;
    margin: 0;
    max-width: 40ch;
}

/* ── Contact ──────────────────────────────────────────────────────── */
.contact {
    padding-block: clamp(3.5rem, 8vw, 6rem);
}

.contact__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

.contact__title {
    font-size: clamp(2rem, 5.5vw, 3.5rem);
    margin-bottom: 1rem;
}

.contact__links {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: var(--rule);
}

.contact__links li {
    border-bottom: var(--rule);
}

.contact__links a {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.05rem 0.25rem;
    text-decoration: none;
    color: var(--fg-soft);
    transition:
        color 140ms ease,
        padding-inline-start 140ms ease;
}

.contact__links a:hover {
    color: var(--primary);
    padding-inline-start: 0.75rem;
}

.contact__links svg {
    width: 19px;
    height: 19px;
    flex: none;
    color: var(--primary);
}

.contact__links span {
    font-family: var(--font-display);
    font-weight: 500;
}

.contact__links small {
    margin-inline-start: auto;
    font-size: 0.8125rem;
    color: var(--fg-muted);
}

/* ── Pied de page ─────────────────────────────────────────────────── */
.footer {
    background: var(--footer-bg);
    border-top: var(--rule);
    padding-block: 2rem;
    font-size: 0.875rem;
    color: var(--fg-muted);
}

.footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    align-items: center;
    justify-content: space-between;
}

.footer p {
    margin: 0;
    max-width: none;
}

.footer a {
    color: var(--fg-soft);
    text-decoration-color: var(--border-strong);
    text-underline-offset: 3px;
}

.footer a:hover {
    color: var(--primary);
}

/* ── Composition d'ouverture (un seul moment de motion) ───────────── */
@media (prefers-reduced-motion: no-preference) {
    .hero__name span,
    .hero__role,
    .hero__lede,
    .hero__actions,
    .hero__portrait {
        animation: rise 700ms cubic-bezier(0.22, 0.68, 0.35, 1) backwards;
    }
    .hero__name span:nth-child(1) {
        animation-delay: 60ms;
    }
    .hero__name span:nth-child(2) {
        animation-delay: 150ms;
    }
    .hero__role {
        animation-delay: 280ms;
    }
    .hero__lede {
        animation-delay: 360ms;
    }
    .hero__actions {
        animation-delay: 440ms;
    }
    .hero__portrait {
        animation: fade-in 900ms ease 200ms backwards;
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(0.6em);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
}

.contact__rdv-texte {
    color: var(--fg-muted);
    font-size: 0.9375rem;
}

/* Portrait masqué depuis le back-office : le texte reprend toute la largeur. */
.hero__inner--sans-portrait {
    grid-template-columns: minmax(0, 1fr);
}

/* ── Adaptations ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .hero__inner {
        grid-template-columns: minmax(0, 1fr);
    }
    .hero__portrait {
        order: -1;
        width: min(60vw, 15rem);
    }
    .work,
    .spec__row,
    .contact__grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .spec__row {
        gap: 0.4rem;
    }
    .prose-cols {
        columns: 1;
    }
    /* Deux colonnes quel que soit le nombre de chiffres : la règle verticale
       ne subsiste qu'entre les paires, l'horizontale sépare les rangées. */
    .facts__list,
    .facts__list[data-colonnes] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .facts__item:nth-child(odd) + .facts__item {
        border-inline-start: var(--rule);
        padding-inline-start: 1.5rem;
    }
    .facts__item:nth-child(odd):not(:first-child) {
        border-inline-start: 0;
        padding-inline-start: 0;
    }
    .facts__item:nth-child(n + 3) {
        border-top: var(--rule);
    }
}

@media (max-width: 620px) {
    .nav__links {
        gap: 1.1rem;
        font-size: 0.875rem;
    }
    .nav__links .is-secondary {
        display: none;
    }
    .contact__links small {
        display: none;
    }
}

@media print {
    .nav,
    .theme-toggle {
        display: none;
    }
    body {
        background: #fff;
        color: #000;
    }
}
