/* Careers: /careers, /careers/<role> and /careers/open-application.
   Same scale and voice as the home (Figtree, rem on a fluid root). */

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

:root {
  --black: #000000;
  --white: #ffffff;
  --text: rgba(255,255,255,0.92);
  --text-muted: rgba(255,255,255,0.55);
  --text-dim: rgba(255,255,255,0.32);
  --line: rgba(255,255,255,0.10);
  --line-soft: rgba(255,255,255,0.06);
  --font-sans: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { font-size: clamp(16px, 1.18vw, 22px); }
body {
  background: var(--black);
  font-family: var(--font-sans);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }

.noise {
  position: fixed; inset: 0; z-index: 9996; pointer-events: none; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

.shell { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 clamp(16px, 5vw, 2rem); }

/* ── Crystal ──
   The same slab as the hiring video. On /careers it is a full-bleed hero; on the
   role pages it sits fixed behind the text, blurred and veiled. */
.crystal { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.crystal video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.crystal::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 28%, rgba(0,0,0,0.72) 55%, rgba(0,0,0,0.94) 78%, #000 100%);
}
.crystal-fixed { position: fixed; z-index: 0; }
.crystal-fixed video { filter: blur(28px); transform: scale(1.15); opacity: 0.55; }
.crystal-fixed::after {
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.78) 45%, rgba(0,0,0,0.92) 100%);
}

/* ── Type ── */
.eyebrow {
  display: block;
  font-size: 0.625rem; font-weight: 500; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--text-dim);
}
.display {
  font-size: clamp(2.25rem, 4.4vw, 3.5rem);
  font-weight: 300; line-height: 1.08; letter-spacing: -0.03em;
  color: var(--text);
}
.display .soft { color: rgba(255,255,255,0.6); }
.lede {
  font-size: 0.9375rem; font-weight: 400; line-height: 1.7;
  color: var(--text-muted); max-width: 40rem;
}

/* ── /careers crystal: behind the hero only ──
   Placed at the top of the page, it scrolls away with the hero like any
   other element; the copy sits on top (z-index 2) over a soft dark pool. */
.stage { position: relative; overflow-x: clip; }
.stage-crystal { position: absolute; left: 0; right: 0; top: 0; height: 100svh; z-index: 0; pointer-events: none; display: grid; place-items: center; overflow: hidden; }
.stage-crystal-pin { display: contents; }
.stage-crystal-media {
  position: relative; width: min(100vw, 46rem); aspect-ratio: 1; opacity: 0.55;
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
  animation: crystalIn 1.6s var(--ease) 0.1s both;
}
.stage-crystal-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes crystalIn {
  from { opacity: 0; filter: blur(14px); transform: scale(1.06); }
  to { opacity: 0.55; filter: blur(0); transform: none; }
}
.hero { position: relative; z-index: 2; padding: 5rem 0 2rem; }
/* Headline and lede, centered over the crystal. */
.hero-grid {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; min-height: calc(100svh - 7rem);
}
.hero-copy { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; }
/* A soft dark pool right behind the words so the slab never fights the type. */
.hero-copy::before {
  content: ''; position: absolute; inset: -14% -8%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0,0,0,0.6), rgba(0,0,0,0) 100%);
}
@media (max-width: 900px) {
  .stage-crystal-media { width: min(100vw, 30rem); }
  .hero-grid { min-height: calc(100svh - 9rem); }
}
.hero .display { margin: 0 0 1.8rem; }
/* Smaller than the page display size, two fixed lines, revealed word by word
   (fade + blur, like the hiring video). Delays come per word in --d. */
.hero-title { font-size: clamp(2.3rem, 5vw, 4.6rem); line-height: 1.06; }
.hero-title .line { display: block; }
.hero-title .line { text-wrap: balance; }
@media (min-width: 641px) { .hero-title .line { white-space: nowrap; } }
.hero-title .w, .hero-lede {
  display: inline-block; opacity: 0; filter: blur(10px); transform: translateY(0.3em);
  animation: wordIn 0.7s var(--ease) forwards; animation-delay: var(--d, 0s);
}
.hero-title .w.soft { color: rgba(255,255,255,0.6); }
.hero-lede b { font-weight: 500; color: var(--text); }
.hero-lede { display: block; max-width: 42rem; font-size: 1.0625rem; line-height: 1.7; transform: translateY(0.6rem); animation-duration: 1s; }
@keyframes wordIn { to { opacity: 1; filter: blur(0); transform: none; } }

/* ── Roles list ── */
.roles { position: relative; z-index: 2; padding: 1rem 0 6rem; }
.roles h2 { margin-bottom: 1.5rem; }
.role {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
  transition: border-color 0.4s var(--ease);
}
.role:last-child { border-bottom: 1px solid var(--line); }
.role-title { font-size: 1.375rem; font-weight: 400; letter-spacing: -0.015em; color: var(--text); }
.role-meta { margin-top: 0.4rem; font-size: 0.75rem; color: var(--text-dim); }
.role-note { margin-top: 0.5rem; font-size: 0.8125rem; line-height: 1.6; color: var(--text-muted); max-width: 32rem; }
.role .go {
  flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--text-muted);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), color 0.4s var(--ease);
}
.role:hover { border-color: rgba(255,255,255,0.22); }
.role:hover .go { transform: translateX(4px); border-color: rgba(255,255,255,0.3); color: var(--white); }

/* Scroll reveal: careers.js adds .is-in when the element enters the viewport. */
.reveal { opacity: 0; filter: blur(6px);
  transition: opacity 0.9s var(--ease), filter 0.9s var(--ease);
  transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; filter: none; }


/* ── /careers split: roles on the left, the chosen one on the right ── */
.shell-wide { max-width: 72rem; }
/* The footer spans the page with the header's side margins (assets/nav.css:
   3rem, 1.375rem on phones), like the home footer. */
.home-footer .shell-wide { max-width: none; padding: 0 3rem; }
@media (max-width: 720px) { .home-footer .shell-wide { padding: 0 1.375rem; } }

/* The whole right column (description and form) fades out, swaps, and
   fades back in when the role changes. */
.role-col { min-width: 0; }
.role-detail { transition: opacity 0.28s ease, transform 0.45s var(--ease), filter 0.35s ease; }
.role-detail.is-out { opacity: 0; transform: translateY(14px); filter: blur(6px); }

/* Apply shortcut: on the right of the role title, and it stays pinned at
   that corner while the role scrolls (zero-height sticky row); a floating
   pill on phones. Hidden while the form itself is on screen. */
.detail-cta {
  position: sticky; top: 6.5rem; z-index: 5; height: 0;
  display: flex; justify-content: flex-end;
}
.detail-cta .apply-cta { margin-top: 2.35rem; }
.apply-cta { transition: opacity 0.3s ease, transform 0.3s var(--ease); }
.apply-cta.is-hidden { opacity: 0; pointer-events: none; }
@media (max-width: 900px) {
  .btn.apply-cta {
    position: fixed; left: 50%; bottom: 1.2rem; z-index: 50; margin: 0; width: auto;
    transform: translateX(-50%); box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    background: rgba(20,20,20,0.75);
  }
  .btn.apply-cta.is-hidden { transform: translateX(-50%) translateY(0.6rem); }
}
.split { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 4.5rem; align-items: start; }
.role-nav { position: sticky; top: 7rem; }
.role-tabs { display: flex; flex-direction: column; margin-top: 1.25rem; border-top: 1px solid var(--line); }
.role-tab {
  display: flex; flex-direction: column; gap: 0.35rem; text-align: left; width: 100%;
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer;
  padding: 1.15rem 0 1.15rem 1rem; border-bottom: 1px solid var(--line);
  position: relative; transition: background 0.4s var(--ease);
}
.role-tab::before {
  content: ''; position: absolute; left: 0; top: 1.15rem; bottom: 1.15rem; width: 1px;
  background: var(--white); opacity: 0; transform: scaleY(0.4);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.role-tab .role-title { font-size: 1rem; color: var(--text-muted); transition: color 0.3s ease; }
.role-tab .role-meta { margin-top: 0; font-size: 0.6875rem; }
.role-tab:hover .role-title { color: var(--text); }
.role-tab.is-active .role-title { color: var(--white); }
.role-tab.is-active::before { opacity: 1; transform: scaleY(1); }
.role-tab:focus-visible { outline: 1px solid rgba(255,255,255,0.4); outline-offset: 2px; }
.role-detail { min-width: 0; }
.panel-title {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem); font-weight: 300; letter-spacing: -0.03em;
  line-height: 1.1; color: var(--text); margin: 0.9rem 0 1.25rem;
}
.role-detail .apply { margin-top: 3.5rem; }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 2rem; }
  .role-nav { position: static; }
  .role-tabs { flex-direction: row; gap: 0.5rem; border-top: 0; overflow-x: auto; }
  .role-tab {
    flex: none; width: auto; padding: 0.7rem 1rem; border: 1px solid var(--line); border-radius: 100px;
  }
  .role-tab::before { display: none; }
  .role-tab .role-meta { display: none; }
  .role-tab .role-title { font-size: 0.8125rem; }
  .role-tab.is-active { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.06); }
}

/* ── Role page ── */
.page { position: relative; z-index: 2; padding: 9rem 0 5rem; }
.back {
  display: inline-block; margin-bottom: 2.5rem;
  font-size: 0.625rem; font-weight: 500; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--text-dim); transition: color 0.3s ease;
}
.back:hover { color: var(--white); }
.page .display { margin: 1rem 0 1.25rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2.5rem; }
.chip {
  font-size: 0.6875rem; color: var(--text-muted);
  padding: 0.35rem 0.8rem; border-radius: 100px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.03);
}
.block { margin-top: 3.5rem; }
.block h2, .block h3 {
  font-size: 1.125rem; font-weight: 500; letter-spacing: -0.01em;
  color: var(--text); margin-bottom: 1.1rem;
}
.block p, .block li { font-size: 0.875rem; line-height: 1.75; color: var(--text-muted); }
.block p + p { margin-top: 1rem; }
.block ul { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.block li { position: relative; padding-left: 1.3rem; }
.block li::before {
  content: ''; position: absolute; left: 0; top: 0.75em;
  width: 0.45rem; height: 1px; background: rgba(255,255,255,0.35);
}
.block li strong { color: var(--text); font-weight: 500; }

/* ── Form ── */
.apply {
  margin-top: 4.5rem; padding: 2.25rem clamp(1.25rem, 4vw, 2.5rem) 2.5rem;
  border-radius: 1.25rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line-soft);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.04);
  scroll-margin-top: 6rem;
}
.apply h2 { font-size: 1.5rem; font-weight: 300; letter-spacing: -0.02em; margin: 0.75rem 0 0.5rem; }
.apply .hint { font-size: 0.8125rem; color: var(--text-dim); margin-bottom: 2rem; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1rem; }
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.04em; color: var(--text-muted); }
.field label .opt, .field .label .opt { color: var(--text-dim); font-weight: 400; }
.field input, .field textarea {
  width: 100%;
  font: inherit; font-size: 0.875rem; color: var(--text);
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--line); border-radius: 0.7rem;
  padding: 0.8rem 0.95rem;
  outline: none;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.field textarea { min-height: 8.5rem; resize: vertical; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: rgba(255,255,255,0.22); }
.field input:focus, .field textarea:focus { border-color: rgba(255,255,255,0.32); background: rgba(0,0,0,0.5); }
.field .label { font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.04em; color: var(--text-muted); }
.file {
  display: flex; align-items: center; gap: 0.9rem; cursor: pointer;
  background: rgba(0,0,0,0.35);
  border: 1px dashed var(--line); border-radius: 0.7rem;
  padding: 0.6rem 0.7rem;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.file:hover, .file:focus-within { border-color: rgba(255,255,255,0.32); background: rgba(0,0,0,0.5); }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-btn {
  flex: none; font-size: 0.6rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text); padding: 0.55rem 0.9rem; border-radius: 100px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.06);
}
.file-name { font-size: 0.8125rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file.has-file .file-name { color: var(--text); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-top: 1.75rem; flex-wrap: wrap; }
.privacy { font-size: 0.6875rem; line-height: 1.6; color: var(--text-dim); max-width: 24rem; }
.privacy a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,0.2); }
.privacy a:hover { color: var(--text-muted); }
.form-error { margin-top: 1rem; font-size: 0.8125rem; color: #F2B45C; min-height: 1.2em; }

.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 2.8rem; padding: 0 2.1rem; border-radius: 100px; border: 0; cursor: pointer;
  font: inherit; font-size: 0.66rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text); background: rgba(255,255,255,0.085);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  transition: transform 0.3s var(--ease), background 0.3s ease, opacity 0.3s ease;
  white-space: nowrap;
}
.btn::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(160deg, rgba(255,255,255,0.55), rgba(255,255,255,0.06) 42%, rgba(255,255,255,0.02) 60%, rgba(255,255,255,0.22));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.btn::after {
  content: ''; position: absolute; left: 14%; right: 14%; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4) 50%, transparent);
  pointer-events: none;
}
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.14); }
.btn .flecha { transition: transform 0.35s var(--ease); }
.btn:hover .flecha { transform: translateX(3px); }
.btn[disabled] { opacity: 0.5; cursor: default; transform: none; }

.sent { display: none; text-align: left; padding: 1rem 0 0.5rem; }
.sent .display { font-size: clamp(1.75rem, 3vw, 2.25rem); margin: 0.75rem 0 0.75rem; }
.apply.is-sent form { display: none; }
.apply.is-sent .sent { display: block; animation: fadeUp 0.8s var(--ease) both; }

/* ── Footer: the home footer (index.html), same rules ── */
.home-footer { position: relative; z-index: 2; padding: 3.5rem 0 2.5rem; border-top: 1px solid var(--line-soft); }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 2.5rem; }
.footer-brand .mark { display: block; line-height: 0; }
.footer-brand .mark img { width: 3.5rem; height: auto; }
.footer-brand p { margin-top: 1rem; font-size: 0.7188rem; line-height: 1.7; color: var(--text-dim); max-width: 26ch; }
.footer-datos { margin-top: 1.15rem; font-style: normal; font-size: 0.7188rem; line-height: 1.75; color: var(--text-dim); }
.footer-mail, .footer-social {
  display: inline-block; margin-top: 0.9rem; margin-right: 1.25rem;
  font-size: 0.7188rem; color: var(--text-dim); transition: color 0.25s ease;
}
.footer-mail:hover, .footer-social:hover { color: var(--white); }
.footer-sedes { color: var(--text-dim); }
.footer-col h4 { font-size: 0.5625rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.75); font-weight: 600; }
.footer-col ul { list-style: none; margin-top: 1.125rem; display: flex; flex-direction: column; gap: 0.6875rem; }
.footer-col a { font-size: 0.7188rem; color: var(--text-dim); transition: color 0.25s ease; }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  margin-top: 3.375rem; padding-top: 1.375rem; border-top: 1px solid var(--line-soft);
  display: flex; gap: 1.625rem; font-size: 0.6562rem; color: var(--text-dim);
}
.footer-bottom a { transition: color 0.25s ease; }
.footer-bottom a:hover { color: var(--white); }
@media (max-width: 1100px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 40rem) {
  .home-footer { padding: 2.5rem 0; }
  .footer-grid { text-align: center; justify-items: center; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.8rem 1rem; }
  .footer-brand { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; }
  .footer-brand .mark { display: inline-block; }
  .footer-brand p { font-size: 0.95rem; max-width: 32ch; margin-inline: auto; }
  .footer-datos { font-size: 0.85rem; }
  .footer-mail, .footer-social { font-size: 0.9rem; margin-inline: 0.6rem; }
  .footer-col ul { align-items: center; gap: 0.9rem; }
  .footer-col h4 { font-size: 0.75rem; }
  .footer-col a { font-size: 0.95rem; }
  .footer-bottom { margin-top: 2.6rem; padding-top: 1.6rem; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; font-size: 0.9rem; }
}

/* ── Entrance ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
.rise { opacity: 0; animation: fadeUp 0.9s var(--ease) both; }
.rise.d1 { animation-delay: 0.15s; }
.rise.d2 { animation-delay: 0.3s; }
.rise.d3 { animation-delay: 0.45s; }
.rise.d4 { animation-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; filter: none; transition: none; }
  .rise, .hero-title .w, .hero-lede { animation: none; opacity: 1; filter: none; transform: none; }
  .stage-crystal-media { animation: none; background: url(/assets/careers-crystal-poster.jpg) center / cover no-repeat; }
  .stage-crystal-media video { display: none; }
  .crystal video { display: none; }
}

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .role-title { font-size: 1.15rem; }
  .form-foot { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
}
