/* Contact drawer styles: slides in from the right side.
   Relies on shared design tokens (--ink, --font-display, --font-primary) from sec1.css. */

body.contact-open {
  overflow: hidden;
}

.contact-shell {
  position: fixed;
  inset: 0;
  z-index: 10500;
  display: flex;
  justify-content: flex-end;
  visibility: hidden;
  pointer-events: none;
}

.contact-shell.is-open {
  visibility: visible;
  pointer-events: auto;
}

.contact-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.55);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.contact-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: #ffffff;
  color: var(--ink);
  box-shadow: -30px 0 90px rgba(0, 0, 0, 0.4);
}

.contact-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  padding: 2.4rem clamp(1.5rem, 4vw, 2.6rem) 1.4rem;
  border-bottom: 1px solid #ededee;
}

.contact-kicker {
  margin-bottom: 0.55rem;
  color: rgba(8, 10, 15, 0.42);
  font-size: 0.76rem;
}

.contact-header h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.contact-close {
  min-width: 5rem;
  height: 2.7rem;
  padding: 0 1.2rem;
  border: 0;
  border-radius: 999px;
  background: #f1f2f4;
  color: rgba(8, 10, 15, 0.7);
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.contact-close:hover,
.contact-close:focus-visible {
  background: #e6e7ea;
  color: var(--ink);
}

.contact-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 1.6rem clamp(1.5rem, 4vw, 2.6rem) max(2.2rem, env(safe-area-inset-bottom));
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.contact-body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-field {
  display: grid;
  gap: 0.5rem;
}

.contact-field span {
  color: rgba(8, 10, 15, 0.55);
  font-size: 0.75rem;
}

.contact-field input,
.contact-field select,
.contact-field textarea {
  width: 100%;
  min-height: 3.5rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 14px;
  outline: none;
  background: #f4f5f6;
  color: var(--ink);
  font: 500 0.95rem var(--font-primary);
  letter-spacing: 0;
  text-transform: none;
}

.contact-field textarea {
  resize: vertical;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder {
  color: rgba(8, 10, 15, 0.35);
}

.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  border-color: var(--ink);
  background: #ffffff;
}

.contact-submit {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.6rem;
  margin-top: 0.4rem;
  padding: 0 1rem 0 1.6rem;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.3s ease;
}

.contact-submit:hover {
  background: #1c1f27;
}

.contact-submit__icon {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink);
  font-size: 1.05rem;
}

.contact-aside {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "email phone"
    "social studio";
  gap: 1.1rem 1.4rem;
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid #ededee;
}

.contact-detail {
  display: grid;
  gap: 0.3rem;
  align-content: start;
}

.contact-detail--email {
  grid-area: email;
}

.contact-detail--phone {
  grid-area: phone;
}

.contact-detail--studio {
  grid-area: studio;
}

.contact-detail span {
  color: rgba(8, 10, 15, 0.45);
  font-size: 0.72rem;
}

.contact-detail a,
.contact-detail p {
  color: var(--ink);
  font-size: 1rem;
  text-decoration: none;
  text-transform: none;
}

.contact-detail a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.contact-socials {
  grid-area: social;
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.contact-socials a {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border: 1px solid rgba(8, 10, 15, 0.16);
  border-radius: 50%;
  color: rgba(8, 10, 15, 0.7);
  font-size: 0.78rem;
  text-decoration: none;
  transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
}

.contact-socials a:hover,
.contact-socials a:focus-visible {
  border-color: var(--ink);
  color: #ffffff;
  background: var(--ink);
}

@media (max-width: 640px) {
  .contact-panel {
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .contact-panel::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .contact-header {
    padding-top: max(1.5rem, env(safe-area-inset-top));
  }

  .contact-body {
    flex: none;
    min-height: auto;
    overflow: visible;
    padding-bottom: max(2.75rem, calc(1.5rem + env(safe-area-inset-bottom)));
  }

  .contact-aside {
    grid-template-columns: 1fr;
    grid-template-areas:
      "email"
      "phone"
      "studio"
      "social";
  }
}
