:root{
  /* ADN Elec & Solutions — nuances de #3A79BD */
  --brand: #3A79BD;
  --brand-dark: #2C5F99;
  --brand-light: #6FA6DD;
  --brand-soft: rgba(58,121,189,.12);

  --bg: #F2F7FD;
  --surface: #FFFFFF;
  --text: #0F2B4A;
  --muted: #4A6A88;
  --border: #CFE1F2;

  --shadow: 0 10px 30px rgba(15,43,74,.10);
  --shadow2: 0 1px 0 rgba(15,43,74,.06);

  --radius: 20px;
  --radius2: 16px;
  --focus: rgba(58,121,189,.55);
}

@media (prefers-color-scheme: dark){
  :root{
    --brand: #6FA6DD;
    --brand-dark: #3A79BD;
    --brand-light: #8BB8E6;
    --brand-soft: rgba(58,121,189,.18);

    --bg: #071625;
    --surface: #0B2136;
    --text: #EAF2FB;
    --muted: #A9C3DE;
    --border: #163A5A;

    --shadow: 0 14px 40px rgba(0,0,0,.55);
    --shadow2: 0 1px 0 rgba(255,255,255,.06);

    --focus: rgba(111,166,221,.60);
  }
}


*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -.01em;
  overflow-x: hidden;

  /* Center content block in the viewport (keeps scroll if content is taller) */
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 0;
}

/* Background canvas: behind everything */
#net{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Content sits above */
.wrap{
  position: relative;
  z-index: 1;
  max-width: 1040px;
  width: min(1040px, 100%);
  margin: 0;
  padding: 36px 20px 56px;
}

/* Subtle glass layer so text stays readable above animated bg */
.wrap::before{
  content:"";
  position:absolute;
  inset: -22px -18px -22px -18px;
  background: color-mix(in srgb, var(--bg) 10%, transparent); /* très léger */
  z-index:-1;
  border-radius: 28px;
  pointer-events:none;
}

a{color:inherit; text-decoration:none}
a:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 14px;
}

.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding: 12px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 0;
}

.mark{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow2);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -.04em;
  user-select:none;
}

.brandText{
  display:flex;
  flex-direction:column;
  gap:2px;
  line-height: 1.1;
  min-width: 0;
}

.brandText b{
  font-size: 13.5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.brandText span{
  font-size: 12px;
  color: var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.chip{
  font-size: 12.5px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-radius: 999px;
  padding: 9px 12px;
  display:flex;
  align-items:center;
  gap:10px;
  white-space:nowrap;
}

.chip::before{
  content:"";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity:.35;
}

.hero{
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding: 34px 28px;
}

.kicker{
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

h1{
  margin: 0 0 12px;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.lead{
  margin: 0;
  max-width: 70ch;
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
}

.cta{
  margin-top: 18px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.btn{
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 650;
  display:inline-flex;
  align-items:center;
  gap:10px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  box-shadow: var(--shadow2);
}

/* Buttons using .btn on <button> */
button.btn{
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}
button.btn:disabled{
  opacity: .6;
  cursor: not-allowed;
  transform: none !important;
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn.primary{
  background: var(--brand);
  color: var(--bg);
  border-color: transparent;
  box-shadow: none;
}

.btn.primary:hover{
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: none;
}

.more{
  margin-top: 16px;
  overflow: hidden;
  max-height: var(--more-max, 3200px);
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height .85s cubic-bezier(.2,.9,.2,1),
    opacity .55s ease,
    transform .55s ease,
    margin-top .55s ease;
}

.more.is-collapsed{
  max-height: 0;
  opacity: 0;
  transform: translateY(-10px);
  margin-top: 0;
  pointer-events: none;
}

.grid{
  margin-top: 0;
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.tile{
  grid-column: span 6;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 70%, transparent); /* + transparent */
  backdrop-filter: blur(12px);
  padding: 20px;
  box-shadow: var(--shadow2);
  transition: transform .18s ease, box-shadow .18s ease;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  min-height: 180px;
  position: relative;
  overflow:hidden;
}

.tile.wide{
  grid-column: 1 / -1; /* full row (equals two tiles) */
  min-height: 168px;
}

.tile:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.tileTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
}

.label{
  display:flex;
  align-items:center;
  gap:10px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.icon{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  display:grid;
  place-items:center;
  flex: 0 0 auto;
}

.open{
  font-size: 13px;
  color: var(--muted);
  display:inline-flex;
  align-items:center;
  gap:8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  white-space:nowrap;
}

.tile h2{
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.tile p{
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
  max-width: 60ch;
}

/* La tuile "OptiBOS" (wide) doit pouvoir utiliser toute la largeur */
.tile.wide p{
  max-width: none;
}

.url{
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  color: color-mix(in srgb, var(--muted) 85%, transparent);
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

footer{
  margin-top: 18px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 13px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  justify-content:space-between;
}

.links{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

footer a{color: var(--muted)}
footer a:hover{color: var(--brand-dark)}

@media (max-width: 920px){
  .tile{grid-column: span 12}
  .hero{padding: 28px 22px}
}

/* Si l’utilisateur veut moins d’animations, on garde un site clean */
@media (prefers-reduced-motion: reduce){
  *{transition:none !important}
}

/* ===== Contact modal ===== */

[hidden]{display:none !important}

.modal{
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
}

.modal.is-open{display:flex}

body.modal-open{overflow: hidden}

.modalPanel{
  width: min(760px, 100%);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
}

.modalHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.modalHeader h2{
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.iconBtn{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow2);
  display:grid;
  place-items:center;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.iconBtn:hover{transform: translateY(-1px)}

.modalLead{
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.status{
  min-height: 18px;
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.status[data-type="error"]{color: color-mix(in srgb, var(--brand-dark) 20%, #b00020)}
.status[data-type="warn"]{color: color-mix(in srgb, var(--brand-dark) 30%, #8a5b00)}
.status[data-type="ok"]{color: color-mix(in srgb, var(--brand-dark) 70%, #0a6d3b)}

.contactForm{
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.row{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field label{
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
  letter-spacing: .02em;
}

.field input,
.field textarea{
  width: 100%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-radius: 14px;
  padding: 11px 12px;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
}

.field textarea{resize: vertical; min-height: 120px}

.field input:focus-visible,
.field textarea:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.hp{position:absolute; left:-9999px; top:-9999px}

.check{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  font-size: 13px;
  color: var(--muted);
  user-select:none;
}

.check input{margin-top: 3px}

.actions{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin-top: 4px;
}

.note{
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.note a{color: var(--brand-dark); text-decoration: underline}

@media (max-width: 640px){
  .row{grid-template-columns: 1fr}
  .modalPanel{padding: 16px 14px}
}
