/* ------------------------------------------------------------------
 * dkweb – custom styles on top of Bootstrap 5
 * ------------------------------------------------------------------ */

:root {
    --dk-primary: #1a73e8;
    --dk-primary-hover: #155fc2;
    --dk-primary-soft: #e8f0fd;
    --dk-navy: #0f1f3d;
    --dk-navy-2: #15284b;
    --dk-heading: #0b1a33;
    --dk-text: #5b6475;
    --dk-light: #f5f8fc;
    --dk-border: #e3e9f2;
    --dk-font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --dk-font-hand: "Caveat", "Segoe Script", "Comic Sans MS", cursive;

    /* Bootstrap overrides */
    --bs-primary: var(--dk-primary);
    --bs-primary-rgb: 26, 115, 232;
    --bs-body-font-family: var(--dk-font);
    --bs-body-color: var(--dk-text);
    --bs-body-bg: #ffffff;
    --bs-heading-color: var(--dk-heading);
    --bs-link-color: var(--dk-primary);
    --bs-link-hover-color: var(--dk-primary-hover);
    --bs-border-color: var(--dk-border);
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-size: 1rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

section[id] {
    scroll-margin-top: 5rem;
}

/* Buttons ---------------------------------------------------------- */
.btn-primary {
    --bs-btn-bg: var(--dk-primary);
    --bs-btn-border-color: var(--dk-primary);
    --bs-btn-hover-bg: var(--dk-primary-hover);
    --bs-btn-hover-border-color: var(--dk-primary-hover);
    --bs-btn-active-bg: var(--dk-primary-hover);
    --bs-btn-active-border-color: var(--dk-primary-hover);
}

.btn-outline-light {
    --bs-btn-color: #fff;
    --bs-btn-border-color: rgba(255, 255, 255, 0.6);
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-color: var(--dk-navy);
}

.btn-pill {
    --bs-btn-padding-x: 1.5rem;
    --bs-btn-padding-y: 0.7rem;
    --bs-btn-border-radius: 50rem;
    --bs-btn-font-weight: 600;
}

/* Arrow links (« En savoir plus → ») -------------------------------- */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    text-decoration: none;
}

.link-arrow svg {
    transition: transform 0.2s ease;
}

.link-arrow:hover svg {
    transform: translateX(3px);
}

/* Section kicker (« MES SERVICES ——— ») ---------------------------- */
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--dk-primary);
}

.kicker--line::after {
    content: "";
    display: block;
    width: 2.5rem;
    height: 2px;
    background: currentColor;
    opacity: 0.6;
}

.kicker--light {
    color: #8fb8f5;
}

.section-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.bg-light-blue {
    background-color: var(--dk-light);
}

.bg-navy {
    background-color: var(--dk-navy);
}

.text-navy {
    color: var(--dk-navy);
}

/* Handwritten notes ------------------------------------------------ */
.note-hand {
    font-family: var(--dk-font-hand);
    font-size: clamp(1.4rem, 2.2vw, 1.9rem);
    font-weight: 600;
    line-height: 1.1;
    color: var(--dk-heading);
    transform: rotate(-6deg);
    display: inline-block;
}

.note-hand__stroke {
    display: block;
    width: 6rem;
    height: 0.4rem;
    margin-top: 0.3rem;
    border-radius: 50rem;
    background: var(--dk-primary);
    transform: rotate(-2deg);
}

/* Header ----------------------------------------------------------- */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--dk-border);
}

.brand {
    display: inline-flex;
    align-items: center;
    padding: 0;
}

.brand img {
    height: 2rem;
    width: auto;
}

.brand--small img {
    height: 1.75rem;
}

.site-header .nav-link {
    color: var(--dk-navy);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.9rem;
    position: relative;
}

.site-header .nav-link:hover,
.site-header .nav-link.active {
    color: var(--dk-primary);
}

@media (min-width: 992px) {
    .site-header .nav-link.active::after {
        content: "";
        position: absolute;
        left: 0.9rem;
        right: 0.9rem;
        bottom: 0;
        height: 2px;
        background: var(--dk-primary);
    }
}

/* Hero ------------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, var(--dk-light) 100%);
}

.hero__title {
    font-size: clamp(2.2rem, 4.5vw, 3.4rem);
    font-weight: 800;
}

.hero__visual {
    position: relative;
    min-height: 320px;
    aspect-ratio: 1366 / 1151;
    overflow: hidden;
    container-type: size;
}

/* The image at its own ratio, covering the visual from the left (like object-fit: cover; object-position: left center),
   so the laptop screen keeps a fixed position in image pixels. */
.hero__stage {
    position: absolute;
    top: 50%;
    left: 0;
    width: max(100cqw, 100cqh * 1366 / 1151);
    aspect-ratio: 1366 / 1151;
    translate: 0 -50%;
}

.hero__stage picture img {
    display: block;
    width: 100%;
    height: 100%;
}

/* The laptop, whose screen is transparent, sits above the captures layer */
.hero__frame {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* An 800x500 layer mapped onto the screen corners of hero-laptop-frame (in 1366x1151 image px):
   TL 766.5,220.5 · TR 1520.5,165.8 · BR 1400,833.2 · BL 668.8,761.5 (right corners lie outside the photo).
   It is grown by 2% past those corners (the trailing translate), under the bezel, so the frame's smooth
   alpha edge draws the screen outline instead of the layer's own, aliased one.
   The layer is close to its rendered size: the captures are downscaled by the (smooth) 2D image resampling,
   not by the 3D transform, which samples without mipmaps and aliases.
   --hero-scale (image width ratio) is set by the hero-screen controller; the layer stays hidden until then. */
.hero__screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 832px;
    height: 520px;
    overflow: hidden;
    background: #fff;
    transform-origin: 0 0;
    transform: scale(var(--hero-scale, 0)) matrix3d(0.58254341, -0.10762577, 0, -0.00023674, -0.195439, 1.0819556, 0, -0.00000006, 0, 0, 1, 0, 766.5, 220.5, 0, 1) translate(-16px, -10px);
}

.hero__screen img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    opacity: 0;
    transition: opacity 1s ease;
}

.hero__screen img.is-active {
    opacity: 1;
}

/* Glass reflection, so the captures don't look pasted on */
.hero__screen::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, rgb(255 255 255 / 0.22) 0%, rgb(255 255 255 / 0.06) 40%, rgb(255 255 255 / 0) 60%);
    pointer-events: none;
}

@media (min-width: 992px) {
    .hero__visual {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 50%;
        min-height: 0;
        aspect-ratio: auto;
    }
}

/* Mobile: three equal columns, icon above centered text. Desktop: one row of icon + text items. */
.hero__features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    line-height: 1.35;
    text-align: center;
}

.feature-item + .feature-item {
    border-left: 1px solid var(--dk-border);
}

@media (min-width: 992px) {
    .hero__features {
        display: flex;
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .feature-item {
        flex-direction: row;
        gap: 0.75rem;
        padding: 0;
        font-size: 0.85rem;
        text-align: left;
    }

    .feature-item + .feature-item {
        padding-left: 1.25rem;
    }
}

.feature-item strong {
    display: block;
    color: var(--dk-heading);
}

.icon-primary {
    color: var(--dk-primary);
    flex-shrink: 0;
}

/* Services --------------------------------------------------------- */
.service-col + .service-col {
    border-top: 1px solid var(--dk-border);
}

@media (min-width: 768px) {
    .service-col + .service-col {
        border-top: 0;
        border-left: 1px solid var(--dk-border);
    }
}

.service-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--dk-primary);
    letter-spacing: 0.1em;
}

/* Projects --------------------------------------------------------- */
.project-card {
    border: 1px solid var(--dk-border);
    border-radius: 0.25rem;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 1rem 2rem rgba(15, 31, 61, 0.1);
}

.project-card__visual {
    position: relative;
}

.project-card__desktop {
    aspect-ratio: 16 / 10;
    width: 100%;
    height: auto; /* the height="" attribute would otherwise override aspect-ratio */
    object-fit: cover;
    object-position: top;
}

/* Mobile capture, framed like a phone in the bottom-right corner of the main image */
.project-card__mobile {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    width: 22%;
    height: auto;
    aspect-ratio: 390 / 844;
    object-fit: cover;
    object-position: top;
    border: 3px solid #fff;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1.25rem rgba(15, 31, 61, 0.3);
    background: #fff;
}

/* About band ------------------------------------------------------- */
.about {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background-color: var(--dk-light);
}

.about__dark {
    position: relative;
    color: #fff;
}

/* Navy background extended to the viewport edge, diagonal cut on desktop */
.about__dark::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: -100vw;
    right: -100vw;
    background-color: var(--dk-navy);
}

@media (min-width: 992px) {
    .about__dark::before {
        right: -3rem;
        clip-path: polygon(0 0, 100% 0, calc(100% - 5rem) 100%, 0 100%);
    }
}

.about__glyph {
    position: absolute;
    right: 1rem;
    bottom: -1rem;
    font-size: clamp(5rem, 10vw, 9rem);
    font-weight: 300;
    line-height: 1;
    color: rgba(255, 255, 255, 0.06);
    user-select: none;
    pointer-events: none;
}

.portrait {
    width: 120px;
    height: 120px;
    object-fit: cover;
    object-position: center top;
    border-radius: 0.5rem;
}

.tech-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--dk-border);
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dk-heading);
}

/* Testimonials ----------------------------------------------------- */
.testimonial-card {
    border: 1px solid var(--dk-border);
    border-radius: 0.25rem;
    background: #fff;
}

.testimonial-card .quote-mark {
    color: var(--dk-primary);
    flex-shrink: 0;
}

.testimonial-card .carousel-indicators {
    position: static;
    margin: 0;
    justify-content: flex-end;
}

.testimonial-card .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--dk-primary);
    opacity: 0.3;
    margin: 0 3px;
}

.testimonial-card .carousel-indicators .active {
    opacity: 1;
}

.testimonial-card .carousel-control-prev,
.testimonial-card .carousel-control-next {
    position: static;
    width: auto;
    opacity: 1;
    color: var(--dk-text);
}

/* CTA band --------------------------------------------------------- */
.cta {
    background: radial-gradient(circle at 90% 50%, rgba(26, 115, 232, 0.25), transparent 40%), var(--dk-navy);
    color: #fff;
}

.cta h2 {
    color: #fff;
}

/* Footer ----------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--dk-border);
    font-size: 0.85rem;
}

.site-footer .nav-link {
    color: var(--dk-text);
    padding: 0.25rem 0.75rem;
}

.site-footer .nav-link:hover {
    color: var(--dk-primary);
}

.social-link {
    color: var(--dk-navy);
    display: inline-flex;
    padding: 0.35rem;
}

.social-link:hover {
    color: var(--dk-primary);
}

/* Simple pages (e.g. unsubscribe confirmation) ---------------------- */
.simple-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
}

/* Soft light text on dark backgrounds (keeps AA contrast on navy) --- */
.text-light-soft {
    color: rgba(255, 255, 255, 0.82);
}

/* Admin ------------------------------------------------------------ */
.admin-header .nav-link.active::after {
    content: none;
}

.admin .table {
    --bs-table-color: var(--dk-heading);
}

.admin pre {
    font-size: 0.85rem;
}

/* CV page ---------------------------------------------------------- */
.kicker--lg {
    font-size: 1rem;
    letter-spacing: 0.28em;
}

.text-heading {
    color: var(--dk-heading);
}

.cv-hero__visual {
    min-height: 240px;
    background:
        radial-gradient(circle at 70% 40%, rgba(26, 115, 232, 0.18), transparent 45%),
        linear-gradient(135deg, var(--dk-light) 0%, #dfe9f7 100%);
}

@media (min-width: 992px) {
    .cv-hero__visual {
        clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%);
    }
}

.cv-hero__glyph {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    font-size: clamp(5rem, 9vw, 8rem);
    font-weight: 300;
    line-height: 1;
    color: var(--dk-navy);
    opacity: 0.12;
    user-select: none;
}

.cv-hero__note {
    position: absolute;
    left: 10%;
    bottom: 14%;
}

@media (min-width: 992px) {
    .cv-hero__note {
        left: 22%;
    }
}

@media (min-width: 992px) {
    .cv-split {
        border-right: 1px solid var(--dk-border);
    }
}

/* Timeline (formations & experiences) */
.timeline {
    --timeline-gutter: 4.5rem;
    position: relative;
    padding-left: var(--timeline-gutter);
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0.6rem;
    bottom: 0.6rem;
    left: calc(var(--timeline-gutter) - 1.5rem);
    width: 2px;
    background: var(--dk-primary);
    opacity: 0.35;
}

.timeline__item {
    position: relative;
}

.timeline__item + .timeline__item {
    margin-top: 1rem;
}

.timeline__item::before {
    content: "";
    position: absolute;
    top: 0.55rem;
    left: calc(-1.5rem - 4px);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--dk-primary);
    box-shadow: 0 0 0 3px #fff;
}

.timeline__year {
    position: absolute;
    top: 0.25rem;
    left: calc(var(--timeline-gutter) * -1);
    width: 2.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dk-primary);
}

.timeline__card {
    padding: 0.75rem 1rem;
    background: var(--dk-light);
    border-radius: 0.25rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.timeline--xp {
    --timeline-gutter: 2rem;
}

/* New formatting context: the inner .row's negative gutter margin must not collapse through the item and offset its bullet */
.timeline--xp .timeline__item {
    display: flow-root;
}

.timeline--xp .timeline__item::before {
    box-shadow: 0 0 0 3px var(--dk-light);
}

.timeline--xp .timeline__item + .timeline__item {
    margin-top: 2rem;
}

/* Client references strip: 5 per row on desktop, 3 on tablets, 2 on phones */
.client-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 1.5rem;
    align-items: center;
}

@media (min-width: 768px) {
    .client-strip {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .client-strip {
        grid-template-columns: repeat(5, 1fr);
    }
}

.client-strip__item {
    display: flex;
    justify-content: center;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--dk-navy);
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

.client-strip__item:hover {
    opacity: 1;
}

/* Logos fit a common box (wide ones by width, tall ones by height), share the text's muted tone,
   and get their colors back on hover */
.client-strip__logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 9rem;
    max-height: 3rem;
    filter: grayscale(1);
    mix-blend-mode: multiply; /* drops the white background of JPEG logos */
    transition: filter 0.2s ease;
}

@media (min-width: 992px) {
    .client-strip__logo {
        max-width: 10rem;
        max-height: 5rem;
    }
}

.client-strip__item:hover .client-strip__logo {
    filter: none;
}

/* Contact page ----------------------------------------------------- */
.contact-info li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    font-size: 0.9rem;
    line-height: 1.5;
}

.contact-info li + li {
    margin-top: 1.25rem;
}

@media (min-width: 992px) {
    .contact-aside {
        border-right: 1px solid var(--dk-border);
    }
}

.contact-form .form-label {
    font-weight: 600;
    color: var(--dk-heading);
    font-size: 0.9rem;
}

.contact-form .form-control {
    border-color: var(--dk-border);
    padding: 0.7rem 0.9rem;
}

.contact-form .form-control:focus {
    border-color: var(--dk-primary);
    box-shadow: 0 0 0 0.2rem rgba(26, 115, 232, 0.15);
}

/* Honeypot: off-screen, never displayed to humans */
.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Project card without image */
.project-card__placeholder {
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 300;
    color: var(--dk-primary);
    background: linear-gradient(135deg, var(--dk-primary-soft) 0%, var(--dk-light) 100%);
}

/* Admin thumbnails */
.admin-thumb {
    width: 80px;
    height: 50px;
    object-fit: cover;
    border-radius: 0.25rem;
    border: 1px solid var(--dk-border);
}

.admin-mobile-preview {
    max-width: 140px;
}

.admin-thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--dk-text);
    background: var(--dk-light);
}
