/* ==========================================================
   All Keyboards – Contact page
   Same system as the home page, guides and About: IBM Plex Sans, teal ink on cool paper,
   marigold only for focus. Motion only answers the visitor: focus, an error appearing, the
   send key pressing, the success check, a question opening. Markup: contact.php; behaviour:
   js/contact.js (classes is-invalid, is-loading, is-over).
   ========================================================== */
.ct-page {
  --ink: #0e2a31;
  --lagoon: #135e6e;
  --paper: #f3f7f8;
  --line: #d3e1e4;
  --muted: #4f6469;
  --marigold: #f2b33d;
  --key: #ffffff;
  --key-edge: #b8cfd4;
  --danger: #b42318;          /* 6.1:1 on white */
  --danger-soft: #fdf1ef;
  --font: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);

  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  padding: 52px 0 0;
}
.ct-page a { color: var(--lagoon); }
.ct-page :focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }

/* Lucide icons: thin outline */
.ct-page svg.lucide { width: 18px; height: 18px; stroke-width: 1.8; flex-shrink: 0; }

/* ---------- Heading ---------- */
.ct-hero { max-width: 720px; margin-bottom: 36px; }
.ct-title {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.1;
  color: var(--ink);
  text-wrap: balance;
}
.ct-lead { max-width: 60ch; margin: 0; font-size: 1.12rem; line-height: 1.65; color: var(--muted); }

/* ---------- Layout ---------- */
.ct-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px;
  align-items: start;
  padding-bottom: 64px;
}
.ct-card-title { margin: 0 0 4px; font-size: 1.2rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.ct-card-sub { margin: 0 0 22px; font-size: .92rem; color: var(--muted); }

/* ---------- Form panel ---------- */
.ct-form-card {
  padding: 32px;
  border-radius: 16px;
  background: var(--key);
  border: 1px solid var(--line);
  scroll-margin-top: 24px;
}
.ct-form { display: grid; gap: 20px; }
.ct-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ct-field { display: grid; gap: 7px; min-width: 0; }
.ct-field label { font-size: .95rem; font-weight: 600; color: var(--ink); }
.ct-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ct-counter { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ct-counter.is-over { color: var(--danger); font-weight: 600; }

/* inputs: a key with a soft bottom edge; focus lifts it to teal with a marigold edge */
.ct-input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--key-edge);
  border-radius: 10px;
  background-color: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  transition: border-color .18s var(--ease), background-color .18s var(--ease), box-shadow .18s var(--ease);
}
.ct-input::placeholder { color: #7b8e93; }
.ct-input:hover { border-color: var(--key-edge); }
.ct-input:focus {
  outline: none;
  background-color: var(--key);
  border-color: var(--lagoon);
  border-bottom-color: var(--marigold);
  box-shadow: 0 0 0 3px rgba(19, 94, 110, .14);
}
.ct-textarea { min-height: 168px; resize: vertical; }
.ct-select {
  appearance: none;
  padding-right: 42px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23135e6e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

/* errors: under the field, linked by aria-describedby; they fade in when they appear */
.ct-input.is-invalid { border-color: var(--danger); border-bottom-color: var(--danger); background-color: var(--danger-soft); }
.ct-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .14); }
.ct-error { margin: 0; font-size: .88rem; line-height: 1.4; color: var(--danger); }
.ct-error:empty { display: none; }
.ct-error:not(:empty) { animation: ct-reveal .22s var(--ease); }
.ct-error:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin: 0 6px -2px 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
@keyframes ct-reveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

.ct-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--danger-soft);
  border: 1px solid #f4c7c1;
  color: var(--danger);
  font-size: .95rem;
  line-height: 1.5;
  animation: ct-reveal .25s var(--ease);
}
.ct-alert svg.lucide { margin-top: 2px; }

/* honeypot: off-screen for people, still in the form for bots */
.ct-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.ct-form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; padding-top: 4px; }
.ct-privacy { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .88rem; color: var(--muted); }

/* ---------- Buttons: keys that press ---------- */
.ct-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  font: 600 1rem var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform .1s var(--ease), border-bottom-width .1s var(--ease), background-color .18s var(--ease);
}
.ct-btn--primary {
  border: 1px solid var(--lagoon);
  border-bottom: 3px solid var(--ink);
  background: var(--lagoon);
  color: #fff !important;
}
.ct-btn--primary:hover { background: #0f4c59; }
.ct-btn:active { transform: translateY(2px); border-bottom-width: 1px; }
.ct-btn--outline {
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--key-edge);
  background: var(--key);
  color: var(--ink) !important;
}
.ct-btn--outline:hover { border-color: var(--key-edge); }

/* sending: the icon turns into a spinner (js adds .is-loading) */
.ct-btn-spinner { display: none; }
.ct-btn.is-loading { pointer-events: none; opacity: .85; }
.ct-btn.is-loading .ct-btn-icon { display: none; }
.ct-btn.is-loading .ct-btn-spinner { display: inline-block; animation: ct-spin .8s linear infinite; }
@keyframes ct-spin { to { transform: rotate(360deg); } }

/* ---------- Sent ---------- */
.ct-success { display: grid; justify-items: start; gap: 10px; padding: 8px 0; }
.ct-success-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 56px;
  margin-bottom: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--marigold);
  background: var(--key);
  color: var(--lagoon);
  animation: ct-press .5s var(--ease) .1s both;
}
.ct-success-icon svg.lucide { width: 28px; height: 28px; }
.ct-success h2 { margin: 0; font-size: 1.6rem; font-weight: 600; letter-spacing: -.015em; }
.ct-success p { margin: 0 0 8px; max-width: 46ch; color: var(--muted); line-height: 1.6; }
/* the check key goes down and comes back: "sent" */
@keyframes ct-press {
  0%   { transform: translateY(-6px); opacity: 0; }
  60%  { transform: translateY(2px); opacity: 1; }
  100% { transform: none; }
}

/* ---------- Side column: one quiet column, sections divided by rules ---------- */
.ct-aside { display: grid; }
.ct-aside .ct-card { padding: 22px 0; border-top: 1px solid var(--line); }
.ct-aside .ct-card:first-child { padding-top: 4px; border-top: 0; }
.ct-aside .ct-card-title { font-size: 1.05rem; margin-bottom: 12px; }
.ct-info-list { margin: 0; padding: 0; list-style: none; }
.ct-info-list li { display: flex; gap: 14px; align-items: center; }
.ct-info-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 42px;
  border-radius: 9px;
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--key-edge);
  background: var(--key);
  color: var(--lagoon);
}
.ct-info-label { margin: 0; font-size: .85rem; color: var(--muted); }
.ct-info-value { font-weight: 600; font-size: 1.02rem; text-decoration: none; overflow-wrap: anywhere; }
.ct-info-value:hover { text-decoration: underline; text-underline-offset: 3px; }

.ct-social-links { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-social-links a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--key-edge);
  background: var(--key);
  color: var(--lagoon);
  transition: border-color .15s, transform .1s;
}
.ct-social-links a:hover { border-bottom-color: var(--marigold); }
.ct-social-links a:active { transform: translateY(1px); }

.ct-links { margin: 0; padding: 0; list-style: none; display: grid; }
.ct-links li + li { border-top: 1px solid var(--line); }
.ct-links a { display: block; padding: 10px 0; font-weight: 500; color: var(--ink) !important; text-decoration: none; transition: color .15s; }
.ct-links a:hover { color: var(--lagoon) !important; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Quick answers ---------- */
.ct-faq {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 40px;
  align-items: start;
  padding: 56px 0 72px;
  border-top: 1px solid var(--line);
}
.ct-faq-head h2 { margin: 0 0 8px; font-size: clamp(1.45rem, 2.4vw, 1.85rem); font-weight: 600; letter-spacing: -.015em; color: var(--ink); }
.ct-faq-head p { margin: 0; color: var(--muted); line-height: 1.6; }
.ct-faq-list { border-top: 1px solid var(--line); }
.ct-faq-item { border-bottom: 1px solid var(--line); interpolate-size: allow-keywords; }
.ct-faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 2px;
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  cursor: pointer;
}
.ct-faq-item summary::-webkit-details-marker { display: none; }
.ct-faq-item summary:hover { color: var(--lagoon); }
.ct-faq-item summary svg.lucide { color: var(--lagoon); transition: transform .22s var(--ease); }
.ct-faq-item[open] summary svg.lucide { transform: rotate(180deg); }
.ct-faq-item p { margin: 0; padding: 0 2px 20px; max-width: 64ch; color: #24393f; line-height: 1.7; }
/* smooth open/close where the browser supports animating details (falls back to instant) */
.ct-faq-item::details-content { block-size: 0; overflow: hidden; transition: block-size .25s var(--ease), content-visibility .25s allow-discrete; }
.ct-faq-item[open]::details-content { block-size: auto; }

/* footer edge to edge, like the other redesigned pages */
.page-contact .site-footer { max-width: none; margin-top: 0; padding-inline: max(26px, calc((100% - 1100px) / 2 + 26px)); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .ct-grid { grid-template-columns: 1fr; gap: 28px; }
  .ct-aside { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); column-gap: 32px; }
  .ct-aside .ct-card { padding-top: 22px !important; border-top: 1px solid var(--line) !important; }
  .ct-faq { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 575.98px) {
  .ct-page { padding-top: 32px; }
  .ct-form-card { padding: 22px 18px; border-radius: 14px; }
  .ct-row { grid-template-columns: 1fr; }
  .ct-form-foot { flex-direction: column-reverse; align-items: stretch; }
  .ct-btn--primary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ct-input, .ct-btn, .ct-links a, .ct-social-links a, .ct-faq-item summary svg.lucide { transition: none; }
  .ct-error:not(:empty), .ct-alert, .ct-success-icon { animation: none; }
  .ct-btn.is-loading .ct-btn-spinner { animation-duration: 2s; }
  .ct-faq-item::details-content { transition: none; }
}
