/* =========================================================
   Ryujin IT — Design tokens
   Palette : fond violet-noir profond, accent violet, accent or (chaleur/confiance)
   Typo : Syne (titres, caractère) + DM Sans (corps, lisibilité — important pour public senior)
   ========================================================= */
:root {
    --bg: #0D0A16;
    --surface: #171227;
    --surface-2: #1F1833;
    --border: #2E2748;

    --accent: #8B5CF6;
    --accent-light: #B794F6;
    --accent-gold: #F0B429;

    --text: #EDEAF6;
    --text-muted: #A79FC4;

    --font-display: 'Syne', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    --radius: 14px;
    --radius-sm: 8px;
    --max-width: 1140px;

    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2.5rem;
    --space-5: 4rem;
    --space-6: 6rem;
}

/* Reset minimal */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 var(--space-2);
}
p { margin: 0 0 var(--space-3); }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-3);
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--accent);
    color: #fff;
    padding: 0.75rem 1.25rem;
    z-index: 999;
    border-radius: var(--radius-sm);
}
.skip-link:focus {
    left: var(--space-2);
    top: var(--space-2);
}

/* Focus visible partout — accessibilité */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 2px;
}

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

/* =========================================================
   Header
   ========================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200 !important;
    background: rgba(13, 10, 22, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.logo-text {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: 0.02em;
}
.logo-text.small { font-size: 1.1rem; }

.logo-dragon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.35));
}

.circuit-node {
    fill: #0D0A16;
    stroke: #F0B429;
    stroke-width: 1.5;
    animation: pulse-node 2.4s ease-in-out infinite;
}
@keyframes pulse-node {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; filter: drop-shadow(0 0 4px #F0B429); }
}
@media (prefers-reduced-motion: reduce) {
    .circuit-node { animation: none; opacity: 0.85; }
}

/* Points décoratifs présents en fond sur toutes les pages */
.site-bg-nodes {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}
.bg-node {
    fill: #0D0A16;
    stroke: #F0B429;
    stroke-width: 1.4;
    opacity: 0.45;
    animation: drift-node 14s ease-in-out infinite;
}
@keyframes drift-node {
    0%   { transform: translate(0, 0); opacity: 0.2; }
    25%  { transform: translate(30px, -20px); opacity: 0.6; }
    50%  { transform: translate(60px, 10px); opacity: 0.2; }
    75%  { transform: translate(20px, 30px); opacity: 0.6; }
    100% { transform: translate(0, 0); opacity: 0.2; }
}
@media (prefers-reduced-motion: reduce) {
    .bg-node { animation: none; opacity: 0.35; }
}
@media (max-width: 640px) {
    .site-bg-nodes { display: none; } /* évite la surcharge visuelle sur petit écran */
}

/* S'assure que le contenu du site reste au-dessus du calque de fond */
.site-header, main, .site-footer { position: relative; z-index: 1; }

.primary-nav ul {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}
.primary-nav a {
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}
.primary-nav a:hover, .primary-nav a.is-active {
    color: var(--text);
}
.btn-nav-cta {
    background: var(--accent);
    color: #fff !important;
    padding: 0.6rem 1.3rem;
    border-radius: var(--radius-sm);
    font-weight: 700 !important;
}
.btn-nav-cta:hover { background: var(--accent-light); }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   Boutons & composants génériques
   ========================================================= */
.btn {
    display: inline-block;
    padding: 0.9rem 1.8rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: transform 0.15s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent-gold); color: #1A1233; }
.btn-primary:hover { background: #f5c559; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent-light); }

.eyebrow {
    display: inline-block;
    color: var(--accent-gold);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: var(--space-2);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
    padding: var(--space-6) 0 var(--space-5);
    background:
        radial-gradient(600px circle at 85% 0%, rgba(139, 92, 246, 0.18), transparent 60%),
        radial-gradient(500px circle at 0% 100%, rgba(240, 180, 41, 0.08), transparent 60%);
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-5);
    align-items: center;
}
.hero h1 {
    font-size: clamp(2.2rem, 4vw, 3.2rem);
}
.hero-lead {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 46ch;
}
.hero-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-top: var(--space-3);
}
.hero-trust {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-4);
    flex-wrap: wrap;
}
.hero-trust li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.hero-trust li::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-gold);
    flex-shrink: 0;
}
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-dragon-stage {
    position: relative;
    width: 100%;
    max-width: 380px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-circuit {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.hero-dragon {
    position: relative;
    z-index: 2;
    width: 88%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 40px rgba(139, 92, 246, 0.35));
}

/* =========================================================
   Grilles de services
   ========================================================= */
.section { padding: var(--space-6) 0; }
.section-header { max-width: 60ch; margin-bottom: var(--space-5); }
.section-header.center { margin-left: auto; margin-right: auto; text-align: center; }

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
}
.service-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.service-card.is-featured {
    border-color: var(--accent);
    background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
}
.service-card.is-full-width {
    margin-bottom: var(--space-3);
    padding: var(--space-4) var(--space-5);
}
.service-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-light);
}
.service-card.is-featured .service-icon {
    background: var(--accent);
    color: #fff;
}
.service-card h3 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.service-card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0; }
.badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================================================
   CTA bandeau
   ========================================================= */
.cta-band {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: var(--space-5) 0;
    text-align: center;
}
.cta-band h2 { margin-bottom: var(--space-1); }
.cta-band p { color: var(--text-muted); margin-bottom: var(--space-3); }

/* =========================================================
   Formulaire de contact
   ========================================================= */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    align-items: start;
}
.form-group { margin-bottom: var(--space-3); }
label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}
input, textarea, select {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--accent-light);
}
textarea { resize: vertical; min-height: 140px; }
.form-note { font-size: 0.85rem; color: var(--text-muted); margin-top: var(--space-1); }
.alert {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-3);
    font-weight: 500;
}
.alert-success { background: rgba(46, 204, 113, 0.12); border: 1px solid rgba(46, 204, 113, 0.4); color: #7EE2A8; }
.alert-error { background: rgba(240, 71, 71, 0.12); border: 1px solid rgba(240, 71, 71, 0.4); color: #F58C8C; }

.contact-info-list { margin-top: var(--space-3); }
.contact-info-list li { padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.contact-info-list li:last-child { border-bottom: none; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    margin-top: var(--space-6);
}
.footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: var(--space-4);
    padding: var(--space-5) 0 var(--space-4);
}
.footer-brand p { color: var(--text-muted); font-size: 0.95rem; }
.footer-links h3, .footer-contact h3 {
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}
.footer-links li, .footer-contact li { margin-bottom: 0.5rem; }
.footer-links a, .footer-contact a { color: var(--text); }
.footer-links a:hover, .footer-contact a:hover { color: var(--accent-light); }
.footer-bottom { border-top: 1px solid var(--border); }
.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: var(--space-1);
}
.footer-bottom-inner a:hover { color: var(--accent-light); }
.footer-cookie-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--font-body);
    cursor: pointer;
    text-decoration: underline;
}
.footer-cookie-link:hover { color: var(--accent-light); }

/* =========================================================
   Bandeau cookies (RGPD)
   ========================================================= */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: var(--surface-2);
    border-top: 1px solid var(--accent-gold);
    box-shadow: 0 -8px 24px rgba(0,0,0,0.35);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-3) var(--space-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.cookie-banner-inner p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
    flex: 1 1 380px;
}
.cookie-banner-inner a { color: var(--accent-light); }
.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}
.cookie-banner-actions .btn {
    padding: 0.65rem 1.3rem;
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .cookie-banner-inner { flex-direction: column; align-items: stretch; text-align: center; }
    .cookie-banner-actions { justify-content: center; }
}

/* Page simple (à propos, mentions légales) */
.prose { max-width: 68ch; }
.prose h2 { margin-top: var(--space-4); }
.prose p { color: var(--text-muted); }
.prose ul { list-style: disc; padding-left: 1.4rem; color: var(--text-muted); margin-bottom: var(--space-3); }
.prose li { margin-bottom: 0.4rem; }

/* =========================================================
   Crédit d'impôt / Agrément SAP
   ========================================================= */
.sap-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--surface);
    border: 1px solid var(--accent-gold);
    border-radius: 999px;
    padding: 0.5rem 1.1rem 0.5rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: var(--space-2);
}
.sap-badge img.sap-badge-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    flex-shrink: 0;
}

.credit-highlight {
    background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin: var(--space-4) 0;
}
.credit-highlight h2 { margin-bottom: 0.5rem; }
.credit-highlight p { color: var(--text-muted); margin-bottom: 0; }

.credit-example {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin: var(--space-4) 0;
    flex-wrap: wrap;
    text-align: center;
}
.credit-example .figure { display: flex; flex-direction: column; gap: 0.3rem; }
.credit-example .figure .amount {
    font-family: var(--font-display);
    font-size: 2.2rem;
}
.credit-example .figure .amount.is-final { color: var(--accent-gold); }
.credit-example .figure .label { color: var(--text-muted); font-size: 0.85rem; }
.credit-example .arrow {
    font-size: 1.6rem;
    color: var(--accent-light);
    font-family: var(--font-display);
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-top: var(--space-4);
}
.compare-card { display: flex; flex-direction: column; gap: var(--space-1); }
.compare-card h3 { font-size: 1.2rem; margin-bottom: 0; }
.compare-card .compare-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}
.compare-card.is-recommended {
    border-color: var(--accent-gold);
    background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
}
.compare-card.is-recommended .compare-tag { color: var(--accent-gold); }
.compare-card ul { margin-top: var(--space-1); margin-bottom: 0; }
.compare-card ul li {
    position: relative;
    padding-left: 1.4rem;
    color: var(--text-muted);
    margin-bottom: 0.55rem;
    font-size: 0.95rem;
}
.compare-card ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-gold);
    font-weight: 700;
}
.compare-card .compare-note {
    margin-top: auto;
    padding-top: var(--space-2);
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Tablette */
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-visual { order: -1; }
    .hero-dragon { max-width: 240px; margin: 0 auto; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-layout { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
    .compare-grid { grid-template-columns: 1fr; }
    .credit-example { gap: var(--space-3); }
}

/* Mobile */
@media (max-width: 640px) {
    body { font-size: 16px; }
    .container { padding: 0 var(--space-2); }

    .nav-toggle { display: flex; }
    .primary-nav {
        position: fixed;
        top: 76px;
        left: 0;
        right: 0;
        background: #0D0A16;
        border-bottom: 1px solid var(--border);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        z-index:150;
    }
    .primary-nav.is-open { max-height: 390px; }
    .primary-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: var(--space-2) var(--space-3) var(--space-3);
    }
    .primary-nav li { border-bottom: 1px solid var(--border); }
    .primary-nav li:last-child { border-bottom: none; padding-top: var(--space-2); }
    .primary-nav a { display: block; padding: var(--space-2) 0; }
    .btn-nav-cta { display: inline-block; text-align: center; }

    .hero { padding: var(--space-5) 0 var(--space-4); }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { text-align: center; width: 100%; }
    .hero-trust { flex-direction: column; gap: var(--space-1); }

    .services-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-bottom-inner { flex-direction: column; text-align: center; }
    .section { padding: var(--space-5) 0; }
}
