/* ============================================================
   Xdoor — Landing page · "Salle des machines"
   Direction: spec-sheet machine room. Matte dark surfaces, hairline
   rules, tabular mono data, one operational accent (status green).
   No gradients, no glass, no icon-tile bento, no kickers.
   ============================================================ */

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

:root {
  --bg: #0d1016;
  --bg-2: #11151c;
  --bg-3: #191e28;
  --panel: #141922;
  --line: #232a35;
  --line-2: #333c4b;
  --text: #edeff3;
  --text-2: #b3b6c1;
  --text-3: #8b8f9b;
  --accent: #4fb573;
  --accent-hi: #5fc383;
  --accent-ink: #081309;
  --amber: #d9a441;
  --red: #cf4f47;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;
  --r-sm: 6px;
  --r-md: 10px;
  --maxw: 1180px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

::selection { background: rgba(79, 181, 115, 0.3); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: var(--bg); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------
   Nav
   ------------------------------------------------------------ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 56px);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.nav.scrolled {
  background: rgba(13, 16, 22, 0.88);
  border-bottom-color: var(--line);
}

/* ------------------------------------------------------------
   Fond shadergradient plein écran (salle des machines, sobre)
   Base CSS affichée dès le premier paint, le shader WebGL se
   superpose en fondu quand il est prêt (aucun "chargement").
   ------------------------------------------------------------ */
.sg-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(70% 58% at 50% 6%, rgba(47, 143, 90, 0.32) 0%, transparent 62%),
    radial-gradient(52% 42% at 82% 78%, rgba(23, 82, 68, 0.34) 0%, transparent 60%),
    radial-gradient(42% 38% at 16% 68%, rgba(30, 90, 72, 0.26) 0%, transparent 58%),
    linear-gradient(180deg, #122018 0%, #0b120e 100%);
  animation: sgDrift 40s ease-in-out infinite alternate;
}
.sg-bg canvas {
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.sg-bg.ready canvas { opacity: 1; }

/* Voile léger au-dessus du shader pour garder la lisibilité
   sans masquer l'animation */
.sg-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(72% 55% at 50% -6%, rgba(13, 16, 22, 0.05) 0%, rgba(13, 16, 22, 0.20) 55%, rgba(13, 16, 22, 0.40) 100%);
}

/* Fallback CSS si WebGL indisponible (même ambiance, doucement animé) */
.sg-bg.sg-fallback {
  animation: sgDrift 40s ease-in-out infinite alternate;
}
@keyframes sgDrift {
  0%   { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.nav-logo img { width: 28px; height: 28px; object-fit: contain; }
.nav-logo b { font-weight: 700; color: var(--text); }
.nav-logo em {
  font-style: normal;
  color: var(--accent);
}

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--r-sm);
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--bg-3); }

.nav-cta {
  margin-left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--r-sm);
  border: 1px solid var(--accent);
  transition: background 0.2s, border-color 0.2s;
}
.nav-cta:hover { background: var(--accent-hi); border-color: var(--accent-hi); }

/* ------------------------------------------------------------
   Hero — first viewport: thesis + preuve connectée
   L'aperçu du panel passe derrière le titre, comme un écran
   allumé sous le texte.
   ------------------------------------------------------------ */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 150px clamp(24px, 6vw, 56px) 72px;
  overflow: hidden;
}

/* Lumière haute froide, neutre */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 48% at 50% -8%, rgba(255, 255, 255, 0.045), transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-copy {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 880px;
  text-shadow: 0 1px 2px rgba(13, 16, 22, 0.85), 0 6px 34px rgba(13, 16, 22, 0.6);
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(40px, 6vw, 78px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.hero h1 .hl { font-weight: 400; color: var(--text-2); }

.hero-under {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 880px;
  margin-top: 28px;
}

.hero-sub {
  max-width: 56ch;
  margin: 0 auto 32px;
  font-size: clamp(15.5px, 1.5vw, 17.5px);
  color: var(--text-2);
  line-height: 1.75;
}
.hero-sub code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--accent);
  background: rgba(79, 181, 115, 0.09);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(79, 181, 115, 0.18);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-primary {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn-ghost {
  color: var(--text);
  background: transparent;
  border-color: var(--line-2);
}
.btn-ghost:hover { background: var(--bg-3); border-color: var(--text-3); }

/* ------------------------------------------------------------
   Aperçu du panel — la preuve connectée derrière le titre
   ------------------------------------------------------------ */
.dash {
  position: relative;
  z-index: 2;
  width: min(820px, 100%);
  margin-top: -96px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 44px 100px -38px rgba(0, 0, 0, 0.9);
}

/* Fondu haut : l'aperçu émerge en douceur derrière le titre */
.dash::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 150px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(13, 16, 22, 0.45) 55%, transparent 100%);
}

/* Entrée en fondu : l'aperçu apparaît progressivement */
.dash[data-reveal] { transition-duration: 0.9s; }
.dash img { width: 100%; height: auto; display: block; }

/* LEDs de statut */
.led {
  width: 8px; height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--line-2);
}
.led.on { background: var(--accent); box-shadow: 0 0 0 3px rgba(79, 181, 115, 0.13); }
.led.warn { background: var(--amber); box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.13); }
.led.down { background: transparent; border: 1px solid var(--line-2); }

/* ------------------------------------------------------------
   Sections
   ------------------------------------------------------------ */
.section { position: relative; z-index: 1; padding: 110px clamp(24px, 6vw, 56px); }
.shell { max-width: var(--maxw); margin: 0 auto; }

.section-head { margin-bottom: 56px; }
.section-head h2 {
  font-family: var(--display);
  font-size: clamp(34px, 4.4vw, 58px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-bottom: 16px;
}
.section-head p {
  color: var(--text-2);
  font-size: 16.5px;
  line-height: 1.75;
  max-width: 56ch;
}

/* ------------------------------------------------------------
   Features — spec sheet (claim + preuve, pas de bento uniforme)
   ------------------------------------------------------------ */
.features { border-top: 1px solid var(--line); }

.feat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}
.feat.flip .feat-copy { order: 2; }
.feat.flip .feat-proof { order: 1; }

.feat h3 {
  font-family: var(--display);
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.005em;
  margin-bottom: 14px;
}
.feat p { color: var(--text-2); font-size: 16px; line-height: 1.7; max-width: 52ch; }
.feat p + p { margin-top: 10px; }

.feat .f-stat {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}
.feat .f-stat .val { color: var(--accent); }

/* ------------------------------------------------------------
   Preuves (mini-UI dans la grammaire machines)
   ------------------------------------------------------------ */
.proof {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px -28px rgba(0, 0, 0, 0.85);
}
.proof .p-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.proof .p-body { padding: 14px 16px; line-height: 1.9; }
.proof .p-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proof .p-ok { color: var(--accent); }
.proof .p-dim { color: var(--text-3); }
.proof .p-accent { color: var(--amber); }

.proof-rows .p-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
}
.proof-rows .p-row:last-child { border-bottom: 0; }
.p-file { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-flag { margin-left: auto; color: var(--text-3); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.p-flag.ok { color: var(--accent); }
.p-flag.warn { color: var(--amber); }
.p-flag.crit { color: var(--red); }

.meter {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}
.meter i {
  height: 20px;
  flex: 1;
  background: var(--bg-3);
  border-radius: 1px;
}
.meter i.lit { background: var(--accent); }
.meter i.warnlit { background: var(--amber); }

.list-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
}
.list-card:last-child { border-bottom: 0; }
.lc-name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-meta { color: var(--text-3); font-size: 11px; }
.lc-price { margin-left: auto; color: var(--amber); white-space: nowrap; }
.lc-price small { color: var(--text-3); }

/* ------------------------------------------------------------
   Stats — rangée chiffrée, règles hairlines
   ------------------------------------------------------------ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat { padding: 42px 28px 42px 0; }
.stat:not(:last-child) { border-right: 1px solid var(--line); }
.stat-num {
  font-family: var(--mono);
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  margin-top: 8px;
  color: var(--text-3);
  font-size: 13px;
}

/* ------------------------------------------------------------
   Premium
   ------------------------------------------------------------ */
.section-head em { font-style: normal; color: var(--amber); }

.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  max-width: 940px;
  align-items: stretch;
}
.plan {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--r-md);
  overflow: hidden;
}
.plan.featured {
  border-color: var(--line-2);
  box-shadow: 0 22px 50px -30px rgba(0, 0, 0, 0.85);
}
.plan .p-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.plan.featured .p-bar { border-bottom-color: var(--line-2); background: var(--bg-3); }
.plan .p-flag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}
.plan .p-flag.warn { color: var(--amber); }
.plan .p-flag .led.warn { box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.13); }
.plan .p-name {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.plan .p-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px 22px 22px;
}
.plan .p-price {
  font-family: var(--mono);
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.plan .p-price small { font-size: 13px; color: var(--text-3); font-weight: 400; letter-spacing: 0; }
.plan .p-sub {
  color: var(--text-3);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 10px 0 18px;
  min-height: 2.6em;
}
.plan ul {
  list-style: none;
  border-top: 1px solid var(--line);
  margin-bottom: 22px;
}
.plan ul li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-2);
}
.plan ul li .ck,
.plan ul li .cx {
  flex: none;
  width: 22px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1;
}
.plan ul li .ck { color: var(--accent); }
.plan ul li .cx { color: var(--amber); }
.plan ul li b { color: var(--text); font-weight: 600; }
.plan .p-cta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  transition: background 0.2s, border-color 0.2s;
}
.plan .p-cta:hover { background: var(--accent-hi); border-color: var(--accent-hi); }

.p-note {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
}
.p-note i { color: var(--amber); }

/* ------------------------------------------------------------
   CTA finale
   ------------------------------------------------------------ */
.cta-box {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background:
    radial-gradient(60% 90% at 50% 110%, rgba(79, 181, 115, 0.05), transparent 65%),
    var(--panel);
  padding: clamp(48px, 7vw, 84px) clamp(24px, 6vw, 72px);
  text-align: center;
}
.cta-box h2 {
  font-family: var(--display);
  font-size: clamp(34px, 4.6vw, 60px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
  text-wrap: balance;
}
.cta-box p {
  color: var(--text-2);
  font-size: 16px;
  max-width: 46ch;
  margin: 0 auto 36px;
  line-height: 1.75;
}
.cta-box .cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.footer { border-top: 1px solid var(--line); padding: 44px clamp(24px, 6vw, 56px); }
.footer .shell { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 18px; font-weight: 700; }
.footer-logo img { width: 22px; height: 22px; object-fit: contain; }
.footer-logo em { font-style: normal; color: var(--accent); }
.footer-copy { font-size: 12.5px; color: var(--text-3); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 13px; color: var(--text-3); transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }

/* ------------------------------------------------------------
   Reveal on scroll (sobre, unobtrusif)
   ------------------------------------------------------------ */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--d, 0s);
}
[data-reveal].in { opacity: 1; transform: translateY(0); }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 1020px) {
  .hero { padding-top: 130px; }
  .dash { margin-top: -64px; }
  .feat { grid-template-columns: 1fr; gap: 28px; }
  .feat.flip .feat-copy { order: 1; }
  .feat.flip .feat-proof { order: 2; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .plans { grid-template-columns: 1fr; }
  .plan.featured { box-shadow: none; }
}

@media (max-width: 640px) {
  .nav { height: 60px; }
  .nav-link { display: none; }
  .section { padding: 84px 20px; }
  .hero { padding-top: 120px; padding-bottom: 56px; }
  .dash { margin-top: -44px; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .stats { grid-template-columns: 1fr; }
  .stat { border-right: 0 !important; border-bottom: 1px solid var(--line); padding: 26px 0; }
  .stat:last-child { border-bottom: 0; }
  .footer .shell { flex-direction: column; text-align: center; gap: 14px; }
}

/* Motion : accessible */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}
