/* ==========================================================================
   Domotique Home Assistant : feuille de style
   Palette reprise du theme sombre par defaut de Home Assistant.
   Couleurs de series des graphiques validees (CVD, contraste) sur la
   surface de carte #1c1f24.
   ========================================================================== */

:root {
  --bg:        #101014;
  --bg-deep:   #0a0a0d;
  --card:      #1c1f24;
  --card-2:    #23262d;
  --card-3:    #2b2f37;
  --line:      rgba(255, 255, 255, 0.08);
  --line-2:    rgba(255, 255, 255, 0.14);

  --text:      #e9ebee;
  --text-2:    #9aa1ab;
  --text-3:    #6f7681;

  --accent:    #03a9f4;
  --accent-d:  #0288d1;
  --amber:     #ffa726;
  --amber-s:   #ffca6a;
  --green:     #4caf50;
  --red:       #ef5350;

  --s1: #3987e5;  /* serie 1 : bleu */
  --s2: #d95926;  /* serie 2 : orange */
  --s3: #199e70;  /* serie 3 : vert */

  --r:   14px;
  --r-l: 20px;
  --sh:  0 18px 48px rgba(0, 0, 0, 0.45);
  --ff:  "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fm:  "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--accent); color: #06131b; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

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

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.wrap-wide { max-width: 1340px; }

.section { padding: clamp(62px, 8vw, 116px) 0; }

.sec-head { max-width: 720px; margin-bottom: clamp(32px, 4vw, 52px); }
.sec-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.55rem); }
.sec-head p { margin-top: 14px; color: var(--text-2); font-size: 1.05rem; }
.sec-head code {
  font-family: var(--fm); font-size: .92em; background: var(--card-2);
  padding: 2px 7px; border-radius: 6px; color: var(--amber-s);
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: 11px; border: 1px solid transparent;
  font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.btn i { font-size: 1.2em; }
.btn-primary { background: var(--accent); color: #05141d; }
.btn-primary:hover { background: #29b6f6; transform: translateY(-2px); }
.btn-ghost { border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: #fff; transform: translateY(-2px); }
.btn-sm { padding: 9px 16px; font-size: .92rem; border-radius: 9px; }
.btn-block { width: 100%; justify-content: center; margin-top: 6px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 11px; border-radius: 999px;
  background: rgba(3, 169, 244, .12); color: #7fd3f7;
  font-size: .85rem; font-weight: 500; letter-spacing: .01em;
}
.chip i { font-size: 1.05rem; }

/* ---------- Barre de navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(16, 16, 20, .82);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.05rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(150deg, #03a9f4, #0277bd); color: #fff; font-size: 1.25rem;
}
.brand-txt { font-weight: 300; letter-spacing: .01em; }
.brand-txt strong { font-weight: 700; }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--text-2); font-size: .95rem;
  padding: 8px 13px; border-radius: 9px; transition: color .16s, background .16s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.burger { display: none; background: none; border: 0; font-size: 1.6rem; padding: 4px 6px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 7vw, 92px) 0 clamp(70px, 8vw, 118px); }
.hero-glow {
  position: absolute; inset: -30% -10% auto -10%; height: 780px; pointer-events: none;
  background:
    radial-gradient(46% 52% at 18% 32%, rgba(3, 169, 244, .20), transparent 68%),
    radial-gradient(40% 48% at 82% 18%, rgba(255, 167, 38, .13), transparent 70%);
  filter: blur(6px);
}
.hero-in {
  position: relative; display: grid; grid-template-columns: 1.02fr .98fr;
  gap: clamp(32px, 5vw, 70px); align-items: center;
}
.hero-copy h1 { margin: 18px 0 0; font-size: clamp(2.1rem, 5.2vw, 3.65rem); line-height: 1.07; }
.hero-copy .hl {
  background: linear-gradient(96deg, #4fc3f7, #03a9f4 42%, #ffa726);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { margin-top: 20px; color: var(--text-2); font-size: 1.08rem; max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 34px; margin: 44px 0 0; padding-top: 26px; border-top: 1px solid var(--line); }
.hero-stats dt { color: var(--text-3); font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; }
.hero-stats dd { margin: 5px 0 0; font-size: 1.5rem; font-weight: 700; }

.hero-cards { position: relative; min-height: 430px; }
.hero-cards .ha-card { position: absolute; box-shadow: var(--sh); }
.float-a { top: 0; left: 4%; width: 63%; z-index: 3; }
.float-b { top: 118px; right: 0; width: 54%; z-index: 2; }
.float-c { bottom: 4px; left: 0; width: 58%; z-index: 4; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.float-a { animation: bob 7s ease-in-out infinite; }
.float-b { animation: bob 8.4s ease-in-out infinite .9s; }
.float-c { animation: bob 6.4s ease-in-out infinite .45s; }

/* ==========================================================================
   Cards Home Assistant
   ========================================================================== */
.ha-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  transition: border-color .2s ease, background .2s ease;
}

/* --- Lumiere --- */
.ha-light { display: grid; grid-template-columns: 46px 1fr; gap: 13px; align-items: center; }
.lt-icon {
  width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, .06); color: var(--text-2); font-size: 1.45rem;
  transition: background .2s, color .2s, box-shadow .2s;
}
.ha-light.is-on .lt-icon {
  background: rgba(255, 167, 38, .18); color: var(--amber);
  box-shadow: 0 0 0 1px rgba(255, 167, 38, .25), 0 0 22px rgba(255, 167, 38, .18);
}
.lt-name { font-weight: 500; font-size: .98rem; }
.lt-state { color: var(--text-3); font-size: .85rem; }
.ha-light.is-on .lt-state { color: var(--amber-s); }
.lt-state .dot { opacity: .5; }
.ha-slider { grid-column: 1 / -1; margin-top: 4px; }

input[type="range"].ha-slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 99px;
  background: linear-gradient(90deg, var(--amber) var(--fill, 60%), rgba(255, 255, 255, .10) var(--fill, 60%));
  cursor: pointer;
}
input[type="range"].ha-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
input[type="range"].ha-slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0;
}
.ha-light:not(.is-on) input[type="range"].ha-slider {
  background: linear-gradient(90deg, rgba(255, 255, 255, .22) var(--fill, 25%), rgba(255, 255, 255, .08) var(--fill, 25%));
}

/* --- Climat --- */
.ha-climate { text-align: center; }
.cl-head { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; }
.cl-title { font-weight: 500; display: inline-flex; align-items: center; gap: 7px; }
.cl-title i { color: var(--text-2); }
.cl-mode { color: var(--amber); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; }
.cl-dial {
  position: relative; width: 148px; height: 148px; margin: 14px auto 6px; border-radius: 50%;
  background: conic-gradient(from 220deg,
    var(--amber) 0deg calc(var(--ratio) * 260deg),
    rgba(255, 255, 255, .10) calc(var(--ratio) * 260deg) 260deg,
    transparent 260deg 360deg);
}
.cl-dial::after {
  content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--card);
}
.cl-dial-in {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0;
}
.cl-target { font-size: 2.3rem; font-weight: 300; line-height: 1; }
.cl-unit { font-size: .95rem; color: var(--text-2); margin-top: -2px; }
.cl-current { font-size: .76rem; color: var(--text-3); margin-top: 7px; }
.cl-btns { display: flex; justify-content: center; gap: 10px; margin-top: 4px; }
.cl-btns button {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2);
  background: transparent; color: var(--text); display: grid; place-items: center; font-size: 1.15rem;
  transition: background .16s, border-color .16s;
}
.cl-btns button:hover { background: rgba(255, 167, 38, .14); border-color: rgba(255, 167, 38, .4); }

/* --- Energie (hero) --- */
.ha-energy { display: flex; flex-direction: column; gap: 8px; }
.en-label { color: var(--text-2); font-size: .84rem; display: flex; align-items: center; gap: 7px; }
.en-label i { color: var(--amber); }
.en-value { font-size: 2rem; font-weight: 300; line-height: 1; }
.en-value span { font-size: 1rem; color: var(--text-2); }
.en-spark { display: flex; align-items: flex-end; gap: 3px; height: 46px; }
.en-spark span { flex: 1; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, var(--accent), rgba(3, 169, 244, .25)); }
.en-foot { font-size: .8rem; color: var(--text-3); }
.en-foot strong { color: var(--green); font-weight: 500; }

/* --- Volet --- */
.cv-head, .pp-head, .ss-head, .sc-head, .fl-head, .lg-head, .al-head {
  display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: .95rem; margin-bottom: 12px;
}
.cv-head i, .pp-head i, .ss-head i, .sc-head i, .fl-head i, .lg-head i, .al-head i { color: var(--text-2); font-size: 1.15rem; }
.cv-vis {
  position: relative; height: 88px; border-radius: 9px; overflow: hidden;
  background: linear-gradient(180deg, #2a3a4a, #16212c);
}
.cv-blind {
  position: absolute; inset: 0 0 auto 0; height: calc(var(--pos) * 1%);
  background: repeating-linear-gradient(180deg, #3c424b 0 5px, #333840 5px 8px);
  transition: height .45s ease;
}
.cv-state { margin-top: 10px; font-size: .85rem; color: var(--text-2); }
.cv-btns { display: flex; gap: 8px; margin-top: 10px; }
.cv-btns button {
  flex: 1; height: 34px; border-radius: 9px; border: 1px solid var(--line-2);
  background: transparent; display: grid; place-items: center;
  transition: background .16s, border-color .16s;
}
.cv-btns button:hover { background: rgba(3, 169, 244, .14); border-color: rgba(3, 169, 244, .42); }

/* --- Personnes --- */
.pp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.pp-list li { display: flex; align-items: center; gap: 11px; font-size: .9rem; }
.pp-av {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card-3); color: var(--text-2); font-size: .72rem; font-weight: 500;
}
.pp-av.pp-on { background: rgba(76, 175, 80, .18); color: #81c784; box-shadow: 0 0 0 1px rgba(76, 175, 80, .3); }
.pp-n { flex: 1; }
.pp-s { color: var(--text-3); font-size: .8rem; }
.pp-s.is-home { color: var(--green); }

/* --- Media --- */
.ha-media { display: grid; grid-template-columns: 78px 1fr; gap: 14px; align-items: center; }
.md-art {
  height: 78px; border-radius: 10px; display: grid; place-items: center; font-size: 2rem; color: #90caf9;
  background: linear-gradient(145deg, #1b2a3a, #14202c);
}
.md-sub { color: var(--text-3); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
.md-title { font-weight: 500; margin-top: 2px; }
.md-bar { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .12); margin: 10px 0 8px; }
.md-bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.md-btns { display: flex; align-items: center; gap: 6px; }
.md-btns button {
  width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent;
  color: var(--text-2); display: grid; place-items: center; font-size: 1.1rem;
}
.md-btns button:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.md-btns .is-main { background: rgba(3, 169, 244, .16); color: #4fc3f7; }
.md-time { margin-left: auto; font-size: .76rem; color: var(--text-3); font-family: var(--fm); }

/* --- Scenes --- */
.sc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-b {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 13px 6px;
  border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  font-size: .8rem; color: var(--text-2); transition: all .16s ease;
}
.sc-b i { font-size: 1.35rem; color: var(--text-2); transition: color .16s; }
.sc-b:hover { border-color: rgba(3, 169, 244, .4); color: var(--text); }
.sc-b:hover i { color: var(--accent); }
.sc-b.is-fired { border-color: rgba(255, 167, 38, .55); background: rgba(255, 167, 38, .12); color: var(--amber-s); }
.sc-b.is-fired i { color: var(--amber); }

/* --- Capteurs --- */
.ss-list, .fl-list, .lg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ss-list li, .fl-list li { display: flex; align-items: center; gap: 10px; font-size: .89rem; }
.ss-list i, .fl-list i { color: var(--text-2); font-size: 1.1rem; width: 20px; }
.ss-list span, .fl-list span { flex: 1; color: var(--text-2); }
.ss-list b, .fl-list b { font-weight: 500; font-variant-numeric: tabular-nums; }
.ss-list b.ok, .fl-list b.pos { color: var(--green); }
.ss-list b.warn { color: var(--amber); }

/* --- Jauge --- */
.ha-gauge { text-align: center; }
.gg-label { font-size: .9rem; font-weight: 500; }
.gg {
  position: relative; width: 160px; height: 160px; margin: 16px auto 12px; border-radius: 50%;
  background: conic-gradient(from 220deg,
    var(--green) 0deg calc(var(--val) * 2.6deg),
    rgba(255, 255, 255, .09) calc(var(--val) * 2.6deg) 260deg,
    transparent 260deg 360deg);
}
.gg::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--card); }
.gg-in { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; }
.gg-in span { font-size: 2.4rem; font-weight: 300; line-height: 1; }
.gg-in small { color: var(--text-2); font-size: .9rem; }
.gg-foot { font-size: .8rem; color: var(--text-3); }

/* --- Tuiles dans une card --- */
.ha-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ha-tiles-4 { grid-template-columns: repeat(4, 1fr); }
.tl {
  display: flex; align-items: center; gap: 11px; padding: 12px;
  border-radius: 11px; background: rgba(255, 255, 255, .035);
}
.tl i { font-size: 1.4rem; color: var(--accent); }
.tl b { display: block; font-weight: 500; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.tl span { font-size: .76rem; color: var(--text-3); }

/* --- Camera --- */
.ha-cam { padding: 0; overflow: hidden; }
.cam-wrap { position: relative; aspect-ratio: 16 / 9; background: #0c0f13; overflow: hidden; }
.cam-wrap img { width: 100%; height: 100%; object-fit: cover; }
/* Grain et vignettage discrets, comme sur un flux video compresse */
.cam-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(115% 115% at 50% 45%, transparent 52%, rgba(0, 0, 0, .55) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
}
.cam-ts {
  position: absolute; bottom: 10px; right: 10px; padding: 3px 8px; border-radius: 6px;
  background: rgba(10, 12, 15, .72); font-family: var(--fm); font-size: .7rem; color: var(--text-2);
  z-index: 1;
}
.cam-live, .cam-name { z-index: 1; }
.cam-live {
  position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 6px; background: rgba(10, 12, 15, .72);
  font-size: .68rem; letter-spacing: .1em; font-weight: 500;
}
.cam-live i { color: var(--red); font-size: .8rem; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.cam-name {
  position: absolute; bottom: 10px; left: 10px; padding: 3px 8px; border-radius: 6px;
  background: rgba(10, 12, 15, .72); font-family: var(--fm); font-size: .7rem; color: var(--text-2);
}
.cam-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; font-size: .82rem; color: var(--text-2); }
.cam-foot i { color: var(--amber); }
.cam-btn { background: transparent; border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 11px; font-size: .8rem; }
.cam-btn:hover { border-color: var(--accent); }

/* --- Alarme --- */
.al-state { font-size: 1.1rem; font-weight: 500; color: var(--amber); margin-bottom: 14px; }
.al-btns { display: flex; gap: 8px; }
.al-btns button {
  flex: 1; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--line-2);
  background: transparent; font-size: .78rem; display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.al-btns button i { font-size: 1.2rem; color: var(--text-2); }
.al-btns .is-main { border-color: rgba(255, 167, 38, .5); background: rgba(255, 167, 38, .12); color: var(--amber-s); }
.al-btns .is-main i { color: var(--amber); }
.al-btns button:hover { border-color: var(--accent); }

/* --- Journal --- */
.lg-list li { font-size: .84rem; color: var(--text-2); }
.lg-list b { color: var(--text); font-family: var(--fm); font-size: .78rem; margin-right: 8px; font-weight: 500; }
.lg-list i { color: var(--text-3); font-style: italic; }

/* ==========================================================================
   Application Home Assistant reconstituee
   ========================================================================== */
.section-dash { background: var(--bg-deep); }
.ha-app {
  display: grid; grid-template-columns: 58px 1fr;
  border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
.ha-side {
  background: var(--card); display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 12px 0; border-right: 1px solid var(--line);
}
.ha-side-logo { color: var(--accent); font-size: 1.7rem; margin-bottom: 10px; }
.ha-side-i {
  width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent;
  color: var(--text-3); font-size: 1.25rem; display: grid; place-items: center;
}
.ha-side-i:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.ha-side-i.is-active { color: var(--accent); background: rgba(3, 169, 244, .12); }
.ha-side-sp { flex: 1; }

.ha-appbar {
  display: flex; align-items: center; gap: 18px; height: 58px; padding: 0 16px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.ha-title { font-weight: 500; font-size: 1.02rem; }
.ha-tabs { display: flex; gap: 2px; margin-left: auto; }
.ha-tabs button {
  border: 0; background: transparent; color: var(--text-3); padding: 9px 15px;
  border-radius: 9px; font-size: .9rem; transition: color .16s, background .16s;
}
.ha-tabs button:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.ha-tabs button.is-active { color: var(--accent); background: rgba(3, 169, 244, .12); }
.ha-appbar-r { color: var(--text-3); font-size: 1.25rem; }

.ha-view { display: none; padding: 18px; background: var(--bg); }
.ha-view.is-active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.ha-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; align-items: start; }
.ha-grid .ha-media, .ha-grid .ha-cam, .ha-grid .ha-tiles { grid-column: span 2; }
.ha-grid .ha-log { grid-column: span 2; }

.dash-note { margin-top: 18px; font-size: .82rem; color: var(--text-3); text-align: center; }

/* ==========================================================================
   Galerie
   ========================================================================== */
.gal { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 2.6vw, 34px); }
.gal-item { margin: 0; }
.gal-wide { grid-column: 1 / -1; }
.gal-demo {
  background: linear-gradient(160deg, #17191e, #121317);
  border: 1px solid var(--line); border-radius: var(--r-l);
  padding: clamp(22px, 3vw, 38px); display: grid; place-items: center;
}
.gal-demo .ha-card { width: 100%; max-width: 380px; background: var(--card-2); }
.gal-demo-row .ha-card { max-width: 100%; }
.gal-demo-flush { padding: 0; overflow: hidden; }
.gal-demo-flush .ha-card { max-width: 100%; border: 0; border-radius: 0; }
.gal-item figcaption { padding: 20px 4px 0; }
.gal-item h3 { font-size: 1.2rem; }
.gal-item figcaption p { margin-top: 8px; color: var(--text-2); font-size: .95rem; }

/* ==========================================================================
   Une soiree
   ========================================================================== */
.eve { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 5vw, 72px); align-items: center; }
.eve-visual { position: relative; padding-bottom: 46px; }
.eve-photo { margin: 0; position: relative; border-radius: var(--r-l); overflow: hidden; box-shadow: var(--sh); }
.eve-photo img { width: 100%; height: auto; }
.eve-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8, 9, 12, .12) 0%, rgba(8, 9, 12, .70) 100%);
}
.eve-photo figcaption {
  position: absolute; left: 16px; bottom: 14px; z-index: 1;
  font-family: var(--fm); font-size: .78rem; color: var(--text-2);
  background: rgba(10, 12, 15, .6); padding: 4px 10px; border-radius: 7px;
}
.eve-card {
  position: absolute; right: 0; bottom: 0; width: min(300px, 78%);
  background: var(--card-2); box-shadow: var(--sh);
}
.eve-copy h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); margin: 16px 0 14px; }
.eve-copy > p { color: var(--text-2); }
.eve-time { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.eve-time li { display: grid; grid-template-columns: 62px 1fr; gap: 16px; align-items: baseline; }
.eve-time time { font-family: var(--fm); font-size: .95rem; color: var(--accent); font-weight: 500; }
.eve-time strong { display: block; font-weight: 500; margin-bottom: 2px; }
.eve-time div { font-size: .9rem; color: var(--text-2); }

/* ==========================================================================
   Automatisations
   ========================================================================== */
.section-auto { background: var(--bg-deep); }
.auto { display: grid; grid-template-columns: 355px 1fr; gap: clamp(20px, 2.6vw, 32px); align-items: start; }
.auto-list { display: flex; flex-direction: column; gap: 10px; }
.auto-b {
  display: flex; align-items: flex-start; gap: 13px; text-align: left; padding: 16px;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--card);
  transition: border-color .18s, background .18s, transform .18s;
}
.auto-b i { font-size: 1.35rem; color: var(--text-3); margin-top: 2px; transition: color .18s; }
.auto-b span { display: flex; flex-direction: column; gap: 3px; font-size: .84rem; color: var(--text-3); }
.auto-b strong { font-size: .99rem; font-weight: 500; color: var(--text); }
.auto-b:hover { border-color: var(--line-2); transform: translateX(3px); }
.auto-b.is-active { background: rgba(3, 169, 244, .10); border-color: rgba(3, 169, 244, .45); }
.auto-b.is-active i { color: var(--accent); }

.auto-code { border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; background: #14161a; }
.code-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px; background: var(--card); border-bottom: 1px solid var(--line);
}
.code-file { display: inline-flex; align-items: center; gap: 8px; font-family: var(--fm); font-size: .82rem; color: var(--text-2); }
.code-copy {
  display: inline-flex; align-items: center; gap: 7px; background: transparent;
  border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 11px; font-size: .78rem; color: var(--text-2);
}
.code-copy:hover { border-color: var(--accent); color: var(--text); }

.code { display: none; margin: 0; padding: 20px 22px; overflow-x: auto; max-height: 560px; }
.code.is-active { display: block; }
.code code { font-family: var(--fm); font-size: .84rem; line-height: 1.75; color: #c9d1d9; white-space: pre; }
.y-key { color: #6fc9ff; }
.y-str { color: #ffc27a; }
.y-num { color: #a5d6a7; }
.y-bool { color: #d3a6ff; }
.y-dash { color: #7f8892; }
.y-com { color: #6a727d; font-style: italic; }

/* ==========================================================================
   Graphiques
   ========================================================================== */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.tile {
  display: flex; flex-direction: column; gap: 6px; padding: 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
}
.tile-l { font-size: .8rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; }
.tile-v { font-size: 2.05rem; font-weight: 300; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tile-v em { font-style: normal; font-size: .95rem; color: var(--text-2); }
.tile-d { font-size: .8rem; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.tile-d.pos { color: var(--green); }
.tile-d.neg { color: #7fd3f7; }

.chart-card {
  margin: 0 0 22px; padding: clamp(18px, 2.2vw, 26px);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l);
}
.chart-card figcaption { margin-bottom: 18px; }
.chart-card h3 { font-size: 1.12rem; }
.chart-card figcaption p { margin-top: 6px; color: var(--text-3); font-size: .88rem; }
.chart-box { position: relative; }
.chart-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.chart-duo .chart-card { margin-bottom: 0; }

.tbl-toggle {
  margin-top: 16px; background: transparent; border: 1px solid var(--line-2);
  border-radius: 9px; padding: 7px 14px; font-size: .8rem; color: var(--text-2);
}
.tbl-toggle:hover { border-color: var(--accent); color: var(--text); }
.tbl { margin-top: 14px; overflow-x: auto; }
.tbl table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.tbl th, .tbl td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { color: var(--text-3); font-weight: 500; }

.data-note { font-size: .82rem; color: var(--text-3); margin-top: 18px; }

/* ==========================================================================
   Contact
   ========================================================================== */
.section-cta { background: var(--bg-deep); }
.cta {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 4vw, 56px);
  align-items: start; padding: clamp(28px, 4vw, 52px);
  border: 1px solid var(--line); border-radius: var(--r-l);
  background:
    radial-gradient(70% 120% at 8% 0%, rgba(3, 169, 244, .13), transparent 62%),
    radial-gradient(60% 100% at 100% 100%, rgba(255, 167, 38, .09), transparent 60%),
    var(--card);
}
.cta-copy h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); margin: 16px 0 14px; }
.cta-copy > p { color: var(--text-2); }
.cta-list { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.cta-list li { display: flex; gap: 14px; align-items: flex-start; }
.cta-list i { font-size: 1.4rem; color: var(--accent); margin-top: 1px; }
.cta-list strong { display: block; font-weight: 500; margin-bottom: 3px; }
.cta-list div { font-size: .9rem; color: var(--text-2); }

.cta-form { background: rgba(10, 11, 14, .5); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.cta-form h3 { font-size: 1.15rem; margin-bottom: 16px; }
.cta-form label { display: block; font-size: .82rem; color: var(--text-2); margin-bottom: 13px; }
.cta-form input, .cta-form select, .cta-form textarea {
  width: 100%; margin-top: 6px; padding: 11px 13px; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--line-2); color: var(--text);
  font-family: inherit; font-size: .92rem; resize: vertical;
}
.cta-form input:focus, .cta-form select:focus, .cta-form textarea:focus { border-color: var(--accent); outline: none; }
.form-note { margin-top: 12px; font-size: .75rem; color: var(--text-3); }

/* ==========================================================================
   Pied de page
   ========================================================================== */
.footer { border-top: 1px solid var(--line); padding: 54px 0 30px; }
.footer-in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 34px; }
.footer-brand p { margin-top: 14px; color: var(--text-3); font-size: .85rem; max-width: 46ch; }
.footer nav { display: flex; flex-direction: column; gap: 9px; }
.footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); margin-bottom: 4px; }
.footer nav a { color: var(--text-2); text-decoration: none; font-size: .9rem; }
.footer nav a:hover { color: var(--accent); }
.footer-bot { margin-top: 38px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; font-size: .78rem; color: var(--text-3); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-cards { min-height: 0; display: grid; gap: 14px; max-width: 460px; }
  .hero-cards .ha-card { position: static; width: 100%; animation: none; }
  .auto { grid-template-columns: 1fr; }
  .auto-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .auto-b { min-width: 260px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .eve { grid-template-columns: 1fr; }
  .eve-visual { max-width: 560px; }
  .footer-in { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .nav {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column;
    background: rgba(14, 15, 19, .97); border-bottom: 1px solid var(--line);
    padding: 10px 18px 18px; display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 8px; }
  .burger { display: block; margin-left: auto; }
  .nav-cta { display: none; }
  .gal { grid-template-columns: 1fr; }
  .chart-duo { grid-template-columns: 1fr; }
  .cta { grid-template-columns: 1fr; }
  .ha-side { flex-direction: row; justify-content: flex-start; gap: 4px; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .ha-app { grid-template-columns: 1fr; }
  .ha-side-logo { margin: 0 6px 0 0; font-size: 1.4rem; }
  .ha-side-sp { display: none; }
  .ha-appbar { flex-wrap: wrap; height: auto; padding: 12px 14px; gap: 10px; }
  .ha-tabs { margin-left: 0; width: 100%; overflow-x: auto; }
  .ha-appbar-r { display: none; }
  .ha-grid { grid-template-columns: 1fr; }
  .ha-grid .ha-media, .ha-grid .ha-cam, .ha-grid .ha-tiles, .ha-grid .ha-log { grid-column: span 1; }
  .ha-tiles-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .tiles { grid-template-columns: 1fr; }
  .hero-stats { gap: 22px; }
  .ha-media { grid-template-columns: 1fr; }
  .md-art { height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
