/* Panneau de contact : glisse depuis la droite, par-dessus un voile sombre. Deux raccourcis (appel direct,
   WhatsApp) puis le formulaire, dans la grammaire du site : capitales Geist 900, libellés en Geist Mono,
   filets fins, coins à 4 px, boutons pleins à angles droits. */

html:has(.contact-dialog[open]) {
  overflow: hidden;
}
.contact-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(640px, 100vw);
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  translate: 100% 0;
  transition: translate 0.45s cubic-bezier(0.7, 0, 0.84, 0);
}
.contact-dialog.is-open {
  translate: 0 0;
  transition: translate 0.95s var(--ease-expo);
}
.contact-dialog:focus {
  outline: none;
}
.contact-dialog::backdrop {
  background: rgb(var(--ink-rgb) / 0.46);
  opacity: 0;
  transition: opacity 0.45s ease;
}
.contact-dialog.is-open::backdrop {
  opacity: 1;
  transition-duration: 0.7s;
}

/* Les blocs arrivent l'un après l'autre (--i posé par contact.js). */
.dialog-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 26px 44px 40px;
}
.dialog-inner > * {
  opacity: 0;
  translate: 0 28px;
  transition:
    opacity 0.25s ease,
    translate 0.3s ease;
}
.contact-dialog.is-open .dialog-inner > * {
  opacity: 1;
  translate: 0 0;
  transition:
    opacity 0.8s var(--ease-out) calc(0.2s + var(--i, 0) * 0.07s),
    translate 1.1s var(--ease-expo) calc(0.2s + var(--i, 0) * 0.07s);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.dialog-kicker {
  color: var(--ink-2);
}
.dialog-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgb(var(--chip-rgb) / 0.6);
  font-size: 18px;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    rotate 0.5s var(--ease-expo);
}
.dialog-close:hover {
  background: var(--ink);
  color: var(--bg);
  rotate: 90deg;
}
.dialog-title {
  margin-top: 44px;
  font: 900 clamp(2rem, 0.5rem + 2.74vw, 2.875rem) / 0.92 var(--sans);
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.dialog-title-accent {
  color: var(--grey-accent);
}

/* ---------- Appel direct et WhatsApp : la carte se remplit d'encre au survol ---------- */
.contact-channels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 36px;
}
.contact-channel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 18px 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgb(var(--chip-rgb) / 0.38);
  transition:
    color 0.35s var(--ease-out),
    border-color 0.35s var(--ease-out),
    scale 0.15s ease;
}
.contact-channel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: 50% 100%;
  transition: transform 0.55s var(--ease-expo);
}
.contact-channel:hover,
.contact-channel:focus-visible {
  border-color: var(--ink);
  color: var(--bg);
}
.contact-channel:hover::before,
.contact-channel:focus-visible::before {
  transform: none;
}
.contact-channel:active {
  scale: 0.98;
}
.contact-channel-top {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.contact-channel-top .icon {
  font-size: 18px;
}
.contact-channel-go {
  margin-left: auto;
  transition: translate 0.35s var(--ease-out);
}
.contact-channel:hover .contact-channel-go {
  translate: 3px -3px;
}
.contact-channel-big {
  font: 900 clamp(1.3125rem, 0.5rem + 1.44vw, 1.625rem) / 1 var(--sans);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.contact-channel-note {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
  transition: color 0.35s var(--ease-out);
}
.contact-channel:hover .contact-channel-note,
.contact-channel:focus-visible .contact-channel-note {
  color: rgb(var(--bg-rgb) / 0.72);
}

/* « Ou sinon, la bonne vieille méthode » : même accent gris que les grands titres. */
.contact-or {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font: 900 20px / 1.1 var(--sans);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.contact-or span {
  color: var(--grey-accent);
}

/* ---------- Formulaire : champs soulignés, le trait d'encre se dessine au focus ---------- */
.contact-form {
  display: grid;
  gap: 22px;
  margin-top: 26px;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 24px;
}
.field {
  display: grid;
  gap: 6px;
}
.field-label {
  font-size: 11px;
  color: var(--ink-2);
}
.field-label small {
  font-size: inherit;
  letter-spacing: inherit;
  color: var(--ink-3);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 6px 0 10px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--line), var(--line));
  background-repeat: no-repeat;
  background-position:
    0 100%,
    0 100%;
  background-size:
    0% 2px,
    100% 1px;
  font: 400 17px / 1.4 var(--sans);
  color: var(--ink);
  transition: background-size 0.6s var(--ease-expo);
  -webkit-appearance: none;
  appearance: none;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-3);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  background-size:
    100% 2px,
    100% 1px;
}
.field input:user-invalid {
  background-image: linear-gradient(#b3261e, #b3261e), linear-gradient(var(--line), var(--line));
  background-size:
    100% 2px,
    100% 1px;
}
.field select {
  padding-right: 28px;
  background-image:
    linear-gradient(var(--ink), var(--ink)),
    linear-gradient(var(--line), var(--line)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%230b0b0b' d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
  background-position:
    0 100%,
    0 100%,
    right 2px center;
  background-size:
    0% 2px,
    100% 1px,
    14px 14px;
  cursor: pointer;
}
.field select:focus {
  background-size:
    100% 2px,
    100% 1px,
    14px 14px;
}
.field textarea {
  min-height: 92px;
  resize: vertical;
}
.contact-hint {
  margin-top: -8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
}
.form-status {
  font-size: 14px;
  line-height: 1.5;
}
.form-status:empty {
  display: none;
}
.form-status.error {
  color: #b3261e;
}
.form-status.success {
  color: #1d7a45;
}
.dialog-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 56px;
  padding: 0 22px;
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  transition:
    opacity 0.2s ease,
    scale 0.15s ease;
}
.dialog-submit .icon {
  font-size: 15px;
  transition: translate 0.35s var(--ease-out);
}
.dialog-submit:hover .icon {
  translate: 3px -3px;
}
.dialog-submit:active {
  scale: 0.99;
}
.dialog-submit:disabled {
  opacity: 0.5;
  cursor: progress;
}
.dialog-disclosure {
  display: block;
  margin-top: -6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
}
.dialog-disclosure a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 640px) {
  .contact-dialog {
    border-left: 0;
  }
  .dialog-inner {
    padding: 18px var(--edge) 32px;
  }
  .dialog-title {
    margin-top: 32px;
  }
  .contact-channels,
  .field-row {
    grid-template-columns: 1fr;
  }
}
