/* =========================================================
   WEALTH NEXUS: CAREERS (careers.wealthnx.com)

   The locked visual identity, carried over verbatim from the
   founding-cohort application form
   (research/application-form-prep/site/styles.css) and
   brand-intelligence/visual-identity/wealth-nexus-design-system.css.

   Colour, type and shape tokens are NOT re-invented here. Only a
   couple of layout-only tokens are added, marked below.

   Mobile first: the base rules are the phone layout, the
   min-width queries add air on larger screens.
   ========================================================= */

:root {
  /* ---- LOCKED TOKENS (design system, do not change) ---- */
  --bg:          #0B0B0D;   /* near-black base */
  --bg-elev:     #141417;   /* raised surface */
  --text:        #F4F2ED;   /* warm off-white */
  --text-dim:    #95949A;   /* muted grey */
  --line:        rgba(244,242,237,0.10);
  --line-strong: rgba(244,242,237,0.24);

  --red:         #A51C30;   /* primary crimson */
  --red-deep:    #7E1521;   /* oxblood */
  --red-bright:  #C42032;   /* hover / glow */
  --red-soft:    #E5566A;   /* crimson for small text on the dark base (about 5:1) */
  --red-tint:    rgba(165,28,48,0.10);

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:  'Montserrat', system-ui, -apple-system, sans-serif;

  --radius: 12px;
  --maxw:   660px;          /* comfortable reading column */
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);

  /* ---- CAREERS ADDITIONS (layout only, no new colours) ---- */
  --maxw-wide: 820px;       /* the roles list gets a little more room */
  --gutter:    20px;
}

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

html { height: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100%;
  overflow-x: hidden;        /* never scroll sideways */
  position: relative;
  font-size: 16px;
  line-height: 1.6;
}

/* A .field is display:flex, which beats the default [hidden] behaviour,
   so make [hidden] win everywhere. */
[hidden] { display: none !important; }

img, svg, video { max-width: 100%; height: auto; }

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

/* =========================================================
   BACKGROUND LAYERS: the calm "subtle" mood (one slow oxblood
   glow), the same stack the application form uses.
   ========================================================= */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.bg-base { background: var(--bg); }

.bg-glow {
  opacity: 0;
  transition: opacity 1.2s var(--ease);
  background:
    radial-gradient(60% 55% at 30% 35%, rgba(165,28,48,0.20), transparent 70%),
    radial-gradient(50% 50% at 75% 70%, rgba(126,21,33,0.16), transparent 70%);
  animation: drift 26s ease-in-out infinite alternate;
  will-change: transform;
}

.bg-vignette {
  background: radial-gradient(120% 120% at 50% 45%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* Film grain: a static baked SVG noise, never animated. */
.bg-grain {
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body.bg-subtle .bg-glow { opacity: 1; }

@keyframes drift {
  from { transform: translate3d(-3%, -2%, 0) scale(1.05); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.15); }
}

/* =========================================================
   SHELL, TOP BAR, FOOTER
   ========================================================= */
.shell {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  width: 100%;
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 22px var(--gutter) 0;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-bottom: 18px;
}

.wordmark {
  font-family: var(--sans);
  font-weight: 600; font-size: 11.5px; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--text); text-decoration: none;
  transition: color 0.2s var(--ease);
}
.wordmark:hover { color: var(--red-bright); }

.topnav a {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-dim); text-decoration: none;
  transition: color 0.2s var(--ease);
}
.topnav a:hover { color: var(--text); }

.page {
  flex: 1;
  width: 100%;
  padding: 32px 0 0;
}

.site-footer {
  margin-top: 72px;
  padding: 26px 0 34px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; letter-spacing: 0.04em; color: var(--text-dim);
}
.site-footer a { color: var(--text-dim); text-decoration: none; border-bottom: 1px solid var(--line); }
.site-footer a:hover { color: var(--text); border-bottom-color: var(--line-strong); }

/* =========================================================
   TYPE
   ========================================================= */
.eyebrow {
  font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--red-bright); opacity: 0.85;
  margin-bottom: 18px;
}
/* The role-page status line carries several facts, not a one-word label, so it
   gets a readable variant. Bold text in it (the live seat's "Hiring now") takes
   the lighter crimson, which stays readable on the dark base. */
.eyebrow.status {
  font-size: 13px; letter-spacing: 0.1em; line-height: 1.6;
  color: var(--text); opacity: 0.92;
}
.eyebrow.status strong { color: var(--red-soft); font-weight: 600; }

.headline {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.75rem, 7vw, 3rem);
  line-height: 1.14; letter-spacing: -0.01em;
  color: var(--text);
}
.headline.display { font-size: clamp(2.1rem, 9vw, 4rem); line-height: 1.08; }

.lead {
  margin-top: 20px;
  font-size: 16px; line-height: 1.62; color: var(--text-dim);
  max-width: 54ch;
}

.section-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.15rem, 4.4vw, 1.4rem);
  line-height: 1.25; letter-spacing: -0.005em;
  color: var(--text);
  margin-bottom: 14px;
}

.body-copy p { color: var(--text-dim); max-width: 60ch; }
.body-copy p + p { margin-top: 14px; }
.body-copy strong { color: var(--text); font-weight: 500; }

.bullets { list-style: none; margin: 0; max-width: 60ch; }
.bullets li {
  position: relative;
  padding-left: 20px;
  color: var(--text-dim);
}
.bullets li + li { margin-top: 10px; }
.bullets li::before {
  content: ''; position: absolute; left: 2px; top: 0.72em;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--red);
}

.helper {
  font-size: 13.5px; line-height: 1.55; color: var(--text-dim); max-width: 56ch;
}

a.inline { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
a.inline:hover { color: var(--red-bright); border-bottom-color: var(--red); }

/* =========================================================
   INDEX: hero, how we hire, the roles list
   ========================================================= */
.hero { padding-bottom: 8px; }

.block { margin-top: 64px; }
.block:first-child { margin-top: 0; }

#roles { scroll-margin-top: 28px; }

.roles { list-style: none; margin-top: 22px; border-top: 1px solid var(--line); }

.role-link {
  display: block;
  text-decoration: none; color: inherit;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.22s var(--ease), padding 0.22s var(--ease);
}
.role-link:hover { border-bottom-color: var(--line-strong); }
.role-link:focus-visible {
  outline: none;
  border-bottom-color: var(--red);
  box-shadow: 0 0 0 2px var(--red-tint);
  border-radius: 4px;
}

.role-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
}
.role-title {
  font-family: var(--serif); font-weight: 500;
  font-size: 1.28rem; line-height: 1.2; color: var(--text);
  transition: color 0.22s var(--ease);
}
.role-link:hover .role-title { color: var(--red-bright); }

.role-line {
  display: block; margin-top: 10px;
  font-size: 14.5px; line-height: 1.55; color: var(--text-dim); max-width: 58ch;
}
.role-cta {
  display: inline-block; margin-top: 14px;
  font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.22s var(--ease);
}
.role-link:hover .role-cta { color: var(--text); }

/* Status pill. Only "Hiring now" carries the accent: one red thing per screen. */
.pill {
  display: inline-block;
  font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 5px 12px 4px; border-radius: 100px;
  border: 1px solid var(--line); color: var(--text-dim);
  white-space: nowrap;
}
.pill.now {
  border-color: var(--red);
  background: var(--red-tint);
  color: var(--red-bright);
}

/* =========================================================
   ROLE PAGE
   ========================================================= */
.role-page .eyebrow { margin-bottom: 16px; }
.role-page .section { margin-top: 52px; }
.role-page .section:first-of-type { margin-top: 56px; }

.apply-block {
  margin-top: 44px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

/* =========================================================
   BUTTONS: the locked pill (crimson to oxblood)
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  font-family: var(--sans); font-weight: 600; font-size: 15px; letter-spacing: 0.04em;
  color: #fff; text-decoration: none; cursor: pointer;
  padding: 15px 38px; border: none; border-radius: 100px;
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  box-shadow: 0 8px 26px rgba(126,21,33,0.30);
  transition: filter 0.2s var(--ease), box-shadow 0.3s var(--ease), transform 0.15s var(--ease);
}
.btn:hover { filter: brightness(1.10); box-shadow: 0 10px 34px rgba(196,32,50,0.42); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--red-tint), 0 8px 26px rgba(126,21,33,0.30); }
.btn.busy { pointer-events: none; opacity: 0.8; }
.btn.busy .label { opacity: 0; }
.btn.busy::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-note { margin-top: 14px; font-size: 12.5px; color: var(--text-dim); }

/* =========================================================
   FORM
   ========================================================= */
.form { margin-top: 40px; }

.fieldset { border: none; }
.fieldset + .fieldset { margin-top: 44px; }
.fieldset legend {
  font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--text-dim); padding: 0; margin-bottom: 20px;
}

.field { display: flex; flex-direction: column; gap: 7px; }
.field + .field { margin-top: 22px; }
.field > label {
  font-size: 12.5px; letter-spacing: 0.05em; color: var(--text-dim);
  line-height: 1.45;
}
.field .optional { color: var(--text-dim); opacity: 0.7; }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="url"],
.field textarea,
.field select {
  width: 100%;
  font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--text);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder,
.field textarea::placeholder { color: var(--text-dim); opacity: 0.6; }
.field input:hover,
.field textarea:hover,
.field select:hover { border-color: var(--line-strong); }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--red);
  background: rgba(255,255,255,0.04);
  box-shadow: 0 0 0 2px var(--red-tint);
}

/* Select: custom chevron, because the native arrow clashes with the dark theme. */
.field select {
  padding-right: 44px;
  cursor: pointer;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2395949A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.field select.placeholder-shown { color: var(--text-dim); }
.field select option { color: var(--text); background: var(--bg-elev); }
.field select option[value=""] { color: var(--text-dim); }

.field-error { font-size: 12.5px; line-height: 1.4; color: var(--red-bright); min-height: 1em; }
.field.invalid input,
.field.invalid textarea,
.field.invalid select { border-color: var(--red-bright); }

/* Consent checkbox */
.field-check { flex-direction: row; align-items: flex-start; gap: 12px; }
.field-check input[type="checkbox"] {
  flex: 0 0 auto; margin-top: 2px;
  width: 20px; height: 20px;
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--line-strong); border-radius: 5px;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.field-check input[type="checkbox"]:hover { border-color: var(--text-dim); }
.field-check input[type="checkbox"]:checked {
  border-color: var(--red);
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23F4F2ED' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center no-repeat;
}
.field-check input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--red-tint); }
.field-check > label { font-size: 14px; color: var(--text-dim); cursor: pointer; }
.field-check.invalid input[type="checkbox"] { border-color: var(--red-bright); }
.field-check .field-error { flex-basis: 100%; }

/* The DM thread shown above the setter test */
.thread {
  margin: 4px 0 16px;
  display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  background: rgba(255,255,255,0.015);
}
.msg { max-width: 88%; }
.msg .who {
  display: block; margin-bottom: 5px;
  font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-dim);
}
.msg .bubble {
  display: block;
  font-size: 14.5px; line-height: 1.55; color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 15px;
  background: rgba(255,255,255,0.02);
}
.msg.us { align-self: flex-end; text-align: right; }
.msg.us .bubble { background: var(--red-tint); border-color: var(--line-strong); text-align: left; }

/* Submit row, error box, success screen */
.submit-row { margin-top: 40px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }

.form-error {
  font-size: 14px; line-height: 1.55; color: var(--text);
  background: var(--red-tint); border: 1px solid var(--red);
  border-radius: var(--radius); padding: 14px 16px; max-width: 52ch;
}
.form-error a { color: var(--red-bright); font-weight: 600; }

.success { padding-top: 24px; }
.success .headline { margin-top: 4px; }
.success .lead { margin-top: 18px; }

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

.noscript {
  position: relative; z-index: 1; max-width: 56ch; margin: 12vh auto; padding: 0 var(--gutter);
}
.noscript h1 { font-family: var(--serif); font-weight: 500; font-size: 1.7rem; margin-bottom: 14px; }
.noscript p { color: var(--text-dim); }
.noscript a { color: var(--red-bright); }

/* =========================================================
   LARGER SCREENS
   ========================================================= */
@media (min-width: 700px) {
  :root { --gutter: 40px; }

  .shell { padding-top: 30px; }
  .topbar { padding-bottom: 26px; }
  .wordmark { font-size: 13px; letter-spacing: 0.34em; }
  .page { padding-top: 56px; }

  .lead { font-size: 17px; margin-top: 24px; }
  .block { margin-top: 84px; }
  .role-link { padding: 26px 0; }
  .role-title { font-size: 1.45rem; }
  .role-line { font-size: 15px; }

  .role-page .section { margin-top: 60px; }
  .site-footer { flex-direction: row; gap: 22px; margin-top: 96px; }
}

@media (min-width: 1000px) {
  .shell { padding-left: 0; padding-right: 0; max-width: var(--maxw-wide); }
  .page { padding-top: 72px; }
}

/* =========================================================
   REDUCED MOTION: hold everything still.
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-glow { animation: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
