/*
 * Contact page (/contact/). Loaded after styles.css + motion.css; reuses .section, .eyebrow,
 * .othertrade, the nav and the footer. Only what's new lives here.
 */

/* ---------- hero: centred headline, the form, then the address ---------- */
.chero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 140px) var(--gutter) var(--section-gap);
  text-align: center;
}
.chero .eyebrow { display: inline-block; }
.chero__title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(44px, 5.6vw, 84px);
  line-height: .98;
  letter-spacing: -.025em;
}
.chero__lede { margin: 32px auto 0; font-size: clamp(18px, 1.5vw, 21px); color: var(--ink-2); max-width: 40ch; }

/* ---------- the form ---------- */
.cform {
  position: relative;
  max-width: 680px;
  margin: clamp(64px, 8vw, 104px) auto 0;
  padding: clamp(28px, 4.5vw, 56px);
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 40px 80px -48px oklch(var(--ao) / .28);
  display: grid; gap: 36px;
}
.cform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 32px; }
.field { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field__l { font: 500 12px/1 var(--f-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0; }
.field__l i { font-style: normal; color: var(--blue); margin-left: 6px; text-transform: none; letter-spacing: 0; }
.field input, .field textarea {
  width: 100%;
  font: 400 17px/1.4 var(--f-ui); color: var(--ink);
  background: none;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 8px 0 12px;
  outline: none;
  transition: border-color .3s, box-shadow .45s var(--ease-out);
}
.field textarea { resize: vertical; min-height: 128px; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }  /* AA contrast */
.field input:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 1px 0 var(--blue); }
.field.is-bad input, .field.is-bad textarea { border-color: oklch(59.5% 0.183 27.3); box-shadow: 0 1px 0 oklch(59.5% 0.183 27.3); }

/* topic chips (radios) */
.field--chips .field__l { margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span {
  display: inline-block;
  font: 400 14px/1.2 var(--f-ui); color: var(--ink-2);
  padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  transition: color .25s, background .25s, border-color .25s, transform .35s var(--ease-spring);
}
.chips label:hover span { color: var(--ink); border-color: var(--ink); }
.chips input:checked + span { background: var(--ink); border-color: var(--ink); color: oklch(100% 0 0); }
.chips input:focus-visible + span { box-shadow: 0 0 0 4px oklch(57.36% 0.2114 260.1 / .25); }
.chips input:checked + span.is-pop { animation: chip-pop .45s var(--ease-spring); }
@keyframes chip-pop { 40% { transform: scale(1.08); } }

.cform__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 28px; }
.cform__note { font: 400 14px/1.4 var(--f-label); color: var(--muted); }
.cform__err:empty { display: none; }
.cform__err { margin-top: -16px; color: oklch(54.3% 0.179 28); font: 400 15px/1.45 var(--f-ui); }
.cform__privacy { margin-top: -12px; font: 400 13px/1.5 var(--f-label); color: var(--muted); }
.cform__privacy a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.cform__privacy a:hover { color: var(--blue); }
.cform.is-shake { animation: shake .45s var(--ease-out); }

/* after submit: the form fades back and a note takes its place */
.cform__ok {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 20px;
  padding: clamp(28px, 4.5vw, 56px);
  background: var(--bg); border-radius: inherit;
  opacity: 0; visibility: hidden;
  transition: opacity .5s var(--ease-out), visibility 0s .5s;
}
.cform.is-sent .cform__ok { opacity: 1; visibility: visible; transition: opacity .5s var(--ease-out); }
.cform__ok svg { width: 44px; height: 44px; flex: none; color: var(--blue); }
.cform__ok .ok-ring { stroke-dasharray: 1; stroke-dashoffset: 1; }
.cform__ok .ok-tick { stroke-dasharray: 1; stroke-dashoffset: 1; }
.cform.is-sent .cform__ok .ok-ring { animation: stroke .7s var(--ease-inout) .1s forwards; }
.cform.is-sent .cform__ok .ok-tick { animation: stroke .45s var(--ease-out) .65s forwards; }
.cform__ok-h { font: 400 clamp(22px, 2.2vw, 28px)/1.2 var(--f-display); letter-spacing: -.015em; }
.cform__ok-p { margin-top: 10px; color: var(--ink-2); max-width: 40ch; }
.cform__ok .link { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font: inherit; color: var(--ink); }

/* ---------- the address, under the form ---------- */
.mail { margin-top: clamp(72px, 9vw, 120px); display: grid; justify-items: center; gap: 20px; }
.mail__or { font: 500 12px/1 var(--f-label); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mail__line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 20px 32px; }
.mail__addr {
  position: relative;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(30px, 4.4vw, 64px);
  line-height: 1.05;
  letter-spacing: -.035em;
  padding-bottom: .08em;
  transition: color .3s ease;
}
.mail__addr::after {  /* blue rule under the address */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: clamp(2px, .25vw, 3px); background: var(--blue);
  transform-origin: 0 50%;
}
.mail__addr:hover { color: var(--blue); }
.mail__addr:focus-visible { outline: none; color: var(--blue); }

.mail__copy {
  display: inline-flex; align-items: center; gap: 10px;
  font: 400 15px/1.2 var(--f-ui); color: var(--ink-2);
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 12px 20px 12px 16px;
  cursor: pointer;
  transition: color .25s, border-color .25s, box-shadow .35s var(--ease-out);
}
.mail__copy:hover, .mail__copy:focus-visible { color: var(--ink); border-color: var(--ink); outline: none; }
.mail__copy svg { width: 16px; height: 16px; flex: none; overflow: visible; }
.mail__ic-copy { transition: opacity .2s, filter .2s, transform .35s var(--ease-out); transform-origin: 8px 8px; }
.mail__ic-ok { stroke-dasharray: 1; stroke-dashoffset: 1; }
/* label rolls to "Copied" */
.mail__label { display: inline-grid; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }  /* both labels share one cell, so it fits the longer */
.mail__label > span, .mail__label::after { grid-area: 1 / 1; }
.mail__label::after { content: attr(data-t); content: attr(data-t) / ""; transform: translateY(100%); }

.mail__label > span, .mail__label::after { transition: transform .45s var(--ease-out); }
.mail__copy.is-copied { color: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 6px oklch(57.36% 0.2114 260.1 / .1); }
.mail__copy.is-copied .mail__ic-copy { opacity: 0; filter: blur(3px); transform: scale(.6); }   /* the copy icon blurs away as the tick draws */
.mail__copy:active { scale: .96; }
.chips label:active span { scale: .95; }
.mail__copy.is-copied .mail__ic-ok { stroke-dashoffset: 0; transition: stroke-dashoffset .4s var(--ease-out) .1s; }
.mail__copy.is-copied .mail__label > span { transform: translateY(-100%); }
.mail__copy.is-copied .mail__label::after { transform: none; }

/* intro, matching the trade-page hero */
.motion .chero__lede { animation: rise-blur 1.1s var(--ease-out) .45s both; }
.motion .cform { animation: rise-blur 1.2s var(--ease-out) .6s both; }
.motion .cform.is-shake { animation: shake .45s var(--ease-out); }
.motion .mail { animation: rise-blur 1.2s var(--ease-out) .8s both; }

/* ---------- topics: each row picks that topic in the form ---------- */
.topics { list-style: none; margin: 96px 0 0; padding: 0; border-top: 1px solid var(--line); }
.topics li { border-bottom: 1px solid var(--line); position: relative; }
.topics li::after {  /* blue line sweeps along the bottom border on hover */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--blue); transform: scaleX(0); transform-origin: 100% 50%;
  transition: transform .6s var(--ease-out);
}
.topics li:hover::after, .topics li:focus-within::after { transform: scaleX(1); transform-origin: 0 50%; }
.topics a {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.2fr) 40px;
  align-items: baseline; gap: 16px 40px;
  padding: 40px 0;
  outline: none;
}
.topics__n { font: 500 13px/1 var(--f-label); font-variant-numeric: tabular-nums; color: var(--muted); }
.topics__h { font: 400 clamp(22px, 2.2vw, 30px)/1.15 var(--f-display); letter-spacing: -.015em; transition: color .3s, transform .5s var(--ease-out); }
.topics__p { color: var(--ink-2); font-size: 17px; max-width: 44ch; }
.topics__go { justify-self: end; font-size: 20px; color: var(--muted); transition: transform .45s var(--ease-spring), color .3s; }
.topics a:hover .topics__h, .topics a:focus-visible .topics__h { color: var(--blue); transform: translateX(6px); }
.topics a:hover .topics__go, .topics a:focus-visible .topics__go { color: var(--blue); transform: translateX(6px); }

@media (max-width: 640px) {
  .cform__row { grid-template-columns: 1fr; }
  .cform__ok { align-items: flex-start; flex-direction: column; justify-content: center; }
}

@media (max-width: 900px) {
  .topics a { grid-template-columns: 40px minmax(0, 1fr) 24px; padding: 32px 0; }
  .topics__p { grid-column: 2 / 3; }
  .topics__go { grid-row: 1; grid-column: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .chips span, .cform__ok, .mail__label > span, .mail__label::after, .topics li::after, .topics__h, .topics__go { transition: none !important; }
}
