:root {

    --bg-deep:    oklch(0.115 0.014 250);
    --bg:         oklch(0.145 0.018 250);
    --surface:    oklch(0.185 0.022 248);
    --surface-2:  oklch(0.235 0.028 246);
    --line:       oklch(0.45 0.025 250 / 0.40);
    --line-strong:oklch(0.52 0.035 250 / 0.62);

    --ink:        oklch(0.96 0.010 240);
    --ink-soft:   oklch(0.82 0.018 240);
    --muted:      oklch(0.66 0.024 245);

    --primary:        oklch(0.70 0.18 256);
    --primary-bright: oklch(0.78 0.16 250);
    --primary-ink:    oklch(0.16 0.03 256);
    --accent:         oklch(0.84 0.22 148);
    --accent-ink:     oklch(0.18 0.06 150);

    --iris-1: oklch(0.60 0.17 256);
    --iris-2: oklch(0.64 0.13 200);
    --iris-3: oklch(0.60 0.17 150);
    --iris:   linear-gradient(115deg, var(--iris-1), var(--iris-2) 48%, var(--iris-3));

    --glow-primary: 0 0 40px -8px oklch(0.70 0.18 256 / 0.55);
    --glow-accent:  0 0 32px -10px oklch(0.84 0.22 148 / 0.5);
    --glow-iris:    0 0 60px -10px oklch(0.64 0.15 200 / 0.45);
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.4), 0 2px 6px oklch(0 0 0 / 0.3);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.45), 0 14px 40px -12px oklch(0 0 0 / 0.55);
    --shadow-lg: 0 10px 30px oklch(0 0 0 / 0.5), 0 30px 80px -20px oklch(0 0 0 / 0.6);
    --inner-hi: inset 0 1px 0 oklch(1 0 0 / 0.05);

    --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
    --font-body:    'Inter', system-ui, sans-serif;

    --step--1: clamp(0.84rem, 0.8rem + 0.18vw, 0.95rem);
    --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
    --step-1:  clamp(1.2rem, 1.08rem + 0.55vw, 1.55rem);
    --step-2:  clamp(1.55rem, 1.3rem + 1.2vw, 2.35rem);
    --step-3:  clamp(2.05rem, 1.55rem + 2.4vw, 3.5rem);
    --step-4:  clamp(2.6rem, 1.6rem + 4.8vw, 5.4rem);

    --space-s: clamp(1rem, 0.9rem + 0.5vw, 1.5rem);
    --space-m: clamp(2rem, 1.6rem + 2vw, 3.5rem);
    --space-l: clamp(4.5rem, 3.2rem + 5.5vw, 9rem);
    --gutter: clamp(1.25rem, 4vw, 4rem);
    --page-max: 1200px;
    --radius: 14px;
    --radius-s: 8px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);

    --z-grain: 1;
    --z-gauge: 8;
    --z-header: 10;
    --z-menu: 20;

    color-scheme: dark;
}

[data-theme="day"] {

    --bg-deep:    oklch(0.93 0.012 240);
    --bg:         oklch(0.965 0.008 240);
    --surface:    oklch(0.99 0.005 240);
    --surface-2:  oklch(1 0 0);
    --line:       oklch(0.62 0.02 245 / 0.28);
    --line-strong:oklch(0.55 0.025 245 / 0.5);

    --ink:        oklch(0.22 0.030 250);
    --ink-soft:   oklch(0.38 0.025 250);
    --muted:      oklch(0.48 0.022 248);

    --primary:        oklch(0.55 0.17 256);
    --primary-bright: oklch(0.54 0.17 252);
    --primary-ink:    oklch(1 0 0);
    --accent:         oklch(0.49 0.16 150);
    --accent-ink:     oklch(0.99 0.01 150);

    --glow-primary: 0 0 36px -10px oklch(0.55 0.17 256 / 0.35);
    --glow-accent:  0 0 28px -12px oklch(0.58 0.17 150 / 0.4);
    --glow-iris:    0 0 50px -12px oklch(0.60 0.15 200 / 0.30);
    --shadow-sm: 0 1px 2px oklch(0.4 0.03 262 / 0.10), 0 2px 6px oklch(0.4 0.03 262 / 0.08);
    --shadow-md: 0 4px 12px oklch(0.4 0.03 262 / 0.10), 0 14px 38px -12px oklch(0.4 0.03 262 / 0.16);
    --shadow-lg: 0 10px 30px oklch(0.4 0.03 262 / 0.12), 0 30px 70px -20px oklch(0.4 0.03 262 / 0.20);
    --inner-hi: inset 0 1px 0 oklch(1 0 0 / 0.8);

    color-scheme: light;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar { width: 0; height: 0; display: none; }

body {
    font-family: var(--font-body);
    font-size: var(--step-0);
    font-weight: 400;
    line-height: 1.7;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; }

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.04;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

p { text-wrap: pretty; }

::selection {
    background: var(--primary);
    color: var(--primary-ink);
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 3px;
}

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

.grain {
    position: fixed;
    inset: -60%;
    z-index: var(--z-grain);
    pointer-events: none;
    opacity: 0.045;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[data-theme="day"] .grain {
    opacity: 0.03;
    mix-blend-mode: multiply;
}

.scroll-gauge {
    position: fixed;
    inset: 0 0 0 auto;
    width: 2px;
    height: 100vh;
    z-index: var(--z-gauge);
    pointer-events: none;
    background: var(--line);
}

.scroll-gauge__fill {
    position: absolute;
    inset: 0 0 auto 0;
    height: 0;
    background: var(--iris);
    box-shadow: var(--glow-primary);
}

@media (max-width: 860px) {
    .scroll-gauge { display: none; }
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: var(--z-menu);
    padding: 0.6rem 1rem;
    background: var(--primary);
    color: var(--primary-ink);
    border-radius: var(--radius-s);
    transition: top 0.2s var(--ease-out);
}

.skip-link:focus { top: 1rem; }

.btn {
    --btn-y: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.6rem;
    border: 1px solid transparent;
    border-radius: var(--radius-s);
    font-family: var(--font-display);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    translate: 0 var(--btn-y);
    transition: background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out),
                color 0.25s var(--ease-out), translate 0.25s var(--ease-out),
                box-shadow 0.25s var(--ease-out);
}

.btn:hover { --btn-y: -2px; }

.btn--primary {
    background: var(--primary);
    color: var(--primary-ink);
    box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
    background: var(--primary-bright);
    box-shadow: var(--shadow-md), var(--glow-primary);
}

.btn--ghost {
    border-color: var(--line-strong);
    color: var(--ink);
    background: oklch(1 0 0 / 0.02);
    backdrop-filter: blur(2px);
}

.btn--ghost:hover {
    border-color: var(--primary);
    color: var(--primary-bright);
}

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: var(--z-header);
    border-bottom: 1px solid transparent;
    background: linear-gradient(180deg, oklch(0.07 0.014 250 / 0.55), oklch(0.07 0.014 250 / 0));
    transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, padding 0.35s var(--ease-out);
}

.site-header.is-scrolled {
    background: color-mix(in oklch, var(--bg-deep) 88%, transparent);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom-color: var(--line);
    box-shadow: var(--shadow-sm);
}

.site-header:not(.is-scrolled) .brand__word { color: oklch(0.97 0.005 250); }

.site-header:not(.is-scrolled) .site-nav__list a { color: oklch(0.88 0.01 250); }

.site-header:not(.is-scrolled) .site-nav__list a:hover,
.site-header:not(.is-scrolled) .site-nav__list a.is-active { color: oklch(0.99 0 0); }

.site-header:not(.is-scrolled) .theme-toggle,
.site-header:not(.is-scrolled) .nav-toggle {
    border-color: oklch(0.97 0.005 250 / 0.4);
    color: oklch(0.97 0.005 250);
    background: oklch(0.06 0 0 / 0.12);
}

.site-header:not(.is-scrolled) .theme-toggle:hover {
    border-color: oklch(0.97 0.005 250);
    color: oklch(0.99 0 0);
}

.site-header:not(.is-scrolled) .nav-toggle span { background: oklch(0.97 0.005 250); }

.site-header:not(.is-scrolled) .site-header__cta {
    border-color: oklch(0.97 0.005 250 / 0.45);
    color: oklch(0.97 0.005 250);
}

.site-header:not(.is-scrolled) .site-header__cta:hover {
    border-color: oklch(0.78 0.16 250);
    color: oklch(0.82 0.16 250);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0.85rem var(--gutter);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-right: auto;
}

.brand__mark {
    width: 2rem;
    height: 2rem;
    color: var(--primary-bright);
    flex: none;
    transition: transform 0.5s var(--ease-out), color 0.3s ease;
}

.brand:hover .brand__mark {
    transform: translateY(-1px) scale(1.06);
}

.brand__pulse {
    stroke-dasharray: 100;
    animation: brand-pulse-trace 3s ease-in-out infinite;
}

@keyframes brand-pulse-trace {
    0%   { stroke-dashoffset: 100; opacity: 1; }
    40%  { stroke-dashoffset: 0;   opacity: 1; }
    70%  { stroke-dashoffset: 0;   opacity: 1; }
    90%  { stroke-dashoffset: 0;   opacity: 0; }
    100% { stroke-dashoffset: 100; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .brand__pulse { animation: none; }
}

.brand__word {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 0.005em;
    white-space: nowrap;
}

.site-nav__list {
    display: flex;
    gap: clamp(1rem, 2vw, 1.8rem);
}

.site-nav__list a {
    position: relative;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink-soft);
    padding: 0.3rem 0;
    transition: color 0.2s ease;
}

.site-nav__list a::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background: var(--primary-bright);
    scale: 0 1;
    transform-origin: left;
    transition: scale 0.3s var(--ease-out);
}

.site-nav__list a:hover,
.site-nav__list a.is-active {
    color: var(--ink);
}

.site-nav__list a:hover::before,
.site-nav__list a.is-active::before {
    scale: 1 1;
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-header__cta {
    padding: 0.55rem 1.05rem;
}

.theme-toggle {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-s);
    background: oklch(1 0 0 / 0.02);
    color: var(--ink);
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary-bright);
}

.theme-toggle__icon {
    grid-area: 1 / 1;
    width: 1.15rem;
    height: 1.15rem;
    transition: opacity 0.3s ease, rotate 0.45s var(--ease-out), scale 0.3s var(--ease-out);
}

.theme-toggle__icon--sun { opacity: 0; rotate: -90deg; scale: 0.6; }
[data-theme="day"] .theme-toggle__icon--sun { opacity: 1; rotate: 0deg; scale: 1; }
[data-theme="day"] .theme-toggle__icon--moon { opacity: 0; rotate: 90deg; scale: 0.6; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-s);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 1.1rem;
    height: 2px;
    margin: 0 auto;
    background: var(--ink);
    transition: translate 0.3s var(--ease-out), rotate 0.3s var(--ease-out);
}

.nav-toggle[aria-expanded="true"] span:first-child { translate: 0 4.5px; rotate: 45deg; }
.nav-toggle[aria-expanded="true"] span:last-child  { translate: 0 -4.5px; rotate: -45deg; }

.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-header) - 1);
    display: grid;
    place-items: center;
    background: color-mix(in oklch, var(--bg-deep) 94%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu.is-open { opacity: 1; visibility: visible; }

.mobile-menu ul {
    display: grid;
    gap: 1.4rem;
    text-align: center;
}

.mobile-menu a {
    font-family: var(--font-display);
    font-size: var(--step-2);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    transition: background-color 0.4s ease;
}

.site-footer a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}

.site-footer a:hover { text-decoration-color: var(--primary); }

.site-footer__base {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 1.1rem var(--gutter);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.78rem;
}

.site-footer__base a { color: inherit; text-decoration: none; }
.site-footer__base a:hover { color: var(--ink); }

@media (max-width: 640px) {
    .site-footer__base {
        justify-content: center;
        text-align: center;
    }
}

html.js [data-reveal].will-reveal {
    opacity: 0;
    translate: 0 26px;
    animation: reveal-secours 0.7s var(--ease-out) 2.8s forwards;
}

html.js [data-reveal].is-in {
    opacity: 1;
    translate: 0 0;
    transition: opacity 0.7s var(--ease-out), translate 0.7s var(--ease-out);
}

@keyframes reveal-secours {
    to { opacity: 1; translate: 0 0; }
}

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

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html.js [data-reveal].will-reveal {
        opacity: 1;
        translate: none;
    }
}

@media (max-width: 860px) {
    .site-nav,
    .site-header__cta {
        display: none;
    }

    .nav-toggle { display: flex; }
}

@media (pointer: coarse) {
    .theme-toggle,
    .nav-toggle {
        width: 2.75rem;
        height: 2.75rem;
    }
}
