/* ============================================================
   Contact — paper, with the room you would be sitting in.

   The form is the one place on the site with a filled panel, and it
   is filled in warm paper rather than a darker blue: on a white page
   the enquiry should read as a sheet handed across a table, not as a
   modal. Rules and labels do the structuring; there are no boxes
   inside boxes.
   ============================================================ */

.contact__layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

/* Sits inside the masthead now; the head's own row supplies the
   space this margin used to. */
.contact__intro h2 {
  margin-top: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--t-h2);
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.contact__intro > p {
  margin-top: 1.5rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 44ch;
}

/* ---- The room ---- */

.contact__figure {
  margin-top: clamp(2rem, 4vw, 3rem);
}
.contact__figure .media { aspect-ratio: 3 / 2; }

/* ---- Details ---- */

.contact__details {
  margin-top: clamp(2.25rem, 4vw, 3rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 1.5rem;
}

.detail { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 1rem; align-items: start; }
.detail svg { width: 20px; height: 20px; color: var(--accent); margin-top: 2px; }
.detail__label {
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail__value {
  margin-top: 0.3rem;
  font-size: var(--t-body);
  color: var(--fg);
  line-height: 1.5;
  transition: color 0.4s var(--ease);
}
@media (hover: hover) { a.detail:hover .detail__value { color: var(--accent); } }

/* ---- Socials ---- */

.contact__socials {
  margin-top: clamp(2.25rem, 4vw, 3rem);
  display: flex;
  gap: 0.75rem;
}
.social {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease),
              background-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.social svg { width: 18px; height: 18px; }
@media (hover: hover) {
  .social:hover {
    color: var(--fg);
    border-color: var(--rule-strong);
    background: var(--tint);
    transform: translateY(-3px);
  }
}

/* ============================================================
   Form
   ============================================================ */

/* The intro column runs taller than the form — it carries a photograph
   and three contact blocks — so a statically placed panel leaves a hole
   half the height of the section beside the details. Sticky closes it:
   the form rides down with the reading and is on screen at the moment
   the reader finishes the address. */
.contact__panel {
  position: relative;
  padding: clamp(1.75rem, 3.5vw, 3rem);
  background: var(--paper-warm);
  border: 1px solid var(--rule);
}

@media (min-width: 900px) {
  .contact__panel {
    position: sticky;
    top: calc(var(--nav-h) + 2rem);
  }
}

.form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}
.field--wide { grid-column: 1 / -1; }

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

.field label {
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.field label .req { color: var(--accent); }

/* Underlined rather than boxed: on paper a filled input well is one
   more rectangle competing with the panel it sits in. */
.field input,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.1rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule-strong);
  border-radius: 0;
  color: var(--fg);
  font-size: var(--t-body);
  font-family: var(--body);
  transition: border-color 0.35s var(--ease), background-color 0.35s var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

.field input::placeholder,
.field textarea::placeholder { color: rgb(10 22 40 / 0.38); }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
  box-shadow: 0 1px 0 0 var(--accent);
}

.field input[aria-invalid='true'],
.field textarea[aria-invalid='true'] { border-bottom-color: #b3392a; }

.field__error {
  min-height: 1rem;
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  color: #a63523;
}

.form__footer {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.form__note {
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  color: var(--muted);
  max-width: 30ch;
}

.btn[data-busy='true'] { opacity: 0.6; pointer-events: none; }

/* ---- Success card ---- */

.form__success {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: clamp(1.75rem, 3.5vw, 3rem);
  text-align: center;
  background: var(--paper-warm);
}
.form__success[data-visible='true'] { display: flex; }
/* Focus moves here so the change is announced; the card is not
   interactive, so it does not need a focus ring of its own. */
.form__success:focus { outline: none; }

.form__success-mark {
  width: 62px; height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  color: var(--accent);
}
.form__success-mark svg { width: 30px; height: 30px; }

.form__success h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--t-h3);
  letter-spacing: -0.03em;
  color: var(--fg);
}
.form__success p { color: var(--muted); max-width: 34ch; line-height: 1.7; }

@media (max-width: 899px) {
  .contact__layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 559px) {
  .form__grid { grid-template-columns: minmax(0, 1fr); }
  .form__footer { flex-direction: column; align-items: stretch; }
  .form__footer .btn { width: 100%; }
}
