/* ==========================================================================
   Contact page. Loaded only by /contact/.
   Left: who you are talking to and the direct lines. Right: the message form.
   Field names are unchanged; /js/contact-form.js posts to /api/contact.
   ========================================================================== */
.ct-page {
  --ct-mark: #ffe58a;
  position: relative; overflow: clip;
  padding: var(--sp-6, 32px) 0 var(--sp-9, 96px);
  background:
    radial-gradient(40% 55% at 88% 20%, rgba(0, 122, 252, 0.11), transparent 70%),
    var(--surface);
}
.ct-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: var(--sp-8, 64px); align-items: start; margin-top: var(--sp-5, 24px); }

/* ---- left ---------------------------------------------------------------- */
.ct-intro { position: sticky; top: 110px; }
.ct-intro h1 { position: relative; z-index: 0; margin-top: 10px; font-size: clamp(2.3rem, 4.2vw, 3.3rem); letter-spacing: -0.025em; line-height: 1.06; text-wrap: balance; }
.ct-under { position: relative; white-space: nowrap; }
.ct-under::after {
  content: ""; position: absolute; left: -2px; right: -4px; bottom: 0.06em; height: 0.28em; z-index: -1;
  background: var(--ct-mark); border-radius: 3px; transform: rotate(-1deg);
}
.ct-intro .lede { margin-top: var(--sp-4, 16px); max-width: 42ch; }
.ct-ways { display: grid; gap: 10px; margin-top: var(--sp-6, 32px); max-width: 440px; }
.ct-way {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); text-decoration: none; color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.ct-way:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft, #e3efff); transform: translateY(-1px); }
.ct-way:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ct-way-ic { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft, #e3efff); color: var(--accent); }
.ct-way-ic.wa { background: #e4f6ef; color: #0b7a5a; }
.ct-way-ic svg { width: 20px; height: 20px; }
.ct-way > span:nth-child(2) { flex: 1; min-width: 0; }
.ct-way b { display: block; font-size: 0.95rem; color: var(--text-1); }
.ct-way small { display: block; font-size: 0.8rem; color: var(--text-2); overflow-wrap: anywhere; }
.ct-way-go { width: 18px; height: 18px; color: var(--text-3); flex: 0 0 18px; }
.ct-way:hover .ct-way-go { color: var(--accent); }
.ct-aside { margin-top: var(--sp-5, 24px); font-size: 0.86rem; color: var(--text-3); }
.ct-aside a { color: var(--accent); font-weight: 600; text-decoration: none; }
.ct-aside a:hover { text-decoration: underline; }

/* ---- the form: a sheet of note paper ------------------------------------ */
.ct-form {
  position: relative; display: grid; gap: 18px;
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px 32px 28px;
  box-shadow: 0 30px 60px -36px rgba(0, 24, 60, 0.35), 0 2px 6px rgba(0, 24, 60, 0.04);
}
.ct-form::before {   /* a margin rule down the left, like writing paper */
  content: ""; position: absolute; left: 16px; top: 24px; bottom: 24px; border-left: 2px solid #ffd5da; pointer-events: none;
}
.ct-form-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px dashed var(--line-strong); }
.ct-form-head b { font-family: var(--font-display); font-size: 1.2rem; color: var(--text-1); }
.ct-form-head span { font-size: 0.8rem; color: var(--text-3); }

.ct-k, .ct-label { display: block; margin: 0 0 6px; font-size: 0.82rem; font-weight: 600; color: var(--text-1); }
.ct-opt { font-weight: 400; color: var(--text-3); margin-left: 4px; }
.ct-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.ct-count { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-3); }
.ct-form .form-input, .ct-form .form-textarea { font-size: 0.95rem; }
.ct-form .form-textarea { min-height: 0; }

.ct-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-topics .ct-k { flex-basis: 100%; }
.ct-topics label { position: relative; cursor: pointer; }
.ct-topics input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ct-topics label span {
  display: inline-block; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff;
  font-size: 0.82rem; font-weight: 600; color: var(--text-2); transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ct-topics label:hover span { border-color: var(--text-3); }
.ct-topics input:checked + span { background: var(--text-1); border-color: var(--text-1); color: #fff; }
.ct-topics input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.ct-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ct-row > div { min-width: 0; }

.ct-drop {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm, 10px); background: var(--surface);
  cursor: pointer; color: var(--text-2); transition: border-color 0.15s ease, background-color 0.15s ease;
}
.ct-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ct-drop svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--text-3); }
.ct-drop-txt { min-width: 0; font-size: 0.86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-drop-txt small { font-weight: 400; color: var(--text-3); margin-left: 4px; }
.ct-drop:hover, .ct-drop.over { border-color: var(--accent); background: #f3f8ff; }
.ct-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.ct-drop.has-file { border-style: solid; border-color: #0b7a5a; background: #e4f6ef; color: #0b7a5a; }
.ct-drop.has-file svg { color: #0b7a5a; }
.ct-drop.bad { border-color: #c0263a; background: #fdecef; color: #c0263a; }

.ct-send { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 4px; }
.ct-send .btn { gap: 8px; }
.ct-send .btn svg { width: 17px; height: 17px; }
.ct-send > span { font-size: 0.8rem; color: var(--text-3); }
.ct-form .form-msg { margin: 0; }
.ct-form .form-msg:not(.show) { display: none; }

@media (max-width: 1024px) {
  .ct-grid { grid-template-columns: 1fr; gap: var(--sp-6, 32px); max-width: 680px; margin-inline: auto; }
  .ct-intro { position: static; }
  .ct-ways { grid-template-columns: 1fr 1fr; max-width: none; }
}
@media (max-width: 640px) {
  .ct-page { padding-bottom: var(--sp-7, 48px); }
  .ct-intro h1 { font-size: clamp(2rem, 9vw, 2.5rem); }
  .ct-ways { grid-template-columns: 1fr; }
  .ct-form { padding: 22px 18px 22px 26px; border-radius: 16px; }
  .ct-form::before { left: 12px; }
  .ct-row { grid-template-columns: 1fr; }
  .ct-send .btn { width: 100%; justify-content: center; }
  .ct-send > span { width: 100%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .ct-way, .ct-topics label span, .ct-drop { transition: none; } .ct-way:hover { transform: none; } }
