/* ============================================================
   GROWMARK — careers page
   Two sections: the hero (the gate carved in relief out of a white
   wall, js/careers-hero.js, with the title in its doorway) and the
   open roles on paper (js/careers.js opens and closes them).
   Everything reads the frame tokens and the shared .btn / .tlink /
   .eyebrow, so this file only adds the page.
   ============================================================ */

/* the page is paper; the hero is the wall the gate is carved from,
   a shade under the paper so the relief's lit slopes can rise to
   white (the same colour as WALL in js/careers-hero.js) */
.careers-page{
  --wall:#F1F0EC;
  background:var(--paper);
}

/* the nav floats clear over the wall; once the roles come up under it
   (js/careers.js sets data-solid) it carries the paper, as on the
   contact page, so the list scrolls behind it, not through it */
.careers-page .nav{transition:background-color .35s var(--ease)}
.careers-page .nav[data-solid]{background:var(--paper)}

/* ---------------------------- hero ------------------------- */

.careers-hero{
  position:relative;
  overflow:hidden;
  /* pull up under the sticky nav (14px + the 56px bar) */
  margin-top:-70px;
  padding-top:70px;
  min-height:100vh;
  min-height:100svh;
  display:flex;
  flex-direction:column;
  /* the wall, running into the paper at the section's foot */
  background:linear-gradient(to bottom, var(--wall) calc(100% - 110px), var(--paper));
}

.careers-hero__sky{
  position:absolute;
  inset:0;
  pointer-events:none;
}
.careers-hero__canvas{
  width:100%;
  height:100%;
  /* the carved wall gives way to the section's ground, which runs on
     into the paper */
  -webkit-mask-image:linear-gradient(to bottom, #000 calc(100% - 110px), transparent);
  mask-image:linear-gradient(to bottom, #000 calc(100% - 110px), transparent);
  opacity:0;
  transition:opacity 1s var(--ease-soft);
}
.careers-hero__canvas.is-live{opacity:1}

/* the gate on top, as big as the screen allows, the line and the
   button under it; the whole stands in the middle of the screen */
.careers-hero__body{
  position:relative;
  z-index:1;
  flex:1;
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:clamp(8px,1.6vh,16px);
  padding-top:clamp(4px,1vh,12px);
  padding-bottom:clamp(28px,4vh,44px);
}

/* where the scene stands the gate: the full width of the screen (out
   of the shell's gutters), as tall as the screen leaves room for, and
   never much taller than wide, which is what a phone would give */
.careers-hero__anchor{
  position:relative;
  align-self:stretch;
  margin-inline:calc(var(--gutter) * -1);
  height:clamp(300px, min(calc(100svh - 268px), 108vw), 1100px);
}

/* the doorway, as the scene projects it (left/top/width/height are
   set by js/careers-hero.js); the title is sized off its width */
.careers-hero__portal{
  position:absolute;
  left:50%;
  top:18%;
  width:min(44%, 420px);
  height:60%;
  transform:translateX(-50%);
  container-type:inline-size;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:clamp(10px,4cqi,20px);
  text-align:center;
}
.careers-hero__portal.is-fitted{transform:none}
/* held back until the scene has placed it in the doorway */
html[data-gate] .careers-hero__portal{visibility:hidden}

.careers-hero__title{
  font-size:clamp(1.6rem, 15.5cqi, 5.2rem);
  font-weight:400;
  line-height:1.02;
  letter-spacing:-.035em;
  /* one line, running wider than the doorway's box, centred on it */
  width:max-content;
  white-space:nowrap;
}

.careers-hero__eyebrow{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:10px;
  font-size:11px;
  font-weight:500;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--muted);
}
.careers-hero__sep{opacity:.5}
/* a narrow doorway (a phone) keeps the line to the count */
@container (max-width:230px){
  .careers-hero__eyebrow{gap:8px;letter-spacing:.14em}
  .careers-hero__label,.careers-hero__sep{display:none}
}
/* the footer's hiring glow, the logo's ice blue, here set on paper:
   a darker core so it reads, the same slow breath */
.careers-hero__pulse{
  width:7px;height:7px;
  flex:none;
  margin-right:4px;
  border-radius:50%;
  background:#8FB4CC;
  box-shadow:0 0 0 3px rgba(143,180,204,.18);
  animation:careers-pulse 3.6s ease-in-out infinite alternate;
}
@keyframes careers-pulse{
  from{opacity:.65;box-shadow:0 0 0 2px rgba(143,180,204,.12)}
  to{opacity:1;box-shadow:0 0 0 5px rgba(143,180,204,.2)}
}

/* the line may run wider than the doorway's box, centred on it */
.careers-hero__portal .careers-hero__lede{
  width:max-content;
  max-width:min(30em, calc(100vw - 2 * var(--gutter)));
}
.careers-hero__portal .actions{justify-content:center;margin-top:4px;width:max-content}
.careers-hero__portal .btn{white-space:nowrap}

/* the dot chevron turned to point down the page */
.careers-hero__down{transform:rotate(90deg)}
.careers-hero__cta:hover .careers-hero__down,
.careers-hero__cta:focus-visible .careers-hero__down{transform:rotate(90deg) translateX(2px)}

/* the words come up a beat after the page does; the title once it
   stands in the doorway */
.careers-hero__portal > *{animation:careers-rise .9s var(--ease-soft) both}
.careers-hero__portal > :nth-child(2){animation-delay:.08s}
.careers-hero__portal > :nth-child(3){animation-delay:.16s}
.careers-hero__portal > :nth-child(4){animation-delay:.24s}
html[data-gate] .careers-hero__portal > *{animation-play-state:paused}
/* with the scene on, the words wait until two thirds of the circle
   and the lines are drawn (js/careers-hero.js sets data-words) */
.careers-hero[data-webgl="true"]:not([data-words]) .careers-hero__portal > *{animation-play-state:paused}
/* arriving through the page turn, they wait for the curtain */
html[data-turn="in"] .careers-hero__portal > *{animation-play-state:paused}
@keyframes careers-rise{
  from{opacity:0;transform:translateY(18px)}
}

/* without WebGL there's no doorway: the words stand alone, centred */
.careers-hero[data-webgl="false"] .careers-hero__anchor{height:auto;margin-inline:0}
.careers-hero[data-webgl="false"] .careers-hero__portal{
  position:static;
  width:auto;
  height:auto;
  max-width:48rem;
  transform:none;
  container-type:normal;
}
.careers-hero[data-webgl="false"] .careers-hero__title{font-size:clamp(2.4rem,6vw,4.6rem);width:auto;white-space:normal;text-wrap:balance}

@media (max-width:820px){
  .careers-hero__portal .careers-hero__lede{font-size:1rem;max-width:min(22em, calc(100vw - 2 * var(--gutter)))}
}
/* phones: the description stays inside the circle, and the button
   stands under the circle, not in it (--ring-r and --ring-foot are
   set by js/careers-hero.js) */
@media (max-width:640px){
  .careers-hero__portal{gap:12px}
  .careers-hero__portal .careers-hero__lede{
    font-size:.95rem;
    line-height:1.5;
    max-width:min(calc(var(--ring-r, 140px) * 1.62), calc(100vw - 2 * var(--gutter)));
  }
  .careers-hero__portal .actions{
    position:absolute;
    left:0;
    right:0;
    top:calc(var(--ring-foot, 100%) + 28px);
    width:auto;
    margin:0;
  }
}

/* ---------------------------- roles ------------------------ */

.roles{
  padding-block:var(--bay);
  scroll-margin-top:0;
}

.roles__head{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:end;
  gap:24px;
  margin-bottom:clamp(40px,6vw,72px);
}
.roles__intro{
  display:flex;
  flex-direction:column;
  gap:18px;
  max-width:44rem;
}
.roles__count{
  font-size:clamp(4rem,11vw,9.5rem);
  font-weight:300;
  line-height:.8;
  letter-spacing:-.05em;
  font-variant-numeric:tabular-nums;
  color:var(--ink);
}

.roles__list{border-top:1px solid var(--ink)}

.role{
  border-bottom:1px solid var(--line);
  /* opened from a link, the row stops clear of the floating nav */
  scroll-margin-top:96px;
}
.role__h{font:inherit;margin:0}

/* the row: number, title, tags, pay, the plus. One grid, so the
   columns line up from role to role */
.role__toggle{
  --cols:3.4rem minmax(0,1.5fr) minmax(0,1.25fr) minmax(8.5rem,auto) 40px;
  width:100%;
  display:grid;
  grid-template-columns:var(--cols);
  align-items:center;
  gap:20px;
  padding:clamp(22px,2.6vw,32px) 0;
  margin:0;
  border:0;
  background:none;
  color:var(--ink);
  font:inherit;
  text-align:left;
  cursor:pointer;
  position:relative;
}
/* a wash rises under the row on hover, the .btn wipe made quiet */
.role__toggle::before{
  content:"";
  position:absolute;
  inset:0 -16px;
  background:var(--wash);
  transform:scaleY(0);
  transform-origin:bottom;
  transition:transform var(--dur-3) var(--ease);
  z-index:0;
}
.role__toggle > *{position:relative;z-index:1}
.role__toggle:hover::before{transform:scaleY(1)}
.role__toggle:focus-visible{outline:2px solid var(--ink);outline-offset:4px}

.role__no{
  font-size:12px;
  font-weight:500;
  letter-spacing:.14em;
  color:var(--muted);
  font-variant-numeric:tabular-nums;
}
.role__title{
  font-size:clamp(1.35rem,2.2vw,1.9rem);
  font-weight:400;
  line-height:1.12;
  letter-spacing:-.022em;
  text-wrap:balance;
  transition:transform var(--dur-3) var(--ease);
}
.role__toggle:hover .role__title{transform:translateX(6px)}

.role__meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.role__tag{
  font-size:10.5px;
  font-weight:500;
  letter-spacing:.1em;
  text-transform:uppercase;
  padding:5px 9px;
  border:1px solid var(--line);
  color:var(--ink);
  white-space:nowrap;
}

.role__pay{
  font-size:15.5px;
  font-weight:500;
  letter-spacing:-.01em;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
  text-align:right;
}
.role__per{font-weight:400;color:var(--muted)}

/* the plus is the dot-matrix one; open, it turns a quarter into the
   contact page's dot X and the tile fills with ink */
.role__icon{
  width:40px;height:40px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  color:var(--ink);
  transition:background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.role__icon svg{
  width:14px;height:14px;
  transition:transform var(--dur-3) var(--ease-soft);
}
.role__toggle:hover .role__icon{border-color:var(--ink)}
.role[data-open] .role__icon{background:var(--ink);border-color:var(--ink);color:var(--ground)}
.role[data-open] .role__icon svg{transform:rotate(45deg)}

/* the description. Without the script every panel stays open; with
   it (data-ready) a closed panel folds to nothing and is inert */
.roles__list[data-ready] .role__panel{
  display:grid;
  grid-template-rows:0fr;
  transition:grid-template-rows .55s var(--ease-soft);
}
.roles__list[data-ready] .role[data-open] .role__panel{grid-template-rows:1fr}
/* clip, not hidden: a hidden box is a scroller, and the info box
   inside couldn't stick to the screen (overflow:hidden stays as the
   fallback for browsers without clip) */
.role__clip{min-height:0;overflow:hidden;overflow:clip}

.role__body{
  display:grid;
  grid-template-columns:3.4rem minmax(0,1.5fr) minmax(0,1fr);
  /* the row's gap, so the words start under the title */
  gap:20px;
  padding:4px 0 clamp(40px,5vw,64px);
}
.roles__list[data-ready] .role__body{
  opacity:0;
  transform:translateY(-8px);
  transition:opacity var(--dur-2) var(--ease), transform var(--dur-3) var(--ease);
}
.roles__list[data-ready] .role[data-open] .role__body{
  opacity:1;
  transform:none;
  transition:opacity .45s var(--ease) .1s, transform .55s var(--ease-soft) .06s;
}

.role__main{grid-column:2;max-width:38rem}
.role__lead{
  font-size:clamp(1.0625rem,1.4vw,1.18rem);
  line-height:1.55;
  color:var(--ink);
}
.role__sub{
  margin-top:30px;
  margin-bottom:12px;
  font-size:11px;
  font-weight:500;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--muted);
}
.role__ticks{display:flex;flex-direction:column;gap:10px}
.role__ticks li{
  position:relative;
  padding-left:22px;
  font-size:15.5px;
  line-height:1.55;
  color:var(--muted);
}
/* a single 2px dot, the site's icon unit, as the bullet */
.role__ticks li::before{
  content:"";
  position:absolute;
  left:2px;
  top:.68em;
  width:4px;height:4px;
  border-radius:1px;
  background:var(--ink);
}

.role__side{
  grid-column:3;
  align-self:start;
  /* it stays in view under the nav while the description scrolls by */
  position:sticky;
  top:96px;
  margin-left:clamp(0px,4vw,60px);
  display:flex;
  flex-direction:column;
  gap:22px;
  padding:22px;
  border:1px solid var(--line);
}
.role__facts{margin:0;display:flex;flex-direction:column}
.role__facts > div{
  display:flex;
  justify-content:space-between;
  gap:16px;
  padding:10px 0;
  border-bottom:1px solid var(--line);
  font-size:14.5px;
}
.role__facts > div:first-child{padding-top:0}
.role__facts dt{color:var(--muted)}
.role__facts dd{margin:0;text-align:right;font-weight:500;font-variant-numeric:tabular-nums}
.role__apply{justify-content:space-between}
.role__note{font-size:13.5px;line-height:1.55;color:var(--muted)}

/* no open roles: the note and the open-application button on the
   list's ink rule */
.roles__closed{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  justify-content:space-between;
  gap:28px 48px;
  padding-top:clamp(28px,3.5vw,44px);
  border-top:1px solid var(--ink);
}
.roles__closed-text{
  max-width:34em;
  margin:0;
  font-size:clamp(1.0625rem,1.5vw,1.25rem);
  line-height:1.5;
  color:var(--muted);
  text-wrap:pretty;
}
.roles__closed-text .tlink{color:var(--ink)}
.roles__apply{flex-shrink:0}
/* more than one paragraph: a short column of them */
.roles__closed-copy{display:grid;gap:.85em;max-width:34em}

/* the 404: the story's one image over the heading, the empty metric
   field, cropped from film 02's poster (1600 x 1000; the label and the
   blank box sit in 860-1240 x 500-650), and its two ways on */
.nf-field{
  width:min(380px, 100%);
  aspect-ratio:380 / 150;
  margin-bottom:clamp(24px, 3vw, 36px);
  border-radius:14px;
  background:#0A0A0A url("../video/manifesto/02-guessing.jpg") no-repeat;
  background-size:421.05% auto;
  background-position:70.49% 58.82%;
}
.nf-actions{display:flex;flex-wrap:wrap;gap:12px}

/* tablets: the tags drop under the title */
@media (max-width:1080px){
  .role__toggle{
    --cols:3.4rem minmax(0,1fr) auto 40px;
    grid-template-areas:"no title pay icon" ". meta meta .";
    row-gap:12px;
  }
  .role__no{grid-area:no}
  .role__title{grid-area:title}
  .role__meta{grid-area:meta}
  .role__pay{grid-area:pay}
  .role__icon{grid-area:icon}
}

/* phones: number and plus either side of the title, tags and pay
   under it; the description is one column under the row */
@media (max-width:640px){
  .roles__head{grid-template-columns:1fr}
  .roles__count{display:none}
  .role__toggle{
    --cols:2rem minmax(0,1fr) 40px;
    grid-template-areas:"no title icon" ". meta meta" ". pay pay";
    column-gap:12px;
    row-gap:10px;
    align-items:start;
  }
  .role__no{padding-top:.5em}
  .role__pay{text-align:left}
  .role__toggle::before{inset:0 -12px}
  .role__toggle:hover .role__title{transform:none}
  .role__body{grid-template-columns:minmax(0,1fr);padding-left:calc(2rem + 12px)}
  .role__main,.role__side{grid-column:1}
  .role__side{padding:18px;margin-left:0;position:static}
}
@media (max-width:400px){
  .role__body{padding-left:0}
}

/* ---------------------------- footer ----------------------- */

.careers-foot{border-top:1px solid var(--line)}
.careers-foot__bar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px 28px;
  padding-block:28px;
  font-size:13.5px;
  color:var(--muted);
}
.careers-foot__bar > :first-child{margin-right:auto}
.careers-foot__bar .tlink{color:var(--ink)}
.careers-foot__cookies{
  padding:0 0 2px;
  border:0;
  background:none;
  font:inherit;
  font-weight:500;
  cursor:pointer;
}

@media (prefers-reduced-motion:reduce){
  .careers-hero__portal > *{animation:none}
  .careers-hero__pulse{animation:none}
}
