/* ============================================================================
   EndoriumSpace — site vitrine. Système de design calqué sur l'UI EndoriumFort
   (tokens de frontend/src/ui/theme.css + dégradé de marque bleu→cyan).
   ========================================================================== */

:root {
  /* Marque */
  --brand-start: #3a64f0;
  --brand-end: #26f1ff;
  --priv: #d9650b;

  /* Surfaces & texte (clair) */
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --sub: #f1f3f5;
  --line: #e3e6ea;
  --line-2: #cfd4da;
  --text: #16191d;
  --text-2: #4d5561;
  --muted: #848b96;
  --accent: #3a64f0;
  --accent-bg: #eef2fe;
  --accent-line: #c3d0fb;
  --ok: #1a7f37;
  --ok-bg: #e9f6ec;

  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 24px 60px -24px rgba(16, 24, 40, 0.28);
  --radius: 10px;
  --radius-sm: 6px;
  --maxw: 1140px;

  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --glow: radial-gradient(60% 50% at 50% 0%, rgba(58, 100, 240, 0.18), transparent 70%);
}

:root[data-theme="dark"] {
  --bg: #0f1115;
  --panel: #171a1f;
  --panel-2: #1a1d22;
  --sub: #1d2127;
  --line: #2a2f37;
  --line-2: #3a404a;
  --text: #e7e9ec;
  --text-2: #b4bac3;
  --muted: #858c97;
  --accent: #5b8def;
  --accent-bg: #1a2740;
  --accent-line: #2c4675;
  --ok: #3fb760;
  --ok-bg: #14301d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.7);
  --glow: radial-gradient(60% 50% at 50% 0%, rgba(91, 141, 239, 0.22), transparent 70%);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; color: var(--text-2); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 0.9em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: clamp(56px, 9vw, 110px) 0; }
.center { text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-bg); border: 1px solid var(--accent-line);
  padding: 7px 12px; border-radius: 999px; margin-bottom: 20px;
}
.lead { font-size: 1.15rem; color: var(--text-2); max-width: 46ch; }
.center .lead { margin-left: auto; margin-right: auto; }
.section-head { max-width: 60ch; margin: 0 auto 48px; }

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text);
  font: 600 15px var(--font); cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, filter .15s, transform .15s;
}
.btn:hover { text-decoration: none; background: var(--sub); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn--primary {
  color: #fff; border: 0;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
}
.btn--primary:hover { filter: brightness(1.07); background: linear-gradient(135deg, var(--brand-start), var(--brand-end)); }
.btn--ghost { background: transparent; }
.btn--lg { height: 50px; padding: 0 26px; font-size: 16px; }

/* Header ---------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 1.1rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.brand b { color: var(--priv); font-weight: 600; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--text-2); font-size: 14.5px; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--sub); }
.nav-toggle { display: none; }

/* Hero ------------------------------------------------------------------ */
.hero { position: relative; padding: clamp(60px, 10vw, 120px) 0 clamp(40px, 7vw, 90px); }
.hero::before {
  content: ""; position: absolute; inset: -10% 0 auto 0; height: 600px;
  background: var(--glow); pointer-events: none; z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand-start), var(--brand-end));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { font-size: 1.22rem; max-width: 50ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero-note { margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.hero-note code { color: var(--text-2); }

/* Mock product card */
.mock {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--panel); box-shadow: var(--shadow-lg);
}
.mock-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.mock-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.mock-bar .title { margin-left: 8px; font: 500 12px var(--mono); color: var(--muted); }
.mock-body { padding: 16px; font: 13px/1.7 var(--mono); color: var(--text-2); background: var(--panel); }
.mock-body .l { display: block; white-space: pre-wrap; }
.mock-body .ok { color: var(--ok); }
.mock-body .ac { color: var(--accent); }
.mock-body .pr { color: var(--priv); }

/* Trust bar ------------------------------------------------------------- */
.trust { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel-2); }
.trust .wrap { display: flex; flex-wrap: wrap; gap: 12px 26px; justify-content: center; padding: 22px 20px; }
.chip { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); font-weight: 500; }
.chip svg { color: var(--accent); }

/* Cards / features ------------------------------------------------------ */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); position: relative;
}
.card h3 { display: flex; align-items: center; gap: 10px; }
.card p { margin-bottom: 0; font-size: 14.5px; }
.card .ic { width: 38px; height: 38px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent-line); margin-bottom: 14px; }
.badge { font: 600 10.5px/1 var(--mono); letter-spacing: .06em; padding: 4px 7px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--muted); }
.badge--ce { color: var(--ok); background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.badge--ee { color: var(--priv); background: color-mix(in srgb, var(--priv) 12%, transparent); border-color: color-mix(in srgb, var(--priv) 38%, transparent); }
.card .badge { position: absolute; top: 18px; right: 18px; }

/* Architecture ---------------------------------------------------------- */
.arch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.arch .node { padding: 24px; text-align: center; }
.arch .node + .node { border-left: 1px solid var(--line); }
.arch .node .k { font: 600 12px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.arch .node h3 { margin: 10px 0 6px; }
.arch .node p { font-size: 13.5px; margin: 0; }

/* Editions table -------------------------------------------------------- */
.cmp { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cmp th, .cmp td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.cmp thead th { background: var(--panel-2); font-family: var(--display); }
.cmp tbody td:not(:first-child), .cmp thead th:not(:first-child) { text-align: center; width: 160px; }
.cmp td:first-child { color: var(--text); font-weight: 500; }
.cmp tr:last-child td { border-bottom: 0; }
.cmp .yes { color: var(--ok); font-weight: 700; }
.cmp .no { color: var(--muted); }
.cmp .plan { font-family: var(--display); font-size: 1.1rem; }
.cmp .price { font: 500 13px var(--mono); color: var(--muted); }

/* Compliance ------------------------------------------------------------ */
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
.pill { border: 1px solid var(--line-2); background: var(--panel); border-radius: 999px; padding: 9px 16px; font: 600 13px var(--font); color: var(--text-2); }
.disclaimer { margin-top: 20px; font-size: 13px; color: var(--muted); max-width: 70ch; margin-inline: auto; }

/* Code blocks ----------------------------------------------------------- */
.code {
  position: relative; background: #0d1017; color: #d7dbe3; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 46px 18px 18px; overflow-x: auto;
  font: 13.5px/1.7 var(--mono); box-shadow: var(--shadow);
}
:root:not([data-theme="dark"]) .code { background: #0d1017; color: #d7dbe3; }
.code .c { color: #7d8595; }
.code .t { color: #57c7ff; }
.copy { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #2a2f37; background: #171a1f; color: #b4bac3; border-radius: 6px; cursor: pointer; }
.copy:hover { background: #1d2127; }
.deploy-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.deploy-tabs button { height: 36px; padding: 0 14px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2); border-radius: var(--radius-sm); font: 600 13.5px var(--font); cursor: pointer; }
.deploy-tabs button[aria-selected="true"] { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-line); }
.deploy-panel[hidden] { display: none; }

/* FAQ ------------------------------------------------------------------- */
.faq { max-width: 820px; margin: 0 auto; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 18px; font-family: var(--display); font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; }
.faq details[open] summary::after { content: "–"; }
.faq .a { padding: 0 18px 16px; color: var(--text-2); font-size: 14.5px; }

/* CTA band -------------------------------------------------------------- */
.cta-band { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: clamp(32px, 6vw, 64px); text-align: center; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.cta-band::before { content: ""; position: absolute; inset: auto 0 -40% 0; height: 300px; background: var(--glow); }
.cta-band > * { position: relative; }

/* Footer ---------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); background: var(--panel-2); padding: 48px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.footer a { display: block; color: var(--text-2); font-size: 14px; padding: 4px 0; }
.footer a:hover { color: var(--text); text-decoration: none; }
.footer .legal { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); }

/* Reveal animation ------------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* Responsive ------------------------------------------------------------ */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .mock { max-width: 520px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .arch { grid-template-columns: 1fr; }
  .arch .node + .node { border-left: 0; border-top: 1px solid var(--line); }
  .nav-links { display: none; }
  .nav-toggle { display: inline-grid; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--panel); border-bottom: 1px solid var(--line); padding: 14px 20px; gap: 6px;
  }
  .nav-links.open a { padding: 8px 0; }
}
@media (max-width: 560px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cmp { font-size: 13px; }
  .cmp th, .cmp td { padding: 11px 12px; }
  .cmp tbody td:not(:first-child), .cmp thead th:not(:first-child) { width: auto; }
}

/* ── Calculateur de dimensionnement (#sizing) ─────────────────────────────── */
.sz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; text-align: left; }
.sz-presets { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 22px; }
.sz-presets button[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-line); }
.sz > * { min-width: 0; }
.sz fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.sz fieldset:last-child { margin-bottom: 0; }
.sz legend { font: 600 12px var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.sz-row { display: grid; grid-template-columns: 1fr 170px; align-items: center; gap: 12px; padding: 4px 0; font-size: 14.5px; }
.sz-row small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.sz input[type="number"], .sz select {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--panel-2); color: var(--text); font: 14px var(--font);
}
.sz input:focus-visible, .sz select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sz-check { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 14.5px; }
.sz-result h3 { margin-top: 0; }
.sz-profile { color: var(--accent); }
.sz-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.sz-kpi { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--panel-2); }
.sz-kpi b { display: block; font: 700 1.55rem/1.2 var(--display); font-variant-numeric: tabular-nums; }
.sz-kpi span { display: block; color: var(--text-2); font-size: 13px; }
.sz-kpi small { display: block; color: var(--muted); font-size: 12px; }
.sz table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sz td { padding: 5px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text-2); }
.sz td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.sz-warn { margin: 10px 0 0; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13.5px;
  background: rgba(217, 101, 11, .1); color: var(--priv); border: 1px solid rgba(217, 101, 11, .3); }
.sz-settings { margin-top: 18px; }
.sz-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.sz-tabs button { height: 36px; padding: 0 14px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2); border-radius: var(--radius-sm); font: 600 13.5px var(--font); cursor: pointer; }
.sz-tabs button[aria-selected="true"] { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-line); }
.sz-settings .code { white-space: pre; padding-right: 18px; font-size: 12.5px; }
.sz-note { margin-top: 18px; font-size: 13.5px; color: var(--muted); }
@media (max-width: 900px) { .sz { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .sz-row { grid-template-columns: 1fr 130px; } .sz-kpis { grid-template-columns: 1fr; } }
