/* Contact: the shared form (views/partials/site/contact-form.ejs), the /contact page and the homepage band.
   Tokens only, so the form sits on paper, drawing paper or the night band (/for-trades#talk) unchanged. */

/* ---------- The form ---------- */
.cf { position: relative; }
.cf-form { display: grid; gap: 18px; }
.cf-form[hidden], .cf-done[hidden] { display: none; }
.cf-topics { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.cf-legend { padding: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.cf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-chip { position: relative; display: inline-flex; cursor: pointer; }
.cf-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cf-chip span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 13px; border-radius: 10px;
  font-size: 14px; font-weight: 500; line-height: 1.25; color: var(--ink-2); background: var(--sheet);
  box-shadow: inset 0 0 0 1px var(--rule-2);
  transition: background-color var(--dur-instant) var(--ease-out), box-shadow var(--dur-instant) var(--ease-out), color var(--dur-instant);
}
.cf-chip span::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--ink-4); transition: background-color var(--dur-quick) var(--ease-out), box-shadow var(--dur-quick) var(--ease-out), transform var(--dur-quick) var(--ease-spring);
}
.cf-chip:hover span { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-3); }
.cf-chip input:checked + span { color: var(--ink); background: var(--amber-soft); box-shadow: inset 0 0 0 1.5px var(--amber); }
.cf-chip input:checked + span::before { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); transform: scale(1.1); }
.cf-chip input:focus-visible + span { box-shadow: inset 0 0 0 1.5px var(--amber), var(--focus); }
.cf-topics[aria-invalid] .cf-chip span { box-shadow: inset 0 0 0 1px var(--amber-deep); }

.cf-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cf .field label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.cf-opt { font-weight: 400; font-size: 12.5px; color: var(--ink-3); }
.cf .input { height: 48px; }
.cf .cf-message { height: auto; min-height: 132px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.cf .input[aria-invalid] { border-color: var(--amber-deep); box-shadow: var(--focus); }
/* Company and phone show for "Trade or business"; without JavaScript (html.no-js) they always show. The entrance
   (from opacity 0) plays only in motion mode: without JavaScript, for crawlers and with reduced motion the row is
   simply there, never caught mid-fade. */
html:not(.no-js) .cf-trade[data-off] { display: none; }
html.pw-motion .cf-trade:not([data-off]) { animation: cf-open var(--dur-enter) var(--ease-out) both; }
@keyframes cf-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.cf-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-error { margin: 0; padding: 12px 14px; border-radius: var(--r-md); font-size: 15px; background: var(--amber-wash); color: var(--amber-ink); box-shadow: inset 0 0 0 1px var(--amber-soft); }
.cf-error[hidden] { display: none; }
.cf-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.cf-submit[disabled] { opacity: .65; cursor: progress; }
.cf-note { font-size: 13.5px; line-height: 1.45; color: var(--ink-3); max-width: 34ch; }
.cf-note .link { color: var(--ink-2); }

/* Sent: a green tick draws itself (green = done, as on the register) */
.cf-done { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; align-items: start; padding: 6px 0; outline: none; }
.cf-done-mark { width: 48px; height: 48px; fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.cf-done-mark circle { fill: var(--green-wash); stroke-dasharray: 132; stroke-dashoffset: 0; }
.cf-done-mark path { stroke-dasharray: 30; stroke-dashoffset: 0; }
.pw-motion .cf-done:not([hidden]) .cf-done-mark circle { animation: cf-draw 520ms var(--ease-draw) both; }
.pw-motion .cf-done:not([hidden]) .cf-done-mark path { animation: cf-tick 320ms var(--ease-out) 360ms both; }
@keyframes cf-draw { from { stroke-dashoffset: 132; } }
@keyframes cf-tick { from { stroke-dashoffset: 30; } }
.pw-motion .cf-done:not([hidden]) > div { animation: cf-rise 320ms var(--ease-out) 120ms both; }
@keyframes cf-rise { from { opacity: 0; transform: translateY(10px); filter: blur(2px); } }
.cf-done-h { font-family: var(--font-display); font-size: 26px; line-height: 1.1; letter-spacing: -0.03em; font-weight: 600; color: var(--ink); }
.cf-done-p { margin-top: 8px; color: var(--ink-2); max-width: 46ch; }
.cf-again { display: inline-block; margin-top: 16px; font-size: 15px; font-weight: 500; }

@media (max-width: 560px) {
  .cf-row { grid-template-columns: 1fr; }
  .cf-foot .btn { width: 100%; }
  .cf-note { max-width: none; }
}

/* ---------- The card the form sits in ---------- */
.cf-card { background: var(--sheet); border-radius: var(--r-xl); box-shadow: var(--sh-3); padding: clamp(20px, 2.6vw, 32px); display: grid; gap: 20px; min-width: 0; }
.cf-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.cf-card-head b { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }
.cf-card-head .mono { color: var(--ink-3); font-size: 12px; }

/* ---------- /contact ---------- */
.contact-hero { background: var(--paper-2); padding-top: calc(var(--nav-clear, 88px) + clamp(20px, 3vw, 44px)); padding-bottom: clamp(64px, 8vw, 112px); overflow: hidden; }
.contact-hero::before { z-index: 0; }
.contact-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 580px); gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact-copy { display: grid; gap: 24px; align-content: start; padding-top: clamp(4px, 2vw, 28px); min-width: 0; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }
.contact-copy .h1 { font-size: clamp(46px, 6vw, 88px); }
.contact-promises { display: grid; gap: 0; margin-top: 4px; border-top: 1px solid var(--rule); max-width: 460px; }
.contact-promises li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.contact-promises b { display: block; font-weight: 600; font-size: 16px; }
.contact-promises span.ink-2 { display: block; font-size: 14.5px; line-height: 1.45; }
.c-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--sheet); color: var(--ink); box-shadow: var(--sh-1); }
.c-ico svg { width: 18px; height: 18px; }
.c-ico--amber { background: var(--amber-soft); box-shadow: none; color: var(--amber-ink); }

/* Every address, one row each */
.bucket-list { border-top: 1px solid var(--rule); }
.bucket { display: grid; grid-template-columns: 44px minmax(0, 1.1fr) minmax(0, 1.3fr) 260px; gap: 8px 24px; align-items: start; padding: 22px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 110px; }
.bucket .c-ico { width: 44px; height: 44px; border-radius: 12px; }
.bucket .c-ico svg { width: 20px; height: 20px; }
.bucket h3 { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.2; letter-spacing: -0.02em; }
.bucket .b-for { margin-top: 4px; color: var(--ink-2); font-size: 15px; }
.bucket .b-ex { color: var(--ink-2); font-size: 15px; line-height: 1.55; padding-top: 2px; }
.bucket .b-mail { display: grid; gap: 6px; justify-items: start; padding-top: 2px; }
.bucket .b-mail a { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; font-size: 16px; word-break: break-all; }
.bucket .b-mail a svg { width: 16px; height: 16px; flex: none; color: var(--amber-deep); }
.bucket .b-mail .mono { color: var(--ink-3); font-size: 12px; }
.bucket:target { background: linear-gradient(90deg, var(--amber-wash), transparent 70%); }
.contact-tips { margin-top: 28px; max-width: 70ch; color: var(--ink-2); font-size: 15px; }
.contact-tips b { color: var(--ink); font-weight: 600; }

@media (max-width: 1100px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-copy { max-width: 680px; }
  .bucket { grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1.2fr); }
  .bucket .b-mail { grid-column: 2 / -1; }
}
@media (max-width: 700px) {
  .bucket { grid-template-columns: 44px minmax(0, 1fr); gap: 10px 16px; }
  .bucket .b-ex, .bucket .b-mail { grid-column: 2; }
}

/* ---------- Homepage contact band ---------- */
.home-contact-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.home-contact .section-head { margin-bottom: 0; position: sticky; top: 120px; }
.home-contact .cf-card { box-shadow: var(--sh-2); }
@media (max-width: 900px) {
  .home-contact-grid { grid-template-columns: 1fr; }
  .home-contact .section-head { position: static; }
}
