/* ================================================================
   Growthhive — Careers Page Stylesheet
   careers.css
   Depends on: shared.css (must be loaded first)
   Work. Play. Grow. 🐝
================================================================ */

/* ── WebGL canvas ──────────────────────────────────────────────
   THE FIX: without this rule the <canvas id="c"> has no CSS at
   all, so it renders at its raw pixel size in normal document
   flow — shoving every section below it down the page instead of
   sitting behind them. Pinning it fixed + full-bleed + z-index:0
   takes it out of flow and puts it behind the content permanently.
------------------------------------------------------------------ */
#c {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

/* All <section> elements already get position:relative + z-index:1
   from shared.css, so once #c is fixed behind them, every section
   below naturally sits on top of the canvas. */

/* ── Hero ──────────────────────────────────────────────────── */
.cr-hero {
  height: 100vh; min-height: 700px;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  padding: 0 3rem 5rem;
  overflow: visible;
}
.cr-eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: .63rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--ch); margin-bottom: 1.6rem; overflow: hidden;
}
.cr-eyebrow span {
  display: block;
  animation: crFadeUp .9s var(--ease) both;
}
.cr-title {
  font-size: clamp(4rem, 11vw, 11rem);
  font-weight: 200; line-height: .98; letter-spacing: -.05em;
  margin-bottom: 3rem;
}
.cr-title .line {
  overflow: hidden;
  display: block;
  padding-bottom: .12em;
  margin-bottom: -.12em;
}
.cr-title .word {
  display: inline-block;
  animation: crFadeUp 1s var(--ease) both;
  animation-delay: .08s;
}
.cr-title .line:nth-child(2) .word { animation-delay: .16s; }
.cr-title .word.acc { color: var(--ch); font-style: italic; }

.cr-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cr-sub {
  font-size: .93rem; line-height: 1.68; color: var(--dim);
  max-width: 420px; overflow: hidden;
}
.cr-sub span {
  display: block;
  animation: crFadeUp 1s var(--ease) both;
  animation-delay: .3s;
}
.cr-scroll { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.cr-scroll-line {
  width: 1px; height: 28px;
  background: linear-gradient(to bottom, var(--ch), transparent);
  animation: crPulse 1.8s ease-in-out infinite;
}
.cr-scroll span {
  font-family: 'Space Mono', monospace;
  font-size: .55rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--dim);
}

@keyframes crFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes crPulse {
  0%, 100% { opacity: .3; transform: scaleY(.6); }
  50%      { opacity: 1;  transform: scaleY(1); }
}

/* ── Why section ───────────────────────────────────────────── */
.why-section { padding: 9rem 3rem; background: transparent; }
.why-grid {
  display: grid; grid-template-columns: .85fr 1.15fr; gap: 5rem;
  max-width: 1280px; margin: 0 auto;
}
.why-label {
  font-family: 'Space Mono', monospace;
  font-size: .6rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--ch); margin-bottom: 1.6rem;
}
.why-headline {
  font-size: clamp(2.2rem, 4.2vw, 3.6rem);
  font-weight: 200; line-height: 1.04; letter-spacing: -.03em;
  margin-bottom: 2rem;
}
.why-headline .line { overflow: hidden; display: block; padding-bottom: .08em; margin-bottom: -.08em; }
.why-headline .inner { display: block; }
.why-headline .inner.acc { color: var(--ch); font-style: italic; }
.why-body { font-size: .95rem; line-height: 1.75; color: var(--dim); max-width: 460px; }

.why-right { display: flex; flex-direction: column; }
.why-trait {
  display: flex; gap: 1.6rem;
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--faint);
}
.why-trait:first-child { border-top: 1px solid var(--faint); }
.why-trait-icon {
  font-family: 'Space Mono', monospace;
  font-size: .75rem; color: var(--ch); flex-shrink: 0; width: 2rem; padding-top: .15rem;
}
.why-trait-title { font-size: 1.05rem; font-weight: 400; margin-bottom: .5rem; }
.why-trait-desc { font-size: .85rem; line-height: 1.6; color: var(--dim); max-width: 460px; }

/* ── Open roles ────────────────────────────────────────────── */
.roles-section { padding: 6rem 3rem 9rem; background: transparent; }
.roles-head { max-width: 720px; margin: 0 auto 4rem; text-align: left; }
.roles-label {
  font-family: 'Space Mono', monospace;
  font-size: .6rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--ch); margin-bottom: 1.6rem;
}
.roles-headline {
  font-size: clamp(2.2rem, 4.2vw, 3.6rem);
  font-weight: 200; line-height: 1.04; letter-spacing: -.03em;
  margin-bottom: 1.6rem;
}
.roles-headline .line { overflow: hidden; display: block; padding-bottom: .08em; margin-bottom: -.08em; }
.roles-headline .inner { display: block; }
.roles-headline .inner.acc { color: var(--ch); font-style: italic; }
.roles-body { font-size: .93rem; line-height: 1.7; color: var(--dim); max-width: 560px; }

.roles-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem;
  max-width: 1280px; margin: 0 auto;
}
.role-card {
  background: rgba(242,242,234,0.03);
  border: 1px solid var(--faint);
  padding: 2.4rem;
  display: flex; flex-direction: column;
  transition: border-color .3s, background .3s;
}
.role-card:hover { border-color: rgba(212,245,60,.35); background: rgba(242,242,234,0.045); }
.role-tag {
  font-family: 'Space Mono', monospace;
  font-size: .58rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ch); margin-bottom: 1rem;
}
.role-name { font-size: 1.5rem; font-weight: 300; letter-spacing: -.02em; margin-bottom: .6rem; }
.role-meta {
  font-family: 'Space Mono', monospace;
  font-size: .6rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 1.4rem;
}
.role-desc { font-size: .88rem; line-height: 1.7; color: var(--dim); margin-bottom: 1.4rem; }
.role-list { list-style: none; margin-bottom: 1.8rem; display: flex; flex-direction: column; gap: .6rem; }
.role-list li {
  font-size: .82rem; line-height: 1.55; color: var(--dim);
  padding-left: 1.1rem; position: relative;
}
.role-list li::before {
  content: ''; position: absolute; left: 0; top: .55rem;
  width: 5px; height: 5px; border-radius: 50%; background: var(--ch);
}
.role-apply {
  margin-top: auto;
  font-family: 'Space Mono', monospace;
  font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--white); text-decoration: none;
  transition: color .3s;
}
.role-apply:hover { color: var(--ch); }

/* ── Apply form ────────────────────────────────────────────── */
.apply-section { padding: 9rem 3rem; background: transparent; }
.apply-head { max-width: 720px; margin: 0 auto 3.5rem; }
.apply-label {
  font-family: 'Space Mono', monospace;
  font-size: .6rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--ch); margin-bottom: 1.6rem;
}
.apply-headline {
  font-size: clamp(2.2rem, 4.2vw, 3.6rem);
  font-weight: 200; line-height: 1.04; letter-spacing: -.03em;
  margin-bottom: 1.4rem;
}
.apply-headline .line { overflow: hidden; display: block; padding-bottom: .08em; margin-bottom: -.08em; }
.apply-headline .inner { display: block; }
.apply-headline .inner.acc { color: var(--ch); font-style: italic; }
.apply-body { font-size: .93rem; line-height: 1.7; color: var(--dim); }

.apply-form { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.6rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
.form-field { display: flex; flex-direction: column; gap: .6rem; }
.form-field-full { width: 100%; }
.form-field label {
  font-family: 'Space Mono', monospace;
  font-size: .58rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim);
}
.form-field input,
.form-field select,
.form-field textarea {
  background: rgba(242,242,234,0.03);
  border: 1px solid var(--faint);
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: .92rem;
  padding: .9rem 1rem;
  border-radius: 2px;
  transition: border-color .3s, background .3s;
  outline: none;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--ch);
  background: rgba(242,242,234,0.05);
}
.form-field textarea { resize: vertical; min-height: 120px; font-family: 'DM Sans', sans-serif; }
.form-field select { cursor: pointer; }
.form-field select option { background: transparent; color: var(--white); }

.form-submit {
  align-self: flex-start;
  font-family: 'Space Mono', monospace;
  font-size: .63rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--navy); background: var(--ch);
  border: none; padding: 1rem 2.2rem;
  cursor: pointer; transition: opacity .3s;
}
.form-submit:hover { opacity: .82; }
.form-submit:disabled { opacity: .55; cursor: not-allowed; }

/* Formspree AJAX form-level messages (data-fs-success / data-fs-error) */
.form-status {
  font-family: 'Space Mono', monospace;
  font-size: .78rem; letter-spacing: .02em; line-height: 1.6;
  padding: 0; min-height: 0;
  transition: color .3s;
}
.form-status:empty { display: none; }
.form-status-success { color: var(--ch); }
.form-status-error { color: #FF6B6B; }

/* Formspree AJAX field-level errors (data-fs-error="fieldname") */
.form-field-error {
  font-family: 'Space Mono', monospace;
  font-size: .6rem; letter-spacing: .04em; color: #FF6B6B;
}
.form-field-error:empty { display: none; }

/* Fields the library flags invalid (aria-invalid, via data-fs-field) */
.form-field input[aria-invalid="true"],
.form-field select[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] {
  border-color: #FF6B6B;
}

/* ── Closer ────────────────────────────────────────────────── */
.cr-closer {
  min-height: 70vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 6rem 3rem; overflow: visible;
  background: transparent;
}
.cr-closer-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(212,245,60,.08) 0%, transparent 65%);
  pointer-events: none;
}
.cr-closer-label {
  font-family: 'Space Mono', monospace;
  font-size: .6rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--ch); margin-bottom: 2rem;
}
.cr-closer-headline {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 200; letter-spacing: -.04em; line-height: 1.08;
  margin-bottom: 2.4rem;
}
.cr-closer-headline .line {
  overflow: hidden;
  display: block;
  padding-bottom: .12em;
  margin-bottom: -.12em;
}
.cr-closer-headline .inner { display: block; }
.cr-closer-headline .inner.acc { color: var(--ch); font-style: italic; }
.cr-closer-sub { font-size: .93rem; line-height: 1.7; color: var(--dim); max-width: 480px; margin: 0 auto 2.4rem; }
.cr-closer-btns { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .why-grid { grid-template-columns: 1fr; gap: 3rem; }
  .roles-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .cr-hero { padding: 0 1.5rem 3.5rem; }
  .cr-foot { flex-direction: column; align-items: flex-start; gap: 1.6rem; }
  .why-section, .roles-section, .apply-section { padding: 5rem 1.5rem; }
  .form-row { grid-template-columns: 1fr; }

  /* Hide desktop nav on mobile */
  .nlinks { display: none !important; }
  .ncta   { display: none !important; }
  /* Show hamburger */
  .nav-burger { display: flex !important; }
}

/* ── Hamburger button (shared pattern, page-local per site convention) ── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1003;
  position: relative;
  margin-left: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}
.nav-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile menu overlay (shared pattern, page-local per site convention) ── */
.nav-mobile {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.nav-mobile.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}
.nav-mobile-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
}
.nav-mobile-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.nav-mobile-links li a {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(2.2rem, 10vw, 3.5rem);
  font-weight: 200;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.03em;
  line-height: 1.15;
  transition: color 0.2s;
}
.nav-mobile-links li a.active { color: var(--ch); }
.nav-mobile-links li a:hover  { color: var(--ch); }
.nav-mobile-cta {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--ch);
  padding: 0.9rem 2rem;
  text-decoration: none;
  border-radius: 2px;
  transition: opacity 0.2s;
}
.nav-mobile-cta:hover { opacity: 0.88; }
.nav-mobile-foot {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

section {
  position: relative;
  z-index: 1;
}
