/* ============================================================
   AURA Design — Careers page
   Loads after css/style.css and reuses its tokens + components
   ============================================================ */

/* ---------- Khmer display font for careers-only headings ---------- */
body.km .role-title, body.km .role-open h3, body.km .apply-alt h3,
body.km .apply-done h3, body.km .perk h3, body.km .chip,
body.km .gal-card span, body.km .role-detail > h4, body.km .role-summary h4, body.km .duty h5, body.km .quals dt {
  font-family: "Bayon", sans-serif; letter-spacing: 0 !important; font-weight: 400;
}
body.km .role-meta, body.km .roles-count { letter-spacing: 0.02em !important; }

/* <button> versions of the site's ghost button (style.css only styles <a>) */
button.btn-ghost { background: transparent; }

/* ---------- Hero ---------- */
.careers-hero { min-height: 100svh; padding-bottom: 130px; }
.careers-hero .hero-sub { margin-inline: auto; }
.careers-hero .eyebrow { display: inline-block; }
.hiring-dot {
  display: inline-block; vertical-align: middle; margin: -3px 12px 0 0;
  width: 9px; height: 9px; border-radius: 50%; background: #3ddc84; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6); animation: hiring-pulse 2s ease-out infinite;
}
@keyframes hiring-pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.55); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(61, 220, 132, 0); }
}

/* ---------- Perks ---------- */
.perk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); }
.perk {
  border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2);
  padding: clamp(26px, 2.6vw, 38px); position: relative; overflow: hidden;
  transition: transform 0.45s var(--ease), border-color 0.45s, box-shadow 0.45s;
}
.perk::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -90px; top: -90px;
  background: radial-gradient(circle, rgba(162, 63, 176, 0.18), transparent 70%);
  opacity: 0; transition: opacity 0.5s; pointer-events: none;
}
.perk:hover { transform: translateY(-6px); border-color: rgba(196, 92, 208, 0.5); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
.perk:hover::after { opacity: 1; }
.perk-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 22px;
}
.perk-icon svg { width: 24px; height: 24px; }
.perk h3 { font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 1.7vw, 22px); margin-bottom: 10px; }
.perk p { color: var(--muted); font-size: 14.5px; }

/* ---------- Roles ---------- */
.roles-section { background: var(--bg-2); border-block: 1px solid var(--line); }
.roles-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.roles-head .section-title { margin-bottom: clamp(30px, 3.6vw, 48px); }
.roles-count {
  color: var(--muted); font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase;
  margin-bottom: clamp(38px, 4.4vw, 58px); white-space: nowrap;
}
.roles-count strong { color: var(--cream); font-weight: 600; }

.role-filters[hidden] { display: none; }
.role-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: clamp(26px, 3vw, 40px); }
.chip {
  font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 99px;
  padding: 10px 20px; cursor: pointer; transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.chip:hover { color: var(--cream); border-color: var(--accent); }
.chip[aria-pressed="true"] { color: #fff; border-color: transparent; background: var(--brand-grad); }

.role-list { display: flex; flex-direction: column; }
.role { border-top: 1px solid var(--line); }
.role:last-child { border-bottom: 1px solid var(--line); }
.role[hidden] { display: none; }
.role-toggle {
  width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px;
  background: none; border: 0; color: inherit; text-align: left; cursor: pointer; font: inherit;
  padding: clamp(24px, 3vw, 38px) 0; transition: padding-left 0.45s var(--ease);
}
.role-toggle:hover { padding-left: clamp(8px, 1.6vw, 22px); }
.role-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.role-title {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 3.2vw, 40px);
  letter-spacing: -0.01em; line-height: 1.12; transition: color 0.35s;
}
.role-toggle:hover .role-title, .role.open .role-title { color: var(--accent); }
.role-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13.5px; letter-spacing: 0.04em; }
.role-meta span { display: inline-flex; align-items: center; gap: 7px; }
.role-meta svg { width: 15px; height: 15px; opacity: 0.8; }
.role-dept { color: var(--accent); font-size: 11.5px !important; letter-spacing: 0.22em !important; text-transform: uppercase; }
.role-plus {
  width: clamp(42px, 4vw, 54px); height: clamp(42px, 4vw, 54px); border-radius: 50%;
  border: 1px solid var(--line); display: grid; place-items: center; color: var(--cream);
  transition: transform 0.45s var(--ease), background 0.35s, border-color 0.35s;
}
.role-plus svg { width: 20px; height: 20px; }
.role-toggle:hover .role-plus { border-color: var(--accent); }
.role.open .role-plus { transform: rotate(45deg); background: var(--brand-grad); border-color: transparent; }

.role-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.55s var(--ease); }
.role.open .role-panel { grid-template-rows: 1fr; }
.role-panel-inner { overflow: hidden; overflow: clip; }
.role-body {
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 2fr); gap: clamp(28px, 4vw, 64px);
  padding: 0 0 clamp(30px, 3.4vw, 46px);
  opacity: 0; transform: translateY(-8px); transition: opacity 0.4s, transform 0.5s var(--ease);
}
.role.open .role-body { opacity: 1; transform: none; transition-delay: 0.12s; }
.role-summary { align-self: start; position: sticky; top: 110px; }
.role-summary p { color: var(--cream); font-size: clamp(15.5px, 1.4vw, 17px); line-height: 1.7; margin-bottom: 20px; }
.role-summary .tags { margin-bottom: 26px; }
.role-summary h4, .role-detail > h4 {
  font-family: var(--font-display); font-size: 12.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px; font-weight: 600;
}
.role-detail > h4:not(:first-child) { margin-top: clamp(30px, 3vw, 42px); }

.duty-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.duty {
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  padding: clamp(18px, 1.8vw, 24px); transition: border-color 0.35s;
}
.duty:hover { border-color: rgba(196, 92, 208, 0.45); }
.duty h5 {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px;
  font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.35; color: var(--cream);
}
.duty-num { font-size: 12px; letter-spacing: 0.14em; color: var(--accent); flex-shrink: 0; }
.duty ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.duty:only-child ul { display: block; columns: 2; column-gap: 32px; }
.duty:only-child li { break-inside: avoid; margin-bottom: 10px; }
.duty li, .quals dd { color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.duty li { padding-left: 20px; position: relative; }
.duty li::before { content: "✦"; position: absolute; left: 0; top: 0; color: var(--accent); font-size: 10px; line-height: 2.3; }

.quals { border-top: 1px solid var(--line); }
.quals > div { display: grid; grid-template-columns: minmax(140px, 0.32fr) 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.quals dt { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--cream); }

.role-open {
  margin-top: clamp(36px, 4vw, 56px); padding: clamp(26px, 3vw, 40px); border-radius: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: var(--surface); position: relative;
}
.role-open::before {
  content: ""; position: absolute; inset: 0; border-radius: 20px; padding: 1.5px; background: var(--brand-grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask-composite: exclude; opacity: 0.5; pointer-events: none;
}
.role-open h3 { font-family: var(--font-display); font-weight: 700; font-size: clamp(20px, 2.2vw, 28px); margin-bottom: 6px; }
.role-open p { color: var(--muted); max-width: 560px; }
.role-open .btn { flex-shrink: 0; }

/* ---------- Gallery strip ---------- */
.gallery-section { overflow: hidden; }
.gallery-section .section-title { margin-bottom: clamp(36px, 4vw, 56px); }
.gallery-row {
  --edge: max(4vw, calc((100vw - 1240px) / 2));
  display: flex; gap: clamp(14px, 1.6vw, 22px); overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px var(--edge) 16px; scroll-padding-inline: var(--edge); scrollbar-width: none;
}
.gallery-row::-webkit-scrollbar { display: none; }
.gallery-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.gal-card {
  flex: 0 0 clamp(220px, 24vw, 320px); aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden;
  position: relative; border: 1px solid var(--line); scroll-snap-align: start; background: var(--surface);
}
.gal-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.gal-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(9, 8, 12, 0.78), transparent 55%); }
.gal-card span {
  position: absolute; left: 18px; bottom: 16px; z-index: 1; font-family: var(--font-display);
  font-size: 14px; font-weight: 600; letter-spacing: 0.04em;
}
.gal-card:hover img { transform: scale(1.06); }

/* ---------- Apply ---------- */
.apply-section { border-top: 1px solid var(--line); overflow: hidden; }
.apply-section::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 20% 40%, rgba(110, 60, 200, 0.14), transparent 70%);
}
.apply-section .aura-rings { justify-items: start; padding-left: 10vw; }
.apply-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(36px, 6vw, 96px); align-items: start; position: relative; z-index: 1; }
.apply-intro { position: sticky; top: 120px; }
.apply-intro .section-title { margin-bottom: 22px; }
.apply-text { color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); max-width: 440px; margin-bottom: 40px; }
.apply-alt { border-top: 1px solid var(--line); padding-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.apply-alt h3 { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.apply-alt p { color: var(--muted); font-size: 14.5px; margin-bottom: 6px; }
.apply-alt a { display: inline-flex; align-items: center; gap: 12px; color: var(--cream); font-size: 15px; width: fit-content; transition: color 0.3s; }
.apply-alt a:hover { color: var(--accent); }
.apply-alt svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }

.apply-card {
  background: var(--surface); border-radius: 24px; padding: clamp(24px, 3.4vw, 46px);
  position: relative; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.apply-card::before {
  content: ""; position: absolute; inset: 0; border-radius: 24px; padding: 1.5px; background: var(--brand-grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask-composite: exclude; opacity: 0.55; pointer-events: none;
}
.apply-form { display: flex; flex-direction: column; gap: 22px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.field label, .field .label { font-size: 13px; letter-spacing: 0.06em; color: var(--cream); font-weight: 500; }
.field label b { color: var(--accent); font-weight: 600; }
.field small { color: var(--muted); font-size: 12.5px; }
.field input:not([type="file"]), .field select, .field textarea {
  width: 100%; background: var(--bg); color: var(--cream); font: inherit; font-size: 15px; font-weight: 400;
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.field textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: rgba(155, 147, 173, 0.6); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(196, 92, 208, 0.4); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: #0c0a11;
}
.field .invalid, .field .invalid:hover { border-color: #ff6b6b; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; pointer-events: none;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg);
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer; }
.field select option { background: var(--surface); color: var(--cream); }

.file-drop {
  display: flex !important; align-items: center; gap: 14px; cursor: pointer; position: relative;
  border: 1px dashed rgba(196, 92, 208, 0.45); border-radius: 12px; padding: 14px 16px; background: var(--bg);
  transition: border-color 0.3s, background 0.3s;
}
.file-drop:hover, .file-drop.drag { border-color: var(--accent); background: rgba(196, 92, 208, 0.06); }
.file-drop:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-drop svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
.file-name { flex: 1; min-width: 0; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-drop.has-file .file-name { color: var(--cream); }
.file-btn {
  flex-shrink: 0; font-family: var(--font-display); font-size: 12px; letter-spacing: 0.06em;
  border: 1px solid var(--line); border-radius: 99px; padding: 7px 14px;
}

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.check input { appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; display: grid; place-items: center; transition: background 0.3s, border-color 0.3s; }
.check input:checked { background: var(--brand-grad); border-color: transparent; }
.check input:checked::after { content: ""; width: 5px; height: 10px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(45deg); }
.check input.invalid { border-color: #ff6b6b; }

.form-error { color: #ff8a8a; background: rgba(255, 107, 107, 0.08); border: 1px solid rgba(255, 107, 107, 0.3); border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.form-error a { color: var(--cream); text-decoration: underline; }
.form-submit { width: 100%; margin-top: 4px; }
.form-submit[disabled] { opacity: 0.65; cursor: progress; transform: none; }

.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.apply-form[hidden], .apply-done[hidden] { display: none; }
.apply-done { text-align: center; padding: clamp(30px, 5vw, 70px) 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.apply-done:focus { outline: none; }
.done-mark {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; color: #fff;
  background: var(--brand-grad); box-shadow: 0 14px 44px rgba(150, 70, 210, 0.45); margin-bottom: 8px;
  animation: done-pop 0.7s var(--ease);
}
@keyframes done-pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.apply-done h3 { font-family: var(--font-display); font-weight: 800; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.2; }
.apply-done p { color: var(--muted); max-width: 420px; margin-bottom: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .perk-grid { grid-template-columns: repeat(2, 1fr); }
  .role-body { grid-template-columns: 1fr; }
  .role-summary { position: static; }
  .apply-grid { grid-template-columns: 1fr; }
  .apply-intro { position: static; }
}
@media (max-width: 768px) {
  .roles-head { flex-direction: column; align-items: flex-start; gap: 0; }
  .roles-count { margin-bottom: 18px; }
  .duty:only-child ul { columns: 1; }
  .quals > div { grid-template-columns: 1fr; gap: 4px; }
  .role-open { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .perk-grid, .field-row { grid-template-columns: 1fr; }
  .role-filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -4vw; padding-inline: 4vw; scrollbar-width: none; }
  .role-filters::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; }
  .role-open .btn { width: 100%; }
  .gal-card { flex-basis: 72vw; }
  .file-btn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .role-body { opacity: 1; transform: none; }
}

/* role heading wraps the toggle button — let the inner spans control type */
.role > h3 { font-size: inherit; font-weight: inherit; }
body.km .role-meta { font-family: "Nokora", sans-serif; }
