/* =====================================================================
   Theme tokens
   - :root        Apple Light -- palette officielle apple.com (#fff/#f5f5f7
                  surfaces, #1d1d1f text, #0066cc Apple Blue accent)
   - html.dark    Cyber Void (dark, default historique cyan #00F2FE)
   Tokens RGB en triplet space-separated pour Tailwind <alpha-value>.
   Theme switching : voir theme.js (toggle html.dark via localStorage / OS).
   ===================================================================== */
:root {
    /* Apple Light -- palette officielle apple.com :
       #ffffff page bg, #f5f5f7 section off-white signature,
       #fbfbfd card panel, #1d1d1f text, #6e6e73 secondary text,
       #d2d2d7 borders, #0066cc Apple Blue accent. */

    /* surface family -- Apple alternance #fff <-> #f5f5f7 :
       bg-surface = blanc (sections principales)
       bg-surface-container-low = #f5f5f7 (sections alternees gris perle)
       bg-surface-container = #fbfbfd (cards quasi-blanches sur sections grises) */
    --surface: 255 255 255;
    --surface-container: 251 251 253;
    --surface-container-low: 245 245 247;
    --surface-container-lowest: 255 255 255;
    --surface-container-high: 240 240 242;
    --surface-container-highest: 232 232 237;
    --surface-bright: 255 255 255;
    --surface-dim: 245 245 247;
    --surface-variant: 232 232 237;
    --surface-tint: 0 102 204;
    --background: 255 255 255;

    /* primary (Apple Blue #0066cc) */
    --primary: 0 102 204;
    --on-primary: 255 255 255;
    --primary-container: 212 230 248;
    --on-primary-container: 0 41 102;

    /* secondary (Apple dark gray #424245 -- neutralise le forest green
       pour rester strictement dans la palette monochromatique Apple) */
    --secondary: 66 66 69;
    --on-secondary: 255 255 255;
    --secondary-container: 232 232 237;
    --on-secondary-container: 29 29 31;

    /* tertiary (Apple gray #86868b) */
    --tertiary: 134 134 139;
    --tertiary-container: 232 232 237;
    --on-tertiary: 255 255 255;
    --on-tertiary-container: 29 29 31;

    /* on-* / inverse / outline -- Apple text + border */
    --on-surface: 29 29 31;
    --on-surface-variant: 110 110 115;
    --on-background: 29 29 31;
    --inverse-surface: 29 29 31;
    --inverse-on-surface: 255 255 255;
    --inverse-primary: 64 156 255;
    --outline: 210 210 215;
    --outline-variant: 232 232 237;

    /* derives non-Tailwind utilises par CSS custom */
    --grid-color: rgba(0, 102, 204, 0.06);
    --bg-gradient: linear-gradient(180deg, rgb(255 255 255) 0%, rgb(245 245 247) 100%);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
}

html.dark {
    --surface: 5 5 7;
    --surface-container: 24 24 30;
    --surface-container-low: 17 17 22;
    --surface-container-lowest: 5 5 7;
    --surface-container-high: 26 28 35;
    --surface-container-highest: 50 53 63;
    --surface-bright: 26 28 35;
    --surface-dim: 5 5 7;
    --surface-variant: 17 17 22;
    --surface-tint: 0 242 254;
    --background: 5 5 7;

    --primary: 0 242 254;
    --on-primary: 5 5 7;
    --primary-container: 0 242 254;
    --on-primary-container: 0 55 58;

    --secondary: 57 255 20;
    --on-secondary: 5 5 7;
    --secondary-container: 17 17 22;
    --on-secondary-container: 57 255 20;

    --tertiary: 130 134 147;
    --tertiary-container: 26 28 35;
    --on-tertiary: 5 5 7;
    --on-tertiary-container: 228 231 235;

    --on-surface: 228 231 235;
    --on-surface-variant: 130 134 147;
    --on-background: 228 231 235;
    --inverse-surface: 228 231 235;
    --inverse-on-surface: 5 5 7;
    --inverse-primary: 0 105 110;
    --outline: 50 53 63;
    --outline-variant: 26 28 35;

    --grid-color: rgb(var(--primary) / 0.03);
    --bg-gradient: none;
    --shadow-card: none;
}

/* Cyber Void Design System - WM Best Service */

body {
    background-color: rgb(var(--surface));
    background-image: var(--bg-gradient),
                      linear-gradient(var(--grid-color) 1px, transparent 1px),
                      linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: auto, 100px 100px, 100px 100px;
    color: rgb(var(--on-surface));
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Glow effects */
.glow-primary-strong:hover {
    box-shadow: 0 0 20px rgb(var(--primary) / 0.4);
}

/* Terminal dots (sidebar header) */
.terminal-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

/* Subgrid alignment for card rows */
.grid-subgrid-rows {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 4;
}

/* Trust metrics: fluid card grid for home page */
.trust-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.75rem, 2vw, 1.5rem);
    width: 100%;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
}

.trust-metric-card {
    min-width: 0;
    min-height: clamp(6.5rem, 10vw, 8.5rem);
    padding: clamp(1rem, 2vw, 1.5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.trust-metrics-grid[data-animate="ready"] .trust-metric-card {
    opacity: 0;
    transform: translateX(2.5rem);
}

.trust-metrics-grid[data-animate="ready"].is-visible .trust-metric-card {
    opacity: 1;
    transform: none;
    animation: trustMetricSlideLeft 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.trust-metrics-grid[data-animate="ready"].is-visible .trust-metric-card:nth-child(2) {
    animation-delay: 0.08s;
}

.trust-metrics-grid[data-animate="ready"].is-visible .trust-metric-card:nth-child(3) {
    animation-delay: 0.16s;
}

.trust-metrics-grid[data-animate="ready"].is-visible .trust-metric-card:nth-child(4) {
    animation-delay: 0.24s;
}

.trust-metrics-grid[data-animate="ready"].is-visible .trust-metric-card:nth-child(5) {
    animation-delay: 0.32s;
}

.trust-metrics-grid[data-animate="ready"].is-visible .trust-metric-card:nth-child(6) {
    animation-delay: 0.4s;
}

@keyframes trustMetricSlideLeft {
    from {
        opacity: 0;
        transform: translateX(2.5rem);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.trust-metric-value,
.trust-metric-label {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    text-wrap: balance;
    letter-spacing: 0;
    line-height: 1.1;
}

.trust-metric-value {
    margin-bottom: clamp(0.375rem, 1vw, 0.5rem);
    font-size: 1.05rem;
}

.trust-metric-value-nowrap {
    overflow-wrap: normal;
    white-space: nowrap;
    word-break: normal;
}

.trust-metric-value-long {
    font-size: 0.95rem;
}

.trust-metric-label {
    font-size: 0.625rem;
    line-height: 1.25;
}

@media (max-width: 360px) {
    .trust-metric-card {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .trust-metric-value {
        font-size: 0.95rem;
    }

    .trust-metric-value-long {
        font-size: 0.8rem;
    }

    .trust-metric-label {
        font-size: 0.58rem;
    }
}

@media (min-width: 640px) {
    .trust-metric-value {
        font-size: 1.25rem;
    }

    .trust-metric-value-long {
        font-size: 1.05rem;
    }

    .trust-metric-label {
        font-size: 0.6875rem;
    }
}

@media (min-width: 768px) {
    .trust-metrics-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .trust-metric-value {
        font-size: 1.5rem;
    }

    .trust-metric-value-long {
        font-size: 1.2rem;
    }

    .trust-metric-label {
        font-size: 0.75rem;
    }
}

@media (min-width: 1280px) {
    .trust-metrics-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .trust-metric-card {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .trust-metric-value {
        font-size: 1.25rem;
    }

    .trust-metric-value-long {
        font-size: 1.05rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .trust-metrics-grid[data-animate="ready"] .trust-metric-card,
    .trust-metrics-grid[data-animate="ready"].is-visible .trust-metric-card {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Nav pill - fluid responsive scaling */
.nav-pill {
    padding: clamp(0.2rem, 0.4vw, 0.375rem) clamp(0.3rem, 0.5vw, 0.5rem);
    gap: clamp(0rem, 0.2vw, 0.25rem);
}

.nav-logo {
    font-size: clamp(0.7rem, 1vw, 0.875rem);
    padding: clamp(0.2rem, 0.4vw, 0.375rem) clamp(0.5rem, 1vw, 1rem);
    gap: clamp(0.3rem, 0.5vw, 0.5rem);
}

.nav-logo .material-symbols-outlined {
    font-size: clamp(0.9rem, 1.3vw, 1.125rem);
}

.nav-link-desktop {
    font-size: clamp(0.55rem, 0.75vw, 0.75rem);
    padding: clamp(0.2rem, 0.4vw, 0.375rem) clamp(0.4rem, 0.8vw, 1rem);
    white-space: nowrap;
}

.nav-cta-desktop {
    font-size: clamp(0.5rem, 0.7vw, 0.75rem);
    padding: clamp(0.3rem, 0.5vw, 0.5rem) clamp(0.5rem, 1vw, 1rem);
    margin-right: clamp(0.5rem, 1vw, 1rem);
    letter-spacing: clamp(0.05em, 0.1vw, 0.1em);
    white-space: nowrap;
}

/* Language selector */
.language-switcher {
    position: relative;
    font-family: 'JetBrains Mono', monospace;
}

.language-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.25rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgb(var(--primary) / 0.28);
    background: rgb(var(--surface-container-high) / 0.92);
    color: rgb(var(--on-surface));
    font-size: 0.75rem;
    line-height: 1;
    white-space: nowrap;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.language-toggle:hover,
.language-toggle[aria-expanded="true"] {
    border-color: rgb(var(--primary));
    color: rgb(var(--primary));
    box-shadow: 0 0 14px rgb(var(--primary) / 0.16);
}

.language-toggle-icon {
    font-size: 1rem;
    line-height: 1;
}

.flag-icon {
    display: inline-block;
    width: 1.45rem;
    height: 0.95rem;
    flex: 0 0 auto;
    border: 1px solid rgb(var(--outline));
    border-radius: 0.12rem;
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.language-toggle .flag-icon {
    width: 1.6rem;
    height: 1.05rem;
}

.flag-de {
    background: linear-gradient(to bottom, #000 0 33.333%, #dd0000 33.333% 66.666%, #ffce00 66.666% 100%);
}

.flag-fr {
    background: linear-gradient(to right, #0055a4 0 33.333%, #fff 33.333% 66.666%, #ef4135 66.666% 100%);
}

.flag-en {
    background:
        linear-gradient(0deg, transparent 39%, #fff 39% 61%, transparent 61%),
        linear-gradient(90deg, transparent 42%, #fff 42% 58%, transparent 58%),
        linear-gradient(0deg, transparent 45%, #c8102e 45% 55%, transparent 55%),
        linear-gradient(90deg, transparent 46%, #c8102e 46% 54%, transparent 54%),
        linear-gradient(32deg, transparent 43%, #fff 43% 48%, #c8102e 48% 53%, #fff 53% 58%, transparent 58%),
        linear-gradient(-32deg, transparent 43%, #fff 43% 48%, #c8102e 48% 53%, #fff 53% 58%, transparent 58%),
        #012169;
}

.language-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 10rem;
    padding: 0.35rem;
    border: 1px solid rgb(var(--primary) / 0.22);
    background: rgb(var(--surface-container-low) / 0.98);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 18px rgb(var(--primary) / 0.08);
    opacity: 0;
    transform: translateY(-0.25rem);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 80;
}

.language-switcher.is-open .language-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 0.65rem;
    color: rgb(var(--on-surface-variant));
    font-size: 0.75rem;
    line-height: 1.2;
    text-align: left;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.language-option:hover,
.language-option:focus-visible {
    background: rgb(var(--primary) / 0.08);
    color: rgb(var(--primary));
}

.language-option[aria-selected="true"] {
    display: none;
}

.language-name {
    color: inherit;
}

@media (max-width: 767px) {
    .language-menu {
        right: -2.5rem;
        min-width: 3.75rem;
    }

    .language-option {
        justify-content: center;
    }

    .language-name {
        display: none;
    }
}

/* Nav link animation - top dot + bottom bar + glow */
.nav-item {
    position: relative;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* Active State */
.nav-item.nav-link-active {
    color: rgb(var(--primary));
    text-shadow: 0 0 8px rgb(var(--primary) / 0.6);
}

/* Hover State - Less intense to differentiate */
.nav-item:not(.nav-link-active):hover {
    color: rgb(var(--primary) / 0.8);
    text-shadow: 0 0 6px rgb(var(--primary) / 0.3);
}

/* Boule lumineuse en haut, collee au bord superieur de la nav pill */
.nav-item::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 6px;
    height: 6px;
    background: rgb(var(--primary));
    border-radius: 50%;
    box-shadow: 0 0 8px rgb(var(--primary) / 0.9), 0 0 16px rgb(var(--primary) / 0.5);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.nav-link-active::before {
    top: -10px;
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

.nav-item:not(.nav-link-active):hover::before {
    top: -10px;
    transform: translateX(-50%) scale(0.85);
    opacity: 0.5;
    box-shadow: 0 0 6px rgb(var(--primary) / 0.5), 0 0 10px rgb(var(--primary) / 0.3);
}

/* Barre lumineuse en bas */
.nav-item::after {
    content: '';
    position: absolute;
    bottom: -12px; /* Flush with the bottom edge of the navbar */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: rgb(var(--primary));
    border-radius: 1px;
    box-shadow: 0 0 8px rgb(var(--primary) / 0.8), 0 2px 12px rgb(var(--primary) / 0.4);
    opacity: 0;
    transition: all 0.3s ease-out;
}

.nav-item.nav-link-active::after {
    width: 70%;
    opacity: 1;
}

.nav-item:not(.nav-link-active):hover::after {
    width: 60%;
    opacity: 0.5;
    box-shadow: 0 0 4px rgb(var(--primary) / 0.4), 0 2px 6px rgb(var(--primary) / 0.2);
}

/* Mobile menu: active state uses left bar instead of top dot + bottom bar */
@media (max-width: 767px) {
    .nav-item::before,
    .nav-item::after {
        display: none;
    }

    .nav-item.nav-link-active {
        border-left: 2px solid rgb(var(--primary));
        box-shadow: inset 4px 0 8px rgb(var(--primary) / 0.15);
        background: rgb(var(--primary) / 0.05);
    }
}

/* Typewriter cursor blink */
.typewriter::after {
    content: '█';
    animation: blink 0.8s step-end infinite;
    color: rgb(var(--primary));
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Card hover glow + 3D tilt */
.card-cyan-hover {
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out, border-color 0.3s, box-shadow 0.3s;
    will-change: transform;
}

.card-cyan-hover:hover {
    border-color: rgb(var(--primary));
    box-shadow: 0 0 20px rgb(var(--primary) / 0.15);
}

.glow-only-hover {
    position: relative;
    overflow: hidden;
}

/* Cursor-reactive spotlight overlay */
.cursor-glow-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgb(var(--surface));
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgb(var(--surface-container-highest));
}

/* Terminal typing animation (Home page) */
.typing-container {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: .15em solid rgb(var(--secondary));
    animation: typing 3.5s steps(40, end), blink .75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* Focus visible - keyboard accessibility (WCAG 2.4.7) */
a:focus-visible,
button:focus-visible {
    outline: 2px solid rgb(var(--primary));
    outline-offset: 2px;
}

.glow-primary-strong:focus-visible {
    box-shadow: 0 0 20px rgb(var(--primary) / 0.8), 0 0 40px rgb(var(--primary) / 0.4);
    outline: 2px solid rgb(var(--primary));
    outline-offset: 2px;
}

.nav-item:focus-visible {
    outline: 2px solid rgb(var(--primary));
    outline-offset: 4px;
}

/* ─── SVG Draw Timeline Section ─── */
.svgdraw-timeline {
    position: relative;
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* SVG path overlay — spans full height of timeline, behind cards */
.svgdraw-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}

.svgdraw-svg-overlay path {
    fill: none;
    stroke: rgb(var(--primary));
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 10px rgb(var(--primary) / 0.4))
           drop-shadow(0 0 20px rgb(var(--primary) / 0.15));
}

/* Each service node: dot column + card */
.svgdraw-node {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    position: relative;
    z-index: 1;
}

/* Dot column — wider strip so path can snake left/right */
.svgdraw-dot-col {
    flex: 0 0 100px;
    display: flex;
    padding-top: 28px; /* vertically center dot with card content */
}

/* Alternate dots left/right within the column for winding effect */
.svgdraw-node:nth-child(odd) .svgdraw-dot-col  { justify-content: flex-start; padding-left: 8px; }
.svgdraw-node:nth-child(even) .svgdraw-dot-col { justify-content: flex-end; padding-right: 8px; }

/* The dot itself */
.svgdraw-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgb(var(--primary));
    opacity: 0;
    box-shadow: none;
    flex-shrink: 0;
}

/* dot glow states controlled by JS — opacity, scale, box-shadow set inline */

/* Service card */
.svgdraw-card {
    flex: 1;
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 28px;
    background: rgb(var(--surface-container));
    border: 1px solid rgb(var(--outline-variant));
    transition: border-color 0.3s, box-shadow 0.3s;
    /* opacity + transform controlled by JS scroll logic — no CSS transition */
}

.svgdraw-card:hover {
    border-color: rgb(var(--primary) / 0.35);
    box-shadow: 0 0 24px rgb(var(--primary) / 0.12);
}

.svgdraw-icon {
    color: rgb(var(--primary));
    font-size: 36px;
    margin-bottom: 12px;
    display: inline-block;
    filter: drop-shadow(0 0 8px rgb(var(--primary) / 0.4));
}

/* ─── SVG Draw Responsive ─── */
@media (max-width: 640px) {
    .svgdraw-timeline {
        gap: 36px;
    }

    .svgdraw-dot-col {
        flex: 0 0 60px;
        padding-top: 22px;
    }

    .svgdraw-node:nth-child(odd) .svgdraw-dot-col  { padding-left: 4px; }
    .svgdraw-node:nth-child(even) .svgdraw-dot-col { padding-right: 4px; }

    .svgdraw-dot {
        width: 14px;
        height: 14px;
    }

    .svgdraw-card {
        padding: 20px;
    }
}

/* K8s SVG animated data lines (DevOps page) */
.svg-line-animated {
    stroke-dasharray: 10;
    stroke-dashoffset: 100;
    animation: dash 3s linear infinite;
}

@keyframes dash {
    to { stroke-dashoffset: 0; }
}

/* =====================================================================
   THEME SWITCHER (Sleek Pill)
   - Pill arrondi avec backdrop-blur
   - Indicateur cyan glissant (translateX, spring)
   - Icones Material Symbols passent outlined -> filled quand actives
   - Place dans la navbar a cote du language-switcher
   ===================================================================== */
.theme-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 2.25rem;
    padding: 0.2rem;
    background: rgb(var(--surface-container-high) / 0.78);
    border: 1px solid rgb(var(--primary) / 0.22);
    border-radius: 9999px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background-color 0.25s ease;
    font-family: 'JetBrains Mono', monospace;
}

.theme-switcher:hover,
.theme-switcher:focus-within {
    border-color: rgb(var(--primary) / 0.6);
    box-shadow:
        0 0 22px rgb(var(--primary) / 0.18),
        0 4px 12px rgba(0, 0, 0, 0.08);
    background: rgb(var(--surface-container-high) / 0.92);
}

.theme-indicator {
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 9999px;
    background: rgb(var(--primary));
    box-shadow:
        0 4px 14px rgb(var(--primary) / 0.38),
        0 0 0 1px rgb(var(--primary) / 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.20),
        inset 0 -1px 0 rgba(0, 0, 0, 0.10);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: 0;
}

.theme-switcher[data-active="light"]  .theme-indicator { transform: translateX(0); }
.theme-switcher[data-active="system"] .theme-indicator { transform: translateX(1.85rem); }
.theme-switcher[data-active="dark"]   .theme-indicator { transform: translateX(3.7rem); }

.theme-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: rgb(var(--on-surface-variant));
    opacity: 0.72;
    cursor: pointer;
    transition:
        color 0.4s ease 0.05s,
        opacity 0.3s ease,
        transform 0.2s ease;
}

.theme-btn:hover:not([aria-pressed="true"]) {
    color: rgb(var(--primary));
    opacity: 1;
    transform: scale(1.08);
}

.theme-btn:active {
    transform: scale(0.92);
}

.theme-btn[aria-pressed="true"] {
    color: rgb(var(--on-primary));
    opacity: 1;
}

.theme-btn .material-symbols-outlined {
    font-size: 1.1rem;
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
    transition:
        font-variation-settings 0.4s ease 0.05s,
        transform 0.3s ease;
}

.theme-btn[aria-pressed="true"] .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
    transform: scale(1.05);
}

.theme-btn:focus-visible {
    outline: 2px solid rgb(var(--primary));
    outline-offset: 3px;
}

.theme-btn::-moz-focus-inner { border: 0; }

@media (max-width: 767px) {
    .theme-switcher {
        height: 2rem;
        padding: 0.15rem;
    }
    .theme-indicator,
    .theme-btn {
        width: 1.7rem;
        height: 1.7rem;
    }
    /* L'indicateur doit s'aligner sur le padding mobile (0.15rem)
       au lieu de garder le top/left desktop (0.2rem) -- sinon il est
       decale de 0.05rem vers le bas-droite et le glow box-shadow
       deborde de maniere asymetrique sur la pillule. */
    .theme-indicator {
        top: 0.15rem;
        left: 0.15rem;
    }
    .theme-switcher[data-active="system"] .theme-indicator { transform: translateX(1.7rem); }
    .theme-switcher[data-active="dark"]   .theme-indicator { transform: translateX(3.4rem); }
    .theme-btn .material-symbols-outlined {
        font-size: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .theme-indicator,
    .theme-btn,
    .theme-btn .material-symbols-outlined {
        transition: none !important;
    }
}

/* ==========================================================================
   Mode clair -- corrections specifiques
   --------------------------------------------------------------------------
   Le markup utilise des couleurs Tailwind "arbitrary" hardcodees pour le mode
   sombre (#050507, white/5, cyan-900/10, etc.) qui ne s'adaptent pas au
   theme clair. Les regles ci-dessous remappent ces utilitaires lorsque la
   classe `dark` est absente sur <html>, sans toucher au mode sombre.
   ========================================================================== */

/* 1. Hero web_dev : masquer entierement l'image aurora_1 + overlays sombres
      (sinon le voile #050507 ecrase tout le hero en mode clair). */
html:not(.dark) .hero-aurora-bg {
    display: none;
}

/* 2. Overlays gradient sombres autour des images aurora_2 / aurora_1
      en sections Vision & Infrastructure : on garde l'image, on masque
      seulement le voile noir decoratif. */
html:not(.dark) .aurora-overlay-dark {
    display: none;
}

/* 3. Bordures et fonds white/N : remappes vers du noir Apple (#1d1d1f)
      avec une opacite calibree pour matcher #d2d2d7 (Apple outline)
      sur fond blanc. 0.18 = exactement le gris Apple des cards. */
html:not(.dark) .border-white\/5 {
    border-color: rgb(29 29 31 / 0.18);
}
html:not(.dark) .border-white\/10 {
    border-color: rgb(29 29 31 / 0.24);
}
html:not(.dark) .bg-white\/5 {
    background-color: rgb(29 29 31 / 0.04);
}
html:not(.dark) .bg-white\/10 {
    background-color: rgb(29 29 31 / 0.06);
}

/* 4. Bordure cyan ultra-faible (separateur de section) ->
      Apple Blue 18% pour rester subtil mais visible. */
html:not(.dark) .border-cyan-900\/10 {
    border-color: rgb(0 102 204 / 0.18);
}

/* 5. Tuiles d'icones cyan-950/30 + cyan-500/20 : trop sombres en clair,
      on les remappe vers Apple Blue tres pale + bordure plus marquee. */
html:not(.dark) .bg-cyan-950\/30 {
    background-color: rgb(0 102 204 / 0.06);
}
html:not(.dark) .border-cyan-500\/20 {
    border-color: rgb(0 102 204 / 0.30);
}

/* 6. Bouton CTA primary en mode clair : sur fond Apple Blue, le texte
      doit etre blanc (le text-black hardcode du HTML est concu pour le
      mode dark cyan brillant ou il reste lisible). */
html:not(.dark) .bg-primary.text-black,
html:not(.dark) a.bg-primary,
html:not(.dark) button.bg-primary {
    color: rgb(var(--on-primary));
}

/* 7. Accent cyan-400 (typewriter "> ./exec", labels VISION/SERVICES,
      icones Material Symbols) : remap vers Apple Blue en mode clair pour
      coherence avec la palette monochromatique Apple. */
html:not(.dark) .text-cyan-400 {
    color: rgb(var(--primary));
}

/* 8. Bordures cyan-500/30 (hover des images aurora_2 / aurora_1) :
      remap vers Apple Blue 30% en mode clair. */
html:not(.dark) .border-cyan-500\/30,
html:not(.dark) .group:hover .group-hover\:border-cyan-500\/30 {
    border-color: rgb(0 102 204 / 0.30);
}

/* 9bis. Logos NextGen -- swap automatique selon le theme :
      - logo-on-dark = Logo_NextGen_png_fond_noir.png (logo blanc, lisible
        sur fond sombre du Cyber Void)
      - logo-on-light = Logo_NextGen_png_fond_blanc.png (logo sombre,
        lisible sur fond blanc Apple)
      Visibilite mutuellement exclusive selon html.dark. */
html:not(.dark) .logo-on-dark,
html.dark .logo-on-light {
    display: none;
}

/* 9. GLOW CYAN PRESERVE EN MODE CLAIR -- signature NextGen, l'utilisateur
      veut un glow bien visible meme sur fond blanc Apple. On force le cyan
      brillant #00F2FE (au lieu de --primary qui vaut Apple Blue en clair)
      et on intensifie l'effet pour qu'il ressorte sur du blanc. */
html:not(.dark) .glow-primary-strong {
    box-shadow: 0 0 20px rgb(0 242 254 / 0.55), 0 0 40px rgb(0 242 254 / 0.25);
}
html:not(.dark) .glow-primary-strong:hover {
    box-shadow: 0 0 28px rgb(0 242 254 / 0.75), 0 0 56px rgb(0 242 254 / 0.40);
}
html:not(.dark) .glow-primary-strong:focus-visible {
    box-shadow: 0 0 28px rgb(0 242 254 / 0.90), 0 0 56px rgb(0 242 254 / 0.50);
    outline: 2px solid rgb(0 242 254);
    outline-offset: 2px;
}
