/* =========================================================
   Page d'accueil 3D — Fils d'idées 3D
   Chargée uniquement sur index.php (via $extraStyles).
   Toutes les classes sont préfixées h3d- pour ne rien casser
   dans style.css. Reprend la palette du logo (style.css).
   ========================================================= */
.home-3d {
    --h3d-ink: var(--color-ink, #1D2224);
    --h3d-slate: var(--color-slate, #314957);
    --h3d-teal: var(--color-teal, #3A7474);
    --h3d-teal-light: var(--color-teal-light, #708F98);
    --h3d-bg: var(--color-bg, #F5F8F8);
    --h3d-line: var(--color-border, #E1E8E8);
    --h3d-mint: #e6f0ef;
    --h3d-glace: #a9dcd7;
    --h3d-muted: #56696f;
    --h3d-filament: #e59a2f;
    --h3d-radius: 14px;
    --h3d-shadow: 0 6px 22px -14px rgba(49, 73, 87, .4);
    --h3d-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* Le header et le footer passent au-dessus des formes 3D en fond */
.site-header, .site-footer { position: relative; z-index: 2; }
main.home-3d { padding-bottom: 0; position: relative; }
main.home-3d > section { position: relative; z-index: 1; }

.h3d-shapes {
    position: fixed; inset: 0; width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
}

.h3d-wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.home-3d h1, .home-3d h2, .home-3d h3 { text-wrap: balance; }
.home-3d :focus-visible { outline: 3px solid var(--h3d-filament); outline-offset: 3px; border-radius: 6px; }

.h3d-eyebrow {
    display: inline-block; font-family: var(--h3d-mono); font-size: .78rem;
    letter-spacing: .12em; text-transform: uppercase; color: var(--h3d-teal);
}
.h3d-eyebrow--light { color: var(--h3d-glace); }

/* Boutons (on neutralise le style global button/.btn de style.css) */
.home-3d .h3d-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 48px; padding: 0 24px; border-radius: 999px; border: 2px solid transparent;
    font-family: 'Baloo 2', 'Nunito Sans', system-ui, sans-serif; font-weight: 700; font-size: 1.02rem;
    text-decoration: none; cursor: pointer; line-height: 1;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.home-3d .h3d-btn:hover { transform: translateY(-2px); }
.home-3d .h3d-btn--white { background: #fff; color: var(--h3d-slate); box-shadow: 0 10px 24px -10px rgba(0,0,0,.45); }
.home-3d .h3d-btn--white:hover { background: var(--h3d-bg); }
.home-3d .h3d-btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.home-3d .h3d-btn--ghost:hover { background: rgba(255,255,255,.12); }
.home-3d .h3d-btn--teal { background: var(--h3d-teal); color: #fff; }
.home-3d .h3d-btn--teal:hover { background: var(--h3d-slate); }
.h3d-ctas { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- HERO ---------- */
.h3d-hero {
    background: linear-gradient(135deg, var(--h3d-slate), var(--h3d-teal));
    color: #fff; overflow: hidden;
}
.h3d-hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
    background-size: 18px 18px;
}
.h3d-hero-grid {
    position: relative; display: grid; grid-template-columns: 1fr 1.1fr;
    gap: 40px; align-items: center; padding-top: 48px; padding-bottom: 56px;
}
.h3d-hero-text { display: grid; gap: 22px; min-width: 0; }
.h3d-hero h1 { color: #fff; font-size: clamp(2.1rem, 4.4vw, 3.4rem); line-height: 1.1; margin: 0; }
.h3d-hero h1 em { font-style: normal; color: var(--h3d-glace); }
.h3d-lead { font-size: 1.15rem; color: #eaf1f1; max-width: 36ch; }
.h3d-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.h3d-chip {
    font-family: var(--h3d-mono); font-size: .78rem; padding: 6px 12px; border-radius: 999px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22);
}

.h3d-stage {
    position: relative; aspect-ratio: 1 / 1; max-width: 100%; min-width: 0;
    border-radius: 22px; overflow: hidden;
    background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.14), rgba(0,0,0,.18));
    border: 1px solid rgba(255,255,255,.18);
}
#h3dScene { width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
#h3dScene:active { cursor: grabbing; }
.h3d-hud {
    position: absolute; left: 14px; top: 14px; right: 14px; display: flex;
    justify-content: space-between; gap: 10px; font-family: var(--h3d-mono); font-size: .74rem; pointer-events: none;
}
.h3d-hud div { background: rgba(10,20,24,.55); padding: 6px 10px; border-radius: 8px; }
.h3d-hud b { color: var(--h3d-filament); font-weight: 600; }
.h3d-hint { position: absolute; right: 14px; top: 50px; font-size: .75rem; opacity: .7; pointer-events: none; }
.h3d-progress {
    position: absolute; left: 14px; right: 14px; bottom: 72px; height: 4px; border-radius: 4px;
    background: rgba(255,255,255,.18); overflow: hidden; pointer-events: none;
}
.h3d-progress i { display: block; height: 100%; width: 0; background: var(--h3d-filament); }
.h3d-picker { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.home-3d .h3d-picker button {
    font: 600 .82rem 'Nunito Sans', system-ui, sans-serif; color: #fff; background: rgba(10,20,24,.5);
    border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 8px 14px; min-height: 40px;
}
.home-3d .h3d-picker button:hover { background: rgba(10,20,24,.7); }
.home-3d .h3d-picker button[aria-pressed="true"] { background: #fff; color: var(--h3d-slate); border-color: #fff; }
.h3d-fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; }

/* ---------- POINTS CLÉS ---------- */
.h3d-specs { background: rgba(255,255,255,.92); border-bottom: 1px solid var(--h3d-line); }
.h3d-specs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.h3d-spec { display: flex; gap: 12px; align-items: center; min-width: 0; }
.h3d-spec svg { flex: none; width: 28px; height: 28px; color: var(--h3d-teal); }
.h3d-spec strong { display: block; font-family: 'Baloo 2', sans-serif; font-size: 1.02rem; line-height: 1.2; color: var(--h3d-slate); }
.h3d-spec span { font-size: .86rem; color: var(--h3d-muted); }

/* ---------- SECTIONS ---------- */
.h3d-section { padding: 80px 0; }
.h3d-section--white { background: rgba(255,255,255,.94); border-top: 1px solid var(--h3d-line); border-bottom: 1px solid var(--h3d-line); }
.h3d-section--last { padding-bottom: 80px; }
.h3d-head { display: grid; gap: 12px; max-width: 640px; margin-bottom: 36px; }
.h3d-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); line-height: 1.15; color: var(--h3d-ink); margin: 0; }
.h3d-head p { color: var(--h3d-muted); }
.h3d-center { text-align: center; margin-top: 32px; }

/* Savoir-faire */
.h3d-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; perspective: 900px; }
.h3d-card {
    background: #fff; border: 1px solid var(--h3d-line); border-top: 3px solid var(--h3d-teal);
    border-radius: var(--h3d-radius); padding: 26px 22px; display: grid; gap: 12px; align-content: start;
    box-shadow: var(--h3d-shadow); transform-style: preserve-3d; transition: transform .15s ease-out, box-shadow .2s;
}
.h3d-card:hover { box-shadow: 0 16px 34px -16px rgba(49,73,87,.45); }
.h3d-ic { width: 52px; height: 52px; border-radius: 14px; background: var(--h3d-mint); display: grid; place-items: center; color: var(--h3d-teal); transform: translateZ(30px); }
.h3d-ic svg { width: 28px; height: 28px; }
.h3d-card h3 { font-size: 1.2rem; color: var(--h3d-slate); margin: 0; transform: translateZ(20px); }
.h3d-card p { color: var(--h3d-muted); font-size: .95rem; }

/* Méthode */
.h3d-process { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.h3d-steps { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.home-3d .h3d-steps button {
    width: 100%; display: flex; gap: 14px; align-items: center; text-align: left;
    background: #fff; color: var(--h3d-ink); border: 1px solid var(--h3d-line); border-radius: 12px;
    padding: 14px 16px; min-height: 56px; font-size: 1.05rem; box-shadow: var(--h3d-shadow);
}
.home-3d .h3d-steps button:hover { background: var(--h3d-bg); }
.h3d-steps button span {
    font-family: var(--h3d-mono); font-size: .8rem; width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center; background: var(--h3d-mint); color: var(--h3d-teal); flex: none;
}
.home-3d .h3d-steps button[aria-selected="true"] { border: 2px solid var(--h3d-teal); }
.h3d-steps button[aria-selected="true"] span { background: var(--h3d-teal); color: #fff; }
.h3d-panel {
    background: #fff; border: 1px solid var(--h3d-line); border-radius: 18px; padding: 30px;
    display: grid; grid-template-columns: 1fr 260px; gap: 28px; align-items: center;
    box-shadow: var(--h3d-shadow); min-width: 0;
}
.h3d-panel[hidden] { display: none; }
.h3d-panel h3 { font-size: 1.6rem; color: var(--h3d-slate); margin: 0 0 10px; }
.h3d-panel p { color: var(--h3d-muted); }
.h3d-panel ul { margin: 14px 0; padding-left: 20px; color: var(--h3d-ink); }
.h3d-panel li { margin-bottom: 4px; }
.h3d-price { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--h3d-teal) !important; margin-bottom: 8px; }
.h3d-link { display: inline-block; margin-right: 18px; color: var(--h3d-teal); font-weight: 700; text-underline-offset: 3px; }
.h3d-media { border-radius: 14px; overflow: hidden; background: var(--h3d-ink); max-width: 100%; }
.h3d-media img, .h3d-media video { display: block; width: 100%; height: auto; max-height: 360px; object-fit: cover; }
.h3d-media--svg { background: var(--h3d-mint); color: var(--h3d-teal); padding: 30px; aspect-ratio: 1; }
.h3d-media--svg svg { width: 100%; height: 100%; }

/* Réalisations */
.h3d-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.home-3d .h3d-filters button {
    font: 700 .92rem 'Nunito Sans', system-ui, sans-serif; padding: 10px 18px; min-height: 44px;
    border-radius: 999px; border: 1px solid var(--h3d-line); background: #fff; color: var(--h3d-slate);
}
.home-3d .h3d-filters button:hover { border-color: var(--h3d-teal-light); background: #fff; }
.home-3d .h3d-filters button[aria-pressed="true"] { background: var(--h3d-teal); border-color: var(--h3d-teal); color: #fff; }
.h3d-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.h3d-work {
    display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--h3d-line);
    border-radius: var(--h3d-radius); overflow: hidden; box-shadow: var(--h3d-shadow);
    transition: transform .25s, box-shadow .25s;
}
.h3d-work:hover { transform: translateY(-4px); box-shadow: 0 16px 34px -16px rgba(49,73,87,.45); }
.h3d-work[hidden] { display: none !important; }
.h3d-pic { aspect-ratio: 4 / 3; max-width: 100%; overflow: hidden; background: var(--h3d-mint); }
.h3d-pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.h3d-work:hover .h3d-pic img { transform: scale(1.05); }
.h3d-meta { padding: 16px 18px; display: grid; gap: 4px; }
.h3d-tag { font-family: var(--h3d-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--h3d-teal); }
.h3d-meta h3 { font-size: 1.1rem; color: var(--h3d-slate); margin: 0; }
.h3d-meta p { font-weight: 700; color: var(--h3d-teal); }

/* Matériaux */
.h3d-materials { display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; align-items: center; }
.h3d-mat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.home-3d .h3d-mat-tabs button {
    font-size: 1rem; padding: 10px 22px; min-height: 44px; border-radius: 12px;
    border: 2px solid var(--h3d-line); background: var(--h3d-bg); color: var(--h3d-ink);
}
.home-3d .h3d-mat-tabs button:hover { background: #fff; }
.home-3d .h3d-mat-tabs button[aria-selected="true"] { border-color: var(--h3d-teal); background: var(--h3d-mint); }
.h3d-mat-card {
    background: #fff; border: 1px solid var(--h3d-line); border-radius: 18px; padding: 28px;
    display: grid; gap: 16px; box-shadow: var(--h3d-shadow); min-width: 0;
}
.h3d-mat-card h3 { font-size: 1.45rem; color: var(--h3d-slate); margin: 0; }
.h3d-mat-card .h3d-btn { justify-self: start; }
.h3d-bar { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; font-size: .92rem; }
.h3d-t { height: 10px; background: var(--h3d-mint); border-radius: 10px; overflow: hidden; }
.h3d-t i { display: block; height: 100%; width: 0; background: var(--h3d-teal); border-radius: 10px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.h3d-mat-use { font-size: .92rem; color: var(--h3d-muted); }
.h3d-spool { display: grid; place-items: center; }
.h3d-spool svg { width: min(280px, 100%); height: auto; }

/* Guide prestation */
.h3d-guide { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: start; }
.h3d-q { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
.h3d-q legend { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 1.15rem; margin-bottom: 10px; color: var(--h3d-slate); }
.h3d-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.h3d-opts label { position: relative; }
.h3d-opts input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.h3d-opts span {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
    border: 1px solid var(--h3d-line); background: #fff; font-weight: 600; font-size: .94rem; cursor: pointer;
    box-shadow: var(--h3d-shadow);
}
.h3d-opts input:checked + span { background: var(--h3d-teal); border-color: var(--h3d-teal); color: #fff; }
.h3d-opts input:focus-visible + span { outline: 3px solid var(--h3d-filament); outline-offset: 2px; }
.h3d-reco {
    background: linear-gradient(135deg, var(--h3d-slate), var(--h3d-teal)); color: #fff;
    border-radius: 18px; padding: 28px; display: grid; gap: 12px; min-width: 0;
}
.h3d-reco h3 { font-size: 1.5rem; color: #fff; margin: 0; }
.h3d-reco p { color: #eaf1f1; }
.h3d-reco .h3d-reco-price { font-family: 'Baloo 2', sans-serif; font-size: 1.2rem; font-weight: 700; color: #fff; }

/* FAQ */
.h3d-faq { display: grid; gap: 10px; max-width: 820px; }
.h3d-faq details { background: #fff; border: 1px solid var(--h3d-line); border-radius: 12px; padding: 0 20px; box-shadow: var(--h3d-shadow); }
.h3d-faq summary {
    cursor: pointer; list-style: none; padding: 18px 0; font-family: 'Baloo 2', sans-serif;
    font-weight: 700; font-size: 1.08rem; color: var(--h3d-slate); display: flex; justify-content: space-between; gap: 12px;
}
.h3d-faq summary::-webkit-details-marker { display: none; }
.h3d-faq summary::after { content: "+"; color: var(--h3d-teal); font-size: 1.4rem; line-height: 1; }
.h3d-faq details[open] summary::after { content: "–"; }
.h3d-faq details p { padding-bottom: 18px; color: var(--h3d-muted); }
.h3d-faq a { color: var(--h3d-teal); font-weight: 700; }

/* CTA final */
.h3d-cta {
    background: linear-gradient(135deg, var(--h3d-slate), var(--h3d-teal)); color: #fff;
    border-radius: 24px; padding: 44px 40px; display: flex; justify-content: space-between;
    align-items: center; gap: 24px; flex-wrap: wrap;
}
.h3d-cta h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.3rem); margin: 0 0 6px; }
.h3d-cta p { color: #eaf1f1; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1000px) {
    .h3d-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .h3d-hero-grid { grid-template-columns: 1fr; }
    .h3d-lead { max-width: none; }
    .h3d-specs-grid { grid-template-columns: repeat(2, 1fr); }
    .h3d-process { grid-template-columns: 1fr; }
    .h3d-panel { grid-template-columns: 1fr; }
    .h3d-gallery { grid-template-columns: repeat(2, 1fr); }
    .h3d-materials { grid-template-columns: 1fr; }
    .h3d-spool { order: -1; }
    .h3d-spool svg { width: 170px; }
    .h3d-guide { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    /* style.css arrondit .hero sur mobile : on garde notre bandeau plein écran */
    .h3d-section { padding: 56px 0; }
    .h3d-hero-grid { padding-top: 32px; padding-bottom: 40px; }
    .h3d-cta { padding: 32px 22px; }
}
@media (max-width: 560px) {
    .h3d-cards, .h3d-gallery, .h3d-specs-grid { grid-template-columns: 1fr; }
    .h3d-bar { grid-template-columns: 1fr; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
    .home-3d * { transition: none !important; }
}
