/* The careers pages (/careers/, /careers/<slug>/): a board of quests.
   Loaded after landing.css, on these two pages only, and built on its tokens.

   The careers pages are the one place outside the virtual world that borrows
   its look, on purpose (DESIGN.md, "Careers"): a job here is shown as a
   quest. What is borrowed is narrow. The pixel face (Pixelify Sans) sets the
   title and the short labels; every sentence stays in Space Mono. Frames are
   square with a 2px border and a hard shadow, like the office's panels.
   Colors are the landing page's own tokens and nothing else. */

.careers {
  --careers-frame-border: rgba(148, 163, 184, 0.34);
  --careers-frame-shadow: rgba(59, 130, 246, 0.32);
  --careers-pixel: "Pixelify Sans", "Space Mono", ui-monospace, monospace;
}

/* ---------- Hero ---------- */
.careers-hero {
  padding: 72px 0 40px;
}

.careers-hero-opening {
  padding-top: 48px;
}

.careers-title {
  margin: 22px 0 16px;
  font-family: var(--careers-pixel);
  font-size: clamp(2.25rem, 7vw, 4.25rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: 0.5px;
  text-wrap: balance;
}

/* The one glow on these pages, as on the inbox screen's name: the accent word of the title. */
.careers-title span {
  color: var(--landing-accent);
  text-shadow: 0 0 24px rgba(59, 130, 246, 0.55);
}

.careers-tagline {
  margin: 0 auto 8px;
  max-width: 640px;
  color: var(--landing-muted);
  font-size: 1.0625rem;
}

.careers-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 8px;
  color: var(--landing-muted);
  font-size: 0.875rem;
  text-underline-offset: 4px;
}

.careers-back:hover {
  color: var(--landing-ink);
  text-decoration: underline;
}

/* ---------- The party ---------- */
/* Five sprites from the home page's office, painted by careers.js. Each canvas is 8 by 12 cells at six pixels a
   cell; before the script runs it is 8 by 12 pixels and transparent, so the row is reserved at its final height. */
.careers-party {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  min-height: 72px;
  /* Room above for a speech bubble (about 44px with its gap), so it never covers the words over the party. */
  margin: 56px 0 8px;
}

.careers-party-member {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.careers-party canvas {
  width: 48px;
  height: 72px;
  image-rendering: pixelated;
  animation: careers-bob 1.6s steps(2, jump-none) infinite;
}

.careers-party-member:nth-child(2n) canvas {
  animation-delay: 0.4s;
}

.careers-party-member:nth-child(3n) canvas {
  animation-delay: 0.8s;
}

/* What a member of the party says when the pointer reaches it (or a finger taps it): a white pixel speech bubble
   above its head with a heart or a few kind words, picked by careers.js. It pops in two steps and has a square
   tail, like the welcome page's bubbles. */
.careers-bubble {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  z-index: 2;
  padding: 4px 10px 5px;
  border: 2px solid var(--landing-canvas);
  background: var(--landing-ink);
  box-shadow: 3px 3px 0 var(--careers-frame-shadow);
  color: var(--landing-canvas);
  font-family: var(--careers-pixel);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
  animation: careers-pop 180ms steps(2, jump-none) both;
}

.careers-bubble[hidden] {
  display: none;
}

.careers-bubble::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  background: var(--landing-ink);
  content: "";
}

/* A bubble that holds only hearts: the red of the sprites' own palette (pixel-sprites.js), the one place it shows. */
.careers-bubble.is-heart {
  color: #e11d48;
}

@keyframes careers-pop {
  0% { transform: translateX(-50%) scale(0.4); }
  100% { transform: translateX(-50%) scale(1); }
}

@keyframes careers-bob {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

/* ---------- Frames and labels ---------- */
.careers-frame {
  border: 2px solid var(--careers-frame-border);
  background: var(--landing-canvas-soft);
  box-shadow: 6px 6px 0 var(--careers-frame-shadow);
}

.careers-label {
  margin: 0 0 10px;
  color: var(--landing-accent);
  font-family: var(--careers-pixel);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.careers-label-muted {
  color: var(--landing-muted);
  font-size: 0.875rem;
}

/* ---------- The stats under a role's title ---------- */
.careers-hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 24px 0 0;
}

.careers-stat {
  min-width: 132px;
  padding: 10px 16px;
  box-shadow: 4px 4px 0 var(--careers-frame-shadow);
  text-align: left;
}

.careers-stat dt {
  color: var(--landing-muted);
  font-family: var(--careers-pixel);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.careers-stat dd {
  margin: 2px 0 0;
  color: var(--landing-ink);
  font-size: 0.9375rem;
  font-weight: 700;
}

.careers-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

/* ---------- The board of openings ---------- */
.careers-board,
.careers-steps,
.careers-brief,
.careers-columns,
.careers-apply {
  padding-bottom: 56px;
}

.careers-board {
  max-width: 900px;
}

.careers-quest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding: 26px 28px;
}

.careers-quest-text {
  min-width: 0;
}

.careers-quest-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.careers-quest-title a {
  text-underline-offset: 5px;
}

.careers-quest-title a:hover {
  text-decoration: underline;
}

.careers-quest-tagline {
  margin: 6px 0 0;
  color: var(--landing-ink);
  font-size: 0.9375rem;
}

.careers-quest-summary {
  margin: 10px 0 0;
  color: var(--landing-muted);
  font-size: 0.9375rem;
}

.careers-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.careers-tags li {
  padding: 5px 10px;
  border: 1px solid var(--landing-border);
  color: var(--landing-muted);
  font-size: 0.8125rem;
}

.careers-quest-action {
  flex: none;
}

.careers-empty {
  padding: 32px 28px;
  text-align: center;
}

.careers-empty p {
  margin: 10px auto 22px;
  max-width: 520px;
  color: var(--landing-muted);
}

/* ---------- How it works ---------- */
.careers-steps {
  max-width: 900px;
}

.careers-step-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.careers-step {
  padding: 22px;
}

.careers-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  background: var(--landing-accent);
  color: var(--landing-canvas);
  font-family: var(--careers-pixel);
  font-size: 1.125rem;
  font-weight: 700;
}

.careers-step h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
}

.careers-step p {
  margin: 0;
  color: var(--landing-muted);
  font-size: 0.9375rem;
}

/* ---------- A role's panels ---------- */
.careers-brief,
.careers-apply {
  max-width: 900px;
}

.careers-panel {
  padding: 30px 32px;
}

.careers-panel h2 {
  margin: 0 0 16px;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.careers-panel p {
  margin: 0 0 14px;
  color: #c3cde0;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.careers-panel p:last-child {
  margin-bottom: 0;
}

.careers-panel p.careers-label {
  margin-bottom: 10px;
  color: var(--landing-accent);
  font-size: 1rem;
  line-height: 1.3;
}

.careers-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  max-width: 1100px;
}

.careers-panel-wide {
  grid-column: 1 / -1;
}

.careers-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.careers-list li {
  position: relative;
  padding-left: 26px;
  color: #c3cde0;
  font-size: 0.9375rem;
  line-height: 1.65;
}

.careers-list strong {
  color: var(--landing-ink);
  font-weight: 700;
}

/* A square mark per list, each a few pixels: an empty checkbox for the mission, a filled square for a skill,
   a diamond for the loot. */
.careers-list li::before {
  position: absolute;
  top: 0.45em;
  left: 2px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--landing-accent);
  content: "";
}

.careers-list-skills li::before {
  background: var(--landing-accent);
}

.careers-list-loot li::before {
  background: var(--landing-accent);
  transform: rotate(45deg);
}

.careers-closed {
  text-align: center;
}

.careers-closed .landing-button {
  margin-top: 12px;
}

/* ---------- The application form ---------- */
.careers-form {
  display: grid;
  gap: 20px;
}

.careers-form h2 {
  margin-bottom: 0;
}

.careers-form .careers-label,
.careers-form .careers-form-intro {
  margin-bottom: 0;
}

.careers-form-intro {
  margin-top: -12px;
}

/* The landing form's fields with the frames' square corners. */
.careers-form input,
.careers-form textarea {
  border-width: 2px;
  border-radius: 0;
}

.careers-form label > span:first-child,
.careers-form legend,
.careers-file > label {
  color: var(--landing-ink);
  font-size: 0.875rem;
  font-weight: 700;
}

.careers-field-error,
.careers-form-error {
  color: #fca5a5;
  font-size: 0.875rem;
  font-weight: 400;
}

.careers-form p.careers-form-error {
  margin: 0;
  color: #fca5a5;
}

/* The CV: the browser's own file control, so that it works with a keyboard, a screen reader and a phone's file
   picker as it is, inside a dashed frame that says what is expected. */
.careers-file {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 2px dashed var(--careers-frame-border);
}

.careers-file:focus-within {
  border-color: var(--landing-accent);
}

.careers-form .careers-file input[type="file"] {
  padding: 10px 12px;
  border-style: solid;
  cursor: pointer;
}

.careers-file input[type="file"]::file-selector-button {
  margin-right: 14px;
  padding: 8px 14px;
  border: 0;
  background: var(--landing-accent);
  color: var(--landing-canvas);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.careers-form .careers-file-help {
  margin: 0;
  color: var(--landing-muted);
  font-size: 0.8125rem;
}

/* A yes-or-no question: two square switches. The radio itself is hidden from sight but not from the keyboard or a
   screen reader; its label carries the look and the focus ring. */
.careers-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.careers-choice legend {
  float: left;
  flex: 1 1 260px;
  padding: 0;
}

.careers-form .careers-choice label {
  display: inline-flex;
  position: relative;
}

.careers-form .careers-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
}

.careers-choice label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid var(--careers-frame-border);
  color: var(--landing-ink);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
}

.careers-choice input:checked + span {
  border-color: var(--landing-accent);
  background: var(--landing-accent);
  color: var(--landing-canvas);
}

.careers-choice input:focus-visible + span {
  outline: 2px solid var(--landing-accent);
  outline-offset: 3px;
}

.careers-choice .careers-field-error {
  flex-basis: 100%;
}

.careers-form label.careers-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #c3cde0;
  font-weight: 400;
  line-height: 1.6;
}

.careers-form .careers-consent input {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  padding: 0;
  accent-color: var(--landing-accent);
}

.careers-form label.careers-consent > span:first-child,
.careers-consent span {
  color: #c3cde0;
  font-weight: 400;
}

.careers-consent a {
  color: var(--landing-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.careers-form-actions {
  display: flex;
  justify-content: flex-end;
}

/* ---------- Phones ---------- */
@media (max-width: 860px) {
  .careers-hero {
    padding: 48px 0 28px;
  }

  .careers-hero-opening {
    padding-top: 28px;
  }

  .careers-quest {
    flex-direction: column;
    align-items: stretch;
    padding: 22px 20px;
  }

  .careers-quest-action {
    justify-content: center;
  }

  .careers-step-list,
  .careers-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .careers-panel {
    padding: 24px 20px;
  }

  .careers-frame {
    box-shadow: 4px 4px 0 var(--careers-frame-shadow);
  }

  .careers-stat {
    flex: 1 1 132px;
  }

  .careers-form-actions .landing-button {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .careers-party canvas,
  .careers-bubble {
    animation: none;
  }
}
