/* careers on a phone: the creed one value a screen, each held while it lights and the next sliding over it; then the close
   over one form, its send under the thumb. loads after careers.css */
@media (max-width: 900px) {
  /* the width the poster type fills. a size below is that width over the line's own width at 1px of Instrument Sans 500,
     measured at the line's tracking, so each value runs gutter to gutter */
  .careers-values, .careers-apply { --fill: calc(100vw - 2 * var(--gutter)); }

  .careers-values { display: block; min-height: 0; padding: 0 var(--gutter) 14svh; }
  .careers-creed { display: block; line-height: .88; }
  /* full bleed, so a frame covers the gutters too; the tracking is set here because the h2's em is its desktop size */
  .careers-creed > span { display: flex; align-items: center; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); letter-spacing: -.048em; }
  .careers-creed > :nth-child(1) { font-size: calc(var(--fill) * .3731); }
  .careers-creed > :nth-child(2) { font-size: calc(var(--fill) * .342); }
  .careers-creed > :nth-child(3) { font-size: calc(var(--fill) * .2392); }
  .careers-creed:lang(pt) > :nth-child(1) { font-size: calc(var(--fill) * .2262); }
  .careers-creed:lang(pt) > :nth-child(3) { font-size: calc(var(--fill) * .2544); }
  .careers-filter { position: relative; max-width: 19ch; margin: 0 0 0 auto; font-size: var(--t-title); line-height: 1.14; }

  .careers-apply { display: block; padding: 11svh var(--gutter) 64px; scroll-margin-top: 0; }
  .careers-close { margin-bottom: 6svh; font-size: calc(var(--fill) * .228); line-height: .9; }
  .careers-close:lang(pt) { font-size: calc(var(--fill) * .2293); }
  .apply-copy { position: static; gap: 10px; margin-bottom: 28px; }
  .apply-copy .scene-head { font-size: clamp(34px, 9.4vw, 72px); }
  .apply-note { max-width: 26ch; font-size: clamp(17px, 3vw, 26px); text-wrap: balance; }

  /* ruled fields: the whole row is the target, the type stays over 16px so ios never zooms, and a focused field clears the
     bar above it and the send bar under it */
  .apply-field { gap: 6px; padding: 16px 0 14px; scroll-margin: 84px 0 120px; }
  .apply-field > span, .apply-field > legend { font-size: clamp(15px, 2.2vw, 18px); }
  .apply-field > legend { margin-bottom: 12px; }
  .apply-field input:not([type="radio"]) { min-height: 44px; font-size: clamp(24px, 3.9vw, 32px); }
  /* the team: two tall keys; the word sits in the middle, so it still reads where the send bar covers a key's foot */
  .apply-team span { display: flex; align-items: center; min-height: clamp(84px, 13vw, 112px); padding: 14px 16px; font-size: clamp(26px, 4.2vw, 36px); line-height: 1; text-align: left; }
  /* the keys share a border; the first keeps its own inside the column, where the send bar covers it */
  .apply-team:first-child span { margin-left: 0; }

  /* send rides at the foot of the screen while the form is on it, and settles at the end of the form. a text field with the
     keyboard up puts it back in place, so it never sits between the keyboard and the field */
  .apply-send { position: sticky; bottom: 0; z-index: 2; margin-top: 10px; padding: 12px 0 max(12px, env(safe-area-inset-bottom)); background: var(--ink); }
  .apply-form:has(input:not([type="radio"]):focus) .apply-send { position: static; }
  .apply-form.is-back > * { animation: none; }
  .apply-send .box { min-height: 60px; padding: 0 24px; font-size: clamp(20px, 2.8vw, 24px); }

  /* the answer fills the rest of the screen under the ask (careers.js sets its height), its words at the foot and the retry
     under the thumb */
  .apply-state { align-content: end; padding: 24px 0 max(24px, env(safe-area-inset-bottom)); }
  /* the two-line error fills the width up to a height that keeps the close on a tablet's screen; the one-word answer always fills */
  .apply-state h3 { line-height: .9; letter-spacing: -.048em; font-size: min(calc(var(--fill) * .2335), 13svh); }
  .apply-state[data-kind="ok"] h3 { font-size: calc(var(--fill) * .33); }
  .apply-state:lang(pt) h3 { font-size: min(calc(var(--fill) * .2905), 13svh); }
  .apply-state[data-kind="ok"]:lang(pt) h3 { font-size: calc(var(--fill) * .4652); }
  .apply-state p { font-size: clamp(20px, 2.8vw, 26px); text-wrap: balance; }
  .apply-state .box { justify-self: stretch; min-height: 60px; margin-top: 16px; font-size: 18px; }
}

/* with motion, each value holds the screen: the frames stick in turn and the next one wipes the last away as it rises.
   aura.js lights each word as its frame climbs to the middle. reduced motion keeps the three as one poster */
@media (max-width: 900px) and (prefers-reduced-motion: no-preference) {
  .careers-creed > span { position: sticky; top: 0; height: 100svh; background: var(--ink); }
  .careers-creed > :last-child { position: relative; }
  /* the filter lands in the last frame, under its value */
  .careers-filter { margin-top: -30svh; }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .careers-values { padding-top: 16svh; }
  .careers-filter { margin-top: 48px; }
}
