:root {
  --bg: #070707;
  --bg-soft: #101010;
  --card: #151515;
  --text: #ffffff;
  --muted: #a7a7a7;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #39d5ff;
  --accent-2: #2f80ed;
  --light: #f3f3f0;
  --dark-text: #111111;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 5vw;
  transition: .35s ease;
}
.site-header.scrolled {
  background: rgba(7,7,7,.78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; font-family: "Manrope"; font-weight: 800; letter-spacing: .16em; }
.brand-logo{
    width:64px;
    height:64px;
    object-fit:contain;
    display:block;
    border-radius:50%;
    transition:.3s ease;
}

.brand-logo:hover{
    transform:scale(1.05);
    box-shadow:0 0 18px rgba(255,170,0,.25);
}
.main-nav { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.main-nav a { color: #d2d2d2; transition: .2s; }
.main-nav a:hover { color: #fff; }
.nav-cta { border: 1px solid var(--line); padding: 12px 18px; border-radius: 999px; }
.menu-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; }
.menu-toggle span { display: block; height: 1px; width: 24px; background: #fff; margin: 7px auto; }

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: 6vw;
  padding: 130px 7vw 80px;
  overflow: hidden;
}
.wave-filter { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.hero-flag {
  position: absolute;
  inset: -7%;
  overflow: hidden;
  pointer-events: none;
  filter: url(#hero-wave-filter);
  transform-origin: 50% 35%;
  animation: heroFlagDrift 12s ease-in-out infinite alternate;
  will-change: transform;
}
.hero-grid {
  position: absolute;
  inset: -5%;
  background-image:
    radial-gradient(circle at 72% 24%, rgba(57,213,255,.13), transparent 34%),
    radial-gradient(circle at 18% 76%, rgba(47,128,237,.11), transparent 38%),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: auto, auto, 52px 52px, 52px 52px;
  mask-image: linear-gradient(to bottom, black 15%, transparent 96%);
  animation: heroTextureShift 18s linear infinite;
  will-change: transform, background-position;
}
@keyframes heroFlagDrift {
  0% { transform: translate3d(-1.2%, -.4%, 0) rotate(-.2deg) skewY(-.35deg) scale(1.02); }
  50% { transform: translate3d(.5%, .35%, 0) rotate(.12deg) skewY(.25deg) scale(1.025); }
  100% { transform: translate3d(1.3%, -.15%, 0) rotate(.25deg) skewY(-.15deg) scale(1.02); }
}
@keyframes heroTextureShift {
  from { background-position: 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 34px -18px, -28px 22px, 52px 26px, 26px 52px; }
}
.hero-glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .28; }
.hero-glow-one { width: 420px; height: 420px; background: var(--accent-2); top: -80px; right: 10%; }
.hero-glow-two { width: 320px; height: 320px; background: var(--accent); bottom: 5%; left: -120px; opacity: .18; }
.hero-content, .hero-panel { position: relative; z-index: 2; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .2em; font-size: 12px; font-weight: 700; margin-bottom: 22px; }
.eyebrow.dark { color: #266bd1; }
.hero h1 { font-family: "Manrope"; font-size: clamp(3.2rem, 7vw, 7rem); line-height: .95; max-width: 900px; letter-spacing: -.06em; }
.hero-copy { color: #c1c1c1; font-size: clamp(1rem, 1.5vw, 1.25rem); line-height: 1.7; max-width: 700px; margin-top: 30px; }
.hero-quote { border-left: 2px solid var(--accent); padding-left: 20px; margin-top: 28px; color: #fff; line-height: 1.65; max-width: 720px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 36px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 52px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: .25s; font-weight: 600; }
.button-primary { background: #fff; color: #000; }
.button-primary:hover { transform: translateY(-2px); background: var(--accent); }
.button-secondary { border-color: var(--line); background: rgba(255,255,255,.03); }
.button-secondary:hover { background: rgba(255,255,255,.09); }

.hero-panel { background: rgba(14,14,14,.72); border: 1px solid var(--line); border-radius: 26px; padding: 20px; box-shadow: 0 30px 100px rgba(0,0,0,.45); backdrop-filter: blur(16px); }
.panel-top, .panel-footer { display: flex; justify-content: space-between; align-items: center; color: #8c8c8c; font-size: 11px; letter-spacing: .12em; }
.status-dot { color: #8cff9c; }
.panel-house { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.room { min-height: 130px; border-radius: 18px; border: 1px solid rgba(255,255,255,.08); padding: 18px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.015)); }
.room span { color: #8f8f8f; font-size: 13px; }
.room b { font-size: 25px; font-family: "Manrope"; }
.room-a { grid-row: span 2; min-height: 272px; background: linear-gradient(160deg, rgba(47,128,237,.35), rgba(255,255,255,.02)); }
.panel-footer { gap: 8px; flex-wrap: wrap; }
.scroll-indicator { position: absolute; bottom: 24px; left: 50%; width: 28px; height: 46px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; display: grid; place-items: start center; padding-top: 8px; z-index: 3; }
.scroll-indicator span { width: 3px; height: 8px; border-radius: 99px; background: #fff; animation: scroll 1.8s infinite; }
@keyframes scroll { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(20px); opacity: 0; } }

.section { padding: 120px 7vw; }
.section-light { background: var(--light); color: var(--dark-text); }
.section-heading { max-width: 1000px; margin-bottom: 60px; }
.section-heading h2 { font-family: "Manrope"; font-size: clamp(2.4rem, 5vw, 5.2rem); line-height: 1.03; letter-spacing: -.05em; }
.section-heading h2 span { color: #7a7a7a; }
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.service-card { background: #fff; border: 1px solid #deded8; min-height: 340px; padding: 34px; border-radius: 24px; transition: .3s ease; display: flex; flex-direction: column; }
.service-card:hover { transform: translateY(-6px); box-shadow: 0 24px 60px rgba(0,0,0,.08); }
.service-number { color: #8d8d8d; font-size: 13px; margin-bottom: auto; }
.service-card h3 { font-family: "Manrope"; font-size: 2rem; margin-bottom: 16px; }
.service-card p { color: #646464; line-height: 1.65; max-width: 580px; }
.service-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.service-tags span { padding: 8px 12px; border: 1px solid #d8d8d2; border-radius: 999px; font-size: 12px; }

.statement-section { min-height: 85vh; display: grid; place-items: center; padding: 100px 7vw; background: radial-gradient(circle at center, #121d2b 0%, #070707 55%); text-align: center; }
.statement-inner { max-width: 1100px; }
.statement-inner h2 { font-family: "Manrope"; font-size: clamp(2.6rem, 6vw, 6.2rem); line-height: 1; letter-spacing: -.055em; }
.statement-answer { color: var(--accent); font-family: "Manrope"; font-size: clamp(3.6rem, 9vw, 9rem); font-weight: 800; letter-spacing: -.07em; margin: 28px 0; }
.statement-inner > p:last-child { color: #b8b8b8; font-size: 1.15rem; }

.technologies-section { background: #0b0b0b; }
.tech-marquee { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 26px 0; }
.tech-track { display: flex; width: max-content; gap: 48px; animation: marquee 30s linear infinite; }
.tech-track span { color: #d7d7d7; font-family: "Manrope"; font-weight: 700; font-size: 1.15rem; }
@keyframes marquee { to { transform: translateX(-50%); } }
.tech-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 54px; }
.tech-feature { border: 1px solid var(--line); padding: 30px; border-radius: 20px; min-height: 220px; }
.tech-feature > span { color: var(--accent); font-size: 12px; }
.tech-feature h3 { font-family: "Manrope"; font-size: 2rem; margin: 46px 0 12px; }
.tech-feature p { color: var(--muted); line-height: 1.6; }

.method-list { border-top: 1px solid #d4d4ce; }
.method-item { display: grid; grid-template-columns: 80px .8fr 1.2fr; gap: 30px; align-items: center; padding: 30px 0; border-bottom: 1px solid #d4d4ce; }
.method-item span { color: #8d8d8d; }
.method-item h3 { font-family: "Manrope"; font-size: 1.7rem; }
.method-item p { color: #666; line-height: 1.55; }

.contact-section { display: grid; grid-template-columns: .9fr 1.1fr; gap: 8vw; padding: 120px 7vw; background: #0a0a0a; }
.contact-copy h2 { font-family: "Manrope"; font-size: clamp(2.5rem, 5vw, 5rem); line-height: 1.04; letter-spacing: -.05em; }
.contact-copy > p { color: #aaa; line-height: 1.7; margin-top: 24px; }
.contact-details { display: flex; flex-direction: column; gap: 12px; margin-top: 34px; }
.contact-details a { color: #fff; font-size: 1.1rem; }
.contact-form { background: #f3f3f0; color: #111; padding: 34px; border-radius: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form label { display: flex; flex-direction: column; gap: 9px; font-weight: 600; font-size: 13px; margin-bottom: 16px; }
.contact-form input, .contact-form textarea, .contact-form select { width: 100%; border: 1px solid #d7d7d1; background: #fff; border-radius: 12px; padding: 14px 15px; outline: none; }
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus { border-color: #2f80ed; box-shadow: 0 0 0 3px rgba(47,128,237,.1); }
.form-status { margin-top: 14px; font-size: 13px; }

.site-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 32px 7vw; border-top: 1px solid var(--line); font-size: 13px; color: #888; }
.footer-brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.footer-brand div { display: flex; flex-direction: column; }
.footer-brand small { color: #777; margin-top: 3px; }
.footer-links { justify-self: end; display: flex; gap: 18px; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }
.delay-1 { transition-delay: .12s; }
.delay-2 { transition-delay: .24s; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 150px; }
  .hero-panel { max-width: 720px; }
  .main-nav { position: fixed; top: 0; right: -100%; width: min(85vw, 360px); height: 100vh; background: #0c0c0c; flex-direction: column; align-items: flex-start; padding: 110px 30px; transition: .35s; }
  .main-nav.open { right: 0; }
  .menu-toggle { display: block; position: relative; z-index: 2; }
  .services-grid, .tech-feature-grid, .contact-section { grid-template-columns: 1fr; }
  .contact-section { gap: 60px; }
  .site-footer { grid-template-columns: 1fr; text-align: left; }
  .footer-links { justify-self: start; }
}

@media (max-width: 640px) {
  .site-header { padding-left: 20px; padding-right: 20px; }
  .hero, .section, .contact-section { padding-left: 20px; padding-right: 20px; }
  .hero h1 { font-size: 3.3rem; }
  .hero-actions { flex-direction: column; }
  .button { width: 100%; }
  .panel-house { grid-template-columns: 1fr; }
  .room-a { grid-row: auto; min-height: 150px; }
  .services-grid { grid-template-columns: 1fr; }
  .service-card { min-height: 300px; padding: 26px; }
  .method-item { grid-template-columns: 48px 1fr; }
  .method-item p { grid-column: 2; }
  .form-row { grid-template-columns: 1fr; }
  .contact-form { padding: 22px; }
}

/* Fenêtre de contact */
.nav-contact-button {
  color: #d2d2d2;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color .2s;
}
.nav-contact-button:hover { color: #fff; }

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
}
.contact-modal.open { opacity: 1; visibility: visible; }
.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(12px);
}
.contact-modal-dialog {
  position: relative;
  width: min(100%, 620px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 42px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(24,24,24,.98), rgba(8,8,8,.98));
  box-shadow: 0 32px 120px rgba(0,0,0,.65);
  transform: translateY(22px) scale(.98);
  transition: transform .28s ease;
}
.contact-modal.open .contact-modal-dialog { transform: none; }
.contact-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.contact-modal-close:hover { background: rgba(255,255,255,.11); transform: rotate(6deg); }
.contact-modal-dialog h2 {
  max-width: 460px;
  font-family: "Manrope";
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -.05em;
}
.contact-modal-intro { margin: 22px 0 28px; color: var(--muted); line-height: 1.7; }
.contact-modal-list { display: grid; gap: 10px; }
.contact-modal-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.025);
  transition: background .2s, border-color .2s, transform .2s;
}
a.contact-modal-item:hover { background: rgba(255,255,255,.07); border-color: rgba(57,213,255,.4); transform: translateX(3px); }
.contact-modal-item span { color: #858585; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.contact-modal-item strong { font-size: 1rem; overflow-wrap: anywhere; }
.contact-modal-project { margin-top: 24px; width: 100%; }
body.modal-open { overflow: hidden; }

@media (max-width: 980px) {
  .nav-contact-button { font-size: inherit; }
}

@media (max-width: 640px) {
  .contact-modal { padding: 14px; }
  .contact-modal-dialog { padding: 34px 20px 22px; border-radius: 20px; }
}


/* Réseaux informatiques — section harmonisée */
.network-section { background: #0b0b0b; }
.section-intro {
  max-width: 760px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}
.network-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.network-card {
  min-height: 320px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  display: flex;
  flex-direction: column;
  transition: transform .3s ease, border-color .3s ease, background .3s ease;
}
.network-card:hover {
  transform: translateY(-6px);
  border-color: rgba(57,213,255,.38);
  background: linear-gradient(145deg, rgba(57,213,255,.07), rgba(255,255,255,.018));
}
.network-number {
  margin-bottom: auto;
  color: var(--accent);
  font-size: 13px;
}
.network-card h3 {
  margin-bottom: 16px;
  font-family: "Manrope";
  font-size: 2rem;
}
.network-card p {
  max-width: 580px;
  color: var(--muted);
  line-height: 1.65;
}
.network-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.network-tags span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d5d5d5;
  font-size: 12px;
}
.network-action { margin-top: 34px; }

@media (max-width: 980px) {
  .network-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .network-card { min-height: 290px; padding: 26px; }
  .network-action .button { width: 100%; }
}


/* Hero — tableau de bord Home Assistant */
.hero-panel {
  width: 100%;
  max-width: 620px;
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(155deg, rgba(22,26,32,.94), rgba(8,10,13,.9));
  box-shadow: 0 35px 120px rgba(0,0,0,.56), inset 0 1px rgba(255,255,255,.04);
}
.panel-top { align-items: flex-start; letter-spacing: 0; }
.panel-top > div { display: flex; flex-direction: column; gap: 4px; }
.panel-top strong { color: #f7f7f7; font-family: "Manrope"; font-size: 1rem; }
.panel-kicker { color: #6f7886; font-size: 9px; letter-spacing: .18em; }
.status-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 9px; letter-spacing: .1em; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; background: #70ef87; box-shadow: 0 0 16px rgba(112,239,135,.8); }
.dashboard-summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(47,128,237,.26), rgba(30,52,76,.28));
}
.summary-main { display: flex; flex-direction: column; }
.summary-main span, .summary-weather span { color: #9ca6b4; font-size: 11px; }
.summary-main strong { margin: 5px 0 1px; font-family: "Manrope"; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1; }
.summary-main small { color: #6ff08b; font-size: 10px; }
.weather-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,206,87,.12); color: #ffd567; font-size: 27px; }
.summary-weather { display: flex; flex-direction: column; min-width: 92px; }
.summary-weather strong { font-family: "Manrope"; font-size: 1.5rem; }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 10px 0; }
.dash-tile {
  min-width: 0;
  min-height: 126px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 17px;
  background: rgba(255,255,255,.035);
  display: flex;
  flex-direction: column;
}
.dash-tile.active { background: linear-gradient(145deg, rgba(255,190,67,.22), rgba(255,255,255,.03)); }
.dash-icon { display: grid; place-items: center; width: 29px; height: 29px; margin-bottom: auto; border-radius: 9px; background: rgba(57,213,255,.1); color: #55dfff; font-size: 16px; }
.dash-light .dash-icon { color: #ffd05b; background: rgba(255,208,91,.12); }
.dash-tile > span { margin-top: 14px; color: #8d98a8; font-size: 10px; }
.dash-tile strong { margin-top: 3px; font-family: "Manrope"; font-size: .95rem; white-space: nowrap; }
.dash-tile small { margin-top: 3px; color: #697383; font-size: 8px; white-space: nowrap; }
.dashboard-bottom { display: grid; grid-template-columns: 1.15fr .85fr; gap: 9px; margin-bottom: 14px; }
.network-health, .quick-scenes { padding: 14px; border: 1px solid rgba(255,255,255,.075); border-radius: 17px; background: rgba(255,255,255,.025); }
.metric-heading, .metric-foot { display: flex; align-items: center; justify-content: space-between; }
.metric-heading span, .quick-scenes > span { color: #8d98a8; font-size: 10px; }
.metric-heading strong { color: #6ff08b; font-size: 11px; }
.signal-bars { height: 32px; display: flex; align-items: end; gap: 4px; margin: 9px 0; }
.signal-bars i { flex: 1; min-width: 3px; border-radius: 3px 3px 1px 1px; background: linear-gradient(to top, #347fe8, #52dfff); opacity: .82; }
.signal-bars i:nth-child(1){height:35%}.signal-bars i:nth-child(2){height:48%}.signal-bars i:nth-child(3){height:42%}.signal-bars i:nth-child(4){height:67%}.signal-bars i:nth-child(5){height:54%}.signal-bars i:nth-child(6){height:79%}.signal-bars i:nth-child(7){height:63%}.signal-bars i:nth-child(8){height:88%}.signal-bars i:nth-child(9){height:72%}.signal-bars i:nth-child(10){height:95%}
.metric-foot { color: #667181; font-size: 8px; }
.quick-scenes > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 14px; }
.quick-scenes button { min-width: 0; padding: 9px 3px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: rgba(255,255,255,.04); color: #b7bec8; font: inherit; font-size: 8px; }
.panel-footer { padding: 0 2px; font-size: 8px; }

@media (min-width: 981px) and (max-width: 1200px) {
  .hero { grid-template-columns: 1fr 1fr; gap: 4vw; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-tile { min-height: 110px; }
}
@media (max-width: 980px) {
  .hero-panel { max-width: 760px; }
  .dashboard-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
  .dashboard-summary { grid-template-columns: 1fr auto; }
  .summary-weather { grid-column: 1 / -1; flex-direction: row; gap: 8px; align-items: center; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-bottom { grid-template-columns: 1fr; }
  .dash-tile { min-height: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-flag, .hero-grid { animation: none !important; }
  .hero-flag { filter: none; transform: none; inset: 0; }
}

/* Liens légaux et modales */
.footer-links button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: color .2s ease;
}
.footer-links button:hover { color: #fff; }

.site-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
}
.site-modal.open { opacity: 1; visibility: visible; }
.site-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.76);
  backdrop-filter: blur(14px);
}
.site-modal-dialog {
  position: relative;
  width: min(100%, 620px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 42px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(24,24,24,.99), rgba(7,7,7,.99));
  box-shadow: 0 32px 120px rgba(0,0,0,.7);
  transform: translateY(22px) scale(.98);
  transition: transform .28s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(57,213,255,.45) transparent;
}
.site-modal.open .site-modal-dialog { transform: none; }
.site-modal-dialog-wide { width: min(100%, 900px); }
.site-modal-close {
  position: sticky;
  float: right;
  top: 0;
  z-index: 2;
  width: 42px;
  height: 42px;
  margin: -18px -18px 0 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(20,20,20,.92);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.site-modal-close:hover { background: rgba(255,255,255,.12); transform: rotate(6deg); }
.site-modal-dialog h2 {
  max-width: 720px;
  font-family: "Manrope";
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -.05em;
}
.site-modal-intro { max-width: 740px; margin: 22px 0 30px; color: var(--muted); line-height: 1.75; }
.legal-content { display: grid; gap: 14px; }
.legal-content article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.025);
}
.legal-content h3 { margin: 0 0 12px; font: 600 1.05rem/1.3 "Manrope"; color: #fff; }
.legal-content p { margin: 0 0 10px; color: #a6a6a6; line-height: 1.72; }
.legal-content p:last-child { margin-bottom: 0; }
.legal-content a { color: #7ddfff; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 640px) {
  .site-modal { padding: 12px; }
  .site-modal-dialog { padding: 32px 18px 20px; border-radius: 20px; max-height: calc(100vh - 24px); }
  .site-modal-close { margin: -14px -8px 0 10px; }
  .legal-content article { padding: 19px; }
}


/* Formulaire sécurisé et captcha */
.privacy-consent { flex-direction: row !important; align-items: flex-start; font-weight: 500 !important; }
.privacy-consent input { width: auto !important; margin-top: 3px; }
.form-honeypot { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.captcha-modal { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 20px; opacity: 0; visibility: hidden; transition: .25s ease; }
.captcha-modal.open { opacity: 1; visibility: visible; }
.captcha-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(12px); }
.captcha-modal-dialog { position: relative; z-index: 1; width: min(460px,100%); padding: 32px; border-radius: 24px; background: #111318; color: #fff; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 30px 90px rgba(0,0,0,.45); transform: translateY(18px) scale(.98); transition: .25s ease; }
.captcha-modal.open .captcha-modal-dialog { transform: none; }
.captcha-modal-close { position:absolute; top:14px; right:16px; border:0; background:transparent; color:#fff; font-size:30px; cursor:pointer; }
.captcha-modal-dialog label { display:flex; flex-direction:column; gap:8px; margin:20px 0; font-size:13px; font-weight:600; }
.captcha-modal-dialog input { padding:14px; border-radius:12px; border:1px solid rgba(255,255,255,.18); background:#1b1e25; color:#fff; font-size:18px; }
.captcha-question { margin-top:18px; padding:18px; border-radius:16px; background:rgba(47,128,237,.12); font-size:20px; font-weight:700; text-align:center; }


/* Popup projets réalisés */
.projects-modal-dialog { width: min(100%, 1040px); }
.projects-list { display: grid; gap: 28px; }
.project-case { padding: 26px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.025); }
.project-case-copy { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; margin-bottom: 22px; }
.project-number { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgba(57,213,255,.28); border-radius: 14px; color: #72e4ff; background: rgba(57,213,255,.07); font: 700 .9rem/1 "Manrope"; }
.project-category { margin: 0 0 6px !important; color: #72e4ff !important; font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.project-case h3 { margin: 0 0 10px; color: #fff; font: 600 clamp(1.25rem, 3vw, 1.8rem)/1.2 "Manrope"; letter-spacing: -.025em; }
.project-case-copy p:last-child { max-width: 760px; margin: 0; color: #a6a6a6; line-height: 1.7; }
.before-after-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.before-after-grid figure { position: relative; margin: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.09); border-radius: 17px; background: #0d0f12; }
.before-after-grid figure > span { position: absolute; z-index: 2; top: 12px; left: 12px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: rgba(4,6,8,.72); backdrop-filter: blur(8px); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.before-after-grid img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.before-after-grid figcaption { padding: 13px 14px 15px; color: #8f98a3; font-size: .82rem; line-height: 1.5; }
@media (max-width: 700px) {
  .project-case { padding: 18px; }
  .project-case-copy { grid-template-columns: 1fr; gap: 12px; }
  .before-after-grid { grid-template-columns: 1fr; }
}

.captcha-actions{display:flex;gap:12px;flex-wrap:wrap}.captcha-actions .button{flex:1 1 180px}

.brand{
    display:flex;
    align-items:center;
    gap:14px;
    text-decoration:none;
}

.brand-text{
    display:flex;
    flex-direction:column;
    align-items:center;
    line-height:1;
    font-family:"Cinzel", serif;
    text-transform:uppercase;
}

.brand-domotek{
    color:#07549F;
    font-size:2rem;
    font-weight:700;
    letter-spacing:0,7px;
}

.brand-systems{
    margin-top:5px;
    color:#ffffff;
    font-size:1.5rem;
    font-weight:500;
    letter-spacing:1px;
    padding-left:0.4em;
}
/* ===========================
   CONDITIONS GÉNÉRALES DE VENTE
   =========================== */

#cgv-modal .site-modal-dialog{
    max-width:1100px;
    max-height:90vh;
    overflow-y:auto;
}

#cgv-modal .legal-content{
    display:flex;
    flex-direction:column;
    gap:2rem;
}

#cgv-modal .legal-content article{
    padding-bottom:1.75rem;
    border-bottom:1px solid rgba(255,255,255,.08);
}

#cgv-modal .legal-content article:last-child{
    border-bottom:none;
}

#cgv-modal h3{
    margin-bottom:.9rem;
    color:var(--accent);
    font-size:1.2rem;
}

#cgv-modal p{
    margin-bottom:1rem;
    line-height:1.85;
    text-align:justify;
}

#cgv-modal strong{
    color:#ffffff;
}

#cgv-modal a{
    color:var(--accent);
    text-decoration:none;
}

#cgv-modal a:hover{
    text-decoration:underline;
}

/* ==========================================================
   HARMONISATION DES POPUPS ET ANIMATIONS DES TUILES
   ========================================================== */

/* Palette commune à toutes les fenêtres */
.contact-modal-backdrop,
.site-modal-backdrop,
.captcha-modal-backdrop {
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(14px);
}

.contact-modal-dialog,
.site-modal-dialog,
.captcha-modal-dialog {
  border: 1px solid rgba(57, 213, 255, .18);
  background:
    radial-gradient(circle at top right, rgba(57, 213, 255, .07), transparent 34%),
    linear-gradient(145deg, rgba(24, 24, 24, .99), rgba(7, 7, 7, .99));
  color: var(--text);
  box-shadow:
    0 32px 120px rgba(0, 0, 0, .72),
    inset 0 1px rgba(255, 255, 255, .035);
  scrollbar-width: thin;
  scrollbar-color: rgba(57, 213, 255, .45) transparent;
}

/* Titres et textes des fenêtres harmonisés */
.contact-modal-dialog h2,
.site-modal-dialog h2,
.captcha-modal-dialog h2 {
  color: #fff;
}

.contact-modal-intro,
.site-modal-intro,
.captcha-modal-dialog .form-status {
  color: var(--muted);
}

/* Boutons de fermeture identiques */
.contact-modal-close,
.site-modal-close,
.captcha-modal-close {
  border: 1px solid rgba(57, 213, 255, .18);
  background: rgba(20, 20, 20, .94);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  transition:
    background .25s ease,
    border-color .25s ease,
    color .25s ease,
    transform .25s ease,
    box-shadow .25s ease;
}

.contact-modal-close:hover,
.site-modal-close:hover,
.captcha-modal-close:hover {
  border-color: rgba(57, 213, 255, .55);
  background: rgba(57, 213, 255, .1);
  color: var(--accent);
  transform: rotate(6deg) scale(1.04);
  box-shadow: 0 0 24px rgba(57, 213, 255, .12);
}

/* Tuiles internes des fenêtres légales */
.legal-content article {
  border-color: rgba(255, 255, 255, .1);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .038), rgba(255, 255, 255, .014));
  transition:
    transform .3s ease,
    border-color .3s ease,
    background .3s ease,
    box-shadow .3s ease;
}

.legal-content article:hover {
  transform: translateY(-6px);
  border-color: rgba(57, 213, 255, .38);
  background:
    linear-gradient(145deg, rgba(57, 213, 255, .07), rgba(255, 255, 255, .018));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .2);
}

.legal-content h3,
#cgv-modal h3 {
  color: var(--accent);
}

.legal-content a,
#cgv-modal a {
  color: var(--accent);
}

/* Contact : mêmes tuiles et même accent que les CGV */
.contact-modal-item {
  border-color: rgba(255, 255, 255, .1);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .038), rgba(255, 255, 255, .014));
  transition:
    transform .3s ease,
    border-color .3s ease,
    background .3s ease,
    box-shadow .3s ease;
}

.contact-modal-item:hover,
a.contact-modal-item:hover {
  transform: translateY(-6px);
  border-color: rgba(57, 213, 255, .38);
  background:
    linear-gradient(145deg, rgba(57, 213, 255, .07), rgba(255, 255, 255, .018));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .2);
}

.contact-modal-item span {
  color: var(--accent);
}

/* Captcha harmonisé */
.captcha-modal-dialog input {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .045);
}

.captcha-modal-dialog input:focus {
  outline: none;
  border-color: rgba(57, 213, 255, .55);
  box-shadow: 0 0 0 3px rgba(57, 213, 255, .1);
}

.captcha-question {
  border: 1px solid rgba(57, 213, 255, .16);
  background: rgba(57, 213, 255, .075);
}

/* Animation commune aux tuiles principales */
.service-card,
.tech-feature,
.network-health,
.quick-scenes,
.project-case,
.before-after-grid figure {
  transition:
    transform .3s ease,
    border-color .3s ease,
    background .3s ease,
    box-shadow .3s ease;
}

/* Tuiles de la section claire */
.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(47, 128, 237, .34);
  background:
    linear-gradient(145deg, rgba(57, 213, 255, .055), #fff 48%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .1);
}

/* Technologies */
.tech-feature:hover {
  transform: translateY(-6px);
  border-color: rgba(57, 213, 255, .38);
  background:
    linear-gradient(145deg, rgba(57, 213, 255, .07), rgba(255, 255, 255, .018));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .2);
}

/* Tuiles du tableau de bord */
.network-health,
.quick-scenes {
  transition: none;
}

.network-health:hover,
.quick-scenes:hover {
  transform: none;
  border-color: rgba(255,255,255,.075);
  background: rgba(255,255,255,.025);
  box-shadow: none;
}

/* Portfolio */
.project-case:hover {
  transform: translateY(-6px);
  border-color: rgba(57, 213, 255, .38);
  background:
    linear-gradient(145deg, rgba(57, 213, 255, .065), rgba(255, 255, 255, .018));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
}

.before-after-grid figure:hover {
  transform: translateY(-6px);
  border-color: rgba(57, 213, 255, .38);
  box-shadow: 0 20px 46px rgba(0, 0, 0, .24);
}

/* Méthode : animation légère sans transformer la ligne en carte */
.method-item {
  transition:
    transform .3s ease,
    padding-left .3s ease,
    border-color .3s ease,
    background .3s ease;
}

.method-item:hover {
  transform: translateY(-4px);
  padding-left: 18px;
  border-color: rgba(47, 128, 237, .38);
  background: linear-gradient(90deg, rgba(47, 128, 237, .065), transparent 76%);
}

/* Accessibilité : suppression des mouvements si l’utilisateur le demande */
@media (prefers-reduced-motion: reduce) {
  .service-card,
  .network-card,
  .tech-feature,
  .network-health,
  .quick-scenes,
  .method-item,
  .contact-modal-item,
  .legal-content article,
  .project-case,
  .before-after-grid figure {
    transition: none !important;
  }

  .service-card:hover,
  .network-card:hover,
  .tech-feature:hover,
  .network-health:hover,
  .quick-scenes:hover,
  .method-item:hover,
  .contact-modal-item:hover,
  .legal-content article:hover,
  .project-case:hover,
  .before-after-grid figure:hover {
    transform: none !important;
  }
}

/* ==========================================================
   CORRECTIFS MENU MOBILE — ANDROID / iOS / SAFARI
   ========================================================== */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  width: 100%;
  min-width: 0;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

input,
select,
textarea {
  font-size: 16px; /* Empêche le zoom automatique des champs sur iPhone */
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.menu-backdrop {
  display: none;
}

@media (max-width: 980px) {
  .site-header {
    min-height: 72px;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  .menu-toggle {
    position: relative;
    z-index: 1003;
    display: block;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    cursor: pointer;
  }

  .menu-toggle span {
    position: absolute;
    left: 10px;
    width: 24px;
    margin: 0;
    transition: transform .25s ease, top .25s ease, opacity .2s ease;
  }

  .menu-toggle span:first-child {
    top: 16px;
  }

  .menu-toggle span:last-child {
    top: 27px;
  }

  .menu-toggle.active span:first-child {
    top: 21px;
    transform: rotate(45deg);
  }

  .menu-toggle.active span:last-child {
    top: 21px;
    transform: rotate(-45deg);
  }

  .main-nav {
    position: fixed;
    z-index: 1002;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    display: flex;
    width: min(86vw, 380px);
    height: 100vh;
    height: 100dvh;
    max-height: none;
    padding:
      calc(94px + env(safe-area-inset-top))
      max(26px, env(safe-area-inset-right))
      max(30px, env(safe-area-inset-bottom))
      26px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border-radius: 0;
    background: rgba(12, 12, 12, .98);
    border-left: 1px solid rgba(255, 255, 255, .1);
    box-shadow: -28px 0 70px rgba(0, 0, 0, .55);
    transform: translate3d(105%, 0, 0);
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    transition:
      transform .32s cubic-bezier(.22, 1, .36, 1),
      opacity .22s ease,
      visibility 0s linear .32s;
    will-change: transform;
  }

  .main-nav.open {
    right: 0;
    transform: translate3d(0, 0, 0);
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
    transition:
      transform .32s cubic-bezier(.22, 1, .36, 1),
      opacity .22s ease,
      visibility 0s;
  }

  .main-nav a,
  .main-nav .nav-contact-button {
    display: flex;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    align-items: center;
    justify-content: flex-start;
    border-radius: 12px;
    text-align: left;
  }

  .main-nav a:active,
  .main-nav .nav-contact-button:active {
    background: rgba(255, 255, 255, .08);
  }

  .main-nav .nav-cta {
    justify-content: center;
    margin-top: 8px;
    border: 1px solid var(--line);
  }

  .menu-backdrop {
    position: fixed;
    z-index: 1001;
    inset: 0;
    display: block;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, .58);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, visibility 0s linear .25s;
  }

  body.menu-open .menu-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .25s ease, visibility 0s;
  }

  body.menu-open {
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
  }

  body.menu-open .main-nav {
    touch-action: pan-y;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 66px;
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .brand {
    min-width: 0;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand-text {
    min-width: 0;
  }

  .brand-domotek {
    font-size: clamp(1.1rem, 6vw, 1.55rem);
  }

  .brand-systems {
    font-size: clamp(.8rem, 4.4vw, 1.1rem);
  }

  .hero,
  .section,
  .statement-section,
  .contact-section {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  .hero {
    min-height: auto;
    padding-top: calc(104px + env(safe-area-inset-top));
  }

  .hero h1 {
    font-size: clamp(2.25rem, 12vw, 3.3rem);
    overflow-wrap: anywhere;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-bottom {
    grid-template-columns: minmax(0, 1fr);
  }

  .dash-tile strong,
  .dash-tile small {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .site-modal-dialog,
  .contact-modal-dialog,
  .captcha-modal-dialog {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 390px) {
  .brand-text {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .main-nav,
  .menu-backdrop,
  .menu-toggle span {
    transition: none !important;
  }
}
