:root {
  --ink: #07080a;
  --panel: #0c0e12;
  --facet-a: #101218;
  --facet-b: #0a0b0f;
  --facet-c: #14161d;
  --seam: rgba(255, 255, 255, 0.04);
  --red: #C62828;
  --red-soft: rgba(198, 40, 40, 0.55);
  --fog: #8b9099;
  --fog-dim: #565b64;
  --line: rgba(255, 255, 255, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--fog);
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--red); color: #fff; }

.shell { position: relative; width: 100%; }

/* ---------- Faceted backdrop ---------- */
.facets {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--ink);
  overflow: hidden;
}
.facets svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Red swarm: revealed only within a spotlight under the cursor (masked on-canvas) */
.swarm-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  opacity: 0.9;
}

.content { position: relative; z-index: 2; }

/* ---------- Top bar ---------- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px clamp(20px, 5vw, 64px);
}

.wordmark {
  font-family: "Archivo", sans-serif;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #f3f4f6;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.wordmark .ai { color: var(--red); }

header .wordmark { font-size: clamp(16px, 1.6vw, 19px); }

.top-tag {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--fog-dim);
  font-weight: 600;
}
.top-link {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fog-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.top-link:hover { color: var(--red); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px clamp(20px, 5vw, 64px) 80px;
}

/* Home page: lock to a single viewport (no scroll on any device). */
body.home, html:has(body.home) { overflow: hidden; height: 100vh; }
body.home .content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
}
body.home .hero {
  min-height: 0;
  flex: 1 1 auto;
  padding: 24px clamp(20px, 5vw, 64px);
}
body.home footer {
  flex: 0 0 auto;
  justify-content: center;
  padding-top: 18px;
  padding-bottom: 18px;
}
body.careers-page footer, body.contact-page footer { justify-content: center; }

/* Contact page: one viewport, tight form. */
body.contact-page, html:has(body.contact-page) { overflow: hidden; height: 100vh; }
body.contact-page .content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
}
body.contact-page section.careers {
  flex: 1 1 auto;
  padding: 12px clamp(20px, 5vw, 64px);
  align-items: center;
}
body.contact-page .panel { padding: clamp(22px, 3vw, 32px); }
body.contact-page .eyebrow { margin-bottom: 14px; }
body.contact-page .field { margin-bottom: 14px; }
body.contact-page .field label { margin-bottom: 6px; }
body.contact-page .field textarea { min-height: 84px; }
body.contact-page footer {
  flex: 0 0 auto;
  border-top: none;
  padding-top: 12px;
  padding-bottom: 12px;
}

.hero-mark {
  font-family: "Archivo", sans-serif;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.92;
  color: #f4f5f7;
  font-size: clamp(30px, 6.5vw, 96px);
  position: relative;
}
.hero-mark > span { display: block; }
.hero-mark .ai { color: var(--red); }
.hero-mark .ch { display: inline-block; }
.hero-mark::after {
  /* thin red edge-light beneath the mark */
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red-soft), transparent);
}

.hero-line {
  margin-top: clamp(22px, 3.5vw, 38px);
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: clamp(12px, 1.5vw, 16px);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-indent: 0.34em;
  color: var(--fog);
}

.join, .contact {
  position: fixed;
  top: clamp(18px, 2.6vw, 32px);
  z-index: 10;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fog-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.join { right: clamp(20px, 5vw, 64px); }
.contact { left: clamp(20px, 5vw, 64px); }
.join:hover, .contact:hover { color: var(--red); }

/* ---------- Careers page: open positions ---------- */
.roles {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(48px, 11vh, 110px) clamp(20px, 5vw, 64px) 10px;
}
.contact-title {
  font-family: "Archivo", sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #f4f5f7;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 0.98;
  text-align: center;
  margin-bottom: 28px;
}
.roles-title {
  font-family: "Archivo", sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #f4f5f7;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 0.96;
  margin-bottom: 18px;
}
.roles-intro {
  max-width: 54ch;
  font-size: clamp(14px, 1.4vw, 16px);
  color: var(--fog);
  letter-spacing: 0.02em;
  margin-bottom: clamp(30px, 5vw, 48px);
}
/* department accordion (caret fold-downs) */
.role-groups { display: flex; flex-direction: column; gap: 12px; }
.dept {
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(20,22,29,0.55) 0%, rgba(12,14,18,0.55) 100%);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  transition: border-color 0.2s;
}
.dept:hover { border-color: rgba(255,255,255,0.1); }
.dept[open] { border-color: var(--red-soft); }
.dept-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(16px, 2vw, 20px) clamp(20px, 3vw, 28px);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.dept-head::-webkit-details-marker { display: none; }
.dept-head:focus-visible { outline: 1px solid var(--red-soft); outline-offset: 2px; }
.dept-name {
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: clamp(13px, 1.7vw, 16px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f3f4f6;
}
.dept-right { display: flex; align-items: center; gap: 16px; }
.dept-count {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fog-dim);
  white-space: nowrap;
}
.caret {
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--red);
  border-bottom: 1.5px solid var(--red);
  transform: rotate(45deg);
  margin-bottom: 3px;
  transition: transform 0.25s ease;
}
.dept[open] .caret { transform: rotate(225deg); margin-bottom: 0; margin-top: 3px; }

.role-list { display: flex; flex-direction: column; gap: 10px; }
.dept .role-list { padding: 2px clamp(14px, 2.4vw, 22px) clamp(16px, 2.4vw, 22px); }
.role {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  text-decoration: none;
  background: linear-gradient(155deg, var(--facet-c) 0%, var(--panel) 60%, var(--facet-b) 100%);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  padding: clamp(16px, 2.2vw, 22px) clamp(18px, 3vw, 28px);
  transition: border-color 0.2s, transform 0.15s;
}
.role:hover { border-color: var(--red-soft); transform: translateY(-2px); }
.role .r-main { display: flex; flex-direction: column; gap: 7px; }
.role .r-title {
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: clamp(16px, 2vw, 21px);
  color: #f3f4f6;
  letter-spacing: -0.01em;
}
.role .r-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fog);
  max-width: 58ch;
}
.role .r-meta {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fog-dim);
  font-weight: 600;
}
.role .r-go {
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  white-space: nowrap;
}
.roles-note {
  max-width: 54ch;
  margin: clamp(26px, 4vw, 38px) 0 0;
  font-size: 13px;
  color: var(--fog-dim);
}

/* ---------- Careers / Apply ---------- */
.careers {
  padding: clamp(60px, 12vh, 140px) clamp(20px, 5vw, 64px) 110px;
  display: flex;
  justify-content: center;
}
.panel-wrap {
  width: 100%;
  max-width: 560px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
  margin-bottom: 18px;
  text-align: center;
}

.recruit {
  text-align: center;
  max-width: 460px;
  margin: 0 auto 40px;
  font-size: clamp(14px, 1.4vw, 16px);
  color: var(--fog);
  letter-spacing: 0.02em;
}

/* faceted apply panel */
.panel {
  position: relative;
  background:
    linear-gradient(155deg, var(--facet-c) 0%, var(--panel) 45%, var(--facet-b) 100%);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px));
  padding: clamp(28px, 4vw, 46px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.03);
}
/* red seam glints on two cut corners */
.panel::before, .panel::after {
  content: "";
  position: absolute;
  width: 36px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: 0.8;
}
.panel::before { top: 12px; right: -4px; transform: rotate(-45deg); }
.panel::after { bottom: 12px; left: -4px; transform: rotate(-45deg); }

.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--fog-dim);
  margin-bottom: 9px;
  font-weight: 700;
}
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field textarea {
  width: 100%;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--line);
  color: #e9eaec;
  font-family: "Nunito", sans-serif;
  font-size: 15px;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}
.field input::placeholder,
.field textarea::placeholder { color: #3c4048; }
.field input:focus,
.field textarea:focus {
  border-color: var(--red-soft);
  background: rgba(198,40,40,0.04);
}

/* faceted file control */
.file-control { position: relative; }
.file-control input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%; height: 100%;
  cursor: pointer;
}
.file-face {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px dashed rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.01);
  padding: 16px 16px;
  color: var(--fog-dim);
  font-size: 13px;
  letter-spacing: 0.04em;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  transition: border-color 0.2s, color 0.2s;
}
.file-control:hover .file-face,
.file-control input:focus + .file-face {
  border-color: var(--red-soft);
  color: var(--fog);
}
.file-face .tag {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
  white-space: nowrap;
}
.file-face .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.submit {
  width: 100%;
  margin-top: 8px;
  background: transparent;
  border: 1px solid var(--red);
  color: #f3f4f6;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 16px;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  transition: background 0.22s, color 0.22s, box-shadow 0.22s;
}
.submit:hover {
  background: var(--red);
  box-shadow: 0 0 30px rgba(198,40,40,0.35);
}
.submit:disabled { opacity: 0.5; cursor: default; }

/* success state */
.success {
  text-align: center;
  padding: 14px 4px;
  animation: rise 0.5s ease;
}
.success .ok {
  width: 46px; height: 46px;
  margin: 0 auto 20px;
  border: 1px solid var(--red);
  display: flex; align-items: center; justify-content: center;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  color: var(--red);
  font-size: 20px;
}
.success h3 {
  font-family: "Archivo", sans-serif;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #f3f4f6;
  font-size: 20px;
  margin-bottom: 10px;
}
.success p { font-size: 14px; color: var(--fog); max-width: 340px; margin: 0 auto; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.err {
  color: var(--red);
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-top: 14px;
  text-align: center;
  min-height: 14px;
}
.hidden { display: none !important; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 34px clamp(20px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
footer .wordmark { font-size: 15px; }
footer .org {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fog-dim);
  font-weight: 600;
}

@media (max-width: 540px) {
  header { padding: 20px; }
  .role { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero-mark::after { left: 4%; right: 4%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .success { animation: none; }
  .role { transition: none; }
  .caret { transition: none; }
}
