@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/inter-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Geist Mono';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('../fonts/geist-mono-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/space-grotesk-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Archivo Black';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/archivo-black-latin.woff2') format('woff2');
}

/* Jeremy Lab — interface inspirée de la précision des outils desktop (Raycast).
   Implémentation originale : aucune police, image ou feuille de style tierce copiée. */

:root {
    color-scheme: dark;
    --app-sans: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --app-mono: 'Geist Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
    --app-max: 1140px;
    --app-header-h: 4.25rem;
    --app-radius-xl: 24px;
    --app-radius-lg: 16px;
    --app-radius-md: 12px;
    --app-radius-sm: 9px;
    --app-accent: #ff6363;
    --app-accent-strong: #e5484d;
    --app-blue: #59c2ff;
    --app-muted: color-mix(in srgb, var(--mud-palette-text-primary) 62%, transparent);
    --app-dim: color-mix(in srgb, var(--mud-palette-text-primary) 46%, transparent);
    --app-hairline: color-mix(in srgb, var(--mud-palette-text-primary) 9%, transparent);
    --app-hairline-strong: color-mix(in srgb, var(--mud-palette-text-primary) 17%, transparent);
    --app-tint: color-mix(in srgb, var(--mud-palette-text-primary) 5%, transparent);
    --app-tint-strong: color-mix(in srgb, var(--mud-palette-text-primary) 8%, transparent);
    --app-card-bg: linear-gradient(137deg, #1b1d22 4.87%, #111317 75.88%);
    --app-card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 24px 60px -34px rgba(0, 0, 0, 0.9);
    --app-glow: 0.34;
    --app-panel-bg: #0c0d10;
}

.app-shell.is-light {
    --app-accent: #d93a3f;
    --app-accent-strong: #c22f35;
    --app-blue: #0b6e99;
    --app-card-bg: #ffffff;
    --app-card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 20px 45px -32px rgba(9, 9, 11, 0.45);
    --app-glow: 0.14;
    --app-panel-bg: #ffffff;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

html[data-theme='dark'] {
    color-scheme: dark;
    background-color: #07080a;
}

html[data-theme='light'] {
    color-scheme: light;
    background-color: #f6f6f7;
}

h1[tabindex='-1']:focus {
    outline: none;
}

body {
    margin: 0;
    color: var(--mud-palette-text-primary);
    background-color: var(--mud-palette-background);
    background-image: radial-gradient(
        70% 55% at 50% -12%,
        color-mix(in srgb, var(--mud-palette-primary) 12%, transparent),
        transparent 72%
    );
    background-repeat: no-repeat;
    font-family: var(--app-sans);
    font-size: 1rem;
    line-height: 1.5;
    letter-spacing: -0.006em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-wrap: break-word;
}

::selection {
    color: #fff;
    background: color-mix(in srgb, var(--app-accent) 70%, transparent);
}

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

.mud-typography,
.mud-button-root,
.mud-nav-link,
.mud-table-root,
.mud-input-root,
.mud-card,
.mud-paper,
.mud-dialog,
.mud-list-item,
.mud-chip,
.mud-pagination,
.mud-tooltip {
    font-family: var(--app-sans) !important;
}

.mono,
.page-kicker,
.app-brand-copy small,
.rc-kbd,
.home-meta {
    font-family: var(--app-mono);
}

/* ---------- Shell ---------- */

.app-header.mud-appbar {
    height: var(--app-header-h);
    min-height: var(--app-header-h);
    padding: 0;
    border-bottom: 1px solid var(--app-hairline);
    background: color-mix(in srgb, var(--mud-palette-background) 78%, transparent);
    color: var(--mud-palette-text-primary);
    backdrop-filter: blur(18px) saturate(1.25);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
}

.app-header-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    height: 100%;
    max-width: var(--app-max);
    margin: 0 auto;
    padding: 0 clamp(0.85rem, 3.5vw, 2rem);
}

.app-brand {
    display: flex;
    flex: none;
    align-items: center;
    gap: 0.7rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: var(--app-radius-md);
}

.app-brand-mark {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: none;
    place-items: center;
    border-radius: 8px;
    color: #1b0708;
    background: conic-gradient(from 200deg at 50% 50%, #ff8a5c, #ff6363 45%, #e5484d 80%, #ff8a5c);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 6px 16px -8px rgba(229, 72, 77, 0.9);
    font-family: var(--app-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.app-brand-copy {
    display: grid;
    white-space: nowrap;
    line-height: 1.15;
}

.app-brand-copy strong {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.app-brand-copy small {
    margin-top: 0.15rem;
    color: var(--app-dim);
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.app-header-button.mud-icon-button {
    width: 2.5rem;
    height: 2.5rem;
    min-height: 2.5rem !important;
    border: 1px solid var(--app-hairline);
    border-radius: 999px;
    color: var(--app-muted);
}

.app-header-button.mud-icon-button:hover {
    color: var(--mud-palette-text-primary);
    background: var(--app-tint);
}

.app-menu-button {
    display: none;
}

/* Desktop: the same nav menu, rendered horizontally in the header. */
.app-nav-inline {
    display: flex;
    flex: none;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
    margin-left: 0.5rem;
}

.mud-button-root,
.mud-icon-button,
.mud-nav-link,
.mud-input-slot,
.mud-table-sort-label,
button,
a {
    transition:
        color 120ms ease,
        background-color 120ms ease,
        border-color 120ms ease,
        box-shadow 120ms ease,
        filter 120ms ease;
}

.app-nav-inline .mud-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0 0.62rem;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--app-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    white-space: nowrap;
}

.app-nav-inline .mud-nav-link-icon {
    display: none;
}

.app-nav-inline .mud-nav-link-text {
    margin: 0;
    padding: 0;
}

.mud-nav-link:focus-visible {
    outline: 2px solid var(--app-accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-accent) 22%, transparent);
}

.app-nav-menu .mud-nav-link {
    min-height: 2.75rem !important;
    margin: 0.15rem 0.6rem;
    padding: 0 0.85rem;
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--app-radius-sm);
    color: var(--app-muted);
    font-size: 0.9375rem;
    font-weight: 500;
}

.app-nav-inline .mud-nav-link:hover {
    color: var(--mud-palette-text-primary);
    background: var(--app-tint);
}

.app-nav-inline .mud-nav-link.active {
    border-color: var(--app-hairline);
    color: var(--mud-palette-text-primary) !important;
    background: var(--app-tint) !important;
    font-weight: 500;
}

.app-nav-inline .mud-nav-link.active .mud-nav-link-text {
    color: inherit !important;
}

.app-drawer.mud-drawer {
    border-right: 1px solid var(--app-hairline);
    background: var(--mud-palette-drawer-background);
}

.app-drawer .app-nav-menu {
    padding-top: 1.25rem;
}

.app-nav-menu .mud-nav-link:hover {
    color: var(--mud-palette-text-primary);
    background: var(--app-tint);
}

.app-nav-menu .mud-nav-link.active {
    border-color: var(--app-hairline);
    color: var(--mud-palette-text-primary) !important;
    background: var(--app-tint-strong);
}

.app-nav-menu .mud-nav-link.active .mud-nav-link-text,
.app-nav-menu .mud-nav-link.active .mud-nav-link-icon {
    color: var(--mud-palette-text-primary) !important;
}

/* ---------- Page scaffolding ---------- */

.page-content {
    width: 100%;
    min-height: 100vh;
    min-width: 0;
    overflow-x: clip;
}

.standard-page {
    padding: calc(var(--app-header-h) + clamp(1.75rem, 5vw, 3rem)) clamp(1rem, 4vw, 2rem) clamp(3rem, 7vw, 5rem) !important;
}

.standard-page > :first-child {
    position: relative;
    z-index: 0;
}

.content-page {
    width: min(100%, var(--app-max));
    margin: 0 auto;
}

.compact-page {
    width: min(100%, 46rem);
}

.page-header {
    display: grid;
    gap: 0.65rem;
    max-width: 54rem;
}

.page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--app-accent);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.page-kicker::before {
    content: '';
    width: 1.35rem;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}

.page-heading {
    margin: 0;
    font-family: var(--app-sans);
    font-size: clamp(2.15rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.03;
    letter-spacing: -0.038em;
    text-wrap: balance;
}

.page-intro {
    max-width: 42rem;
    margin: 0.15rem 0 0 !important;
    color: var(--app-muted);
    font-size: clamp(0.975rem, 0.5vw + 0.8rem, 1.0625rem);
    line-height: 1.65;
}

/* ---------- Surfaces ---------- */

.rc-panel,
.rc-card.mud-card,
.about-card,
.about-id {
    border: 1px solid var(--app-hairline);
    border-radius: var(--app-radius-lg);
    background: var(--app-card-bg);
    box-shadow: var(--app-card-shadow);
}

.rc-card.mud-card,
.about-card,
.about-id {
    overflow: hidden;
}

.rc-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.35rem;
    border: 1px solid var(--app-hairline-strong);
    border-radius: 5px;
    background: var(--app-tint);
    color: var(--app-muted);
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1;
}

/* ---------- Buttons ---------- */

.rc-btn-primary.mud-button-root {
    padding: 0 1.15rem;
    border-radius: 999px;
    color: #ffffff !important;
    background: linear-gradient(180deg, #f4686b, var(--app-accent-strong)) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 10px 24px -14px rgba(229, 72, 77, 0.95);
    font-size: 0.9375rem;
    font-weight: 600;
}

.rc-btn-primary.mud-button-root:hover {
    filter: brightness(1.06);
}

.rc-btn-ghost.mud-button-root {
    padding: 0 1.1rem;
    border: 1px solid var(--app-hairline-strong) !important;
    border-radius: 999px;
    color: var(--mud-palette-text-primary) !important;
    background: var(--app-tint) !important;
    font-size: 0.9375rem;
    font-weight: 500;
}

.rc-btn-ghost.mud-button-root:hover {
    background: var(--app-tint-strong) !important;
}

.rc-btn-ghost.is-danger.mud-button-root {
    color: #ff8f8f !important;
    border-color: color-mix(in srgb, #ff6363 32%, transparent) !important;
    background: color-mix(in srgb, #ff6363 10%, transparent) !important;
}

.rc-btn-plain.mud-button-root {
    padding: 0 0.95rem;
    border-radius: 999px;
    color: var(--mud-palette-text-primary) !important;
    font-size: 0.9375rem;
    font-weight: 500;
    background: transparent !important;
}

.rc-btn-plain.mud-button-root:hover {
    background: var(--app-tint) !important;
}

.mud-button-root .mud-icon-root {
    font-size: 1.05rem;
}

/* ---------- Shared MudBlazor overrides ---------- */

.mud-button-root,
.mud-button-root .mud-button-label {
    text-transform: none;
    letter-spacing: -0.005em;
}

.mud-button-root,
.mud-icon-button,
.mud-table-sort-label,
button,
a {
    min-height: 44px !important;
}

.mud-input-slot,
.mud-select-input {
    min-height: 44px !important;
}

/* The switch knob is a mud-icon-button: the global 44px target would push it
   3px below the track. The label keeps the 44px touch target instead. */
.mud-switch {
    min-height: 44px;
}

.mud-switch .mud-switch-base {
    min-height: 0 !important;
    height: 100%;
}

/* MudSelect paints its value in an inline combobox with top/bottom padding: the
   text hugs the top of the 65px field. Centre it vertically instead. */
.mud-select .mud-select-input[role='combobox'] {
    display: flex !important;
    align-items: center;
    min-height: 0 !important;
    height: 100%;
}

.mud-button-root:focus-visible,
.mud-icon-button:focus-visible,
.mud-input-control:focus-within .mud-input-slot,
.mud-table-sort-label:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--app-accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-accent) 22%, transparent);
}

.mud-button-root.mud-disabled,
.mud-icon-button.mud-disabled {
    opacity: 1;
    color: var(--mud-palette-action-disabled) !important;
    background: var(--mud-palette-action-disabled-background) !important;
    box-shadow: none;
}

.mud-input-outlined-border {
    border-width: 1px;
    border-color: var(--app-hairline-strong);
}

.mud-input-error .mud-input-outlined-border {
    border-color: var(--mud-palette-error) !important;
}

.mud-alert-message,
.mud-snackbar-content-message {
    color: inherit;
}

.mud-dialog {
    border: 1px solid var(--app-hairline);
    border-radius: var(--app-radius-lg);
}

.mud-tooltip-root {
    border-radius: 8px;
}

/* ---------- Draw ---------- */

.draw-page {
    width: 100%;
}

.draw-content {
    display: grid;
    gap: 0;
}

.draw-canvas-shell {
    position: relative;
    min-height: 600px;
    margin-top: 1.75rem;
    overflow: hidden;
    border: 1px solid var(--app-hairline);
    border-radius: var(--app-radius-lg);
    background: var(--app-panel-bg);
    box-shadow: var(--app-card-shadow);
}

.draw-canvas-shell::after {
    content: 'Canvas · Three.js';
    position: absolute;
    right: 0.85rem;
    bottom: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(8, 10, 14, 0.72);
    color: rgba(255, 255, 255, 0.85);
    font-family: var(--app-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    pointer-events: none;
}

.draw-loading-panel {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.65rem;
    padding: 2rem;
    color: #f4f5f7;
    background: color-mix(in srgb, var(--app-panel-bg) 88%, transparent);
    text-align: center;
    backdrop-filter: blur(12px);
}

.draw-loading-panel > strong {
    font-size: 0.9375rem;
    font-weight: 600;
}

.draw-loading-panel > span {
    max-width: 26rem;
    color: rgba(244, 245, 247, 0.6);
    font-size: 0.875rem;
    line-height: 1.55;
}

.draw-loading-panel > .mud-icon-root {
    font-size: 2rem;
}

.draw-canvas {
    display: block;
    width: 100%;
    height: 600px;
    touch-action: none;
}

.draw-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.draw-toolbar .mud-button-root {
    min-height: 44px;
}

/* ---------- Not found ---------- */

.notfound {
    display: grid;
    gap: 0.5rem;
    padding-top: clamp(1rem, 6vw, 4rem);
}

.notfound-code {
    margin: 0;
    color: transparent;
    background: linear-gradient(
        180deg,
        var(--app-hairline-strong),
        color-mix(in srgb, var(--mud-palette-text-primary) 4%, transparent)
    );
    -webkit-background-clip: text;
    background-clip: text;
    font-family: var(--app-mono);
    font-size: clamp(5rem, 20vw, 10rem);
    font-weight: 500;
    letter-spacing: -0.06em;
    line-height: 0.85;
}

.mud-grid-item,
.mud-card,
.mud-paper,
.mud-table-container {
    min-width: 0;
    max-width: 100%;
}

.mud-table-container {
    overflow-x: auto;
}

/* ---------- Responsive ---------- */

@media (min-width: 960px) {
    .app-drawer.mud-drawer,
    .mud-drawer-overlay,
    .mud-overlay-drawer {
        display: none !important;
    }
}

@media (max-width: 959px) {
    .app-nav-inline {
        display: none !important;
    }

    .app-menu-button {
        display: inline-flex;
    }
}

@media (max-width: 600px) {
    .app-brand-copy small {
        display: none !important;
    }

    .app-header-inner {
        gap: 0.25rem;
    }

    .page-heading {
        font-size: clamp(1.95rem, 9vw, 2.6rem);
        letter-spacing: -0.045em;
    }

    .draw-canvas-shell,
    .draw-canvas {
        min-height: 420px;
        height: 420px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-shell *,
    .app-shell *::before,
    .app-shell *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Accueil — grille éditoriale, halo chromatique et aperçu type application. */

.home-page {
    width: 100%;
}

.home-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 4.5rem);
    width: min(100%, var(--app-max));
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(3rem, 7vw, 5.5rem);
    isolation: isolate;
}

.home-hero-glow {
    position: absolute;
    z-index: -1;
    top: -22%;
    left: -14%;
    width: 128%;
    height: 96%;
    border-radius: 50%;
    background: conic-gradient(from 180deg, #3ef3ff, #2f5bff 34%, #ff3ef7 63%, #3ef3ff);
    filter: blur(130px);
    opacity: var(--app-glow);
    pointer-events: none;
    mask-image: radial-gradient(closest-side, #000 55%, transparent);
    -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent);
}

.home-hero-copy {
    display: grid;
    align-content: center;
    min-width: 0;
}

.home-title {
    max-width: 15ch;
    margin: 0.9rem 0 0;
    font-family: var(--app-sans);
    font-size: clamp(2.5rem, 5.4vw, 4.15rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.042em;
    text-wrap: balance;
}

.home-lead {
    max-width: 33rem;
    margin: 1.2rem 0 0;
    color: var(--app-muted);
    font-size: clamp(1rem, 0.45vw + 0.86rem, 1.125rem);
    line-height: 1.65;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    margin-top: 1.85rem;
}

.home-actions .mud-button-root {
    min-height: 44px;
}

.home-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0;
    margin: 2.1rem 0 0;
    padding: 0;
    list-style: none;
    color: var(--app-dim);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.home-meta li {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
}

.home-meta li + li::before {
    content: '';
    width: 1px;
    height: 0.7rem;
    margin: 0 0.85rem;
    background: var(--app-hairline-strong);
    align-self: center;
}

.home-meta strong {
    color: var(--mud-palette-text-primary);
    font-weight: 500;
}

/* ---------- Aperçu type application ---------- */

.home-hero-visual {
    position: relative;
    display: grid;
    justify-items: end;
    min-width: 0;
}

.home-hero-visual::before {
    content: '';
    position: absolute;
    inset: 8% 6% -14% 4%;
    z-index: -1;
    border-radius: 40px;
    background:
        radial-gradient(60% 70% at 60% 20%, rgba(255, 99, 99, 0.35), transparent 70%),
        radial-gradient(50% 60% at 20% 70%, rgba(89, 194, 255, 0.22), transparent 70%);
    filter: blur(34px);
    opacity: calc(var(--app-glow) + 0.25);
}

.rc-window {
    position: relative;
    width: 100%;
    max-width: 36rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 18px;
    background: linear-gradient(180deg, #17181c, #0d0e11 62%, #0a0b0d);
    color: #f4f5f7;
    box-shadow:
        0 50px 100px -55px rgba(0, 0, 0, 0.95),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    font-family: var(--app-sans);
    transform: translateZ(0);
}

.rc-window-bar {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.02);
}

.rc-window-dots {
    display: inline-flex;
    gap: 0.3rem;
}

.rc-window-dots i {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
}

.rc-window-dots i:first-child {
    background: #ff6f6c;
}

.rc-window-dots i:nth-child(2) {
    background: #f5c451;
}

.rc-window-dots i:last-child {
    background: #6fd68a;
}

.rc-window-title {
    margin-left: 0.2rem;
    color: rgba(244, 245, 247, 0.78);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.rc-window-tag {
    margin-left: auto;
    padding: 0.15rem 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: rgba(244, 245, 247, 0.45);
    font-family: var(--app-mono);
    font-size: 0.5625rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.rc-window-foot {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.015);
    color: rgba(244, 245, 247, 0.38);
    font-family: var(--app-mono);
    font-size: 0.5625rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ---------- Sections ---------- */

.home-section {
    width: min(100%, var(--app-max));
    margin: 0 auto;
    padding-top: clamp(2.5rem, 6vw, 4rem);
}

.home-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2.5rem;
    margin-bottom: 1.4rem;
}

.home-section-title {
    margin: 0.55rem 0 0;
    font-size: clamp(1.7rem, 2.6vw, 2.1rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.032em;
}

/* ---------- Bento ---------- */

.home-bento {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
}

.home-card {
    position: relative;
    display: flex;
    flex-direction: column;
    grid-column: span 3;
    transition:
        border-color 180ms ease,
        transform 180ms ease;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    border: 1px solid var(--app-hairline);
    border-radius: var(--app-radius-lg);
    background: var(--app-card-bg);
    box-shadow: var(--app-card-shadow);
}

.home-card--immersive {
    grid-column: span 2;
}
.home-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1.25rem 1.35rem 0.35rem;
}

.home-card-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.15rem;
    height: 2.15rem;
    margin-bottom: 0.15rem;
    border: 1px solid var(--app-hairline);
    border-radius: 10px;
    background: var(--app-tint);
    color: var(--mud-palette-text-primary);
}

.home-card-icon .mud-icon-root {
    font-size: 1.15rem;
}

.home-card h2,
.home-card h3 {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.022em;
}

.home-card p {
    margin: 0;
    color: var(--app-muted);
    font-size: 0.9rem;
    line-height: 1.58;
}

.home-card-foot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding: 0.85rem 1.35rem 1.15rem;
}

.home-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--mud-palette-text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.home-card-link .mud-icon-root {
    font-size: 0.95rem;
    transition: transform 160ms ease;
}

.about-id-link .mud-icon-root {
    flex: none;
    font-size: 1rem;
}

.about-icon .mud-icon-root {
    font-size: 1.15rem;
}

.home-card-link:hover .mud-icon-root,
.home-card-link:focus-visible .mud-icon-root {
    transform: translate(2px, -2px);
}

.home-card-tag {
    margin-left: auto;
    color: var(--app-dim);
    font-family: var(--app-mono);
    font-size: 0.625rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.home-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    width: min(100%, var(--app-max));
    margin: 2.5rem auto 0;
    padding-top: 1.15rem;
    border-top: 1px solid var(--app-hairline);
    color: var(--app-dim);
    font-family: var(--app-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-foot strong {
    color: var(--app-muted);
    font-weight: 500;
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
    .home-hero {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
        gap: 2rem;
    }

    .rc-window {
        max-width: 24rem;
    }
}

@media (max-width: 900px) {
    .home-hero {
        grid-template-columns: 1fr;
        padding-top: 0.5rem;
    }

    .home-title {
        max-width: 18ch;
    }

    .home-hero-visual {
        justify-items: stretch;
    }

    .rc-window {
        max-width: none;
    }

    .home-card--immersive {
        grid-column: span 6;
    }

    .home-card {
        grid-column: span 3;
    }
}

@media (max-width: 640px) {
    .home-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .home-actions .mud-button-root {
        width: 100%;
        justify-content: center;
    }

    .home-bento {
        grid-template-columns: 1fr;
    }

    .home-card,
    .home-card--immersive {
        grid-column: span 1;
    }

    .home-meta li + li::before {
        margin-inline: 0.6rem;
    }
}

/* ---------- Aperçus réels des jeux ---------- */

.rc-window-shot {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #07080a;
}

.rc-window-shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.04);
}

.home-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1100ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.ambient .rc-window-shot img {
    animation: home-pan 20s ease-in-out infinite alternate;
}

.rc-window-shot::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 62%, rgba(7, 8, 10, 0.55));
    pointer-events: none;
}

.home-tilt {
    width: 100%;
    transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
    will-change: transform;
}

.ambient .home-tilt .rc-window {
    animation: home-float 8s ease-in-out infinite;
}

.home-card:hover {
    border-color: var(--app-hairline-strong);
}

.home-card--echos,
.home-card--atelier {
    grid-column: span 3;
}

.home-tilt-card {
    position: relative;
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition:
        transform 380ms cubic-bezier(0.2, 0.7, 0.2, 1),
        border-color 220ms ease,
        box-shadow 320ms ease;
}

.home-tilt-card:hover {
    border-color: var(--app-hairline-strong);
    box-shadow:
        var(--app-card-shadow),
        0 30px 60px -36px rgba(255, 99, 99, 0.45);
}

.home-tilt-card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(
        420px circle at var(--mx, 50%) var(--my, 0%),
        rgba(255, 255, 255, 0.075),
        transparent 62%
    );
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}

.home-tilt-card:hover::after {
    opacity: 1;
}

.home-tilt-card .home-card-link {
    transition: color 200ms ease;
}

.home-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-bottom: 1px solid var(--app-hairline);
    background: #07080a;
}

.home-tilt-card:hover .home-media img {
    transform: scale(1.06);
}

.home-card-body h2,
.home-card-body h3 {
    margin: 0;
}

.home-card-foot .home-card-link {
    color: var(--mud-palette-text-primary);
}

.home-foot-link {
    color: var(--mud-palette-text-primary);
    text-decoration: underline;
    text-decoration-color: var(--app-hairline-strong);
    text-underline-offset: 0.4em;
    transition: text-decoration-color 200ms ease;
}

.home-foot-link:hover {
    text-decoration-color: var(--app-accent);
}

/* ---------- Animations ---------- */

.ambient .home-hero-glow {
    animation: home-aurora 26s linear infinite;
}

html:not(.intro-done) .home-rise {
    animation: home-rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
    animation-delay: calc(var(--d, 0) * 70ms + 40ms);
}

.js-motion [data-reveal].is-hidden {
    opacity: 0;
    transform: translate3d(0, 32px, 0);
}

[data-reveal] {
    transition:
        opacity 900ms cubic-bezier(0.2, 0.7, 0.2, 1),
        transform 900ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js-motion .home-bento [data-reveal]:nth-child(2) {
    transition-delay: 90ms;
}
.js-motion .home-bento [data-reveal]:nth-child(3) {
    transition-delay: 180ms;
}
.js-motion .home-bento [data-reveal]:nth-child(4) {
    transition-delay: 270ms;
}

@keyframes home-rise {
    from {
        opacity: 0;
        transform: translate3d(0, 24px, 0);
        filter: blur(8px);
    }

    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

@keyframes home-aurora {
    to {
        transform: rotate(360deg);
    }
}

@keyframes home-float {
    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    50% {
        transform: translate3d(0, -10px, 0);
    }
}

@keyframes home-pan {
    from {
        transform: scale(1.04) translate3d(0, 0, 0);
    }

    to {
        transform: scale(1.12) translate3d(-1.5%, -1%, 0);
    }
}

@media (max-width: 900px) {
    .home-card--echos,
    .home-card--atelier {
        grid-column: span 3;
    }
}

@media (max-width: 640px) {
    .home-card--echos,
    .home-card--atelier,
    .home-card--immersive {
        grid-column: span 1;
    }
}

/* À propos — fiche de présentation, savoir-faire et principes. */

.about-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, var(--app-max));
    margin: 0 auto;
    position: relative;
    isolation: isolate;
}

.about-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    align-items: stretch;
    gap: clamp(1.5rem, 4vw, 3.5rem);
}

.about-hero .page-header {
    align-content: center;
    max-width: 40rem;
}

.about-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    margin-top: 1.75rem;
}

.about-actions .mud-button-root {
    min-height: 44px;
}

/* ---------- Fiche ---------- */

.about-id {
    position: relative;
    display: grid;
    align-content: start;
    gap: 1.1rem;
    overflow: hidden;
    padding: clamp(1.25rem, 3vw, 1.75rem);
}

.about-id::before {
    content: '';
    position: absolute;
    inset: -55% 30% auto;
    height: 120%;
    border-radius: 50%;
    background: radial-gradient(
        50% 50% at 50% 50%,
        color-mix(in srgb, var(--app-accent) 26%, transparent),
        transparent 70%
    );
    filter: blur(46px);
    opacity: calc(var(--app-glow) + 0.1);
    pointer-events: none;
}

.about-id-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.about-avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--app-accent), #b8323a 68%, #7e2029);
    color: #1b0708;
    font-family: var(--app-mono);
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 12px 26px -14px rgba(255, 99, 99, 0.8);
}

.about-id-name {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.about-id-name strong {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.022em;
}

.about-id-name small {
    color: var(--app-muted);
    font-size: 0.8125rem;
}

.about-id-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    border-top: 1px solid var(--app-hairline);
}

.about-id-facts > div {
    display: grid;
    gap: 0.2rem;
    padding: 0.7rem 0 0.7rem;
}

.about-id-facts > div:nth-child(odd) {
    padding-right: 0.9rem;
}

.about-id-facts > div:nth-child(even) {
    padding-left: 0.9rem;
    border-left: 1px solid var(--app-hairline);
}

.about-id-facts > div:nth-child(n + 3) {
    border-top: 1px solid var(--app-hairline);
}

.about-id-facts dt {
    color: var(--app-dim);
    font-family: var(--app-mono);
    font-size: 0.5625rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.about-id-facts dd {
    margin: 0;
    color: var(--mud-palette-text-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.about-id-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding-top: 0.95rem;
    border-top: 1px solid var(--app-hairline);
    color: var(--app-muted);
    font-family: var(--app-mono);
    font-size: 0.75rem;
    text-decoration: none;
}

.about-id-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.about-id-link .mud-icon-root:last-child {
    margin-left: auto;
    color: var(--app-dim);
}

.about-id-link:hover,
.about-id-link:focus-visible {
    color: var(--mud-palette-text-primary);
}

/* ---------- Sections ---------- */

.about-section {
    margin-top: clamp(2.75rem, 7vw, 4.5rem);
}

.about-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2.5rem;
    margin-bottom: 1.35rem;
}

.about-section-title {
    margin: 0.55rem 0 0;
    font-size: clamp(1.6rem, 2.5vw, 2rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.032em;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.about-card {
    display: grid;
    align-content: start;
    gap: 0.6rem;
    padding: 1.35rem 1.4rem 1.5rem;
}

.about-icon {
    display: grid;
    place-items: center;
    width: 2.15rem;
    height: 2.15rem;
    margin-bottom: 0.15rem;
    border: 1px solid var(--app-hairline);
    border-radius: 10px;
    background: var(--app-tint);
    color: var(--mud-palette-text-primary);
}

.about-card h3 {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.022em;
}

.about-card p {
    margin: 0;
    color: var(--app-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .about-hero {
        grid-template-columns: 1fr;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .about-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .about-actions .mud-button-root {
        width: 100%;
        justify-content: center;
    }

    .about-id-facts {
        grid-template-columns: 1fr;
    }

    .about-id-facts > div + div {
        border-top: 1px solid var(--app-hairline);
    }

    .about-id-facts > div:nth-child(odd) {
        padding-right: 0;
    }

    .about-id-facts > div:nth-child(even) {
        padding-left: 0;
        border-left: 0;
    }
}

/* Projets, mentions légales, pied de page. */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.projects-grid .home-card {
    grid-column: auto;
}

.site-foot-links a {
    display: inline-flex;
    align-items: center;
}

.site-foot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.legal-page {
    max-width: 46rem;
}

.legal-body {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.legal-body h2 {
    margin: 0 0 0.5rem;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.022em;
}

.legal-body p {
    margin: 0 0 0.5rem;
    color: var(--app-muted);
    font-size: 0.9375rem;
    line-height: 1.65;
}

.home-bento--even .home-card {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .home-bento--even .home-card {
        grid-column: 1 / -1;
    }
}

/* ---------- Pages secondaires : halo, entrée échelonnée, révélation ---------- */

.page-glow {
    top: -9rem;
    left: -10%;
    width: 120%;
    height: 26rem;
}

.js-motion .about-grid [data-reveal]:nth-child(2) {
    transition-delay: 90ms;
}
.js-motion .about-grid [data-reveal]:nth-child(3) {
    transition-delay: 180ms;
}
.js-motion .legal-body [data-reveal]:nth-child(2) {
    transition-delay: 70ms;
}
.js-motion .legal-body [data-reveal]:nth-child(3) {
    transition-delay: 140ms;
}
.js-motion .legal-body [data-reveal]:nth-child(4) {
    transition-delay: 210ms;
}

/* ---------- Page /demo (catalogue interne) ---------- */

.demo-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    margin-top: 1.75rem;
    font-family: var(--app-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.demo-section {
    min-width: 0;
    margin-top: clamp(2.5rem, 6vw, 3.75rem);
}

.demo-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.4rem, 2.2vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.demo-note,
.demo-dim {
    color: var(--app-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.demo-note {
    max-width: 44rem;
    margin: 0 0 1.25rem;
}

.demo-dim {
    margin: 0.35rem 0 0;
}

.demo-page code {
    padding: 0.1em 0.4em;
    border: 1px solid var(--app-hairline);
    border-radius: 6px;
    background: var(--app-tint);
    font-family: var(--app-mono);
    font-size: 0.82em;
}

.demo-stage {
    padding: 1.5rem;
}

.demo-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.25rem;
}

.demo-row--spaced {
    margin-top: 1.5rem;
}

.demo-row .home-card-tag {
    margin-left: 0;
}

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

.demo-window {
    align-self: start;
}

.demo-code {
    margin: 1rem 0 0;
    padding: 1rem 1.15rem;
    overflow-x: auto;
    border: 1px solid var(--app-hairline);
    border-radius: var(--app-radius-md);
    background: var(--app-panel-bg);
}

.demo-code code {
    padding: 0;
    border: 0;
    background: none;
    color: var(--app-muted);
    font-size: 0.8rem;
    line-height: 1.7;
    white-space: pre;
}

.demo-table {
    display: grid;
    border: 1px solid var(--app-hairline);
    border-radius: var(--app-radius-md);
    background: var(--app-panel-bg);
}

.demo-table-row {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 0.5rem 1.25rem;
    align-items: baseline;
    padding: 0.85rem 1.1rem;
    font-size: 0.875rem;
}

.demo-table-row + .demo-table-row {
    border-top: 1px solid var(--app-hairline);
}

.demo-table-row .demo-dim {
    margin: 0;
    font-size: 0.8rem;
}

.demo-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    gap: 0.75rem;
}

.demo-swatch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.demo-chip {
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--app-hairline-strong);
    border-radius: 10px;
}

/* MudBlazor demos: keep the site surfaces, let the components bring behaviour. */
.demo-grid--spaced {
    margin-top: 1rem;
}

.demo-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
    align-items: start;
}

.demo-field-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.demo-slider {
    align-self: center;
    padding-top: 0.5rem;
}

.demo-slider-field {
    display: grid;
    gap: 0.35rem;
    align-content: start;
}

.demo-form-grid > .demo-slider-field {
    grid-column: 1 / -1;
}

.demo-field-label {
    color: var(--app-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.demo-field-value {
    color: var(--app-text);
    font-family: var(--app-mono);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 1100px) {
    .demo-form-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .demo-form-grid > .demo-slider-field {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .demo-form-grid {
        grid-template-columns: 1fr;
    }
}

.demo-mud-table {
    overflow: hidden;
    border: 1px solid var(--app-hairline);
    border-radius: var(--app-radius-md);
    background: var(--app-panel-bg);
}

.demo-mud-table .mud-table-root {
    background: transparent;
}

.demo-mud-table .mud-table-cell {
    border-bottom-color: var(--app-hairline);
    font-size: 0.875rem;
}

.demo-mud-table .mud-table-head .mud-table-cell {
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.demo-mud-table .mud-table-body .mud-table-row:last-child .mud-table-cell {
    border-bottom: 0;
}

@media (max-width: 760px) {
    .demo-table-row {
        grid-template-columns: 1fr;
    }
}
