/* ==========================================================================
   RECYTECNIC — design system
   Signature: la "ligne de densité" — les matières et machines de ce site
   sont littéralement triées par densité, comme sur la table densimétrique
   du site industriel.
   ========================================================================== */

   :root {
    --ink: #10141c;
    --panel: #1b2230;
    --panel-line: #2a3142;
    --concrete: #e9e8e2;
    --paper: #f7f6f2;
    --signal: #35A329;
    --current: #4fd8e8;
    --ink-muted: #8790a0;
    --concrete-ink: #363b34;
    --concrete-muted: #6b7268;

    --font-display: "Big Shoulders", "Arial Narrow", sans-serif;
    --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, monospace;

    --container: 1180px;
    --ease: cubic-bezier(.22, .68, 0, 1);
}

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

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body { margin: 0; }

.site {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

.wrap {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--signal);
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
}
.eyebrow::before {
    content: "";
    width: 22px;
    height: 1px;
    background: var(--signal);
    display: inline-block;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: .95;
    letter-spacing: -.01em;
    margin: 0;
    text-wrap: balance;
}

h2 { font-size: clamp(2rem, 4vw, 3.2rem); text-transform: uppercase; }
h3 { font-size: 1.5rem; text-transform: uppercase; }

p { margin: 0 0 1rem; }

a { color: inherit; }

a:focus-visible, button:focus-visible {
    outline: 2px solid var(--current);
    outline-offset: 2px;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(16, 20, 28, .92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--panel-line);
}
.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--paper);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.brand img { height: 32px; width: 32px; border-radius: 3px; }
.brand span { color: var(--signal); }

.site-nav { display: flex; gap: 2rem; }
.site-nav a {
    color: var(--ink-muted);
    text-decoration: none;
    font-size: .88rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    font-weight: 500;
    transition: color .15s ease;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--paper); }
.site-nav form { margin: 0; display: flex; align-items: center; }
.nav-logout {
    background: none;
    border: 0;
    padding: 0;
    color: var(--ink-muted);
    font: inherit;
    font-size: .88rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
}
.nav-logout:hover, .nav-logout:focus-visible { color: var(--paper); }

.btn-contact {
    background: var(--signal);
    color: var(--ink) !important;
    padding: .6rem 1.2rem;
    border-radius: 2px;
    font-weight: 700;
    font-size: .85rem !important;
    text-transform: uppercase;
}

/* ---------- Hero ---------- */
.hero {
    background: var(--ink);
    color: var(--paper);
    position: relative;
    overflow: hidden;
    padding: 5rem 0 4rem;
}
.hero .wrap {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 3rem;
    align-items: center;
}
.hero h1 {
    font-size: clamp(2.8rem, 6vw, 5rem);
    text-transform: uppercase;
    color: var(--paper);
}
.hero h1 em {
    font-style: normal;
    color: var(--signal);
}
.hero-lede {
    font-size: 1.15rem;
    color: #c7cdd6;
    max-width: 46ch;
    margin: 1.5rem 0 2rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-ghost {
    border: 1px solid var(--panel-line);
    color: var(--paper);
    text-decoration: none;
    padding: .75rem 1.4rem;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: .85rem;
    background: rgb(27, 34, 48);
    text-transform: uppercase;
    transition: border-color .15s ease, background .15s ease;
}
.btn-ghost:hover { border-color: var(--current); background: rgba(79, 216, 232, .08); }

.hero-coords {
    margin-top: 2.5rem;
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--ink-muted);
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.hero-coords strong { color: var(--current); }

/* Hero entrance sequence */
.hero-in {
    opacity: 0;
    transform: translateY(22px);
    animation: hero-in .8s var(--ease) forwards;
    animation-delay: calc(var(--d, 0) * 110ms);
}
.hero-line { display: block; }
@keyframes hero-in {
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .hero-in { opacity: 1; transform: none; animation: none; }
}

/* Density scene — signature 3D element */
.density-scene {
    position: relative;
    height: 420px;
}
.density-scene canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.rule-marks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.rule-mark {
    position: absolute;
    left: 0;
    display: flex;
    align-items: baseline;
    gap: .6rem;
    font-family: var(--font-mono);
    font-size: .8rem;
    color: var(--paper);
    white-space: nowrap;
}
.rule-mark b { color: var(--current); font-size: .95rem; }
.rule-mark span { color: var(--ink-muted); text-transform: uppercase; letter-spacing: .06em; font-size: .68rem; }

/* ---------- Sections generic ---------- */
.section { padding: 5.5rem 0; }
.section--dark { background: var(--ink); color: var(--paper); }
.section--concrete { background: var(--concrete); color: var(--concrete-ink); }
.section-head { max-width: 60ch; margin-bottom: 3rem; }
.section-head p { color: var(--concrete-muted); font-size: 1.05rem; }
.section--dark .section-head p, .section--dark .section-head { color: #c7cdd6; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { transition-delay: calc(var(--i, 0) * 70ms); }

/* ---------- Pillars (not numbered — parallel, not sequential) ---------- */
.pillars {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--concrete-muted);
    border: 1px solid var(--concrete-muted);
}
.pillar {
    background: var(--paper);
    padding: 2.2rem;
}
.pillar .eyebrow { color: var(--concrete-muted); }
.pillar .eyebrow::before { background: var(--concrete-muted); }
.pillar h3 { font-size: 1.3rem; margin-bottom: .7rem; }
.pillar p { color: var(--concrete-muted); margin: 0; font-size: .95rem; }

/* ---------- Materials gallery ---------- */
.materials-legend {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: .8rem;
    color: var(--ink-muted);
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--panel-line);
}
.materials-legend span b { color: var(--current); }

.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}
.material-card {
    position: relative;
    border: 1px solid var(--panel-line);
    overflow: hidden;
    background: var(--panel);
}
.material-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform .5s var(--ease);
}
.material-card:hover img { transform: scale(1.06); }
.material-card-tag {
    position: absolute;
    top: .8rem;
    left: .8rem;
    background: rgba(16, 20, 28, .85);
    color: var(--current);
    font-family: var(--font-mono);
    font-size: .72rem;
    padding: .25rem .55rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.material-card-title {
    padding: .9rem 1rem 1.1rem;
    font-size: .92rem;
    color: var(--paper);
}

/* ---------- Process (real sequence — numbered) ---------- */
.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    position: relative;
}
.process-steps-line {
    position: absolute;
    top: 22px;
    left: 5%;
    right: 5%;
    height: 1px;
    background: var(--concrete-muted);
}
.process-steps-fill {
    position: absolute;
    inset: 0;
    transform: scaleX(0);
    transform-origin: left;
    background: linear-gradient(to right, var(--signal), var(--current));
    transition: transform .1s linear;
}
.step { position: relative; padding: 0 1.2rem; }
.step-num {
    font-family: var(--font-mono);
    font-size: .95rem;
    color: var(--paper);
    background: var(--ink);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.2rem;
    position: relative;
    z-index: 1;
}
.step h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.step p { color: var(--concrete-muted); font-size: .9rem; }

/* ---------- Equipment ---------- */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}
.equipment-card {
    background: var(--paper);
    border: 1px solid var(--concrete-muted);
}
.equipment-card-media { position: relative; overflow: hidden; }
.equipment-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.equipment-card.is-vendu img { filter: grayscale(70%); opacity: .75; }
.equipment-vendu-banner {
    position: absolute;
    top: 22px;
    right: -46px;
    z-index: 2;
    width: 200px;
    text-align: center;
    background: #d01212;
    color: #fff;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    padding: .4rem 0;
    transform: rotate(35deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
    pointer-events: none;
}
.photo-sold { margin-top: .6rem; }
.photo-sold button {
    border: 1px solid #d01212;
    background: #d01212;
    color: #fff;
    font: inherit;
    font-size: .75rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .35rem .6rem;
    cursor: pointer;
}
.equipment-card-body { padding: 1rem 1.1rem 1.2rem; }
.equipment-card-body h4 {
    font-family: var(--font-mono);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0 0 .3rem;
    color: var(--concrete-ink);
}

.admin-notice {
    margin: 0;
    padding: .8rem 1.5rem;
    background: var(--signal);
    color: var(--ink);
    text-align: center;
    font-size: .9rem;
}
.admin-notice--error { background: #b0413e; color: #fff; }

.photo-replace {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin: 0 1rem 1rem;
    font-size: .75rem;
}
.material-card .photo-replace { color: var(--paper); }
.equipment-card .photo-replace { color: var(--concrete-ink); margin: .8rem 0 0; }
.photo-replace input[type="file"] { max-width: 100%; font: inherit; }
.photo-replace button,
.photo-rename button {
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .35rem .6rem;
    cursor: pointer;
}

.photo-rename {
    display: grid;
    gap: .45rem;
    margin: 0 1rem .75rem;
    font-size: .75rem;
}
.material-card .photo-rename { color: var(--paper); }
.equipment-card .photo-rename { color: var(--concrete-ink); margin: .8rem 0 0; }
.photo-delete { margin: 0 1rem 1rem; }
.equipment-card .photo-delete { margin: .6rem 0 0; }
.photo-delete button {
    border: 1px solid #d01212;
    background: transparent;
    color: #d01212;
    font: inherit;
    font-size: .75rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .35rem .6rem;
    cursor: pointer;
}
.photo-add { max-width: 420px; margin-top: 1.5rem; }
.section--dark .photo-add { color: var(--paper); margin-left: 0; margin-right: 0; }
.photo-add input[type="file"] { display: block; margin-top: .2rem; max-width: 100%; font: inherit; }
.photo-add button {
    justify-self: start;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .35rem .6rem;
    cursor: pointer;
}

.photo-rename input[type="text"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: .2rem;
    padding: .35rem .45rem;
    border: 1px solid currentColor;
    background: #fff;
    color: #10141c;
    font: inherit;
}

.equipment-catalogue {
    margin-top: 3rem;
    border-top: 1px solid var(--concrete-muted);
    padding-top: 2rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    font-family: var(--font-mono);
    font-size: .82rem;
}
.catalogue-item b { display: block; color: var(--concrete-ink); font-size: .9rem; margin-bottom: .4rem; text-transform: uppercase; }
.catalogue-item span { color: var(--concrete-muted); }

/* ---------- News banner (aluminium / Foucault) ---------- */
.news-banner {
    background: var(--panel);
    border: 1px solid var(--panel-line);
    border-left: 3px solid var(--current);
    padding: 2.2rem 2.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}
.news-pulse {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid var(--current);
    position: relative;
    flex: none;
}
.news-pulse::before, .news-pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid var(--current);
    animation: pulse-ring 2.4s var(--ease) infinite;
}
.news-pulse::after { animation-delay: 1.2s; }
@keyframes pulse-ring {
    0% { transform: scale(1); opacity: .8; }
    100% { transform: scale(2.1); opacity: 0; }
}
.news-banner p { margin: 0; color: #c7cdd6; }
.news-banner strong { color: var(--paper); display: block; font-family: var(--font-mono); text-transform: uppercase; font-size: .82rem; letter-spacing: .04em; margin-bottom: .3rem; }

/* ---------- Contact ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}
.contact-card {
    font-family: var(--font-mono);
    font-size: .95rem;
    line-height: 2;
}
.contact-card a { color: var(--current); text-decoration: none; }
.contact-card a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--ink);
    color: var(--ink-muted);
    padding: 2.5rem 0;
    font-size: .85rem;
    border-top: 1px solid var(--panel-line);
}
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-legal { display: flex; gap: 1.5rem; }
.footer-legal a { color: var(--ink-muted); text-decoration: none; }
.footer-legal a:hover { color: var(--paper); text-decoration: underline; }

/* ---------- Legal pages ---------- */
.legal-page .wrap { max-width: 760px; }
.legal-title { font-size: clamp(2rem, 4vw, 2.8rem); text-transform: uppercase; margin: .5rem 0 2rem; }
.legal-page h2 {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    text-transform: none;
    margin: 2rem 0 .6rem;
    color: var(--concrete-ink);
}
.legal-page p { color: var(--concrete-muted); }
.legal-page a { color: var(--ink); text-decoration: underline; }
.legal-note { font-style: italic; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
    position: fixed;
    left: 1.5rem;
    right: 1.5rem;
    bottom: -200px;
    max-width: 640px;
    margin: 0 auto;
    background: var(--panel);
    color: var(--paper);
    border: 1px solid var(--panel-line);
    padding: 1.3rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    z-index: 90;
    transition: bottom .5s var(--ease);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.cookie-banner.is-visible { bottom: 1.5rem; }
.cookie-banner p { margin: 0; font-size: .88rem; color: #c7cdd6; flex: 1 1 260px; }
.cookie-banner p a { color: var(--current); }
.cookie-banner-actions { display: flex; gap: .8rem; flex: none; }
.cookie-banner-actions .btn-ghost { padding: .55rem 1rem; }

.photo-trigger {
    all: unset;
    cursor: pointer;
    display: block;
}
.photo-trigger:focus-visible {
    outline: 2px solid var(--current);
    outline-offset: 2px;
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(16, 20, 28, .96);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 3rem;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-height: 85vh; max-width: 90vw; object-fit: contain; }
.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--paper);
    background: none;
    border: 1px solid var(--panel-line);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hero .wrap { grid-template-columns: 1fr; }
    .density-scene { height: 260px; margin-top: 2rem; }
    .pillars { grid-template-columns: 1fr; }
    .process-steps { grid-template-columns: 1fr; gap: 2rem; }
    .process-steps-line { display: none; }
    .equipment-catalogue { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .site-nav a:not(.btn-contact):not(.nav-account) { display: none; }
    .equipment-catalogue { grid-template-columns: 1fr 1fr; }
    .news-banner { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
