/* The illustrated set pieces: mission relay, output panel, office floor,
   provider lineup, skills library and the locked roadmap cards. */

/* ---- Mission relay ---- */

.mission {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 470px;
}

.relay {
  position: relative;
  height: 120px;
}

.relay svg.path {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.track {
  fill: none;
  stroke: rgba(255, 236, 214, .14);
  stroke-width: 2;
  stroke-dasharray: 2 7;
}

.done {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(232, 145, 63, .7));
}

/* Node coordinates are measured from the relay box in JS each layout. */
.node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform .5s var(--ease);
}

.node .av {
  width: 52px;
  height: 56px;
  display: grid;
  place-items: center;
  position: relative;
}

.node svg {
  width: 46px;
  height: 50px;
}

.node b {
  font-size: 11.5px;
  white-space: nowrap;
}

.node small {
  font-size: 10.5px;
  color: var(--dim);
}

.node.on { transform: translate(-50%, -50%) scale(1.14) }
.node.on small { color: var(--accent) }
.node.past small { color: var(--ok) }

.node.on .av::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: ping 1.4s ease-out infinite;
}

@keyframes ping {
  from { transform: scale(.8); opacity: .9 }
  to { transform: scale(1.4); opacity: 0 }
}

.stream {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%);
  mask-image: linear-gradient(to bottom, transparent, #000 30%);
}

.beat {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line);
  animation: beatIn .6s var(--ease);
}

.beat.now { border-color: color-mix(in srgb, var(--bc) 60%, transparent) }

.beat .bi {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bc) 18%, transparent);
  color: color-mix(in srgb, var(--bc) var(--tint), #fff);
}

.beat .bi svg {
  width: 17px;
  height: 17px;
}

.beat b {
  font-size: var(--text-sm);
  font-weight: 600;
}

.beat p {
  margin: 2px 0 0;
  font-size: var(--text-xs);
  color: var(--muted);
}

.code {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .4);
  font: 12.5px/1.6 var(--mono);
  overflow-x: auto;
}

.code .a { color: #9FE3BC }
.code .r { color: #F29AA6 }

@keyframes beatIn {
  from { opacity: 0; transform: translateY(20px) }
}

/* ---- Output panel with diff ---- */

.out {
  padding: 0;
  overflow: hidden;
}

.out .hd {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.out .hd .av { width: 64px }

.out .hd svg {
  width: 64px;
  height: 72px;
}

.out .hd b { font-size: var(--text-lg) }

.out .hd small {
  display: block;
  color: var(--muted);
  font-size: var(--text-xs);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 18px 0;
}

.tabs span {
  padding: 8px 13px;
  border-radius: 9px 9px 0 0;
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 600;
}

.tabs span.on {
  background: rgba(0, 0, 0, .35);
  color: var(--text);
}

.diff {
  margin: 0 18px;
  border-radius: 0 12px 12px 12px;
  background: rgba(0, 0, 0, .35);
  font: 13px/1.8 var(--mono);
  padding: 8px 0;
  overflow: auto;
}

.diff div {
  display: grid;
  grid-template-columns: 40px 18px 1fr;
  white-space: pre;
  padding-right: 12px;
}

.diff .n {
  color: var(--dim);
  text-align: right;
  padding-right: 8px;
}

.diff .ad { background: rgba(76, 194, 126, .1) }
.diff .ad .m { color: var(--ok) }
.diff .dl { background: rgba(229, 86, 106, .1) }
.diff .dl .m { color: #F29AA6 }
.diff .k { color: #C9A2FF }
.diff .s { color: #F2B77A }

.ticks {
  display: flex;
  gap: 4px;
  padding: 18px 22px 22px;
  align-items: flex-end;
  height: 64px;
}

.ticks i {
  flex: 1;
  border-radius: 4px;
  background: var(--c);
  opacity: .6;
  height: 60%;
}

.ticks i:nth-child(3n) {
  height: 100%;
  opacity: 1;
}

/* ---- Isometric office floor ---- */

.office {
  position: relative;
  height: 460px;
  perspective: 1600px;
  overflow: hidden;
  border-radius: var(--radius-card);
}

.plane {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 760px;
  height: 640px;
  margin: -320px 0 0 -380px;
  transform-style: preserve-3d;
  transform: rotateX(56deg) rotateZ(-42deg) scale(.62);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.isle {
  border-radius: 18px;
  transform-style: preserve-3d;
  padding: 34px 8px 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 2px;
  position: relative;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--c) 45%, transparent);
}

.isle span.n {
  position: absolute;
  left: 10px;
  top: 8px;
  font-size: 13px;
  font-weight: 800;
}

/* Counter-rotated so the characters stand upright on the tilted floor. */
.bb {
  transform: rotateZ(42deg) rotateX(-56deg);
  transform-origin: 50% 100%;
}

.bb svg {
  width: 44px;
  height: 48px;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .5));
}

.bb.w svg { animation: hop 1.4s ease-in-out infinite }

@keyframes hop {
  50% { transform: translateY(-5px) }
}

/* ---- Provider lineup ---- */

.lineup {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(4px, 1.4vw, 22px);
  margin-top: 50px;
  flex-wrap: wrap;
}

/* 130px is the widest the eight characters can be and still stand in one row
   inside the 1180px container. Below that the row wraps, four and four on a
   tablet and two and two on a phone, and the cards keep their size rather than
   being squeezed until the drawings are unreadable. */
.pc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 130px;
  text-align: center;
}

/* The lineup reveals left to right across all eight characters, rather than
   using the default four-step stagger. */
.lineup .pc:nth-child(1) { --reveal-delay: 0ms }
.lineup .pc:nth-child(2) { --reveal-delay: 70ms }
.lineup .pc:nth-child(3) { --reveal-delay: 140ms }
.lineup .pc:nth-child(4) { --reveal-delay: 210ms }
.lineup .pc:nth-child(5) { --reveal-delay: 280ms }
.lineup .pc:nth-child(6) { --reveal-delay: 350ms }
.lineup .pc:nth-child(7) { --reveal-delay: 420ms }
.lineup .pc:nth-child(8) { --reveal-delay: 490ms }

.pc svg {
  width: 100%;
  height: auto;
  aspect-ratio: 160 / 200;
}

/* The longest role, "The Switchboard", is wider than the card at this size, so
   the tag wraps instead of running out over its neighbours. The lineup is
   bottom-aligned, so a two-line tag grows upward and the characters still stand
   on the same line. */
.pc .tag {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-wrap: balance;
  color: color-mix(in srgb, var(--c) var(--tint), #fff);
  border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--c) 30%, transparent);
}

.pc b { font-size: var(--text-md) }

.pc small {
  font-size: var(--text-2xs);
  color: var(--muted);
}

.bills {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.bill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--line);
  background: var(--glass);
  font-size: var(--text-sm);
  color: var(--muted);
}

.bill i {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 6px;
}

.bill .s {
  background: rgba(127, 176, 255, .16);
  color: #8FBBFF;
}

.bill .p {
  background: var(--soft);
  color: var(--accent);
}

/* ---- Skills library ---- */

.library {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 40px;
}

.shelf {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  align-items: end;
  padding: 0 0 10px;
  border-bottom: 6px solid #2A2420;
  position: relative;
}

.shelf-l {
  font-weight: 700;
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
}

.shelf-l i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--c);
}

.books {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  overflow: hidden;
}

/* Spine height is deterministic per shelf position and written to --h in JS. */
.book {
  width: 30px;
  height: var(--h, 90px);
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #26232A, #1B191E);
  border: 1px solid rgba(255, 255, 255, .06);
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .3s var(--ease);
}

.book em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  max-height: 90%;
}

/* A lit spine keeps its department colour but is darkened enough that the
   white label clears AA. The glow carries the brightness instead. */
.book.lit {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--c) 62%, #000),
    color-mix(in srgb, var(--c) 34%, #000));
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 40%, transparent);
}

.book.lit em { color: #fff }

.book:hover { transform: translateY(-8px) }

.more {
  align-self: center;
  margin-left: var(--space-3);
  color: var(--muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

/* ---- Locked roadmap cards ---- */

.lock {
  position: relative;
  padding: 26px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 380px;
}

.lock .lock-fig {
  width: 140px;
  margin: 0 auto;
  filter: drop-shadow(0 0 24px var(--c));
}

.lock .lock-fig svg { animation: hover 4s ease-in-out infinite }

@keyframes hover {
  50% { transform: translateY(-8px) }
}

.lock .st {
  position: absolute;
  right: var(--space-5);
  top: var(--space-5);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: .14em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px dashed color-mix(in srgb, var(--c) var(--tint), #fff);
  color: color-mix(in srgb, var(--c) var(--tint), #fff);
}

.lock h3 {
  margin: var(--space-2) 0 0;
  font-size: var(--text-xl);
  /* The status pill is absolutely positioned in the same corner, so the title
     keeps clear of it rather than running underneath. */
  padding-right: var(--space-2);
}

.lock p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-md);
}

.lock .blur {
  margin-top: auto;
  height: 54px;
  border-radius: 12px;
  background: repeating-linear-gradient(90deg,
    rgba(255, 255, 255, .06) 0 40px,
    rgba(255, 255, 255, .02) 40px 70px);
  filter: blur(3px);
}

.lock--arena { --c: #E8913F }
.lock--studio { --c: #D8487A }
.lock--muse { --c: #0866FF }
.lock--approvals { --c: #4CC27E }
.lock--talk { --c: #1EC3D2 }
.lock--recruitment { --c: #9B4FD8 }

@media (max-width: 960px) {
  .office { height: 360px }
  .plane { transform: rotateX(56deg) rotateZ(-42deg) scale(.45) }
  .shelf { grid-template-columns: 1fr }
}

/* On a narrow card the five relay stations sit about 58px apart, which is less
   than a name like "Backend Architect" needs on one line. Let the labels wrap
   inside a fixed column so they stay legible and stop overlapping. */
@media (max-width: 720px) {
  .relay { height: 150px }

  .node b {
    white-space: normal;
    width: 50px;
    font-size: 9.5px;
    line-height: 1.15;
    text-align: center;
  }

  .node small { font-size: 9.5px }
}

/* ---- Phone ---- */

/* The set pieces are drawn at a fixed size and then scaled, so on a phone they
   are reduced rather than reflowed: the floor stays a floor and the relay stays
   a relay. Each one is clipped by its own card, so none of this can reach the
   page and push it sideways. */
@media (max-width: 560px) {
  .mission {
    min-height: 0;
    padding: var(--space-4);
  }

  .stream { gap: var(--space-2) }

  .beat {
    grid-template-columns: 30px 1fr;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
  }

  .beat .bi {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .office { height: 290px }
  .plane { transform: rotateX(56deg) rotateZ(-42deg) scale(.34) }

  .out .hd {
    gap: var(--space-3);
    padding: var(--space-4);
  }

  .out .hd .av,
  .out .hd svg { width: 48px }
  .out .hd svg { height: 54px }

  .tabs { padding: var(--space-2) var(--space-4) 0 }
  .diff { margin-inline: var(--space-4) }
  .ticks { padding: var(--space-4) }

  .lineup { margin-top: var(--space-8) }

  .lock {
    min-height: 0;
    padding: var(--space-5);
  }

  .lock .lock-fig { width: 120px }
}
