/* The site's forms (Get in touch on /contact/, the job application on /careers/ and a role's page), loaded only by the
   pages that hold one. A form is one white sheet torn at the foot like an order ticket, standing on Cookinn Red or Night;
   on /contact/ it hangs from the kitchen rail by a clip, as the role tickets do. Grounds, type and the rail come from
   assets/css/site.css; the markup from tools/forms.mjs; the behaviour from assets/js/form.js. */

/* ---------- the sheet ---------- */
.sheet { position: relative; color: var(--ink); --focus: var(--ink); filter: drop-shadow(0 18px 16px rgba(0, 0, 0, 0.26)); }
.sheet ::selection { background: var(--ink); color: #fff; }
.sheet__paper { --z: 10px; padding: clamp(24px, 3vw, 44px) clamp(20px, 3vw, 44px) calc(clamp(24px, 3vw, 44px) + var(--z) + 4px); background: #fff;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--z)) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--z)) var(--z) repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--z)) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--z)) var(--z) repeat-x; }
/* hung from the rail: the same clip that holds a role's ticket; it swings once when the order goes in */
.sheet--hung { padding-top: 18px; transform-origin: 50% 0; }
.sheet--hung::before { content: ""; position: absolute; z-index: 1; top: -12px; left: 50%; width: 46px; height: 30px; translate: -50% 0; border-radius: 6px;
  background: linear-gradient(180deg, #45423e, #1d1c1a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.sheet--hung.is-sent { animation: sheet-swing 1300ms ease-in-out; }
@keyframes sheet-swing { 0% { rotate: 0deg; } 20% { rotate: -2.2deg; } 45% { rotate: 1.4deg; } 68% { rotate: -0.7deg; } 86% { rotate: 0.25deg; } 100% { rotate: 0deg; } }

/* ---------- the form: labels above, filled fields on an ink rule, one red action ---------- */
.form { display: grid; gap: clamp(20px, 2.4vw, 26px); }
.form[hidden], .form [hidden], .form__done[hidden] { display: none; }
.form__trap { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: clamp(20px, 2.4vw, 26px) 16px; }
.field { display: grid; align-content: start; gap: 8px; min-width: 0; }
.field > label, .field__label, .chips legend { font: 700 1rem/1.25 var(--text); }
.field__opt { font-weight: 400; color: var(--soft); }
.field__hint { margin: 0; font-size: 0.92rem; line-height: 1.4; color: var(--soft); }
.field input:not([type="file"]), .field select, .field textarea { display: block; width: 100%; min-height: 54px; margin: 0; padding: 15px 16px 13px;
  border: 0; border-bottom: 2px solid var(--ink); border-radius: 10px 10px 0 0; background-color: var(--mist); color: var(--ink);
  font: 400 17px/1.4 var(--text); caret-color: var(--red); -webkit-appearance: none; appearance: none; transition: background-color 160ms ease, border-color 160ms ease; }
.field textarea { min-height: 156px; resize: vertical; }
.field select { padding-right: 48px; cursor: pointer; background-repeat: no-repeat; background-position: right 16px center; background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 7.5 6 6 6-6' fill='none' stroke='%231B1612' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.field ::placeholder { color: var(--soft); opacity: 1; }
.field input:not([type="file"]):hover, .field select:hover, .field textarea:hover { background-color: #EAE8E4; background-color: color-mix(in oklab, var(--ink) 6%, var(--mist)); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 10px 10px 0 0; }
/* a browser's own autofill tint gives way to the field's */
.field input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 100px var(--mist) inset; }
.field [aria-invalid="true"] { border-bottom-color: var(--red); }
.field__err { margin: 0; font: 700 0.95rem/1.35 var(--text); color: var(--red); }

/* what it is about: one choice, as pills */
.chips { min-width: 0; margin: 0; padding: 0; border: 0; }
.chips legend { margin-bottom: 10px; padding: 0; }
.chips__row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip > span { display: inline-flex; align-items: center; min-height: 46px; padding: 0 18px; border-radius: var(--r-pill); background-color: var(--mist);
  font: 700 1.05rem/1 var(--head); transition: background-color 160ms ease, color 160ms ease; }
.chip:hover > span { background-color: #EAE8E4; background-color: color-mix(in oklab, var(--ink) 8%, var(--mist)); }
.chip input:checked + span { background-color: var(--ink); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }

/* the role an application is for, over a ticket's dashed rule */
.form__for { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; padding-bottom: 18px; border-bottom: 2px dashed rgba(27, 22, 18, 0.22); color: var(--soft); }
.form__for strong { color: var(--ink); font: 800 clamp(1.5rem, 2.2vw, 2rem)/1 var(--head); letter-spacing: -0.015em; }

/* a CV: the browser's own file control under an ink pill, the chosen file's name beside it */
.file { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; min-height: 68px; padding: 10px 12px; border: 2px dashed rgba(27, 22, 18, 0.3); border-radius: var(--r-s); }
.file__pick { position: relative; display: inline-flex; max-width: 100%; cursor: pointer; }
.file__btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--r-pill); background: var(--ink); color: #fff; font: 700 1.02rem/1 var(--head); transition: background-color 160ms ease; }
.file__pick:hover .file__btn { background: var(--red); }
html.live .file__pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
html:not(.live) .file__btn { display: none; }
.file__pick input:focus-visible + .file__btn { outline: 3px solid var(--ink); outline-offset: 3px; }
.file__name { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; font-size: 0.98rem; }
.file__clear { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--mist); cursor: pointer; transition: background-color 160ms ease, color 160ms ease; }
.file__clear:hover { background: var(--ink); color: #fff; }
.file__clear svg { width: 18px; height: 18px; }
.file__clear:focus-visible { border-radius: 50%; }

/* the end: the action, what happens to the words, and what went wrong if it did */
.form__end { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.form__send { display: inline-flex; align-items: center; justify-content: center; min-height: 60px; padding: 0 30px; border: 0; border-radius: var(--r-pill); background: var(--red); color: #fff;
  font: 800 1.25rem/1 var(--head); cursor: pointer; transition: background-color 160ms ease, translate 200ms var(--ease-out); }
.form__send:hover { background: var(--ink); translate: 0 -2px; }
.form__send:active { translate: 0 0; }
.form__send:focus-visible { border-radius: var(--r-pill); }
.form__send[aria-busy="true"] { background: var(--ink); translate: none; cursor: progress; }
.form__busy, .form__send[aria-busy="true"] .form__idle { display: none; }
.form__send[aria-busy="true"] .form__busy { display: inline; }
.form__note { flex: 1 1 220px; margin: 0; font-size: 0.92rem; line-height: 1.4; color: var(--soft); text-wrap: pretty; }
.form__error { margin: 0; padding: 14px 18px; border-radius: var(--r-s); background: var(--ink); color: #fff; font-weight: 600; text-wrap: pretty; --focus: #fff; }
.form__error a { color: #fff; }
.form__done { display: grid; align-content: center; justify-items: start; gap: 16px; min-height: 320px; outline: none; }
.form__done h3 { margin: 0; color: var(--red); font: 800 clamp(2.6rem, 4.6vw, 4.2rem)/0.92 var(--head); letter-spacing: -0.025em; text-wrap: balance; }
.form__done p { margin: 0; max-width: 30ch; font: 600 clamp(1.15rem, 1.6vw, 1.4rem)/1.3 var(--head); overflow-wrap: anywhere; text-wrap: pretty; }
.form__again { display: inline-flex; align-items: center; min-height: 48px; margin-top: 10px; padding: 0 22px; border: 0; border-radius: var(--r-pill); background: var(--mist);
  font: 700 1.05rem/1 var(--head); cursor: pointer; transition: background-color 160ms ease, color 160ms ease; }
.form__again:hover { background: var(--ink); color: #fff; }
.form__again:focus-visible { border-radius: var(--r-pill); }

/* ---------- /contact/: the words and the other ways in on the left, the order ticket on the rail on the right ---------- */
.contact { overflow-x: clip; background: var(--red); color: #fff; --focus: #fff;
  padding: calc(var(--bar) + clamp(36px, 7vh, 88px)) var(--pad-r) clamp(72px, 12vh, 140px) var(--pad-l); }
.contact ::selection, .apply ::selection { background: var(--coal); color: #fff; }
.contact .sheet ::selection, .apply .sheet ::selection { background: var(--ink); }
.contact__in, .apply__in { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: clamp(36px, 6vw, 104px); align-items: start; }
.contact__in { min-height: calc(100svh - var(--bar) - 230px); }
.contact__text { position: sticky; top: calc(var(--bar) + 36px); }
.contact h1 { margin: 0; font: 800 clamp(3rem, 6.2vw, 6rem)/0.92 var(--head); letter-spacing: -0.025em; text-wrap: balance; }
.contact__lines { display: grid; gap: 20px; margin: clamp(36px, 7vh, 72px) 0 0; }
.contact__lines dt { font-size: 1rem; line-height: 1.3; }
.contact__lines dd { margin: 0; font: 800 clamp(1.3rem, 1.9vw, 1.7rem)/1.15 var(--head); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.contact__lines a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.contact__lines svg { flex: none; width: 20px; height: 20px; transition: translate 300ms var(--ease-out); }
.contact__lines a:hover svg { translate: 5px 0; }
.contact__rail, .apply .sheet, .talk__in--form .sheet { width: 100%; max-width: 700px; justify-self: end; }

/* ---------- a role's page: the application on a red band; /careers/: the open application on its Night band ---------- */
.apply { overflow-x: clip; background: var(--red); color: #fff; --focus: #fff; padding: clamp(72px, 12vh, 140px) var(--pad-r) clamp(80px, 13vh, 150px) var(--pad-l); }
.apply h2 { margin: 0; max-width: 12ch; font: 800 clamp(2.4rem, 5vw, 4.6rem)/0.95 var(--head); letter-spacing: -0.02em; text-wrap: balance; }
.apply__text { position: sticky; top: calc(var(--bar) + 36px); }
.talk__in--form { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: clamp(36px, 6vw, 104px); align-items: start; }
.talk__in--form .talk__lead { margin: 24px 0 0; }
/* Partners: the form's pill under the big address */
.bigmail__form { margin: clamp(28px, 5vh, 48px) 0 0; }

@media (max-width: 900px) {
  .contact__in, .apply__in, .talk__in--form { grid-template-columns: minmax(0, 1fr); gap: clamp(40px, 7vh, 56px); }
  .contact__in { min-height: 0; }
  .contact__text, .apply__text { position: static; }
  .contact__rail, .apply .sheet, .talk__in--form .sheet { max-width: 640px; justify-self: start; }
  /* narrow screens: the form comes right after the opening words, the other ways in after it */
  .contact__in { display: flex; flex-direction: column; gap: 0; }
  .contact__text { display: contents; }
  .contact__rail { order: 2; margin-top: clamp(40px, 7vh, 56px); }
  .contact__lines { order: 3; margin-top: 52px; gap: 14px; }
}
@media (max-width: 699px) {
  .contact h1 { font-size: clamp(2.6rem, 11.6vw, 3.6rem); }
  .apply h2 { font-size: clamp(2.2rem, 10.4vw, 3rem); }
  .form__send { width: 100%; }
  .form__done { min-height: 260px; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet--hung.is-sent { animation: none; }
  .field input, .field select, .field textarea, .chip > span, .file__btn, .file__clear, .form__send, .form__again, .contact__lines svg { transition: none; }
  .form__send:hover { translate: none; }
}
