/* Contact: the navbar island glides to the centre and expands into a contact
   card with a message form (js/contact.js). Without motion it's simply the
   card. The card is inverted (ink background), like the island it grows from. */

.contact {
  padding: 12vh var(--pad) 4vh;
}

.ct__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(22px, 4vh, 40px);
}

.has-motion .contact.is-pinned {
  height: 220svh;
  padding: 0 var(--pad);
}

.has-motion .contact.is-pinned .ct__stage {
  position: sticky;
  top: 0;
  justify-content: center;
  height: 100svh;
  padding: 70px 0 16px;
}

.ct__head {
  text-align: center;
}

.ct__head .tag {
  margin-bottom: 0.6rem;
}

.ct__title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  font-weight: 400;
  line-height: 0.95;
  text-transform: uppercase;
  text-wrap: balance;
}

.ct__title em {
  color: var(--accent);
  font-style: normal;
}

/* ---------- The card ---------- */

.ct__card {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  padding: clamp(22px, 3vw, 32px);
  border-radius: 36px;
  background: var(--ink);
  color: var(--bg);
}

/* While the shell grows, the card itself is see-through; its content fades
   in on top once the shell has its size. */
.has-motion .contact.is-pinned .ct__card {
  background: transparent;
}

.ct__who {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ct__face {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 88%, var(--accent));
}

.ct__name {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  line-height: 1;
  text-transform: uppercase;
}

.ct__role {
  margin: 4px 0 0;
  color: color-mix(in srgb, var(--bg) 65%, var(--ink));
  font-size: 0.875rem;
}

.ct__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.ct__field {
  display: block;
  padding: 12px 16px 10px;
  border: 1.5px solid transparent;
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 9%, var(--ink));
  transition: border-color 0.2s;
}

.ct__field:focus-within {
  border-color: var(--accent);
}

.ct__field span {
  display: block;
  margin-bottom: 4px;
  color: color-mix(in srgb, var(--bg) 58%, var(--ink));
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ct__field input,
.ct__field textarea {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--bg);
  font: 500 1rem/1.4 var(--body);
  resize: none;
}

.ct__field input::placeholder,
.ct__field textarea::placeholder {
  color: color-mix(in srgb, var(--bg) 40%, var(--ink));
}

.ct__field--msg {
  grid-column: 1 / -1;
}

.ct__field.is-invalid {
  border-color: #ff6b5b;
}

.ct__form[hidden] {
  display: none;
}

.ct__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ct__row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.ct__link {
  padding: 0.8em 1.2em;
  border: 1.5px solid color-mix(in srgb, var(--bg) 25%, transparent);
  border-radius: 999px;
  color: var(--bg);
  font-size: 0.8125rem;
  font-weight: 700;
  transition: border-color 0.2s;
}

.ct__link:hover {
  border-color: var(--bg);
}

.ct__send {
  margin-left: auto;
  padding: 0.95em 1.5em;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 0.875rem/1 var(--body);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

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

.ct__send:disabled {
  opacity: 0.6;
  cursor: progress;
}

.ct__link:focus-visible,
.ct__send:focus-visible,
.ct__again:focus-visible,
.ct__foot a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.ct__status {
  grid-column: 1 / -1;
  min-height: 1.2em;
  margin: 2px 0 0;
  color: #ff8a7d;
  font-size: 0.8125rem;
}

.ct__status:empty {
  display: none;
}

/* Sent */
.ct__done {
  margin-top: 20px;
  padding: 26px 20px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--bg) 9%, var(--ink));
  text-align: center;
}

.ct__done[hidden] {
  display: none;
}

.ct__tick {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1.5rem;
  font-weight: 700;
}

.ct__done-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.9rem;
  text-transform: uppercase;
}

.ct__done-body {
  margin: 6px 0 14px;
  color: color-mix(in srgb, var(--bg) 62%, var(--ink));
  font-size: 0.875rem;
}

.ct__again {
  padding: 0.7em 1.2em;
  border: 1.5px solid color-mix(in srgb, var(--bg) 25%, transparent);
  border-radius: 999px;
  background: none;
  color: var(--bg);
  font: 700 0.8125rem/1 var(--body);
  cursor: pointer;
}

/* ---------- The growing shell (motion only) ---------- */

.ct__shell {
  display: none;
}

.has-motion .contact.is-pinned .ct__shell {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  background: var(--ink);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform-origin: 0 0;
  will-change: transform;
  pointer-events: none;
}

/* The pill's own content, shown while the shell is still island-sized.
   JS keeps it centred on the shell. Without motion it isn't shown. */
.ct__pill {
  display: none;
}

.has-motion .contact.is-pinned .ct__pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 16px 5px 5px;
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

.ct__pill img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 88%, var(--accent));
}

.ct__pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* The real navbar island steps aside while its double grows into the card. */
.is-contacting .island {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Footer ---------- */

.ct__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
}

.has-motion .contact.is-pinned .ct__foot {
  position: absolute;
  right: 0;
  bottom: 18px;
  left: 0;
}

.ct__foot a {
  color: var(--ink);
  font-weight: 700;
}

@media (max-width: 899px) {
  .ct__form {
    grid-template-columns: 1fr;
  }

  .ct__send {
    order: -1;
    width: 100%;
    margin-left: 0;
  }

  .ct__link {
    flex: 1;
    text-align: center;
  }

  .ct__foot span:nth-child(2) {
    display: none;
  }
}
