/* ---------- Contact page (layout primitives live in support.css) ---------- */

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 64px;
  align-items: start;
  padding-top: 72px;
}

/* ---------- Intro column ---------- */

.contact-intro {
  position: sticky;
  top: calc(var(--header-height) + 32px);
}

.contact-title {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.045em;
  background: linear-gradient(180deg, #fff 30%, #a9adb9 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: s-rise 1s var(--ease-out) both;
}

.contact-intro .support-lead {
  max-width: 460px;
  margin: 22px 0 0;
  color: var(--s-dim);
  font-size: 1.04rem;
  line-height: 1.85;
}

.contact-flow {
  position: relative;
  display: grid;
  gap: 0;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.contact-flow li {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding-bottom: 18px;
}

.contact-flow li:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 32px;
  bottom: 2px;
  left: 14.5px;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 138, 76, 0.55), var(--s-hair));
}

.contact-flow-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 138, 76, 0.45);
  background: rgba(255, 122, 69, 0.08);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
}

.contact-flow strong {
  display: block;
  margin-top: 4px;
  font-size: 0.94rem;
}

.contact-flow div > span {
  color: var(--s-dim);
  font-size: 0.84rem;
  line-height: 1.6;
}

/* Photo with direct email */
.contact-visual {
  position: relative;
  margin: 26px 0 0;
  min-height: 230px;
  border-radius: 22px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 40px 80px -40px rgba(0, 0, 0, 0.9);
}

.contact-visual img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 60%;
  transform: scale(1.08) translate3d(calc(var(--px, 0) * -10px), calc(var(--py, 0) * -8px), 0);
  transition: transform 0.8s var(--ease-out);
}

.contact-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(6, 7, 11, 0.92) 0%, rgba(6, 7, 11, 0.6) 55%, rgba(6, 7, 11, 0.1) 100%),
    radial-gradient(260px circle at var(--mx, 80%) var(--my, 30%), rgba(255, 138, 76, 0.18), transparent 70%);
}

.contact-visual figcaption {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 30px 28px;
}

.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  color: #fff;
  font-size: 1.18rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease-out), color 0.3s ease;
}

.contact-mail svg {
  flex: none;
  width: 16px;
  height: 16px;
  transition: transform 0.4s var(--ease-out);
}

.contact-mail:hover {
  color: var(--amber);
  background-size: 100% 1px;
}

.contact-mail:hover svg {
  transform: translateX(4px);
}

.contact-mail:focus-visible {
  outline: 2px solid #ffb48a;
  outline-offset: 4px;
  border-radius: 4px;
}

.contact-visual-note {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.84rem;
}

.contact-visual-credit {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.66rem;
}

.contact-visual-credit a:hover {
  color: #fff;
}

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

.contact-panel {
  --text: #f1eee8;
  --text-2: #d3cdc4;
  --muted: #a49c91;
  --s-dim: #b4aca1;
  --s-faint: #a49c91;
  --s-hair: rgba(220, 206, 184, 0.12);
  --s-hair-2: rgba(220, 206, 184, 0.24);
  --orange: #d5b98b;
  --amber: #dcc59e;
  position: relative;
  padding: 32px 0 12px 40px;
  border-left: 1px solid var(--s-hair);
  border-radius: 0;
  background: none;
  color: var(--text);
  box-shadow: none;
}

.contact-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 40px;
  right: 0;
  height: 1px;
  background: var(--s-hair-2);
}

.contact-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--s-hair);
}

.contact-panel h2 {
  margin: 10px 0 0;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.contact-panel-head p {
  margin: 8px 0 0;
  color: var(--s-dim);
  font-size: 0.9rem;
  line-height: 1.7;
}

.contact-secure {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  color: var(--muted);
  background: none;
}

.contact-secure svg {
  width: 18px;
  height: 18px;
}

/* Topic selector */
.contact-topics {
  margin: 26px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.contact-topics legend,
.contact-panel label:not(.contact-topic) {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  padding: 0;
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 600;
}

.contact-topic-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.contact-topic {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--s-hair-2);
  border-radius: 0;
  background: none;
  color: var(--s-dim);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease;
}

.contact-topic input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.contact-topic-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--s-dim);
  background: none;
  transition: color 0.25s ease;
}

.contact-topic-icon svg {
  width: 16px;
  height: 16px;
}

.contact-topic:hover {
  color: #fff;
  border-color: var(--amber);
}

.contact-topic:has(input:checked) {
  color: var(--amber);
  background: none;
  border-color: var(--amber);
}

.contact-topic:has(input:checked) .contact-topic-icon {
  color: var(--amber);
  background: none;
}

.contact-topic:has(input:focus-visible) {
  outline: 2px solid #ffb48a;
  outline-offset: 2px;
}

.contact-topic-hint {
  margin: 12px 0 0;
  color: var(--s-faint);
  font-size: 0.8rem;
  line-height: 1.6;
  animation: contact-status-in 0.35s var(--ease-out);
}

/* Fields */
.contact-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contact-field {
  margin-top: 22px;
}

.field-tag {
  padding: 2px 0;
  background: none;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.field-tag.is-required {
  background: none;
  color: var(--amber);
}

.field-control {
  position: relative;
}

.field-control svg {
  position: absolute;
  z-index: 1;
  left: 0;
  top: 50%;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
  transition: color 0.2s ease;
}

.field-control:focus-within svg {
  color: var(--orange);
}

.contact-panel input:not([type="radio"]),
.contact-panel textarea {
  width: 100%;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--s-hair-2);
  border-radius: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, background-color 0.2s ease;
}

.contact-panel .field-control input {
  padding-left: 30px;
}

.contact-panel input::placeholder,
.contact-panel textarea::placeholder {
  color: #938b80;
}

.contact-panel input:not([type="radio"]):hover,
.contact-panel textarea:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.contact-panel input:not([type="radio"]):focus,
.contact-panel textarea:focus {
  outline: none;
  border-color: var(--amber);
  background: rgba(220, 206, 184, 0.025);
  box-shadow: 0 2px 0 -1px var(--amber);
}

.contact-panel input:user-invalid,
.contact-panel textarea:user-invalid {
  border-color: rgba(255, 93, 77, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 93, 77, 0.12);
}

.contact-panel input:not([type="radio"]):read-only,
.contact-panel textarea:read-only {
  opacity: 0.7;
}

.contact-topic input:disabled + .contact-topic-icon {
  opacity: 0.6;
}

.contact-panel textarea {
  display: block;
  resize: vertical;
  min-height: 160px;
  padding: 16px;
  border: 1px solid var(--s-hair-2);
  border-radius: 3px;
  background: #100f0e;
  line-height: 1.75;
}

.field-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

.char-count {
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}

.char-count.is-short {
  color: var(--amber);
}

.char-count.is-near-limit {
  color: var(--red);
}

.contact-privacy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 24px 0 18px;
  color: var(--s-faint);
  font-size: 0.8rem;
  line-height: 1.6;
}

.contact-privacy svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
  color: var(--muted);
}

#sendContact {
  min-height: 54px;
  border: 1px solid #e6dccb;
  border-radius: 3px;
  background: #e6dccb;
  color: #211e19;
  text-shadow: none;
  box-shadow: none;
  font-size: 1rem;
}

#sendContact:hover:not(:disabled),
#sendContact:active:not(:disabled) {
  background: #f3ebdf;
  border-color: #f3ebdf;
  box-shadow: none;
  filter: none;
}

#sendContact .btn-spinner {
  border-color: rgba(33, 30, 25, 0.2);
  border-top-color: #211e19;
}

/* ---------- Status ---------- */

.contact-panel #contactStatus {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
  line-height: 1.7;
  animation: contact-status-in 0.45s var(--ease-out);
}

.contact-panel #contactStatus::before {
  content: '';
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 50%;
}

.contact-panel #contactStatus.contact-pending {
  color: var(--text-2);
}

.contact-panel #contactStatus.contact-pending::before {
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--orange);
  animation: spin 0.7s linear infinite;
}

.contact-panel #contactStatus.contact-error {
  border-color: rgba(255, 93, 77, 0.35);
  background: rgba(255, 93, 77, 0.07);
  color: #ffb3a8;
}

.contact-panel #contactStatus.contact-error::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 5.5v5.5M10 14v.5' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 18px no-repeat,
    var(--red);
}

.contact-panel #contactStatus.contact-success {
  border-color: rgba(95, 224, 163, 0.35);
  background: rgba(95, 224, 163, 0.07);
  color: #b5f3d3;
}

.contact-panel #contactStatus.contact-success::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m6 10.3 2.6 2.5L14 7.5' fill='none' stroke='%2306130c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat,
    var(--green);
  animation: success-pop 0.6s var(--ease-spring);
}

@keyframes contact-status-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 48px;
  }

  /* Promote intro children into the grid so the form follows the intro text directly */
  .contact-intro {
    display: contents;
  }

  .contact-intro .s-kicker {
    justify-self: start;
  }

  .contact-panel {
    order: 1;
    margin-top: 36px;
    padding-left: 0;
    border-left: 0;
  }

  .contact-panel::before {
    left: 0;
  }

  .contact-visual {
    order: 2;
    margin-top: 20px;
  }
}

@media (max-width: 600px) {
  .contact-layout {
    padding-top: 36px;
  }

  .contact-title {
    font-size: clamp(2.5rem, 13vw, 3.2rem);
  }

  .contact-panel {
    padding: 26px 0 12px;
  }

  .contact-panel::before {
    left: 0;
    right: 0;
  }

  .contact-topic-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-topic {
    flex-direction: row;
    align-items: center;
    padding: 10px 0;
  }

  .contact-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .contact-visual figcaption {
    padding: 24px 20px;
  }

  .contact-mail {
    font-size: 1.02rem;
  }
}
