/* Shared smartphone layout for the home page and every service. */
html { -webkit-text-size-adjust: 100%; }
.menu-toggle, .mobile-contact-bar, .nav-mobile-service { display: none; }
img, video { max-width: 100%; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: #f6bf0033; }

@media (max-width: 1000px) {
  html { scroll-padding-top: 100px; }
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  body > header {
    position: sticky; top: 0; z-index: 30;
    min-height: 78px; height: auto; padding: 15px 18px;
    display: flex; flex-wrap: wrap; gap: 12px;
    border-bottom: 1px solid #343638; background: #080a0ef7;
  }
  header .company-brand { flex: 1; min-width: 0; font-size: 18px; }
  header .company-brand small {
    max-width: 270px; font-size: 8px; line-height: 1.5;
    letter-spacing: .15px; margin-top: 6px;
  }
  .menu-toggle:not([hidden]) {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    flex: 0 0 auto; min-height: 46px; padding: 10px 12px;
    border: 1px solid #5d5740; border-radius: 6px;
    background: #161916; color: #f6bf00; font: 700 13px Arial,sans-serif;
  }
  .menu-icon { width: 17px; height: 12px; position: relative; display: block; }
  .menu-icon::before, .menu-icon::after {
    content: ''; position: absolute; left: 0; width: 17px; height: 2px;
    background: currentColor; transition: transform .2s, top .2s;
  }
  .menu-icon::before { top: 2px; }
  .menu-icon::after { top: 10px; }
  .menu-toggle[aria-expanded=true] .menu-icon::before { top: 6px; transform: rotate(45deg); }
  .menu-toggle[aria-expanded=true] .menu-icon::after { top: 6px; transform: rotate(-45deg); }
  header #main-navigation {
    width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 6px; padding-top: 10px; max-height: calc(100svh - 170px);
    overflow-y: auto; overscroll-behavior: contain;
  }
  .mobile-nav-ready header #main-navigation { display: none; }
  .mobile-nav-ready header #main-navigation.is-open { display: grid; }
  header #main-navigation a, header #main-navigation a:not(:last-child) {
    display: flex; align-items: center; min-height: 46px; padding: 11px 12px;
    border: 1px solid #343a35; border-radius: 5px;
    font-size: 12px; line-height: 1.35; text-transform: none;
    white-space: normal; overflow-wrap: anywhere;
  }
  header #main-navigation .btn { grid-column: 1 / -1; justify-content: center; font-size: 13px; }
  header #main-navigation a[aria-current=page] { color: #f6bf00; border-color: #f6bf00; }
  .mobile-contact-bar {
    position: fixed; z-index: 25; bottom: 0; left: 0; right: 0;
    display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px;
    padding: 10px max(16px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));
    background: #090c0df5; border-top: 1px solid #3e4238; backdrop-filter: blur(12px);
  }
  .mobile-contact-bar a {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; border: 1px solid #5d624f; border-radius: 6px;
    font-size: 14px; font-weight: 700; text-decoration: none;
  }
  .mobile-contact-bar .mobile-project { background: #f6bf00; color: #090b0c; border-color: #f6bf00; }
  .mobile-contact-bar svg { width: 18px; height: 18px; flex: none; }
  .btn, .tab, .demo-control-group button, .demo-action, .home-tags button,
  .modes button, .demo-reset, .demo-enlarge, .shutter-scale button,
  .lightbox button, .shutter-preview > button { min-height: 44px; }
  .btn { white-space: normal; text-align: center; line-height: 1.4; }
  .demo-controls input[type=range], .home-experience input[type=range], .compare-control input { min-height: 44px; }
  input:not([type=range]):not([type=checkbox]), select, textarea { font-size: 16px; min-height: 48px; }
  input[type=checkbox] { min-width: 20px; min-height: 20px; }
  textarea { min-height: 160px; }
  #brief label, .demo-controls label { font-size: 14px; }
  .contact-consent { min-height: 44px; padding: 8px 0; align-items: flex-start; }
  .contact-consent span, .contact-privacy, .contact-help { font-size: 12px; }
  #brief, #request-fields, .project > div, .demo-controls, .scene-panel,
  .home-layout > *, .demo-shell > *, .service > *, .scope > * { min-width: 0; }
  #result pre, .send-status, .contact-privacy { overflow-wrap: anywhere; }
  .detail .service-nav { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .detail .service-nav a { display: flex !important; align-items: center; justify-content: center; font-size: 12px; padding: 12px 10px; text-align: center; }
  .detail .service-nav a:last-child { grid-column: 1 / -1; }
  .hotspot { width: 44px; height: 44px; }
  .hotspot span { top: 48px; }
  summary { min-height: 44px; padding: 10px 0; }
  footer { overflow-wrap: anywhere; }
}

@media (max-width: 600px) {
  body > header { padding: 12px 16px; }
  header .company-brand { font-size: 16px; }
  header .company-brand small { max-width: 220px; font-size: 7.5px; }
  .wrap, .detail { max-width: 100%; }
  .detail { padding: 20px 16px; }
  .hero { height: auto; min-height: 540px; }
  .hero-copy { padding: 30px 20px 120px; }
  .hero h1 { font-size: clamp(34px,9.7vw,44px); letter-spacing: -1px; }
  .hero p { font-size: 16px; line-height: 1.5; }
  .hero .actions { display: grid; grid-template-columns: 1fr; gap: 10px; max-width: 360px; }
  .hero .actions .btn { width: 100%; min-height: 48px; font-size: 12px; }
  .home-experience, .journey, .compare-section { padding: 36px 16px; }
  .home-layout, .demo-shell { grid-template-columns: minmax(0,1fr); }
  .scene-panel { padding: 22px 18px; }
  .home-tags { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .home-tags button { padding: 10px 8px; font-size: 13px; }
  .modes { flex-wrap: wrap; }
  .modes button { font-size: 12px; }
  .demo-controls { padding: 22px 16px; }
  .service-demo:not([data-demo=domotique]):not([data-demo=automatismes]) .demo-photo {
    width: 100%; min-height: 0; aspect-ratio: auto;
  }
  .service-demo:not([data-demo=domotique]):not([data-demo=automatismes]) .demo-photo > img {
    position: relative; display: block; width: 100%; height: auto; aspect-ratio: 3/2; object-fit: cover;
  }
  .service-demo:not([data-demo=domotique]):not([data-demo=automatismes]) .photo-footer {
    position: relative; padding: 18px 16px; background: #0b100d; font-size: 13px;
  }
  .service-demo:not([data-demo=domotique]):not([data-demo=automatismes]) .demo-enlarge {
    top: 12px; right: 10px; bottom: auto;
  }
  .service-demo:not([data-demo=domotique]):not([data-demo=automatismes]) .photo-pill {
    top: 12px; left: 10px; max-width: calc(100% - 90px); font-size: 10px; padding: 8px 10px;
  }
  .charge-visual { width: 88px; padding: 10px; top: 65px; }
  .demo-control-group button { flex: 1 1 auto; font-size: 13px; }
  .shutter-commands { padding: 12px; }
  .shutter-buttons { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .shutter-buttons button { white-space: normal; font-size: 12px; padding: 10px 4px; line-height: 1.3; }
  .shutter-scale { flex-wrap: wrap; }
  .shutter-scale button { order: 3; width: 100%; font-size: 12px; margin-top: 4px; }
  .shutter-scale span:last-child { margin-left: auto; }
  .domotique-project { padding: 22px 16px; }
  .demo-save { padding: 13px 12px; font-size: 12px; }
  .demo-readout { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .demo-readout div { overflow-wrap: anywhere; }
  .demo-disclaimer, .experience-note { font-size: 12px !important; line-height: 1.55; }
  .journey-actions { flex-wrap: wrap; }
  .journey-actions .btn { flex: 1; min-height: 48px; }
  .project > div:last-child { padding: 20px 16px; }
  #request-fields { grid-template-columns: minmax(0,1fr); }
  .contact-submit-actions { flex-direction: column; }
  .contact-submit-actions .btn { width: 100%; min-height: 50px; font-size: 13px; }
  .result { padding: 18px 14px; }
  .detail h1 { font-size: clamp(32px,9vw,44px); overflow-wrap: anywhere; }
  .detail h2 { font-size: 27px; }
  .detail-cta { padding: 22px 18px !important; }
  .detail-cta .btn { width: 100%; }
  .service-cards strong { font-size: 13px; line-height: 1.4; }
  .service-cards p, .quick-services p { font-size: 13px; line-height: 1.5; }
  .about p, .step p, .scope li, .example p, .detail-lead { font-size: 15px; line-height: 1.65; }
  .lightbox, .shutter-preview { max-width: calc(100vw - 20px); max-height: 90dvh; padding: 10px; }
  .lightbox img { max-width: 100%; max-height: 74dvh; }
}

@media (max-width: 360px) {
  header .company-brand { font-size: 15px; }
  header .company-brand small { font-size: 7px; }
  .menu-toggle:not([hidden]) { padding: 10px; gap: 6px; }
  .service-cards { grid-template-columns: minmax(0,1fr); }
  .service-cards img { height: 170px; }
  .charge { grid-template-columns: minmax(0,1fr); }
  .charge > img { height: 230px; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-icon::before, .menu-icon::after { transition: none; }
}
