/* Contact Overlay — desktop split / mobile bottom sheet */

.chiye-contact {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease-out, visibility 0s linear 220ms;
}

.chiye-contact.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 220ms ease-out, visibility 0s linear 0s;
}

.chiye-contact__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 13, 12, 0.4);
  border: 0;
  cursor: pointer;
}

.chiye-contact__panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  background: #f5f4f1;
  color: #141311;
  padding: clamp(1.75rem, 3.5vw, 2.5rem);
  transform: translateY(8px);
  transition: transform 220ms ease-out;
  box-shadow: 0 24px 64px rgba(14, 13, 12, 0.12);
}

.chiye-contact.is-open .chiye-contact__panel {
  transform: translateY(0);
}

.chiye-contact__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: #141311;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  z-index: 2;
}

.chiye-contact__close:hover {
  opacity: 1;
}

.chiye-contact__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
}

.chiye-contact__eyebrow {
  margin: 0 0 0.85rem;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(20, 19, 17, 0.42);
}

.chiye-contact__title {
  margin: 0;
  max-width: 12em;
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  font-weight: 560;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.chiye-contact__lead {
  margin: 1rem 0 0;
  max-width: 22em;
  font-size: 0.98rem;
  line-height: 1.6;
  color: rgba(20, 19, 17, 0.7);
}

.chiye-contact__qr-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.chiye-contact__qr {
  width: 240px;
  height: 240px;
  padding: 18px;
  background: #fff;
  border: 1px solid rgba(20, 19, 17, 0.1);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(14, 13, 12, 0.05);
  display: grid;
  place-items: center;
  /* no overflow crop that could clip QR */
}

.chiye-contact__qr img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  /* CRITICAL: no filter / opacity / blend / blur on QR */
  opacity: 1;
  image-rendering: auto;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.chiye-contact__hint {
  margin: 0.85rem 0 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(20, 19, 17, 0.45);
}

.chiye-contact__subhint {
  margin: 0.45rem 0 0;
  max-width: 16em;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(20, 19, 17, 0.5);
}

.chiye-contact__save {
  margin-top: 0.85rem;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: #141311;
  border: 1px solid rgba(20, 19, 17, 0.28);
  padding: 0.45rem 0.75rem;
  background: transparent;
  cursor: pointer;
  transition: background 250ms ease, color 250ms ease;
}

.chiye-contact__save:hover {
  background: #141311;
  color: #f5f4f1;
}

body.chiye-contact-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .chiye-contact {
    align-items: flex-end;
    padding: 0;
  }

  .chiye-contact__panel {
    width: 100%;
    max-height: min(90svh, 720px);
    overflow: auto;
    padding: 1.35rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 280ms ease-out;
    box-shadow: 0 -12px 40px rgba(14, 13, 12, 0.1);
  }

  .chiye-contact.is-open .chiye-contact__panel {
    transform: translateY(0);
  }

  .chiye-contact__layout {
    grid-template-columns: 1fr;
    gap: 1.35rem;
    text-align: left;
  }

  .chiye-contact__qr-col {
    padding-bottom: 0.25rem;
  }

  .chiye-contact__qr {
    width: min(68vw, 280px);
    height: min(68vw, 280px);
    padding: 16px;
  }

  .chiye-contact__title {
    max-width: none;
    padding-right: 1.5rem;
  }

  .chiye-contact__lead {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chiye-contact,
  .chiye-contact__panel {
    transition: none !important;
  }
}
