/* EchoDoc — charte graphique alignée Trajecta / elmiup
   Or #E9B949 · Anthracite #292929 · Pétrole #1F5A63 · Papier #F8F7F3
   Titres : Fraunces · Texte : IBM Plex Sans
*/

@font-face {
    font-family: "Fraunces";
    src: url("../fonts/fraunces-var.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("../fonts/ibm-plex-sans-var.woff2") format("woff2");
    font-weight: 400 600;
    font-style: normal;
    font-display: swap;
}

:root {
    --gold: #e9b949;
    --gold-dark: #c99b31;
    --anthracite: #292929;
    --anthracite-soft: #3a3a3a;
    --off-white: #f8f7f3;
    --petrol: #1f5a63;

    --ink: var(--anthracite);
    --ink-soft: var(--anthracite-soft);
    --mist: var(--off-white);
    --paper: #f3f2ed;
    --line: rgba(41, 41, 41, 0.14);
    --line-strong: rgba(41, 41, 41, 0.22);
    --rule-light: rgba(248, 247, 243, 0.18);
    --text: var(--anthracite);
    --muted: rgba(41, 41, 41, 0.66);
    --white: #ffffff;
    --shadow: 0 24px 60px rgba(41, 41, 41, 0.16);

    --font-display: "Fraunces", Georgia, serif;
    --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
    --radius: 0;
    --shell: min(1120px, calc(100% - 2.5rem));
    --header-h: 4.5rem;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
    margin: 0;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.65;
    background: var(--off-white);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--petrol);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--anthracite);
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--gold);
    color: var(--anthracite);
    padding: 0.75rem 1rem;
    z-index: 100;
    text-decoration: none;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

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

.shell {
    width: var(--shell);
    margin-inline: auto;
}

.eyebrow {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0;
}

.eyebrow--light {
    color: rgba(248, 247, 243, 0.62);
}

/* Header — anthracite Trajecta */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--anthracite);
    color: var(--off-white);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s var(--ease);
}

.site-header.is-scrolled {
    border-bottom-color: var(--rule-light);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--off-white);
}

.brand-mark {
    width: 1.15rem;
    height: 1.15rem;
    background:
        linear-gradient(90deg, var(--off-white) 0 33%, var(--gold) 33% 66%, var(--petrol) 66% 100%);
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav a {
    color: rgba(248, 247, 243, 0.78);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
}

.nav a:hover,
.nav a[aria-current] {
    color: var(--gold);
}

.nav-cta {
    padding: 0.6rem 1rem;
    border: 1px solid var(--gold);
    background: var(--gold);
    color: var(--anthracite) !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
}

.nav-cta:hover {
    background: var(--gold-dark);
    border-color: var(--gold-dark);
    color: var(--anthracite) !important;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.35rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--rule-light);
}

.lang-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid transparent;
    opacity: 0.55;
    text-decoration: none;
    transition: opacity 0.2s var(--ease), border-color 0.2s var(--ease);
}

.lang-flag:hover,
.lang-flag.is-active {
    opacity: 1;
}

.lang-flag.is-active {
    border-color: rgba(233, 185, 73, 0.55);
}

.lang-flag .flag-fr,
.lang-flag .flag-uk {
    width: 1.35rem;
    height: 0.95rem;
    flex: none;
}

.flag-uk {
    display: inline-block;
    width: 1.35rem;
    height: 0.95rem;
    vertical-align: -0.08em;
    border-radius: 1px;
    box-shadow: inset 0 0 0 1px rgba(248, 247, 243, 0.25);
    background-color: #012169;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Cpath fill='%23012169' d='M0 0h60v30H0z'/%3E%3Cpath stroke='%23fff' stroke-width='6' d='M0 0l60 30M60 0L0 30'/%3E%3Cpath stroke='%23C8102E' stroke-width='2' d='M0 0l60 30M60 0L0 30'/%3E%3Cpath stroke='%23fff' stroke-width='10' d='M30 0v30M0 15h60'/%3E%3Cpath stroke='%23C8102E' stroke-width='6' d='M30 0v30M0 15h60'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Hero */
.hero {
    position: relative;
    min-height: calc(100vh - var(--header-h));
    display: grid;
    grid-template-columns: minmax(20rem, 1fr) minmax(18rem, 1fr);
    gap: 0;
    align-items: stretch;
    overflow: hidden;
    background: var(--anthracite);
    color: var(--off-white);
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    z-index: 3;
    background: linear-gradient(
        90deg,
        var(--anthracite-soft) 0 33.33%,
        var(--gold) 33.33% 66.66%,
        var(--petrol) 66.66% 100%
    );
}

.hero-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    justify-self: start;
    width: min(36rem, 100%);
    margin-left: max(1.25rem, calc((100vw - 1120px) / 2));
    padding: clamp(2.5rem, 6vw, 5rem) clamp(1.25rem, 3vw, 2.5rem);
    box-sizing: border-box;
}

.hero-brand {
    font-family: var(--font-display);
    font-size: clamp(3rem, 6vw, 4.75rem);
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 0.95;
    color: var(--off-white);
    margin: 0.85rem 0 0;
    opacity: 0;
    transform: translateY(16px);
    animation: rise 0.9s var(--ease) forwards 0.1s;
}

.hero-brand .up {
    color: var(--gold);
}

.hero h1 {
    margin: 1.25rem 0 0;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2.6vw, 1.85rem);
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: rgba(248, 247, 243, 0.9);
    max-width: 24ch;
    opacity: 0;
    transform: translateY(16px);
    animation: rise 0.9s var(--ease) forwards 0.28s;
}

.hero-sep {
    width: 72px;
    height: 2px;
    background: var(--gold);
    border: 0;
    margin: 1.5rem 0;
    opacity: 0;
    animation: rise 0.9s var(--ease) forwards 0.36s;
}

.hero-lead {
    margin: 0 0 1.85rem;
    color: rgba(248, 247, 243, 0.72);
    font-size: 1.05rem;
    max-width: 40ch;
    line-height: 1.55;
    opacity: 0;
    transform: translateY(16px);
    animation: rise 0.9s var(--ease) forwards 0.42s;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    opacity: 0;
    transform: translateY(16px);
    animation: rise 0.9s var(--ease) forwards 0.56s;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.95rem 1.5rem;
    border-radius: 0;
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s var(--ease), background 0.25s var(--ease),
        border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--anthracite);
}

.btn-primary:hover {
    background: var(--gold-dark);
    border-color: var(--gold-dark);
    color: var(--anthracite);
}

.btn-secondary {
    background: transparent;
    color: var(--off-white);
    border-color: var(--rule-light);
}

.btn-secondary:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.hero-visual {
    position: relative;
    min-height: 520px;
    background: linear-gradient(160deg, #1a1a1a 0%, #292929 45%, #1f5a63 120%);
    color: var(--off-white);
    overflow: hidden;
    opacity: 0;
    animation: fade-in 1.1s var(--ease) forwards 0.2s;
}

.hero-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 18%, rgba(233, 185, 73, 0.28), transparent 42%),
        radial-gradient(circle at 18% 82%, rgba(31, 90, 99, 0.35), transparent 40%);
}

.hero-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cpath d='M0 40h160M0 80h160M0 120h160M40 0v160M80 0v160M120 0v160' stroke='%23f8f7f3' stroke-width='0.6' fill='none'/%3E%3C/svg%3E");
}

.doc-stage {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 2.5rem;
    z-index: 1;
}

.doc-stack {
    position: relative;
    width: min(420px, 100%);
    aspect-ratio: 4 / 5;
    transform: rotate(-2deg);
    animation: float-y 7s ease-in-out infinite;
}

.doc-sheet {
    position: absolute;
    inset: 0;
    border-radius: 0;
    background: linear-gradient(180deg, #fbfcfa 0%, #f0eee8 100%);
    color: var(--anthracite);
    box-shadow: var(--shadow);
    padding: 1.4rem 1.35rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.doc-sheet.back-1 {
    transform: translate(14px, 12px) rotate(3deg);
    opacity: 0.55;
}

.doc-sheet.back-2 {
    transform: translate(28px, 24px) rotate(6deg);
    opacity: 0.3;
}

.doc-label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--petrol);
    font-weight: 600;
    margin-bottom: 0.85rem;
}

.doc-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    line-height: 1.2;
    margin: 0 0 1rem;
    letter-spacing: -0.01em;
}

.doc-lines {
    display: grid;
    gap: 0.55rem;
}

.doc-lines span {
    display: block;
    height: 0.55rem;
    border-radius: 0;
    background: rgba(41, 41, 41, 0.12);
}

.doc-lines span:nth-child(1) { width: 92%; }
.doc-lines span:nth-child(2) { width: 78%; }
.doc-lines span:nth-child(3) { width: 86%; }
.doc-lines span:nth-child(4) { width: 64%; }
.doc-lines span:nth-child(5) { width: 80%; margin-top: 0.6rem; }
.doc-lines span:nth-child(6) { width: 70%; }
.doc-lines span:nth-child(7) { width: 88%; }

.answer-chip {
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: 1.25rem;
    background: var(--anthracite);
    color: var(--off-white);
    border-radius: 0;
    padding: 0.9rem 1rem;
    font-size: 0.88rem;
    line-height: 1.4;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.answer-chip strong {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

/* Sections */
.section {
    padding: clamp(4rem, 8vw, 6.5rem) 0;
}

.section-head {
    max-width: 38rem;
    margin-bottom: 2.25rem;
    display: grid;
    gap: 1rem;
}

.section-head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3.6vw, 2.8rem);
    font-weight: 500;
    letter-spacing: -0.015em;
    line-height: 1.15;
    color: var(--ink);
}

.section-head p {
    margin: 0;
    color: var(--muted);
    max-width: 42ch;
}

.section-ink {
    background: var(--anthracite);
    color: var(--off-white);
}

.section-ink .section-head h2 {
    color: var(--off-white);
}

.section-ink .section-head p,
.section-ink .eyebrow--light {
    color: rgba(248, 247, 243, 0.72);
}

.usage-list {
    display: grid;
    gap: 0;
    max-width: 48rem;
    padding: 0;
    margin: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.usage-list li {
    padding: 1.35rem 0;
    border-bottom: 1px solid var(--line);
}

.usage-list li:last-child {
    border-bottom: 0;
}

.usage-list h3 {
    margin: 0 0 0.4rem;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--ink);
}

.usage-list p {
    margin: 0;
    color: var(--muted);
}

.flag-fr {
    display: inline-block;
    width: 1.2em;
    height: 0.85em;
    vertical-align: -0.08em;
    border-radius: 1px;
    background: linear-gradient(
        90deg,
        #002395 0 33.333%,
        #ffffff 33.333% 66.666%,
        #ed2939 66.666% 100%
    );
    box-shadow: inset 0 0 0 1px rgba(41, 41, 41, 0.18);
}

.flag-fr--on-ink {
    box-shadow: inset 0 0 0 1px rgba(248, 247, 243, 0.35);
    margin-right: 0.2em;
}

.pillar h3 .flag-fr {
    vertical-align: 0.05em;
}

.pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.pillar {
    padding: 0;
    border: 0;
    background: none;
}

.pillar h3 {
    margin: 0 0 0.55rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--off-white);
}

.pillar p {
    margin: 0;
    color: rgba(248, 247, 243, 0.72);
    max-width: 28ch;
}

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    counter-reset: step;
}

.step {
    position: relative;
    padding-top: 0.25rem;
}

.step::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold-dark);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.step h3 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    color: var(--ink);
}

.step p {
    margin: 0;
    color: var(--muted);
    font-size: 0.98rem;
}

.cta-band {
    display: grid;
    grid-template-columns: 1.4fr auto;
    gap: 1.5rem;
    align-items: center;
    padding: 2rem 0 0;
    border-top: 1px solid var(--line);
    margin-top: 3rem;
}

.cta-band h2 {
    margin: 0 0 0.4rem;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.8vw, 2rem);
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.cta-band p {
    margin: 0;
    color: var(--muted);
    max-width: 40ch;
}

.cta-band .btn-primary {
    color: var(--anthracite);
}

/* Contact */
.page-hero {
    padding: clamp(3rem, 7vw, 5rem) 0 2rem;
}

.page-hero h1 {
    margin: 0.75rem 0 0.75rem;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4.5vw, 3.2rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.page-hero p {
    margin: 0;
    color: var(--muted);
    max-width: 42ch;
}

.contact-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: clamp(2rem, 5vw, 3.5rem);
    padding-bottom: clamp(4rem, 8vw, 6rem);
}

.contact-form {
    display: grid;
    gap: 1rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

.field {
    display: grid;
    gap: 0.4rem;
}

.field label {
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.field input,
.field textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 0;
    padding: 0.85rem 0.95rem;
    font: inherit;
    color: var(--ink);
    background: #fff;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--petrol);
    box-shadow: 0 0 0 2px rgba(31, 90, 99, 0.12);
}

.field textarea {
    min-height: 160px;
    resize: vertical;
}

.hp {
    position: absolute;
    left: -10000px;
    opacity: 0;
    pointer-events: none;
}

.form-note {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.alert {
    padding: 0.9rem 1rem;
    border-radius: 0;
    margin-bottom: 1rem;
}

.alert-ok {
    background: rgba(31, 90, 99, 0.1);
    color: var(--petrol);
    border: 1px solid rgba(31, 90, 99, 0.25);
}

.alert-err {
    background: rgba(201, 155, 49, 0.12);
    color: #7a5a12;
    border: 1px solid rgba(201, 155, 49, 0.35);
}

.alert ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.aside-panel {
    align-self: start;
}

.aside-panel h2 {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--ink);
}

.aside-panel ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--muted);
    display: grid;
    gap: 0.55rem;
}

.prose {
    max-width: 42rem;
    padding-bottom: clamp(4rem, 8vw, 6rem);
}

.prose h2 {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--ink);
    margin: 2rem 0 0.6rem;
}

.prose p {
    color: var(--muted);
}

/* Footer */
.site-footer {
    border-top: 0;
    padding: 2.75rem 0 2rem;
    background: var(--anthracite);
    color: rgba(248, 247, 243, 0.72);
}

.footer-inner {
    display: grid;
    gap: 1.25rem;
}

.footer-brand .brand-name {
    color: var(--off-white);
}

.footer-brand p {
    margin: 0.65rem 0 0;
    color: rgba(248, 247, 243, 0.62);
    max-width: 36ch;
}

.footer-links {
    display: flex;
    gap: 1.25rem;
}

.footer-links a {
    text-decoration: none;
    color: rgba(248, 247, 243, 0.78);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--gold);
}

.footer-meta {
    margin: 0;
    color: rgba(248, 247, 243, 0.48);
    font-size: 0.85rem;
}

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

@keyframes rise {
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes fade-in {
    to { opacity: 1; }
}

@keyframes float-y {
    0%, 100% { transform: rotate(-2deg) translateY(0); }
    50% { transform: rotate(-2deg) translateY(-10px); }
}

@media (max-width: 960px) {
    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-copy {
        width: 100%;
        margin-left: 0;
        padding: 2.5rem 1.25rem 1.5rem;
    }

    .hero-visual {
        min-height: 420px;
    }

    .pillars,
    .steps,
    .contact-layout {
        grid-template-columns: 1fr;
    }

    .cta-band {
        grid-template-columns: 1fr;
    }

    .nav a:not(.nav-cta):not(.lang-flag) {
        display: none;
    }

    .lang-switch {
        border-left: 0;
        padding-left: 0;
        margin-left: 0;
    }
}

@media (max-width: 560px) {
    .hero-brand {
        font-size: 2.8rem;
    }

    .doc-stage {
        padding: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
    .hero-brand,
    .hero h1,
    .hero-sep,
    .hero-lead,
    .hero-actions,
    .hero-visual,
    .reveal {
        opacity: 1;
        transform: none;
    }
}
