.application-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0;
}
.application-options a {
  padding: 24px;
  border: 1px solid #454545;
  border-radius: 18px;
  color: #fff;
  text-decoration: none;
  background: #141414;
}
.application-options a:hover {
  background: #242424;
  border-color: #aaa;
}
.academy-application {
  max-width: 1000px;
  padding: clamp(20px, 4vw, 48px);
  border: 1px solid #404040;
  border-radius: 24px;
  background: #121212;
  scroll-margin-top: 110px;
}
.academy-application label {
  display: grid;
  gap: 10px;
  margin: 20px 0;
  color: #eee;
}
.application-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}
.application-fields > label,
#voucher-fields > label,
#project-fields > label {
  min-width: 0;
}
.academy-application :is(input:not([type='checkbox']), select, textarea) {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid #656565;
  border-radius: 10px;
  background: #090909;
  color: #fff;
  font: inherit;
}
.academy-application :is(input, select, textarea):focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.academy-application .application-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.application-consent input {
  margin-top: 5px;
  accent-color: #ff0000;
}
.academy-application [hidden] {
  display: none !important;
}
#application-result {
  white-space: pre-line;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
#application-result[data-error='true'] {
  color: #ffb7b7;
}
.academy-application button:disabled {
  opacity: 0.6;
  cursor: wait;
}
@media (max-width: 700px) {
  .application-options,
  .application-fields {
    grid-template-columns: 1fr;
  }
}

.application-modal-open {
  overflow: hidden;
}
#application-dialog {
  box-sizing: border-box;
  width: min(1000px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid #555;
  border-radius: 24px;
  background: #121212;
  color: #fff;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#application-dialog::backdrop {
  background: rgb(0 0 0 / 0.72);
  backdrop-filter: blur(8px);
}
#application-dialog .academy-application {
  border: 0;
  max-width: none;
  padding-top: 64px;
}
:root body .application-close {
  position: absolute;
  right: 18px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #666;
  border-radius: 50%;
  background: #242424;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
:root body .application-close:hover {
  background: #383838;
}
@media (max-width: 600px) {
  #application-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 18px;
  }
}

.alumni-profiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  list-style: none;
  margin: 36px 0 0;
  padding: 8px 0 16px;
}
.alumni-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: #eee;
  text-align: center;
  font-size: 15px;
  line-height: 1.4;
}
.alumni-profile-copy {
  display: grid;
  gap: 6px;
}
.alumni-profile-copy strong {
  font-size: 15px;
}
.alumni-profile-copy small {
  color: #bbb;
  font-size: 12px;
  letter-spacing: normal;
  line-height: 1.5;
  text-transform: none;
}
.alumni-profile img {
  display: block;
  width: 88px;
  height: 88px;
  box-sizing: border-box;
  border: 2px solid #666;
  border-radius: 50%;
  object-fit: cover;
}
@media (max-width: 700px) {
  .alumni-profiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.careers-page {
  position: relative;
  background: #080808;
  isolation: isolate;
}
body.careers-page::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: max(850px, 100vh);
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(0deg, #080808 0%, transparent 48%),
    linear-gradient(90deg, rgb(8 8 8 / 38%), rgb(8 8 8 / 32%) 60%, rgb(8 8 8 / 25%)),
    url('/assets/images/cdd.jpg') center 55% / cover no-repeat;
}

/* Opportunity cards retain the photo layout, with clear reading surfaces. */
.careers-page .community-intro h1 {
  text-shadow: 0 2px 18px #000;
}
.careers-page .lead,
.careers-page .section-copy {
  color: #eee;
  font-size: 18px;
  line-height: 1.7;
  text-shadow: 0 1px 8px #000;
}
.careers-page #opportunities,
.careers-page #heroes {
  background: rgb(8 8 8 / 76%);
  border-radius: 22px;
  margin: 20px 4% 40px;
  padding: 36px 3%;
  border: 1px solid #444;
}
.careers-page .application-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.careers-page .application-options a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  min-width: 0;
  background: #151515;
  border: 1px solid #555;
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.2s;
}
.careers-page .application-options a:hover {
  background: #232323;
  border-color: #aaa;
  transform: translateY(-3px);
}
.opportunity-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  background: #282828;
  border: 1px solid #505050;
  border-radius: 16px;
  color: #eee;
  margin-bottom: 24px;
}
.opportunity-icon svg {
  width: 32px;
  height: 32px;
}
.application-options h3 {
  font-size: 23px;
  line-height: 1.25;
  margin: 0 0 14px;
  color: #fff;
}
.application-options p {
  font-size: 16px;
  line-height: 1.6;
  color: #bdbdbd;
  margin: 0 0 24px;
}
.opportunity-link {
  font-size: 13px;
  color: #eee;
  padding-top: 16px;
  border-top: 1px solid #444;
  margin-top: auto;
  width: 100%;
}
@media (max-width: 1100px) {
  .careers-page .application-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .careers-page .application-options {
    grid-template-columns: 1fr;
  }
  .careers-page #opportunities,
  .careers-page #heroes {
    padding: 24px 18px;
    margin: 16px 4% 28px;
  }
  .careers-page .lead,
  .careers-page .section-copy {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .careers-page .application-options a {
    transition: none;
  }
  .careers-page .application-options a:hover {
    transform: none;
  }
}

/* Wider Careers layout with lightly tinted section surfaces. */
.careers-page .community-main {
  width: 100%;
  max-width: none;
}
.careers-page .community-intro {
  padding-left: 3%;
  padding-right: 3%;
}
.careers-page #opportunities,
.careers-page #heroes {
  margin-left: 2%;
  margin-right: 2%;
  padding-left: 2%;
  padding-right: 2%;
  background: rgb(8 8 8 / 18%);
  border-color: rgb(255 255 255 / 12%);
}
.careers-page .application-options a {
  background: rgb(15 15 15 / 62%);
  border-color: rgb(255 255 255 / 24%);
}
.careers-page .application-options a:hover {
  background: rgb(25 25 25 / 78%);
}
.careers-page .application-options p {
  color: #eeeeee;
}
@media (max-width: 600px) {
  .careers-page #opportunities,
  .careers-page #heroes {
    padding: 24px 16px;
  }
}

.careers-page #opportunities,
.careers-page #heroes {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
#voucher-fields small {
  color: #bbb;
  font-size: 14px;
  line-height: 1.5;
}

/* Keep one scroll area in the rounded application dialog. */
#application-dialog {
  scrollbar-gutter:stable;
  max-width:calc(100vw - 32px);
}
#application-dialog .academy-application {
  box-sizing:border-box;
  width:100%;
  min-width:0;
  overflow:visible;
}
#application-dialog .academy-application label {
  overflow-wrap:anywhere;
}
#application-dialog select {
  text-overflow:ellipsis;
}
#application-dialog textarea {
  resize:vertical;
  min-height:100px;
  max-height:220px;
}
#application-dialog input[type='file'] {
  white-space:normal;
  font-size:14px;
}
:root body #application-dialog .application-close {
  position:sticky;
  float:right;
  top:12px;
  margin:12px 16px -52px 0;
  right:auto;
  z-index:2;
}
@media(min-width:1000px) {
  #application-dialog {
    width:min(1100px,calc(100vw - 64px));
  }
  #application-dialog .academy-application {
    padding:40px 36px 28px;
  }
  #application-dialog h2 {
    margin:0 50px 12px 0;
    font-size:30px;
  }
  #application-dialog .academy-application label {
    margin:12px 0;
    gap:7px;
  }
  #application-dialog .academy-application :is(input:not([type='checkbox']),select,textarea) {
    padding:11px 14px;
  }
  #application-dialog textarea {
    height:100px;
  }
  #voucher-fields {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:24px;
  }
}
.alumni-profile-copy {
  max-width:230px;
}
.alumni-profile-copy strong {
  font-size:17px;
}
.alumni-profile-copy small {
  font-size:14px;
}
@media(min-width:1300px) {
  .alumni-profiles {
    grid-template-columns:repeat(7,minmax(0,1fr));
    gap:20px;
  }
}

:root body .alumni-profile .instructor-choice {
  width: 160px;
  max-width: 100%;
  margin: 0;
}
.alumni-profile .hero-profile-role[hidden] {
  display: none;
}
#hero-profile-dialog .instructor-selected-course {
  font-size: 17px;
  line-height: 1.6;
}

/* Let the group photograph breathe above the Careers introduction. */
.careers-page #opportunities {
  padding-top: clamp(300px, 45svh, 560px);
}
.careers-page #opportunities > h1 {
  margin: 0 0 22px;
  text-shadow: 0 2px 18px #000;
}
@media (max-width: 600px) {
  .careers-page #opportunities {
    padding-top: clamp(240px, 36svh, 340px);
  }
}

/* Keep expanded academy biographies readable on wide and narrow screens. */
#hero-profile-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
}
/* Detailed biographies appear only inside the expanded hero profile. */
.alumni-profile .hero-profile-bio[hidden] { display: none; }
#hero-profile-dialog .hero-profile-biography {
  margin: 20px 0 0;
  font-size: 16px;
  line-height: 1.7;
  text-align: justify;
  text-align-last: left;
  text-transform: none;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Focus the supplied competition photograph on Sigfrid's face and shoulders. */
#hero-profile-dialog img[data-portrait="sigfrid"],
.alumni-profile img[data-portrait="sigfrid"] {
  object-fit: cover;
  object-position: 42% 40%;
  object-view-box: inset(30% 35% 45% 20%);
}

/* Keep the full head visible in the supplied passport portraits. */
.alumni-profile img[data-portrait="mwaipopo"],
.alumni-profile img[data-portrait="felix"],
#hero-profile-dialog img:is([data-portrait="mwaipopo"], [data-portrait="felix"]) {
  object-fit: cover;
  object-position: center top;
}

#hero-profile-dialog img:is([data-portrait="mwaipopo"], [data-portrait="felix"]) {
  width: 180px;
  height: 180px;
}

@media (max-width: 480px) {
  #hero-profile-dialog img:is([data-portrait="mwaipopo"], [data-portrait="felix"]) {
    width: 160px;
    height: 160px;
  }
}
