/* ==========================================================================
   Contact — "Kontakt"
   The closing panel. Bookends the hero: the same two hands, still and faint,
   frame the invitation. Below it: what to write about, the e-mail address,
   and the form, which sends through the server (assets/js/contact.js).
   ========================================================================== */

.contact {
  isolation: isolate;
  overflow: hidden;
  margin-bottom: var(--panel-inset);
}

/* The hero's first frame, reused (already in the browser cache). "screen"
   drops its black background, so only the hands show on the panel surface. */
.contact__backdrop {
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: clamp(34rem, 22rem + 30vw, 54rem);
  background: url("../video/hero-hands-poster.webp") 50% 45% / cover no-repeat;
  opacity: 0.34;
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 55%, transparent);
  pointer-events: none;
}

.contact__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 48rem;
  margin-inline: auto;
  text-align: center;
}

.contact__header .section-lead {
  margin-inline: auto;
}

.contact__layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 3rem clamp(3rem, 6vw, 6rem);
  align-items: start;
  margin-top: clamp(3.5rem, 2.5rem + 4vw, 6rem);
}

/* ---- What to write about ------------------------------------------------------ */

.contact__prompts-title {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--color-text-subtle);
}

.contact__prompts {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.contact__prompts li {
  position: relative;
  padding-left: 1.5rem;
}

.contact__prompts li::before {
  content: "";
  position: absolute;
  top: 0.65em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
}

/* ---- Form ------------------------------------------------------------------------ */

/* a slightly lighter surface, with a little of the warm light on it */
.contact__form {
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  border: 1px solid var(--color-line-soft);
  border-radius: 1.5rem;
  background:
    radial-gradient(70% 55% at 100% 0%, var(--color-accent-glow), transparent 70%),
    var(--color-surface-2);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.07);
}

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

.field + .field {
  margin-top: 1.25rem;
}

.field__label {
  font-size: 0.9375rem;
  line-height: 1.4;
}

.field__optional {
  margin-left: 0.4em;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-subtle);
}

.field__control {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 0.75rem;
  background: #09090a;
  color: var(--color-text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.field__control:hover {
  border-color: rgb(255 255 255 / 0.35);
}

.field__control:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.field__control:user-invalid {
  border-color: #ff9a9a;
}

textarea.field__control {
  min-height: 9.5rem;
  resize: vertical;
}

.field__hint {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text-subtle);
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.75rem;
}

.contact__status {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.contact__status:empty {
  display: none;
}

.contact__status.is-error {
  color: #ffb3b3;
}

/* the form cannot send yet (no mailbox configured, or no server): said before anyone types */
.contact__status.is-notice {
  flex-basis: 100%;
  padding: 0.85rem 1rem;
  border: 1px dashed rgb(242 163 94 / 0.6);
  border-radius: 0.75rem;
  background: rgb(242 163 94 / 0.06);
  color: var(--color-text);
}

.contact__privacy {
  margin-top: 1.5rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--color-text-subtle);
  text-wrap: pretty;
}

.contact__privacy .text-link {
  display: inline;
  color: var(--color-text-muted);
}

/* a field for bots only: out of sight, out of the keyboard's way */
.contact__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* after sending: the form makes way for the confirmation */
.contact__success {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.contact__success[hidden] {
  display: none;
}

.contact__success:focus {
  outline: none;
}

.contact__success .spark {
  margin-top: 0.7em;
}

.contact__success-title {
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
  font-variation-settings: "opsz" 32;
  line-height: 1.25;
}

.contact__success-text {
  margin-top: 0.6rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* without JavaScript the form posts normally and comes back to #kontakt-wyslano or #kontakt-blad */
.contact__flash {
  display: none;
  margin-bottom: 1.5rem;
  padding: 0.9rem 1.1rem;
  border-radius: 0.75rem;
  line-height: 1.5;
}

.contact__flash:target {
  display: block;
}

.contact__flash--ok {
  border: 1px solid rgb(242 163 94 / 0.5);
  background: var(--color-accent-glow);
  color: var(--color-text);
}

.contact__flash--error {
  border: 1px solid rgb(255 154 154 / 0.5);
  background: rgb(255 154 154 / 0.06);
  color: #ffd6d6;
}

/* ---- E-mail instead of the form ----------------------------------------------------- */

.contact__direct {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--color-line-soft);
}

.contact__direct-text {
  margin-top: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.contact__direct-text .text-link {
  display: inline;
}

/* ---- Tablet and phone --------------------------------------------------------- */

@media (max-width: 1023.98px) {
  .contact__layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .field__control {
    transition: none;
  }
}
